Added packF3x9_E1x5 and unpackF3x9_E1x5 to GTC_packing for RGB9E5 #416
This commit is contained in:
@@ -254,6 +254,30 @@ int test_F2x11_1x10()
|
||||
return Error;
|
||||
}
|
||||
|
||||
int test_F3x9_E1x5()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
std::vector<glm::vec3> Tests;
|
||||
Tests.push_back(glm::vec3(1.0f));
|
||||
Tests.push_back(glm::vec3(0.0f));
|
||||
Tests.push_back(glm::vec3(2.0f));
|
||||
Tests.push_back(glm::vec3(0.1f));
|
||||
Tests.push_back(glm::vec3(0.5f));
|
||||
Tests.push_back(glm::vec3(0.9f));
|
||||
|
||||
for (std::size_t i = 0; i < Tests.size(); ++i)
|
||||
{
|
||||
glm::uint32 p0 = glm::packF3x9_E1x5(Tests[i]);
|
||||
glm::vec3 v0 = glm::unpackF3x9_E1x5(p0);
|
||||
glm::uint32 p1 = glm::packF3x9_E1x5(v0);
|
||||
glm::vec3 v1 = glm::unpackF3x9_E1x5(p1);
|
||||
Error += glm::all(glm::epsilonEqual(v0, v1, 0.01f)) ? 0 : 1;
|
||||
}
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
int test_packUnorm1x16()
|
||||
{
|
||||
int Error = 0;
|
||||
@@ -522,6 +546,7 @@ int main()
|
||||
Error += test_packUnorm4x8();
|
||||
|
||||
Error += test_F2x11_1x10();
|
||||
Error += test_F3x9_E1x5();
|
||||
Error += test_Snorm3x10_1x2();
|
||||
Error += test_Unorm3x10_1x2();
|
||||
Error += test_I3x10_1x2();
|
||||
|
||||
Reference in New Issue
Block a user