We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 419ac92 commit 6fe0174Copy full SHA for 6fe0174
Source/astcenc_vecmathlib_none_4.h
@@ -1056,8 +1056,10 @@ ASTCENC_SIMD_INLINE float float16_to_float(uint16_t a)
1056
*/
1057
ASTCENC_SIMD_INLINE vint4 float_as_int(vfloat4 a)
1058
{
1059
+ static_assert(sizeof(int) == sizeof(float), "int must be 32-bit");
1060
+
1061
vint4 r;
- std::memcpy(r.m, a.m, 4 * 4);
1062
+ std::memcpy(r.m, a.m, 4 * sizeof(int));
1063
return r;
1064
}
1065
@@ -1071,7 +1073,7 @@ ASTCENC_SIMD_INLINE vint4 float_as_int(vfloat4 a)
1071
1073
ASTCENC_SIMD_INLINE vfloat4 int_as_float(vint4 a)
1072
1074
1075
vfloat4 r;
1076
+ std::memcpy(r.m, a.m, 4 * sizeof(float));
1077
1078
1079
0 commit comments