- Added lowp variant of GTC_colorspace convertLinearToSRGB #419

This commit is contained in:
Christophe Riccio
2016-10-16 20:17:29 +02:00
parent e4c559b29b
commit a2684a8fe5
4 changed files with 31 additions and 2 deletions

View File

@@ -40,11 +40,29 @@ namespace srgb
}
}//namespace srgb
namespace srgb_lowp
{
int test()
{
int Error(0);
for(float Color = 0.0f; Color < 1.0f; Color += 0.01f)
{
glm::highp_vec3 const HighpSRGB = glm::convertLinearToSRGB(glm::highp_vec3(Color));
glm::lowp_vec3 const LowpSRGB = glm::convertLinearToSRGB(glm::lowp_vec3(Color));
Error += glm::all(glm::epsilonEqual(glm::abs(HighpSRGB - glm::highp_vec3(LowpSRGB)), glm::highp_vec3(0), 0.1f)) ? 0 : 1;
}
return Error;
}
}//namespace srgb_lowp
int main()
{
int Error(0);
Error += srgb::test();
Error += srgb_lowp::test();
return Error;
}