Fixed GCC build
This commit is contained in:
@@ -10,7 +10,9 @@
|
||||
#include <glm/gtc/bitfield.hpp>
|
||||
#include <glm/gtc/type_precision.hpp>
|
||||
#include <glm/vector_relational.hpp>
|
||||
//#include <glm/vec2.hpp>
|
||||
#if GLM_ARCH != GLM_ARCH_PURE
|
||||
# include <glm/detail/intrinsic_integer.hpp>
|
||||
#endif
|
||||
#include <ctime>
|
||||
#include <cstdio>
|
||||
#include <vector>
|
||||
|
||||
@@ -10,8 +10,9 @@
|
||||
#include <glm/gtc/integer.hpp>
|
||||
#include <glm/gtc/type_precision.hpp>
|
||||
#include <glm/gtc/vec1.hpp>
|
||||
#include <ctime>
|
||||
#include <vector>
|
||||
#include <ctime>
|
||||
#include <cstdio>
|
||||
|
||||
namespace isPowerOfTwo
|
||||
{
|
||||
@@ -254,8 +255,8 @@ namespace ceilPowerOfTwo
|
||||
|
||||
std::clock_t Timestramp2 = std::clock();
|
||||
|
||||
printf("ceilPowerOfTwo_loop: %d clocks\n", Timestramp1 - Timestramp0);
|
||||
printf("glm::ceilPowerOfTwo: %d clocks\n", Timestramp2 - Timestramp1);
|
||||
std::printf("ceilPowerOfTwo_loop: %d clocks\n", static_cast<unsigned int>(Timestramp1 - Timestramp0));
|
||||
std::printf("glm::ceilPowerOfTwo: %d clocks\n", static_cast<unsigned int>(Timestramp2 - Timestramp1));
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,42 @@
|
||||
|
||||
#include <glm/gtx/multiple.hpp>
|
||||
|
||||
int test_higher_uint()
|
||||
{
|
||||
int Error(0);
|
||||
|
||||
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(0), glm::uvec4(4)), glm::uvec4(0))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(1), glm::uvec4(4)), glm::uvec4(4))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(2), glm::uvec4(4)), glm::uvec4(4))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(3), glm::uvec4(4)), glm::uvec4(4))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(4), glm::uvec4(4)), glm::uvec4(4))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(5), glm::uvec4(4)), glm::uvec4(8))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(6), glm::uvec4(4)), glm::uvec4(8))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(7), glm::uvec4(4)), glm::uvec4(8))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(8), glm::uvec4(4)), glm::uvec4(8))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(9), glm::uvec4(4)), glm::uvec4(12))) ? 0 : 1;
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
int test_Lower_uint()
|
||||
{
|
||||
int Error(0);
|
||||
|
||||
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(0), glm::uvec4(4)), glm::uvec4(0))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(1), glm::uvec4(4)), glm::uvec4(0))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(2), glm::uvec4(4)), glm::uvec4(0))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(3), glm::uvec4(4)), glm::uvec4(0))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(4), glm::uvec4(4)), glm::uvec4(4))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(5), glm::uvec4(4)), glm::uvec4(4))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(6), glm::uvec4(4)), glm::uvec4(4))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(7), glm::uvec4(4)), glm::uvec4(4))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(8), glm::uvec4(4)), glm::uvec4(8))) ? 0 : 1;
|
||||
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(9), glm::uvec4(4)), glm::uvec4(8))) ? 0 : 1;
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
int test_higher_int()
|
||||
{
|
||||
int Error(0);
|
||||
@@ -108,6 +144,8 @@ int main()
|
||||
|
||||
Error += test_higher_int();
|
||||
Error += test_Lower_int();
|
||||
Error += test_higher_uint();
|
||||
Error += test_Lower_uint();
|
||||
Error += test_higher_double();
|
||||
Error += test_Lower_double();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user