- Added GLM_EXT_vector_intX_sized and GLM_EXT_vector_uintX_sized extensions

This commit is contained in:
Christophe Riccio
2020-02-04 17:11:07 +01:00
parent 13724cfae6
commit 8e58cdbbf8
19 changed files with 1103 additions and 3 deletions

View File

@@ -19,8 +19,16 @@ glmCreateTestGTC(ext_vec1)
glmCreateTestGTC(ext_vector_bool1)
glmCreateTestGTC(ext_vector_common)
glmCreateTestGTC(ext_vector_iec559)
glmCreateTestGTC(ext_vector_int1_sized)
glmCreateTestGTC(ext_vector_int2_sized)
glmCreateTestGTC(ext_vector_int3_sized)
glmCreateTestGTC(ext_vector_int4_sized)
glmCreateTestGTC(ext_vector_integer)
glmCreateTestGTC(ext_vector_integer_sized)
glmCreateTestGTC(ext_vector_uint1_sized)
glmCreateTestGTC(ext_vector_uint2_sized)
glmCreateTestGTC(ext_vector_uint3_sized)
glmCreateTestGTC(ext_vector_uint4_sized)
glmCreateTestGTC(ext_vector_relational)
glmCreateTestGTC(ext_vector_ulp)

View File

@@ -0,0 +1,71 @@
#include <glm/ext/vector_int1_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::lowp_i8vec1) == 1, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::mediump_i8vec1) == 1, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::highp_i8vec1) == 1, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i8vec1) == 1, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::lowp_i16vec1) == 2, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::mediump_i16vec1) == 2, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::highp_i16vec1) == 2, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i16vec1) == 2, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::lowp_i32vec1) == 4, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::mediump_i32vec1) == 4, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::highp_i32vec1) == 4, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i32vec1) == 4, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::lowp_i64vec1) == 8, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::mediump_i64vec1) == 8, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::highp_i64vec1) == 8, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::i64vec1) == 8, "int64 size isn't 8 bytes on this platform");
#endif
static int test_size()
{
int Error = 0;
Error += sizeof(glm::lowp_i8vec1) == 1 ? 0 : 1;
Error += sizeof(glm::mediump_i8vec1) == 1 ? 0 : 1;
Error += sizeof(glm::highp_i8vec1) == 1 ? 0 : 1;
Error += sizeof(glm::i8vec1) == 1 ? 0 : 1;
Error += sizeof(glm::lowp_i16vec1) == 2 ? 0 : 1;
Error += sizeof(glm::mediump_i16vec1) == 2 ? 0 : 1;
Error += sizeof(glm::highp_i16vec1) == 2 ? 0 : 1;
Error += sizeof(glm::i16vec1) == 2 ? 0 : 1;
Error += sizeof(glm::lowp_i32vec1) == 4 ? 0 : 1;
Error += sizeof(glm::mediump_i32vec1) == 4 ? 0 : 1;
Error += sizeof(glm::highp_i32vec1) == 4 ? 0 : 1;
Error += sizeof(glm::i32vec1) == 4 ? 0 : 1;
Error += sizeof(glm::lowp_i64vec1) == 8 ? 0 : 1;
Error += sizeof(glm::mediump_i64vec1) == 8 ? 0 : 1;
Error += sizeof(glm::highp_i64vec1) == 8 ? 0 : 1;
Error += sizeof(glm::i64vec1) == 8 ? 0 : 1;
return Error;
}
static int test_comp()
{
int Error = 0;
Error += sizeof(glm::i8vec1) < sizeof(glm::i16vec1) ? 0 : 1;
Error += sizeof(glm::i16vec1) < sizeof(glm::i32vec1) ? 0 : 1;
Error += sizeof(glm::i32vec1) < sizeof(glm::i64vec1) ? 0 : 1;
return Error;
}
int main()
{
int Error = 0;
Error += test_size();
Error += test_comp();
return Error;
}

View File

@@ -0,0 +1,71 @@
#include <glm/ext/vector_int2_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::lowp_i8vec2) == 2, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::mediump_i8vec2) == 2, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::highp_i8vec2) == 2, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i8vec2) == 2, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::lowp_i16vec2) == 4, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::mediump_i16vec2) == 4, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::highp_i16vec2) == 4, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i16vec2) == 4, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::lowp_i32vec2) == 8, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::mediump_i32vec2) == 8, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::highp_i32vec2) == 8, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i32vec2) == 8, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::lowp_i64vec2) == 16, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::mediump_i64vec2) == 16, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::highp_i64vec2) == 16, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::i64vec2) == 16, "int64 size isn't 8 bytes on this platform");
#endif
static int test_size()
{
int Error = 0;
Error += sizeof(glm::lowp_i8vec2) == 2 ? 0 : 1;
Error += sizeof(glm::mediump_i8vec2) == 2 ? 0 : 1;
Error += sizeof(glm::highp_i8vec2) == 2 ? 0 : 1;
Error += sizeof(glm::i8vec2) == 2 ? 0 : 1;
Error += sizeof(glm::lowp_i16vec2) == 4 ? 0 : 1;
Error += sizeof(glm::mediump_i16vec2) == 4 ? 0 : 1;
Error += sizeof(glm::highp_i16vec2) == 4 ? 0 : 1;
Error += sizeof(glm::i16vec2) == 4 ? 0 : 1;
Error += sizeof(glm::lowp_i32vec2) == 8 ? 0 : 1;
Error += sizeof(glm::mediump_i32vec2) == 8 ? 0 : 1;
Error += sizeof(glm::highp_i32vec2) == 8 ? 0 : 1;
Error += sizeof(glm::i32vec2) == 8 ? 0 : 1;
Error += sizeof(glm::lowp_i64vec2) == 16 ? 0 : 1;
Error += sizeof(glm::mediump_i64vec2) == 16 ? 0 : 1;
Error += sizeof(glm::highp_i64vec2) == 16 ? 0 : 1;
Error += sizeof(glm::i64vec2) == 16 ? 0 : 1;
return Error;
}
static int test_comp()
{
int Error = 0;
Error += sizeof(glm::i8vec2) < sizeof(glm::i16vec2) ? 0 : 1;
Error += sizeof(glm::i16vec2) < sizeof(glm::i32vec2) ? 0 : 1;
Error += sizeof(glm::i32vec2) < sizeof(glm::i64vec2) ? 0 : 1;
return Error;
}
int main()
{
int Error = 0;
Error += test_size();
Error += test_comp();
return Error;
}

View File

@@ -0,0 +1,71 @@
#include <glm/ext/vector_int3_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::lowp_i8vec3) == 3, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::mediump_i8vec3) == 3, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::highp_i8vec3) == 3, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i8vec3) == 3, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::lowp_i16vec3) == 6, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::mediump_i16vec3) == 6, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::highp_i16vec3) == 6, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i16vec3) == 6, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::lowp_i32vec3) == 12, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::mediump_i32vec3) == 12, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::highp_i32vec3) == 12, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i32vec3) == 12, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::lowp_i64vec3) == 24, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::mediump_i64vec3) == 24, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::highp_i64vec3) == 24, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::i64vec3) == 24, "int64 size isn't 8 bytes on this platform");
#endif
static int test_size()
{
int Error = 0;
Error += sizeof(glm::lowp_i8vec3) == 3 ? 0 : 1;
Error += sizeof(glm::mediump_i8vec3) == 3 ? 0 : 1;
Error += sizeof(glm::highp_i8vec3) == 3 ? 0 : 1;
Error += sizeof(glm::i8vec3) == 3 ? 0 : 1;
Error += sizeof(glm::lowp_i16vec3) == 6 ? 0 : 1;
Error += sizeof(glm::mediump_i16vec3) == 6 ? 0 : 1;
Error += sizeof(glm::highp_i16vec3) == 6 ? 0 : 1;
Error += sizeof(glm::i16vec3) == 6 ? 0 : 1;
Error += sizeof(glm::lowp_i32vec3) == 12 ? 0 : 1;
Error += sizeof(glm::mediump_i32vec3) == 12 ? 0 : 1;
Error += sizeof(glm::highp_i32vec3) == 12 ? 0 : 1;
Error += sizeof(glm::i32vec3) == 12 ? 0 : 1;
Error += sizeof(glm::lowp_i64vec3) == 24 ? 0 : 1;
Error += sizeof(glm::mediump_i64vec3) == 24 ? 0 : 1;
Error += sizeof(glm::highp_i64vec3) == 24 ? 0 : 1;
Error += sizeof(glm::i64vec3) == 24 ? 0 : 1;
return Error;
}
static int test_comp()
{
int Error = 0;
Error += sizeof(glm::i8vec3) < sizeof(glm::i16vec3) ? 0 : 1;
Error += sizeof(glm::i16vec3) < sizeof(glm::i32vec3) ? 0 : 1;
Error += sizeof(glm::i32vec3) < sizeof(glm::i64vec3) ? 0 : 1;
return Error;
}
int main()
{
int Error = 0;
Error += test_size();
Error += test_comp();
return Error;
}

View File

@@ -0,0 +1,71 @@
#include <glm/ext/vector_int4_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::lowp_i8vec4) == 4, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::mediump_i8vec4) == 4, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::highp_i8vec4) == 4, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::i8vec4) == 4, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::lowp_i16vec4) == 8, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::mediump_i16vec4) == 8, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::highp_i16vec4) == 8, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::i16vec4) == 8, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::lowp_i32vec4) == 16, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::mediump_i32vec4) == 16, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::highp_i32vec4) == 16, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::i32vec4) == 16, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::lowp_i64vec4) == 32, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::mediump_i64vec4) == 32, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::highp_i64vec4) == 32, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::i64vec4) == 32, "int64 size isn't 8 bytes on this platform");
#endif
static int test_size()
{
int Error = 0;
Error += sizeof(glm::lowp_i8vec4) == 4 ? 0 : 1;
Error += sizeof(glm::mediump_i8vec4) == 4 ? 0 : 1;
Error += sizeof(glm::highp_i8vec4) == 4 ? 0 : 1;
Error += sizeof(glm::i8vec4) == 4 ? 0 : 1;
Error += sizeof(glm::lowp_i16vec4) == 8 ? 0 : 1;
Error += sizeof(glm::mediump_i16vec4) == 8 ? 0 : 1;
Error += sizeof(glm::highp_i16vec4) == 8 ? 0 : 1;
Error += sizeof(glm::i16vec4) == 8 ? 0 : 1;
Error += sizeof(glm::lowp_i32vec4) == 16 ? 0 : 1;
Error += sizeof(glm::mediump_i32vec4) == 16 ? 0 : 1;
Error += sizeof(glm::highp_i32vec4) == 16 ? 0 : 1;
Error += sizeof(glm::i32vec4) == 16 ? 0 : 1;
Error += sizeof(glm::lowp_i64vec4) == 32 ? 0 : 1;
Error += sizeof(glm::mediump_i64vec4) == 32 ? 0 : 1;
Error += sizeof(glm::highp_i64vec4) == 32 ? 0 : 1;
Error += sizeof(glm::i64vec4) == 32 ? 0 : 1;
return Error;
}
static int test_comp()
{
int Error = 0;
Error += sizeof(glm::i8vec4) < sizeof(glm::i16vec4) ? 0 : 1;
Error += sizeof(glm::i16vec4) < sizeof(glm::i32vec4) ? 0 : 1;
Error += sizeof(glm::i32vec4) < sizeof(glm::i64vec4) ? 0 : 1;
return Error;
}
int main()
{
int Error = 0;
Error += test_size();
Error += test_comp();
return Error;
}

View File

@@ -0,0 +1,71 @@
#include <glm/ext/vector_uint1_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::lowp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::mediump_u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::highp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::lowp_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::mediump_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::highp_u16vec1) == 2, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u16vec1) == 2, "uint16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::lowp_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::mediump_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::highp_u32vec1) == 4, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u32vec1) == 4, "uint32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::lowp_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::mediump_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::highp_u64vec1) == 8, "uint64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::u64vec1) == 8, "uint64 size isn't 8 bytes on this platform");
#endif
static int test_size()
{
int Error = 0;
Error += sizeof(glm::lowp_u8vec1) == 1 ? 0 : 1;
Error += sizeof(glm::mediump_u8vec1) == 1 ? 0 : 1;
Error += sizeof(glm::highp_u8vec1) == 1 ? 0 : 1;
Error += sizeof(glm::u8vec1) == 1 ? 0 : 1;
Error += sizeof(glm::lowp_u16vec1) == 2 ? 0 : 1;
Error += sizeof(glm::mediump_u16vec1) == 2 ? 0 : 1;
Error += sizeof(glm::highp_u16vec1) == 2 ? 0 : 1;
Error += sizeof(glm::u16vec1) == 2 ? 0 : 1;
Error += sizeof(glm::lowp_u32vec1) == 4 ? 0 : 1;
Error += sizeof(glm::mediump_u32vec1) == 4 ? 0 : 1;
Error += sizeof(glm::highp_u32vec1) == 4 ? 0 : 1;
Error += sizeof(glm::u32vec1) == 4 ? 0 : 1;
Error += sizeof(glm::lowp_u64vec1) == 8 ? 0 : 1;
Error += sizeof(glm::mediump_u64vec1) == 8 ? 0 : 1;
Error += sizeof(glm::highp_u64vec1) == 8 ? 0 : 1;
Error += sizeof(glm::u64vec1) == 8 ? 0 : 1;
return Error;
}
static int test_comp()
{
int Error = 0;
Error += sizeof(glm::u8vec1) < sizeof(glm::u16vec1) ? 0 : 1;
Error += sizeof(glm::u16vec1) < sizeof(glm::u32vec1) ? 0 : 1;
Error += sizeof(glm::u32vec1) < sizeof(glm::u64vec1) ? 0 : 1;
return Error;
}
int main()
{
int Error = 0;
Error += test_size();
Error += test_comp();
return Error;
}

View File

@@ -0,0 +1,71 @@
#include <glm/ext/vector_uint2_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::lowp_u8vec2) == 2, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::mediump_u8vec2) == 2, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::highp_u8vec2) == 2, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u8vec2) == 2, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::lowp_u16vec2) == 4, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::mediump_u16vec2) == 4, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::highp_u16vec2) == 4, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u16vec2) == 4, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::lowp_u32vec2) == 8, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::mediump_u32vec2) == 8, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::highp_u32vec2) == 8, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u32vec2) == 8, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::lowp_u64vec2) == 16, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::mediump_u64vec2) == 16, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::highp_u64vec2) == 16, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::u64vec2) == 16, "int64 size isn't 8 bytes on this platform");
#endif
static int test_size()
{
int Error = 0;
Error += sizeof(glm::lowp_u8vec2) == 2 ? 0 : 1;
Error += sizeof(glm::mediump_u8vec2) == 2 ? 0 : 1;
Error += sizeof(glm::highp_u8vec2) == 2 ? 0 : 1;
Error += sizeof(glm::u8vec2) == 2 ? 0 : 1;
Error += sizeof(glm::lowp_u16vec2) == 4 ? 0 : 1;
Error += sizeof(glm::mediump_u16vec2) == 4 ? 0 : 1;
Error += sizeof(glm::highp_u16vec2) == 4 ? 0 : 1;
Error += sizeof(glm::u16vec2) == 4 ? 0 : 1;
Error += sizeof(glm::lowp_u32vec2) == 8 ? 0 : 1;
Error += sizeof(glm::mediump_u32vec2) == 8 ? 0 : 1;
Error += sizeof(glm::highp_u32vec2) == 8 ? 0 : 1;
Error += sizeof(glm::u32vec2) == 8 ? 0 : 1;
Error += sizeof(glm::lowp_u64vec2) == 16 ? 0 : 1;
Error += sizeof(glm::mediump_u64vec2) == 16 ? 0 : 1;
Error += sizeof(glm::highp_u64vec2) == 16 ? 0 : 1;
Error += sizeof(glm::u64vec2) == 16 ? 0 : 1;
return Error;
}
static int test_comp()
{
int Error = 0;
Error += sizeof(glm::u8vec2) < sizeof(glm::u16vec2) ? 0 : 1;
Error += sizeof(glm::u16vec2) < sizeof(glm::u32vec2) ? 0 : 1;
Error += sizeof(glm::u32vec2) < sizeof(glm::u64vec2) ? 0 : 1;
return Error;
}
int main()
{
int Error = 0;
Error += test_size();
Error += test_comp();
return Error;
}

View File

@@ -0,0 +1,71 @@
#include <glm/ext/vector_uint3_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::lowp_u8vec3) == 3, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::mediump_u8vec3) == 3, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::highp_u8vec3) == 3, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u8vec3) == 3, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::lowp_u16vec3) == 6, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::mediump_u16vec3) == 6, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::highp_u16vec3) == 6, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u16vec3) == 6, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::lowp_u32vec3) == 12, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::mediump_u32vec3) == 12, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::highp_u32vec3) == 12, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u32vec3) == 12, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::lowp_u64vec3) == 24, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::mediump_u64vec3) == 24, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::highp_u64vec3) == 24, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::u64vec3) == 24, "int64 size isn't 8 bytes on this platform");
#endif
static int test_size()
{
int Error = 0;
Error += sizeof(glm::lowp_u8vec3) == 3 ? 0 : 1;
Error += sizeof(glm::mediump_u8vec3) == 3 ? 0 : 1;
Error += sizeof(glm::highp_u8vec3) == 3 ? 0 : 1;
Error += sizeof(glm::u8vec3) == 3 ? 0 : 1;
Error += sizeof(glm::lowp_u16vec3) == 6 ? 0 : 1;
Error += sizeof(glm::mediump_u16vec3) == 6 ? 0 : 1;
Error += sizeof(glm::highp_u16vec3) == 6 ? 0 : 1;
Error += sizeof(glm::u16vec3) == 6 ? 0 : 1;
Error += sizeof(glm::lowp_u32vec3) == 12 ? 0 : 1;
Error += sizeof(glm::mediump_u32vec3) == 12 ? 0 : 1;
Error += sizeof(glm::highp_u32vec3) == 12 ? 0 : 1;
Error += sizeof(glm::u32vec3) == 12 ? 0 : 1;
Error += sizeof(glm::lowp_u64vec3) == 24 ? 0 : 1;
Error += sizeof(glm::mediump_u64vec3) == 24 ? 0 : 1;
Error += sizeof(glm::highp_u64vec3) == 24 ? 0 : 1;
Error += sizeof(glm::u64vec3) == 24 ? 0 : 1;
return Error;
}
static int test_comp()
{
int Error = 0;
Error += sizeof(glm::u8vec3) < sizeof(glm::u16vec3) ? 0 : 1;
Error += sizeof(glm::u16vec3) < sizeof(glm::u32vec3) ? 0 : 1;
Error += sizeof(glm::u32vec3) < sizeof(glm::u64vec3) ? 0 : 1;
return Error;
}
int main()
{
int Error = 0;
Error += test_size();
Error += test_comp();
return Error;
}

View File

@@ -0,0 +1,71 @@
#include <glm/ext/vector_uint4_sized.hpp>
#if GLM_HAS_STATIC_ASSERT
static_assert(sizeof(glm::lowp_u8vec4) == 4, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::mediump_u8vec4) == 4, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::highp_u8vec4) == 4, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::u8vec4) == 4, "int8 size isn't 1 byte on this platform");
static_assert(sizeof(glm::lowp_u16vec4) == 8, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::mediump_u16vec4) == 8, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::highp_u16vec4) == 8, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::u16vec4) == 8, "int16 size isn't 2 bytes on this platform");
static_assert(sizeof(glm::lowp_u32vec4) == 16, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::mediump_u32vec4) == 16, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::highp_u32vec4) == 16, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::u32vec4) == 16, "int32 size isn't 4 bytes on this platform");
static_assert(sizeof(glm::lowp_u64vec4) == 32, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::mediump_u64vec4) == 32, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::highp_u64vec4) == 32, "int64 size isn't 8 bytes on this platform");
static_assert(sizeof(glm::u64vec4) == 32, "int64 size isn't 8 bytes on this platform");
#endif
static int test_size()
{
int Error = 0;
Error += sizeof(glm::lowp_u8vec4) == 4 ? 0 : 1;
Error += sizeof(glm::mediump_u8vec4) == 4 ? 0 : 1;
Error += sizeof(glm::highp_u8vec4) == 4 ? 0 : 1;
Error += sizeof(glm::u8vec4) == 4 ? 0 : 1;
Error += sizeof(glm::lowp_u16vec4) == 8 ? 0 : 1;
Error += sizeof(glm::mediump_u16vec4) == 8 ? 0 : 1;
Error += sizeof(glm::highp_u16vec4) == 8 ? 0 : 1;
Error += sizeof(glm::u16vec4) == 8 ? 0 : 1;
Error += sizeof(glm::lowp_u32vec4) == 16 ? 0 : 1;
Error += sizeof(glm::mediump_u32vec4) == 16 ? 0 : 1;
Error += sizeof(glm::highp_u32vec4) == 16 ? 0 : 1;
Error += sizeof(glm::u32vec4) == 16 ? 0 : 1;
Error += sizeof(glm::lowp_u64vec4) == 32 ? 0 : 1;
Error += sizeof(glm::mediump_u64vec4) == 32 ? 0 : 1;
Error += sizeof(glm::highp_u64vec4) == 32 ? 0 : 1;
Error += sizeof(glm::u64vec4) == 32 ? 0 : 1;
return Error;
}
static int test_comp()
{
int Error = 0;
Error += sizeof(glm::u8vec4) < sizeof(glm::u16vec4) ? 0 : 1;
Error += sizeof(glm::u16vec4) < sizeof(glm::u32vec4) ? 0 : 1;
Error += sizeof(glm::u32vec4) < sizeof(glm::u64vec4) ? 0 : 1;
return Error;
}
int main()
{
int Error = 0;
Error += test_size();
Error += test_comp();
return Error;
}