Added ULP comparison between lowp and highp for inversesqrt

This commit is contained in:
Christophe Riccio 2013-12-28 03:45:18 +01:00
parent 775c6136fc
commit 71035db795

View File

@ -7,12 +7,38 @@
// File : test/core/func_exponential.cpp // File : test/core/func_exponential.cpp
/////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////
#include <glm/common.hpp>
#include <glm/exponential.hpp> #include <glm/exponential.hpp>
#include <glm/gtc/ulp.hpp>
namespace inversesqrt
{
int test()
{
int Error(0);
glm::uint ulp(0);
float diff(0.0f);
for(float f = 0.001f; f < 10.f; f *= 1.001f)
{
glm::lowp_fvec1 lowp_v = glm::inversesqrt(glm::lowp_fvec1(f));
float defaultp_v = glm::inversesqrt(f);
ulp = glm::max(glm::float_distance(lowp_v.x, defaultp_v), ulp);
diff = glm::abs(lowp_v.x - defaultp_v);
}
return Error;
}
}//namespace inversesqrt
int main() int main()
{ {
int Failed = 0; int Error(0);
return Failed; Error += inversesqrt::test();
return Error;
} }