11class [[nodiscard]] alignas(JPH_VECTOR_ALIGNMENT)
UVec4
17#if defined(JPH_USE_SSE)
19#elif defined(JPH_USE_NEON)
20 using Type = uint32x4_t;
34 JPH_INLINE
bool operator == (
UVec4Arg inV2)
const;
35 JPH_INLINE
bool operator != (
UVec4Arg inV2)
const {
return !(*
this == inV2); }
38 template<u
int32 SwizzleX, u
int32 SwizzleY, u
int32 SwizzleZ, u
int32 SwizzleW>
42 static JPH_INLINE
UVec4 sZero();
48 static JPH_INLINE
UVec4 sLoadInt(
const uint32 *inV);
51 static JPH_INLINE
UVec4 sLoadInt4(
const uint32 *inV);
54 static JPH_INLINE
UVec4 sLoadInt4Aligned(
const uint32 *inV);
57 template <const
int Scale>
90#if defined(JPH_USE_SSE)
91 JPH_INLINE
uint32 GetX()
const {
return (
uint32)_mm_cvtsi128_si32(mValue); }
92 JPH_INLINE
uint32 GetY()
const {
return mU32[1]; }
93 JPH_INLINE
uint32 GetZ()
const {
return mU32[2]; }
94 JPH_INLINE
uint32 GetW()
const {
return mU32[3]; }
95#elif defined(JPH_USE_NEON)
96 JPH_INLINE
uint32 GetX()
const {
return vgetq_lane_u32(mValue, 0); }
97 JPH_INLINE
uint32 GetY()
const {
return vgetq_lane_u32(mValue, 1); }
98 JPH_INLINE
uint32 GetZ()
const {
return vgetq_lane_u32(mValue, 2); }
99 JPH_INLINE
uint32 GetW()
const {
return vgetq_lane_u32(mValue, 3); }
114 JPH_INLINE
uint32 operator [] (
uint inCoordinate)
const {
JPH_ASSERT(inCoordinate < 4);
return mU32[inCoordinate]; }
115 JPH_INLINE
uint32 & operator [] (
uint inCoordinate) {
JPH_ASSERT(inCoordinate < 4);
return mU32[inCoordinate]; }
127 JPH_INLINE
UVec4 SplatX()
const;
130 JPH_INLINE
UVec4 SplatY()
const;
133 JPH_INLINE
UVec4 SplatZ()
const;
136 JPH_INLINE
UVec4 SplatW()
const;
139 JPH_INLINE
Vec4 ToFloat()
const;
142 JPH_INLINE
Vec4 ReinterpretAsFloat()
const;
145 JPH_INLINE
void StoreInt4(
uint32 *outV)
const;
148 JPH_INLINE
void StoreInt4Aligned(
uint32 *outV)
const;
151 JPH_INLINE
bool TestAnyTrue()
const;
154 JPH_INLINE
bool TestAnyXYZTrue()
const;
157 JPH_INLINE
bool TestAllTrue()
const;
160 JPH_INLINE
bool TestAllXYZTrue()
const;
163 JPH_INLINE
int CountTrues()
const;
166 JPH_INLINE
int GetTrues()
const;
169 template <const u
int Count>
173 template <const u
int Count>
177 template <const u
int Count>
181 JPH_INLINE
UVec4 Expand4Uint16Lo()
const;
184 JPH_INLINE
UVec4 Expand4Uint16Hi()
const;
187 JPH_INLINE
UVec4 Expand4Byte0()
const;
190 JPH_INLINE
UVec4 Expand4Byte4()
const;
193 JPH_INLINE
UVec4 Expand4Byte8()
const;
196 JPH_INLINE
UVec4 Expand4Byte12()
const;
199 JPH_INLINE
UVec4 ShiftComponents4Minus(
int inCount)
const;
202 friend ostream & operator << (ostream &inStream,
UVec4Arg inV)
204 inStream << inV.
mU32[0] <<
", " << inV.
mU32[1] <<
", " << inV.
mU32[2] <<
", " << inV.
mU32[3];
215 static const UVec4 sFourMinusXShuffle[];
218static_assert(is_trivial<UVec4>(),
"Is supposed to be a trivial type!");
uint32_t uint32
Definition Core.h:312
unsigned int uint
Definition Core.h:309
#define JPH_NAMESPACE_END
Definition Core.h:240
#define JPH_NAMESPACE_BEGIN
Definition Core.h:234
DVec3 operator*(double inV1, DVec3Arg inV2)
Definition DVec3.inl:447
#define JPH_ASSERT(...)
Definition IssueReporting.h:33
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:29
JPH_INLINE UVec4 Swizzle() const
Swizzle the elements in inV.
JPH_INLINE uint32 GetZ() const
Definition UVec4.h:103
JPH_INLINE UVec4 LogicalShiftLeft() const
Shift all components by Count bits to the left (filling with zeros from the left)
JPH_INLINE void SetW(uint32 inW)
Definition UVec4.h:111
JPH_INLINE uint32 GetY() const
Definition UVec4.h:102
JPH_INLINE void SetY(uint32 inY)
Definition UVec4.h:109
JPH_INLINE UVec4 LogicalShiftRight() const
Shift all components by Count bits to the right (filling with zeros from the right)
static JPH_INLINE UVec4 sGatherInt4(const uint32 *inBase, UVec4Arg inOffsets)
Gather 4 ints from memory at inBase + inOffsets[i] * Scale.
struct { uint32 mData[4];} Type
Definition UVec4.h:22
JPH_INLINE void SetZ(uint32 inZ)
Definition UVec4.h:110
JPH_INLINE uint32 GetW() const
Definition UVec4.h:104
Type mValue
Definition UVec4.h:210
UVec4(const UVec4 &inRHS)=default
JPH_INLINE uint32 GetX() const
Get individual components.
Definition UVec4.h:101
JPH_INLINE void SetX(uint32 inX)
Set individual components.
Definition UVec4.h:108
JPH_INLINE UVec4 ArithmeticShiftRight() const
Shift all components by Count bits to the right (shifting in the value of the highest bit)
JPH_INLINE UVec4(Type inRHS)
Definition UVec4.h:28
UVec4()=default
Constructor.
uint32 mU32[4]
Definition UVec4.h:211