Added all precision types for GTC_type_precision
This commit is contained in:
@@ -136,16 +136,16 @@ int test_packDouble2x32()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
std::vector<glm::u32vec2> A;
|
||||
A.push_back(glm::u32vec2( 1, 2));
|
||||
A.push_back(glm::u32vec2(-1,-2));
|
||||
A.push_back(glm::u32vec2(-1000, 1100));
|
||||
std::vector<glm::uvec2> A;
|
||||
A.push_back(glm::uvec2( 1, 2));
|
||||
A.push_back(glm::uvec2(-1,-2));
|
||||
A.push_back(glm::uvec2(-1000, 1100));
|
||||
|
||||
for(std::size_t i = 0; i < A.size(); ++i)
|
||||
{
|
||||
glm::u32vec2 B(A[i]);
|
||||
glm::uvec2 B(A[i]);
|
||||
double C = glm::packDouble2x32(B);
|
||||
glm::u32vec2 D = glm::unpackDouble2x32(C);
|
||||
glm::uvec2 D = glm::unpackDouble2x32(C);
|
||||
Error += B == D ? 0 : 1;
|
||||
assert(!Error);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Created : 2010-09-16
|
||||
// Updated : 2011-05-08
|
||||
// Updated : 2013-04-16
|
||||
// Licence : This source is under MIT licence
|
||||
// File : test/gtc/type_precision.cpp
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -12,154 +12,522 @@
|
||||
|
||||
static int test_scalar_size()
|
||||
{
|
||||
int Error = 0;
|
||||
Error += sizeof(glm::int8) != 1;
|
||||
Error += sizeof(glm::int16) != 2;
|
||||
Error += sizeof(glm::int32) != 4;
|
||||
Error += sizeof(glm::int64) != 8;
|
||||
Error += sizeof(glm::uint8) != 1;
|
||||
Error += sizeof(glm::uint16) != 2;
|
||||
Error += sizeof(glm::uint32) != 4;
|
||||
Error += sizeof(glm::uint64) != 8;
|
||||
Error += sizeof(glm::float16) != 2;
|
||||
Error += sizeof(glm::float32) != 4;
|
||||
Error += sizeof(glm::float64) != 8;
|
||||
int Error(0);
|
||||
Error += sizeof(glm::int8) != 1;
|
||||
Error += sizeof(glm::int16) != 2;
|
||||
Error += sizeof(glm::int32) != 4;
|
||||
Error += sizeof(glm::int64) != 8;
|
||||
Error += sizeof(glm::uint8) != 1;
|
||||
Error += sizeof(glm::uint16) != 2;
|
||||
Error += sizeof(glm::uint32) != 4;
|
||||
Error += sizeof(glm::uint64) != 8;
|
||||
Error += sizeof(glm::float16) != 2;
|
||||
Error += sizeof(glm::float32) != 4;
|
||||
Error += sizeof(glm::float64) != 8;
|
||||
|
||||
Error += sizeof(glm::lowp_int8) != 1;
|
||||
Error += sizeof(glm::lowp_int16) != 2;
|
||||
Error += sizeof(glm::lowp_int32) != 4;
|
||||
Error += sizeof(glm::lowp_int64) != 8;
|
||||
Error += sizeof(glm::lowp_uint8) != 1;
|
||||
Error += sizeof(glm::lowp_uint16) != 2;
|
||||
Error += sizeof(glm::lowp_uint32) != 4;
|
||||
Error += sizeof(glm::lowp_uint64) != 8;
|
||||
Error += sizeof(glm::lowp_float16) != 2;
|
||||
Error += sizeof(glm::lowp_float32) != 4;
|
||||
Error += sizeof(glm::lowp_float64) != 8;
|
||||
|
||||
Error += sizeof(glm::mediump_int8) != 1;
|
||||
Error += sizeof(glm::mediump_int16) != 2;
|
||||
Error += sizeof(glm::mediump_int32) != 4;
|
||||
Error += sizeof(glm::mediump_int64) != 8;
|
||||
Error += sizeof(glm::mediump_uint8) != 1;
|
||||
Error += sizeof(glm::mediump_uint16) != 2;
|
||||
Error += sizeof(glm::mediump_uint32) != 4;
|
||||
Error += sizeof(glm::mediump_uint64) != 8;
|
||||
Error += sizeof(glm::mediump_float16) != 2;
|
||||
Error += sizeof(glm::mediump_float32) != 4;
|
||||
Error += sizeof(glm::mediump_float64) != 8;
|
||||
|
||||
Error += sizeof(glm::highp_int8) != 1;
|
||||
Error += sizeof(glm::highp_int16) != 2;
|
||||
Error += sizeof(glm::highp_int32) != 4;
|
||||
Error += sizeof(glm::highp_int64) != 8;
|
||||
Error += sizeof(glm::highp_uint8) != 1;
|
||||
Error += sizeof(glm::highp_uint16) != 2;
|
||||
Error += sizeof(glm::highp_uint32) != 4;
|
||||
Error += sizeof(glm::highp_uint64) != 8;
|
||||
Error += sizeof(glm::highp_float16) != 2;
|
||||
Error += sizeof(glm::highp_float32) != 4;
|
||||
Error += sizeof(glm::highp_float64) != 8;
|
||||
return Error;
|
||||
}
|
||||
|
||||
static int test_fvec_size()
|
||||
{
|
||||
int Error = 0;
|
||||
Error += sizeof(glm::f16vec2) != 4;
|
||||
Error += sizeof(glm::f16vec3) != 6;
|
||||
Error += sizeof(glm::f16vec4) != 8;
|
||||
Error += sizeof(glm::f32vec2) != 8;
|
||||
Error += sizeof(glm::f32vec3) != 12;
|
||||
Error += sizeof(glm::f32vec4) != 16;
|
||||
Error += sizeof(glm::f64vec2) != 16;
|
||||
Error += sizeof(glm::f64vec3) != 24;
|
||||
Error += sizeof(glm::f64vec4) != 32;
|
||||
int Error(0);
|
||||
Error += sizeof(glm::f16vec2) != 4;
|
||||
Error += sizeof(glm::f16vec3) != 6;
|
||||
Error += sizeof(glm::f16vec4) != 8;
|
||||
Error += sizeof(glm::f32vec2) != 8;
|
||||
Error += sizeof(glm::f32vec3) != 12;
|
||||
Error += sizeof(glm::f32vec4) != 16;
|
||||
Error += sizeof(glm::f64vec2) != 16;
|
||||
Error += sizeof(glm::f64vec3) != 24;
|
||||
Error += sizeof(glm::f64vec4) != 32;
|
||||
|
||||
Error += sizeof(glm::lowp_f16vec2) != 4;
|
||||
Error += sizeof(glm::lowp_f16vec3) != 6;
|
||||
Error += sizeof(glm::lowp_f16vec4) != 8;
|
||||
Error += sizeof(glm::lowp_f32vec2) != 8;
|
||||
Error += sizeof(glm::lowp_f32vec3) != 12;
|
||||
Error += sizeof(glm::lowp_f32vec4) != 16;
|
||||
Error += sizeof(glm::lowp_f64vec2) != 16;
|
||||
Error += sizeof(glm::lowp_f64vec3) != 24;
|
||||
Error += sizeof(glm::lowp_f64vec4) != 32;
|
||||
|
||||
Error += sizeof(glm::mediump_f16vec2) != 4;
|
||||
Error += sizeof(glm::mediump_f16vec3) != 6;
|
||||
Error += sizeof(glm::mediump_f16vec4) != 8;
|
||||
Error += sizeof(glm::mediump_f32vec2) != 8;
|
||||
Error += sizeof(glm::mediump_f32vec3) != 12;
|
||||
Error += sizeof(glm::mediump_f32vec4) != 16;
|
||||
Error += sizeof(glm::mediump_f64vec2) != 16;
|
||||
Error += sizeof(glm::mediump_f64vec3) != 24;
|
||||
Error += sizeof(glm::mediump_f64vec4) != 32;
|
||||
|
||||
Error += sizeof(glm::highp_f16vec2) != 4;
|
||||
Error += sizeof(glm::highp_f16vec3) != 6;
|
||||
Error += sizeof(glm::highp_f16vec4) != 8;
|
||||
Error += sizeof(glm::highp_f32vec2) != 8;
|
||||
Error += sizeof(glm::highp_f32vec3) != 12;
|
||||
Error += sizeof(glm::highp_f32vec4) != 16;
|
||||
Error += sizeof(glm::highp_f64vec2) != 16;
|
||||
Error += sizeof(glm::highp_f64vec3) != 24;
|
||||
Error += sizeof(glm::highp_f64vec4) != 32;
|
||||
return Error;
|
||||
}
|
||||
|
||||
static int test_ivec_size()
|
||||
{
|
||||
int Error = 0;
|
||||
Error += sizeof(glm::i8vec2) != 2;
|
||||
Error += sizeof(glm::i8vec3) != 3;
|
||||
Error += sizeof(glm::i8vec4) != 4;
|
||||
Error += sizeof(glm::i16vec2) != 4;
|
||||
Error += sizeof(glm::i16vec3) != 6;
|
||||
Error += sizeof(glm::i16vec4) != 8;
|
||||
Error += sizeof(glm::i32vec2) != 8;
|
||||
Error += sizeof(glm::i32vec3) != 12;
|
||||
Error += sizeof(glm::i32vec4) != 16;
|
||||
Error += sizeof(glm::i64vec2) != 16;
|
||||
Error += sizeof(glm::i64vec3) != 24;
|
||||
Error += sizeof(glm::i64vec4) != 32;
|
||||
int Error(0);
|
||||
Error += sizeof(glm::i8vec2) != 2;
|
||||
Error += sizeof(glm::i8vec3) != 3;
|
||||
Error += sizeof(glm::i8vec4) != 4;
|
||||
Error += sizeof(glm::i16vec2) != 4;
|
||||
Error += sizeof(glm::i16vec3) != 6;
|
||||
Error += sizeof(glm::i16vec4) != 8;
|
||||
Error += sizeof(glm::i32vec2) != 8;
|
||||
Error += sizeof(glm::i32vec3) != 12;
|
||||
Error += sizeof(glm::i32vec4) != 16;
|
||||
Error += sizeof(glm::i64vec2) != 16;
|
||||
Error += sizeof(glm::i64vec3) != 24;
|
||||
Error += sizeof(glm::i64vec4) != 32;
|
||||
|
||||
Error += sizeof(glm::lowp_i8vec2) != 2;
|
||||
Error += sizeof(glm::lowp_i8vec3) != 3;
|
||||
Error += sizeof(glm::lowp_i8vec4) != 4;
|
||||
Error += sizeof(glm::lowp_i16vec2) != 4;
|
||||
Error += sizeof(glm::lowp_i16vec3) != 6;
|
||||
Error += sizeof(glm::lowp_i16vec4) != 8;
|
||||
Error += sizeof(glm::lowp_i32vec2) != 8;
|
||||
Error += sizeof(glm::lowp_i32vec3) != 12;
|
||||
Error += sizeof(glm::lowp_i32vec4) != 16;
|
||||
Error += sizeof(glm::lowp_i64vec2) != 16;
|
||||
Error += sizeof(glm::lowp_i64vec3) != 24;
|
||||
Error += sizeof(glm::lowp_i64vec4) != 32;
|
||||
|
||||
Error += sizeof(glm::mediump_i8vec2) != 2;
|
||||
Error += sizeof(glm::mediump_i8vec3) != 3;
|
||||
Error += sizeof(glm::mediump_i8vec4) != 4;
|
||||
Error += sizeof(glm::mediump_i16vec2) != 4;
|
||||
Error += sizeof(glm::mediump_i16vec3) != 6;
|
||||
Error += sizeof(glm::mediump_i16vec4) != 8;
|
||||
Error += sizeof(glm::mediump_i32vec2) != 8;
|
||||
Error += sizeof(glm::mediump_i32vec3) != 12;
|
||||
Error += sizeof(glm::mediump_i32vec4) != 16;
|
||||
Error += sizeof(glm::mediump_i64vec2) != 16;
|
||||
Error += sizeof(glm::mediump_i64vec3) != 24;
|
||||
Error += sizeof(glm::mediump_i64vec4) != 32;
|
||||
|
||||
Error += sizeof(glm::highp_i8vec2) != 2;
|
||||
Error += sizeof(glm::highp_i8vec3) != 3;
|
||||
Error += sizeof(glm::highp_i8vec4) != 4;
|
||||
Error += sizeof(glm::highp_i16vec2) != 4;
|
||||
Error += sizeof(glm::highp_i16vec3) != 6;
|
||||
Error += sizeof(glm::highp_i16vec4) != 8;
|
||||
Error += sizeof(glm::highp_i32vec2) != 8;
|
||||
Error += sizeof(glm::highp_i32vec3) != 12;
|
||||
Error += sizeof(glm::highp_i32vec4) != 16;
|
||||
Error += sizeof(glm::highp_i64vec2) != 16;
|
||||
Error += sizeof(glm::highp_i64vec3) != 24;
|
||||
Error += sizeof(glm::highp_i64vec4) != 32;
|
||||
return Error;
|
||||
}
|
||||
|
||||
static int test_uvec_size()
|
||||
{
|
||||
int Error = 0;
|
||||
Error += sizeof(glm::u8vec2) != 2;
|
||||
Error += sizeof(glm::u8vec3) != 3;
|
||||
Error += sizeof(glm::u8vec4) != 4;
|
||||
Error += sizeof(glm::u16vec2) != 4;
|
||||
Error += sizeof(glm::u16vec3) != 6;
|
||||
Error += sizeof(glm::u16vec4) != 8;
|
||||
Error += sizeof(glm::u32vec2) != 8;
|
||||
Error += sizeof(glm::u32vec3) != 12;
|
||||
Error += sizeof(glm::u32vec4) != 16;
|
||||
Error += sizeof(glm::u64vec2) != 16;
|
||||
Error += sizeof(glm::u64vec3) != 24;
|
||||
Error += sizeof(glm::u64vec4) != 32;
|
||||
int Error(0);
|
||||
Error += sizeof(glm::u8vec2) != 2;
|
||||
Error += sizeof(glm::u8vec3) != 3;
|
||||
Error += sizeof(glm::u8vec4) != 4;
|
||||
Error += sizeof(glm::u16vec2) != 4;
|
||||
Error += sizeof(glm::u16vec3) != 6;
|
||||
Error += sizeof(glm::u16vec4) != 8;
|
||||
Error += sizeof(glm::u32vec2) != 8;
|
||||
Error += sizeof(glm::u32vec3) != 12;
|
||||
Error += sizeof(glm::u32vec4) != 16;
|
||||
Error += sizeof(glm::u64vec2) != 16;
|
||||
Error += sizeof(glm::u64vec3) != 24;
|
||||
Error += sizeof(glm::u64vec4) != 32;
|
||||
|
||||
Error += sizeof(glm::lowp_u8vec2) != 2;
|
||||
Error += sizeof(glm::lowp_u8vec3) != 3;
|
||||
Error += sizeof(glm::lowp_u8vec4) != 4;
|
||||
Error += sizeof(glm::lowp_u16vec2) != 4;
|
||||
Error += sizeof(glm::lowp_u16vec3) != 6;
|
||||
Error += sizeof(glm::lowp_u16vec4) != 8;
|
||||
Error += sizeof(glm::lowp_u32vec2) != 8;
|
||||
Error += sizeof(glm::lowp_u32vec3) != 12;
|
||||
Error += sizeof(glm::lowp_u32vec4) != 16;
|
||||
Error += sizeof(glm::lowp_u64vec2) != 16;
|
||||
Error += sizeof(glm::lowp_u64vec3) != 24;
|
||||
Error += sizeof(glm::lowp_u64vec4) != 32;
|
||||
|
||||
Error += sizeof(glm::mediump_u8vec2) != 2;
|
||||
Error += sizeof(glm::mediump_u8vec3) != 3;
|
||||
Error += sizeof(glm::mediump_u8vec4) != 4;
|
||||
Error += sizeof(glm::mediump_u16vec2) != 4;
|
||||
Error += sizeof(glm::mediump_u16vec3) != 6;
|
||||
Error += sizeof(glm::mediump_u16vec4) != 8;
|
||||
Error += sizeof(glm::mediump_u32vec2) != 8;
|
||||
Error += sizeof(glm::mediump_u32vec3) != 12;
|
||||
Error += sizeof(glm::mediump_u32vec4) != 16;
|
||||
Error += sizeof(glm::mediump_u64vec2) != 16;
|
||||
Error += sizeof(glm::mediump_u64vec3) != 24;
|
||||
Error += sizeof(glm::mediump_u64vec4) != 32;
|
||||
|
||||
Error += sizeof(glm::highp_u8vec2) != 2;
|
||||
Error += sizeof(glm::highp_u8vec3) != 3;
|
||||
Error += sizeof(glm::highp_u8vec4) != 4;
|
||||
Error += sizeof(glm::highp_u16vec2) != 4;
|
||||
Error += sizeof(glm::highp_u16vec3) != 6;
|
||||
Error += sizeof(glm::highp_u16vec4) != 8;
|
||||
Error += sizeof(glm::highp_u32vec2) != 8;
|
||||
Error += sizeof(glm::highp_u32vec3) != 12;
|
||||
Error += sizeof(glm::highp_u32vec4) != 16;
|
||||
Error += sizeof(glm::highp_u64vec2) != 16;
|
||||
Error += sizeof(glm::highp_u64vec3) != 24;
|
||||
Error += sizeof(glm::highp_u64vec4) != 32;
|
||||
return Error;
|
||||
}
|
||||
|
||||
static int test_hmat_size()
|
||||
{
|
||||
int Error = 0;
|
||||
Error += sizeof(glm::f16mat2) != 8;
|
||||
Error += sizeof(glm::f16mat3) != 18;
|
||||
Error += sizeof(glm::f16mat4) != 32;
|
||||
Error += sizeof(glm::f16mat2x2) != 8;
|
||||
Error += sizeof(glm::f16mat2x3) != 12;
|
||||
Error += sizeof(glm::f16mat2x4) != 16;
|
||||
Error += sizeof(glm::f16mat3x2) != 12;
|
||||
Error += sizeof(glm::f16mat3x3) != 18;
|
||||
Error += sizeof(glm::f16mat3x4) != 24;
|
||||
Error += sizeof(glm::f16mat4x2) != 16;
|
||||
Error += sizeof(glm::f16mat4x3) != 24;
|
||||
Error += sizeof(glm::f16mat4x4) != 32;
|
||||
int Error(0);
|
||||
Error += sizeof(glm::f16mat2) != 8;
|
||||
Error += sizeof(glm::f16mat3) != 18;
|
||||
Error += sizeof(glm::f16mat4) != 32;
|
||||
Error += sizeof(glm::f16mat2x2) != 8;
|
||||
Error += sizeof(glm::f16mat2x3) != 12;
|
||||
Error += sizeof(glm::f16mat2x4) != 16;
|
||||
Error += sizeof(glm::f16mat3x2) != 12;
|
||||
Error += sizeof(glm::f16mat3x3) != 18;
|
||||
Error += sizeof(glm::f16mat3x4) != 24;
|
||||
Error += sizeof(glm::f16mat4x2) != 16;
|
||||
Error += sizeof(glm::f16mat4x3) != 24;
|
||||
Error += sizeof(glm::f16mat4x4) != 32;
|
||||
|
||||
Error += sizeof(glm::lowp_f16mat2) != 8;
|
||||
Error += sizeof(glm::lowp_f16mat3) != 18;
|
||||
Error += sizeof(glm::lowp_f16mat4) != 32;
|
||||
Error += sizeof(glm::lowp_f16mat2x2) != 8;
|
||||
Error += sizeof(glm::lowp_f16mat2x3) != 12;
|
||||
Error += sizeof(glm::lowp_f16mat2x4) != 16;
|
||||
Error += sizeof(glm::lowp_f16mat3x2) != 12;
|
||||
Error += sizeof(glm::lowp_f16mat3x3) != 18;
|
||||
Error += sizeof(glm::lowp_f16mat3x4) != 24;
|
||||
Error += sizeof(glm::lowp_f16mat4x2) != 16;
|
||||
Error += sizeof(glm::lowp_f16mat4x3) != 24;
|
||||
Error += sizeof(glm::lowp_f16mat4x4) != 32;
|
||||
|
||||
Error += sizeof(glm::mediump_f16mat2) != 8;
|
||||
Error += sizeof(glm::mediump_f16mat3) != 18;
|
||||
Error += sizeof(glm::mediump_f16mat4) != 32;
|
||||
Error += sizeof(glm::mediump_f16mat2x2) != 8;
|
||||
Error += sizeof(glm::mediump_f16mat2x3) != 12;
|
||||
Error += sizeof(glm::mediump_f16mat2x4) != 16;
|
||||
Error += sizeof(glm::mediump_f16mat3x2) != 12;
|
||||
Error += sizeof(glm::mediump_f16mat3x3) != 18;
|
||||
Error += sizeof(glm::mediump_f16mat3x4) != 24;
|
||||
Error += sizeof(glm::mediump_f16mat4x2) != 16;
|
||||
Error += sizeof(glm::mediump_f16mat4x3) != 24;
|
||||
Error += sizeof(glm::mediump_f16mat4x4) != 32;
|
||||
|
||||
Error += sizeof(glm::highp_f16mat2) != 8;
|
||||
Error += sizeof(glm::highp_f16mat3) != 18;
|
||||
Error += sizeof(glm::highp_f16mat4) != 32;
|
||||
Error += sizeof(glm::highp_f16mat2x2) != 8;
|
||||
Error += sizeof(glm::highp_f16mat2x3) != 12;
|
||||
Error += sizeof(glm::highp_f16mat2x4) != 16;
|
||||
Error += sizeof(glm::highp_f16mat3x2) != 12;
|
||||
Error += sizeof(glm::highp_f16mat3x3) != 18;
|
||||
Error += sizeof(glm::highp_f16mat3x4) != 24;
|
||||
Error += sizeof(glm::highp_f16mat4x2) != 16;
|
||||
Error += sizeof(glm::highp_f16mat4x3) != 24;
|
||||
Error += sizeof(glm::highp_f16mat4x4) != 32;
|
||||
return Error;
|
||||
}
|
||||
|
||||
static int test_fmat_size()
|
||||
{
|
||||
int Error = 0;
|
||||
Error += sizeof(glm::fmat2) != 16;
|
||||
Error += sizeof(glm::fmat3) != 36;
|
||||
Error += sizeof(glm::fmat4) != 64;
|
||||
Error += sizeof(glm::fmat2x2) != 16;
|
||||
Error += sizeof(glm::fmat2x3) != 24;
|
||||
Error += sizeof(glm::fmat2x4) != 32;
|
||||
Error += sizeof(glm::fmat3x2) != 24;
|
||||
Error += sizeof(glm::fmat3x3) != 36;
|
||||
Error += sizeof(glm::fmat3x4) != 48;
|
||||
Error += sizeof(glm::fmat4x2) != 32;
|
||||
Error += sizeof(glm::fmat4x3) != 48;
|
||||
Error += sizeof(glm::fmat4x4) != 64;
|
||||
int Error(0);
|
||||
Error += sizeof(glm::mat2) != 16;
|
||||
Error += sizeof(glm::mat3) != 36;
|
||||
Error += sizeof(glm::mat4) != 64;
|
||||
Error += sizeof(glm::mat2x2) != 16;
|
||||
Error += sizeof(glm::mat2x3) != 24;
|
||||
Error += sizeof(glm::mat2x4) != 32;
|
||||
Error += sizeof(glm::mat3x2) != 24;
|
||||
Error += sizeof(glm::mat3x3) != 36;
|
||||
Error += sizeof(glm::mat3x4) != 48;
|
||||
Error += sizeof(glm::mat4x2) != 32;
|
||||
Error += sizeof(glm::mat4x3) != 48;
|
||||
Error += sizeof(glm::mat4x4) != 64;
|
||||
|
||||
Error += sizeof(glm::f32mat2) != 16;
|
||||
Error += sizeof(glm::f32mat3) != 36;
|
||||
Error += sizeof(glm::f32mat4) != 64;
|
||||
Error += sizeof(glm::f32mat2x2) != 16;
|
||||
Error += sizeof(glm::f32mat2x3) != 24;
|
||||
Error += sizeof(glm::f32mat2x4) != 32;
|
||||
Error += sizeof(glm::f32mat3x2) != 24;
|
||||
Error += sizeof(glm::f32mat3x3) != 36;
|
||||
Error += sizeof(glm::f32mat3x4) != 48;
|
||||
Error += sizeof(glm::f32mat4x2) != 32;
|
||||
Error += sizeof(glm::f32mat4x3) != 48;
|
||||
Error += sizeof(glm::f32mat4x4) != 64;
|
||||
Error += sizeof(glm::fmat2) != 16;
|
||||
Error += sizeof(glm::fmat3) != 36;
|
||||
Error += sizeof(glm::fmat4) != 64;
|
||||
Error += sizeof(glm::fmat2x2) != 16;
|
||||
Error += sizeof(glm::fmat2x3) != 24;
|
||||
Error += sizeof(glm::fmat2x4) != 32;
|
||||
Error += sizeof(glm::fmat3x2) != 24;
|
||||
Error += sizeof(glm::fmat3x3) != 36;
|
||||
Error += sizeof(glm::fmat3x4) != 48;
|
||||
Error += sizeof(glm::fmat4x2) != 32;
|
||||
Error += sizeof(glm::fmat4x3) != 48;
|
||||
Error += sizeof(glm::fmat4x4) != 64;
|
||||
|
||||
Error += sizeof(glm::f32mat2) != 16;
|
||||
Error += sizeof(glm::f32mat3) != 36;
|
||||
Error += sizeof(glm::f32mat4) != 64;
|
||||
Error += sizeof(glm::f32mat2x2) != 16;
|
||||
Error += sizeof(glm::f32mat2x3) != 24;
|
||||
Error += sizeof(glm::f32mat2x4) != 32;
|
||||
Error += sizeof(glm::f32mat3x2) != 24;
|
||||
Error += sizeof(glm::f32mat3x3) != 36;
|
||||
Error += sizeof(glm::f32mat3x4) != 48;
|
||||
Error += sizeof(glm::f32mat4x2) != 32;
|
||||
Error += sizeof(glm::f32mat4x3) != 48;
|
||||
Error += sizeof(glm::f32mat4x4) != 64;
|
||||
|
||||
|
||||
Error += sizeof(glm::lowp_mat2) != 16;
|
||||
Error += sizeof(glm::lowp_mat3) != 36;
|
||||
Error += sizeof(glm::lowp_mat4) != 64;
|
||||
Error += sizeof(glm::lowp_mat2x2) != 16;
|
||||
Error += sizeof(glm::lowp_mat2x3) != 24;
|
||||
Error += sizeof(glm::lowp_mat2x4) != 32;
|
||||
Error += sizeof(glm::lowp_mat3x2) != 24;
|
||||
Error += sizeof(glm::lowp_mat3x3) != 36;
|
||||
Error += sizeof(glm::lowp_mat3x4) != 48;
|
||||
Error += sizeof(glm::lowp_mat4x2) != 32;
|
||||
Error += sizeof(glm::lowp_mat4x3) != 48;
|
||||
Error += sizeof(glm::lowp_mat4x4) != 64;
|
||||
|
||||
Error += sizeof(glm::lowp_fmat2) != 16;
|
||||
Error += sizeof(glm::lowp_fmat3) != 36;
|
||||
Error += sizeof(glm::lowp_fmat4) != 64;
|
||||
Error += sizeof(glm::lowp_fmat2x2) != 16;
|
||||
Error += sizeof(glm::lowp_fmat2x3) != 24;
|
||||
Error += sizeof(glm::lowp_fmat2x4) != 32;
|
||||
Error += sizeof(glm::lowp_fmat3x2) != 24;
|
||||
Error += sizeof(glm::lowp_fmat3x3) != 36;
|
||||
Error += sizeof(glm::lowp_fmat3x4) != 48;
|
||||
Error += sizeof(glm::lowp_fmat4x2) != 32;
|
||||
Error += sizeof(glm::lowp_fmat4x3) != 48;
|
||||
Error += sizeof(glm::lowp_fmat4x4) != 64;
|
||||
|
||||
Error += sizeof(glm::lowp_f32mat2) != 16;
|
||||
Error += sizeof(glm::lowp_f32mat3) != 36;
|
||||
Error += sizeof(glm::lowp_f32mat4) != 64;
|
||||
Error += sizeof(glm::lowp_f32mat2x2) != 16;
|
||||
Error += sizeof(glm::lowp_f32mat2x3) != 24;
|
||||
Error += sizeof(glm::lowp_f32mat2x4) != 32;
|
||||
Error += sizeof(glm::lowp_f32mat3x2) != 24;
|
||||
Error += sizeof(glm::lowp_f32mat3x3) != 36;
|
||||
Error += sizeof(glm::lowp_f32mat3x4) != 48;
|
||||
Error += sizeof(glm::lowp_f32mat4x2) != 32;
|
||||
Error += sizeof(glm::lowp_f32mat4x3) != 48;
|
||||
Error += sizeof(glm::lowp_f32mat4x4) != 64;
|
||||
|
||||
|
||||
Error += sizeof(glm::mediump_mat2) != 16;
|
||||
Error += sizeof(glm::mediump_mat3) != 36;
|
||||
Error += sizeof(glm::mediump_mat4) != 64;
|
||||
Error += sizeof(glm::mediump_mat2x2) != 16;
|
||||
Error += sizeof(glm::mediump_mat2x3) != 24;
|
||||
Error += sizeof(glm::mediump_mat2x4) != 32;
|
||||
Error += sizeof(glm::mediump_mat3x2) != 24;
|
||||
Error += sizeof(glm::mediump_mat3x3) != 36;
|
||||
Error += sizeof(glm::mediump_mat3x4) != 48;
|
||||
Error += sizeof(glm::mediump_mat4x2) != 32;
|
||||
Error += sizeof(glm::mediump_mat4x3) != 48;
|
||||
Error += sizeof(glm::mediump_mat4x4) != 64;
|
||||
|
||||
Error += sizeof(glm::mediump_fmat2) != 16;
|
||||
Error += sizeof(glm::mediump_fmat3) != 36;
|
||||
Error += sizeof(glm::mediump_fmat4) != 64;
|
||||
Error += sizeof(glm::mediump_fmat2x2) != 16;
|
||||
Error += sizeof(glm::mediump_fmat2x3) != 24;
|
||||
Error += sizeof(glm::mediump_fmat2x4) != 32;
|
||||
Error += sizeof(glm::mediump_fmat3x2) != 24;
|
||||
Error += sizeof(glm::mediump_fmat3x3) != 36;
|
||||
Error += sizeof(glm::mediump_fmat3x4) != 48;
|
||||
Error += sizeof(glm::mediump_fmat4x2) != 32;
|
||||
Error += sizeof(glm::mediump_fmat4x3) != 48;
|
||||
Error += sizeof(glm::mediump_fmat4x4) != 64;
|
||||
|
||||
Error += sizeof(glm::mediump_f32mat2) != 16;
|
||||
Error += sizeof(glm::mediump_f32mat3) != 36;
|
||||
Error += sizeof(glm::mediump_f32mat4) != 64;
|
||||
Error += sizeof(glm::mediump_f32mat2x2) != 16;
|
||||
Error += sizeof(glm::mediump_f32mat2x3) != 24;
|
||||
Error += sizeof(glm::mediump_f32mat2x4) != 32;
|
||||
Error += sizeof(glm::mediump_f32mat3x2) != 24;
|
||||
Error += sizeof(glm::mediump_f32mat3x3) != 36;
|
||||
Error += sizeof(glm::mediump_f32mat3x4) != 48;
|
||||
Error += sizeof(glm::mediump_f32mat4x2) != 32;
|
||||
Error += sizeof(glm::mediump_f32mat4x3) != 48;
|
||||
Error += sizeof(glm::mediump_f32mat4x4) != 64;
|
||||
|
||||
|
||||
Error += sizeof(glm::highp_mat2) != 16;
|
||||
Error += sizeof(glm::highp_mat3) != 36;
|
||||
Error += sizeof(glm::highp_mat4) != 64;
|
||||
Error += sizeof(glm::highp_mat2x2) != 16;
|
||||
Error += sizeof(glm::highp_mat2x3) != 24;
|
||||
Error += sizeof(glm::highp_mat2x4) != 32;
|
||||
Error += sizeof(glm::highp_mat3x2) != 24;
|
||||
Error += sizeof(glm::highp_mat3x3) != 36;
|
||||
Error += sizeof(glm::highp_mat3x4) != 48;
|
||||
Error += sizeof(glm::highp_mat4x2) != 32;
|
||||
Error += sizeof(glm::highp_mat4x3) != 48;
|
||||
Error += sizeof(glm::highp_mat4x4) != 64;
|
||||
|
||||
Error += sizeof(glm::highp_fmat2) != 16;
|
||||
Error += sizeof(glm::highp_fmat3) != 36;
|
||||
Error += sizeof(glm::highp_fmat4) != 64;
|
||||
Error += sizeof(glm::highp_fmat2x2) != 16;
|
||||
Error += sizeof(glm::highp_fmat2x3) != 24;
|
||||
Error += sizeof(glm::highp_fmat2x4) != 32;
|
||||
Error += sizeof(glm::highp_fmat3x2) != 24;
|
||||
Error += sizeof(glm::highp_fmat3x3) != 36;
|
||||
Error += sizeof(glm::highp_fmat3x4) != 48;
|
||||
Error += sizeof(glm::highp_fmat4x2) != 32;
|
||||
Error += sizeof(glm::highp_fmat4x3) != 48;
|
||||
Error += sizeof(glm::highp_fmat4x4) != 64;
|
||||
|
||||
Error += sizeof(glm::highp_f32mat2) != 16;
|
||||
Error += sizeof(glm::highp_f32mat3) != 36;
|
||||
Error += sizeof(glm::highp_f32mat4) != 64;
|
||||
Error += sizeof(glm::highp_f32mat2x2) != 16;
|
||||
Error += sizeof(glm::highp_f32mat2x3) != 24;
|
||||
Error += sizeof(glm::highp_f32mat2x4) != 32;
|
||||
Error += sizeof(glm::highp_f32mat3x2) != 24;
|
||||
Error += sizeof(glm::highp_f32mat3x3) != 36;
|
||||
Error += sizeof(glm::highp_f32mat3x4) != 48;
|
||||
Error += sizeof(glm::highp_f32mat4x2) != 32;
|
||||
Error += sizeof(glm::highp_f32mat4x3) != 48;
|
||||
Error += sizeof(glm::highp_f32mat4x4) != 64;
|
||||
return Error;
|
||||
}
|
||||
|
||||
static int test_dmat_size()
|
||||
{
|
||||
int Error = 0;
|
||||
Error += sizeof(glm::f64mat2) != 32;
|
||||
Error += sizeof(glm::f64mat3) != 72;
|
||||
Error += sizeof(glm::f64mat4) != 128;
|
||||
Error += sizeof(glm::f64mat2x2) != 32;
|
||||
Error += sizeof(glm::f64mat2x3) != 48;
|
||||
Error += sizeof(glm::f64mat2x4) != 64;
|
||||
Error += sizeof(glm::f64mat3x2) != 48;
|
||||
Error += sizeof(glm::f64mat3x3) != 72;
|
||||
Error += sizeof(glm::f64mat3x4) != 96;
|
||||
Error += sizeof(glm::f64mat4x2) != 64;
|
||||
Error += sizeof(glm::f64mat4x3) != 96;
|
||||
Error += sizeof(glm::f64mat4x4) != 128;
|
||||
int Error(0);
|
||||
Error += sizeof(glm::f64mat2) != 32;
|
||||
Error += sizeof(glm::f64mat3) != 72;
|
||||
Error += sizeof(glm::f64mat4) != 128;
|
||||
Error += sizeof(glm::f64mat2x2) != 32;
|
||||
Error += sizeof(glm::f64mat2x3) != 48;
|
||||
Error += sizeof(glm::f64mat2x4) != 64;
|
||||
Error += sizeof(glm::f64mat3x2) != 48;
|
||||
Error += sizeof(glm::f64mat3x3) != 72;
|
||||
Error += sizeof(glm::f64mat3x4) != 96;
|
||||
Error += sizeof(glm::f64mat4x2) != 64;
|
||||
Error += sizeof(glm::f64mat4x3) != 96;
|
||||
Error += sizeof(glm::f64mat4x4) != 128;
|
||||
|
||||
Error += sizeof(glm::lowp_f64mat2) != 32;
|
||||
Error += sizeof(glm::lowp_f64mat3) != 72;
|
||||
Error += sizeof(glm::lowp_f64mat4) != 128;
|
||||
Error += sizeof(glm::lowp_f64mat2x2) != 32;
|
||||
Error += sizeof(glm::lowp_f64mat2x3) != 48;
|
||||
Error += sizeof(glm::lowp_f64mat2x4) != 64;
|
||||
Error += sizeof(glm::lowp_f64mat3x2) != 48;
|
||||
Error += sizeof(glm::lowp_f64mat3x3) != 72;
|
||||
Error += sizeof(glm::lowp_f64mat3x4) != 96;
|
||||
Error += sizeof(glm::lowp_f64mat4x2) != 64;
|
||||
Error += sizeof(glm::lowp_f64mat4x3) != 96;
|
||||
Error += sizeof(glm::lowp_f64mat4x4) != 128;
|
||||
|
||||
Error += sizeof(glm::mediump_f64mat2) != 32;
|
||||
Error += sizeof(glm::mediump_f64mat3) != 72;
|
||||
Error += sizeof(glm::mediump_f64mat4) != 128;
|
||||
Error += sizeof(glm::mediump_f64mat2x2) != 32;
|
||||
Error += sizeof(glm::mediump_f64mat2x3) != 48;
|
||||
Error += sizeof(glm::mediump_f64mat2x4) != 64;
|
||||
Error += sizeof(glm::mediump_f64mat3x2) != 48;
|
||||
Error += sizeof(glm::mediump_f64mat3x3) != 72;
|
||||
Error += sizeof(glm::mediump_f64mat3x4) != 96;
|
||||
Error += sizeof(glm::mediump_f64mat4x2) != 64;
|
||||
Error += sizeof(glm::mediump_f64mat4x3) != 96;
|
||||
Error += sizeof(glm::mediump_f64mat4x4) != 128;
|
||||
|
||||
Error += sizeof(glm::highp_f64mat2) != 32;
|
||||
Error += sizeof(glm::highp_f64mat3) != 72;
|
||||
Error += sizeof(glm::highp_f64mat4) != 128;
|
||||
Error += sizeof(glm::highp_f64mat2x2) != 32;
|
||||
Error += sizeof(glm::highp_f64mat2x3) != 48;
|
||||
Error += sizeof(glm::highp_f64mat2x4) != 64;
|
||||
Error += sizeof(glm::highp_f64mat3x2) != 48;
|
||||
Error += sizeof(glm::highp_f64mat3x3) != 72;
|
||||
Error += sizeof(glm::highp_f64mat3x4) != 96;
|
||||
Error += sizeof(glm::highp_f64mat4x2) != 64;
|
||||
Error += sizeof(glm::highp_f64mat4x3) != 96;
|
||||
Error += sizeof(glm::highp_f64mat4x4) != 128;
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
static int test_quat_size()
|
||||
{
|
||||
int Error = 0;
|
||||
Error += sizeof(glm::f16quat) != 8;
|
||||
Error += sizeof(glm::f32quat) != 16;
|
||||
Error += sizeof(glm::f64quat) != 32;
|
||||
int Error = 0;
|
||||
Error += sizeof(glm::lowp_f16quat) != 8;
|
||||
Error += sizeof(glm::f32quat) != 16;
|
||||
Error += sizeof(glm::f64quat) != 32;
|
||||
|
||||
Error += sizeof(glm::lowp_f16quat) != 8;
|
||||
Error += sizeof(glm::lowp_f32quat) != 16;
|
||||
Error += sizeof(glm::lowp_f64quat) != 32;
|
||||
|
||||
Error += sizeof(glm::mediump_f16quat) != 8;
|
||||
Error += sizeof(glm::mediump_f32quat) != 16;
|
||||
Error += sizeof(glm::mediump_f64quat) != 32;
|
||||
|
||||
Error += sizeof(glm::highp_f16quat) != 8;
|
||||
Error += sizeof(glm::highp_f32quat) != 16;
|
||||
Error += sizeof(glm::highp_f64quat) != 32;
|
||||
return Error;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int Error = 0;
|
||||
Error += test_scalar_size();
|
||||
Error += test_scalar_size();
|
||||
Error += test_fvec_size();
|
||||
Error += test_ivec_size();
|
||||
Error += test_ivec_size();
|
||||
Error += test_uvec_size();
|
||||
Error += test_hmat_size();
|
||||
Error += test_fmat_size();
|
||||
|
||||
@@ -17,23 +17,23 @@
|
||||
|
||||
int myrand()
|
||||
{
|
||||
static int holdrand = 1;
|
||||
return (((holdrand = holdrand * 214013L + 2531011L) >> 16) & 0x7fff);
|
||||
static int holdrand = 1;
|
||||
return (((holdrand = holdrand * 214013L + 2531011L) >> 16) & 0x7fff);
|
||||
}
|
||||
|
||||
float myfrand() // returns values from -1 to 1 inclusive
|
||||
{
|
||||
return float(double(myrand()) / double( 0x7ffff )) * 2.0f - 1.0f;
|
||||
return float(double(myrand()) / double( 0x7ffff )) * 2.0f - 1.0f;
|
||||
}
|
||||
|
||||
int test_dquat_type()
|
||||
{
|
||||
glm::dvec3 vA;
|
||||
glm::dquat dqA,dqB;
|
||||
glm::ddualquat C(dqA,dqB);
|
||||
glm::ddualquat B(dqA);
|
||||
glm::ddualquat D(dqA,vA);
|
||||
return 0;
|
||||
glm::dvec3 vA;
|
||||
glm::dquat dqA,dqB;
|
||||
glm::ddualquat C(dqA,dqB);
|
||||
glm::ddualquat B(dqA);
|
||||
glm::ddualquat D(dqA,vA);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int test_scalars() {
|
||||
@@ -76,7 +76,8 @@ int test_inverse()
|
||||
glm::dualquat dqid;
|
||||
glm::mat4x4 mid(1.0f);
|
||||
|
||||
for (int j = 0; j < 100; ++j) {
|
||||
for (int j = 0; j < 100; ++j)
|
||||
{
|
||||
glm::mat4x4 rot = glm::yawPitchRoll(myfrand() * 360.0f, myfrand() * 360.0f, myfrand() * 360.0f);
|
||||
glm::vec3 vt = glm::vec3(myfrand() * 10.0f, myfrand() * 10.0f, myfrand() * 10.0f);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user