Common: Add vector rsize()

This commit is contained in:
Stenzek 2025-01-16 21:01:30 +10:00
parent 93771981a6
commit 0507054675
No known key found for this signature in database
3 changed files with 4 additions and 0 deletions

View File

@ -1180,6 +1180,8 @@ public:
ALWAYS_INLINE s32 width() const { return right - left; }
ALWAYS_INLINE s32 height() const { return bottom - top; }
ALWAYS_INLINE GSVector2i rsize() const { return zwzw().sub32(xyxy()).xy(); }
ALWAYS_INLINE bool rempty() const
{
// !any((x, y) < (z, w)) i.e. !not_empty

View File

@ -963,6 +963,7 @@ public:
ALWAYS_INLINE s32 width() const { return right - left; }
ALWAYS_INLINE s32 height() const { return bottom - top; }
ALWAYS_INLINE GSVector2i rsize() const { return GSVector2i(width(), height()); }
ALWAYS_INLINE bool rempty() const { return (lt32(zwzw()).mask() != 0x00ff); }
ALWAYS_INLINE bool rvalid() const { return ((ge32(zwzw()).mask() & 0xff) == 0); }

View File

@ -1082,6 +1082,7 @@ public:
ALWAYS_INLINE s32 width() const { return right - left; }
ALWAYS_INLINE s32 height() const { return bottom - top; }
ALWAYS_INLINE GSVector2i rsize() const { return zwzw().sub32(xyxy()).xy(); }
ALWAYS_INLINE bool rempty() const { return (lt32(zwzw()).mask() != 0x00ff); }
ALWAYS_INLINE bool rvalid() const { return ((ge32(zwzw()).mask() & 0xff) == 0); }