Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Will Usher
2020-02-16 14:07:18 -08:00
29 changed files with 1233 additions and 292 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,28 @@
#include <glm/ext/scalar_packing.hpp>
#include <glm/ext/scalar_relational.hpp>
int test_packUnorm()
{
int Error = 0;
return Error;
}
int test_packSnorm()
{
int Error = 0;
return Error;
}
int main()
{
int Error = 0;
Error += test_packUnorm();
Error += test_packSnorm();
return Error;
}

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,58 @@
#include <glm/ext/vector_packing.hpp>
#include <glm/ext/vector_relational.hpp>
#include <glm/ext/vector_uint2_sized.hpp>
#include <glm/ext/vector_int2_sized.hpp>
#include <glm/gtc/packing.hpp>
#include <glm/vec2.hpp>
#include <vector>
int test_packUnorm()
{
int Error = 0;
std::vector<glm::vec2> A;
A.push_back(glm::vec2(1.0f, 0.7f));
A.push_back(glm::vec2(0.5f, 0.1f));
for (std::size_t i = 0; i < A.size(); ++i)
{
glm::vec2 B(A[i]);
glm::u16vec2 C = glm::packUnorm<glm::uint16>(B);
glm::vec2 D = glm::unpackUnorm<float>(C);
Error += glm::all(glm::equal(B, D, 1.0f / 255.f)) ? 0 : 1;
assert(!Error);
}
return Error;
}
int test_packSnorm()
{
int Error = 0;
std::vector<glm::vec2> A;
A.push_back(glm::vec2(1.0f, 0.0f));
A.push_back(glm::vec2(-0.5f, -0.7f));
A.push_back(glm::vec2(-0.1f, 0.1f));
for (std::size_t i = 0; i < A.size(); ++i)
{
glm::vec2 B(A[i]);
glm::i16vec2 C = glm::packSnorm<glm::int16>(B);
glm::vec2 D = glm::unpackSnorm<float>(C);
Error += glm::all(glm::equal(B, D, 1.0f / 32767.0f * 2.0f)) ? 0 : 1;
assert(!Error);
}
return Error;
}
int main()
{
int Error = 0;
Error += test_packUnorm();
Error += test_packSnorm();
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;
}