mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 04:31:47 +00:00
Added float unit tests
This commit is contained in:
parent
22a2cd5332
commit
ee56c3a449
@ -46,7 +46,7 @@ namespace glm
|
||||
//! There is no guarantee on the actual precision.
|
||||
//! From GLSL 1.30.8 specification
|
||||
//! \ingroup core_precision
|
||||
typedef mediump_float_t mediump_float;
|
||||
typedef mediump_float_t mediump_float;
|
||||
//! High precision floating-point numbers.
|
||||
//! There is no guarantee on the actual precision.
|
||||
//! From GLSL 1.30.8 specification
|
||||
@ -58,7 +58,7 @@ namespace glm
|
||||
#if(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
|
||||
typedef precision::mediump_float float_t;
|
||||
#elif(defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
|
||||
typedef precision::highp_float float_t;
|
||||
typedef precision::highp_float float_t;
|
||||
#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && defined(GLM_PRECISION_MEDIUMP_FLOAT) && !defined(GLM_PRECISION_LOWP_FLOAT))
|
||||
typedef precision::mediump_float float_t;
|
||||
#elif(!defined(GLM_PRECISION_HIGHP_FLOAT) && !defined(GLM_PRECISION_MEDIUMP_FLOAT) && defined(GLM_PRECISION_LOWP_FLOAT))
|
||||
|
@ -9,9 +9,29 @@
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
int test_float_size()
|
||||
{
|
||||
return
|
||||
sizeof(glm::float_t) != sizeof(glm::lowp_float) &&
|
||||
sizeof(glm::float_t) != sizeof(glm::mediump_float) &&
|
||||
sizeof(glm::float_t) != sizeof(glm::highp_float);
|
||||
}
|
||||
|
||||
int test_float_precision()
|
||||
{
|
||||
return (
|
||||
sizeof(glm::lowp_float) <= sizeof(glm::mediump_float) &&
|
||||
sizeof(glm::mediump_float) <= sizeof(glm::highp_float)) ? 0 : 1;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
return -1;
|
||||
int Error = 0;
|
||||
|
||||
Error += test_float_size();
|
||||
Error += test_float_precision();
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user