mirror of
https://github.com/g-truc/glm.git
synced 2024-11-29 19:34:36 +00:00
simd constexpr vec: compWiseTernary, swizzle functions: construct the vec-to-return directly from the GccVec thingy
This commit is contained in:
parent
4f5d589ecc
commit
55a64cf2ae
@ -8,7 +8,7 @@
|
||||
G vin; std::memcpy(&vin, &data, std::min(sizeof(data), sizeof(vin))); \
|
||||
GccVec<2, T, Q> vout; \
|
||||
vout = __builtin_shufflevector(vin, vin, offsetof(E, A)/sizeof(A), offsetof(E, B)/sizeof(B)); \
|
||||
return vec<2, T, Q>(std::bit_cast<typename vec<2, T, Q>::data_t>(vout)); \
|
||||
return vec<2, T, Q>(vout); \
|
||||
}
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC3_ENTRY(L, T, Q, CONST, A, B, C) \
|
||||
@ -31,7 +31,7 @@
|
||||
G vin; std::memcpy(&vin, &data, std::min(sizeof(data), sizeof(vin))); \
|
||||
GccVec<4, T, Q> vout; \
|
||||
vout=__builtin_shufflevector(vin, vin, offsetof(E, A)/sizeof(A), offsetof(E, B)/sizeof(B), offsetof(E, C)/sizeof(C), offsetof(E, D)/sizeof(D)); \
|
||||
return vec<4, T, Q>(std::bit_cast<typename vec<4, T, Q>::data_t>(vout)); \
|
||||
return vec<4, T, Q>(vout); \
|
||||
}
|
||||
|
||||
#define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(T, Q, L, CONST, A, B) \
|
||||
|
@ -189,7 +189,7 @@ namespace glm
|
||||
GccVec_t condMask = std::bit_cast<GccVec_t>(elementArr);
|
||||
auto gv1 = std::bit_cast<GccVec<L, Tx, Qx>>(v1.elementArr);
|
||||
auto gv2 = std::bit_cast<GccVec<L, Tx, Qx>>(v2.elementArr);
|
||||
return vec<L, Tx, Qx>(std::bit_cast<detail::_data_t<L, Tx, Qx>> ((condMask ? gv1 : gv2)));
|
||||
return vec<L, Tx, Qx>((condMask ? gv1 : gv2));
|
||||
}
|
||||
|
||||
template <typename ScalarGetter>
|
||||
|
Loading…
Reference in New Issue
Block a user