Tweak matrix input values to avoid small determinants
authorPiers Daniell <pdaniell@nvidia.com>
Wed, 26 Aug 2020 00:08:19 +0000 (18:08 -0600)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 11 Sep 2020 11:07:14 +0000 (07:07 -0400)
Modify the matrix test input values to better avoid
zero and close to zero determinants, which can produce
invalid inverse matrices.

Affects:

dEQP-GLES3.functional.shaders.matrix.*

Components: OpenGL

VK-GL-CTS issue: 2559

Change-Id: I2015e0f60dbe6271bc540f95dc6631928d38c108

modules/gles3/functional/es3fShaderMatrixTests.cpp

index 650d79e..098e99e 100644 (file)
@@ -1652,10 +1652,10 @@ void ShaderMatrixCase::init (void)
        for (int attribNdx = 0; attribNdx < 4; attribNdx++)
        {
                m_userAttribTransforms[attribNdx] = Mat4(0.0f);
-               m_userAttribTransforms[attribNdx](                  0, 3) = 0.2f;                                                               // !< prevent matrix*vec from going into zero (assuming vec.w != 0)
-               m_userAttribTransforms[attribNdx](                  1, 3) = 0.1f;                                                               // !<
-               m_userAttribTransforms[attribNdx](                  2, 3) = 0.4f + 0.15f * float(attribNdx);    // !<
-               m_userAttribTransforms[attribNdx](                  3, 3) = 0.7f;                                                               // !<
+               m_userAttribTransforms[attribNdx](                  0, 3) = 0.1f + 0.15f * float(attribNdx);    // !< prevent matrix*vec from going into zero (assuming vec.w != 0)
+               m_userAttribTransforms[attribNdx](                  1, 3) = 0.2f + 0.15f * float(attribNdx);    // !<
+               m_userAttribTransforms[attribNdx](                  2, 3) = 0.3f + 0.15f * float(attribNdx);    // !<
+               m_userAttribTransforms[attribNdx](                  3, 3) = 0.4f + 0.15f * float(attribNdx);    // !<
                m_userAttribTransforms[attribNdx]((0 + attribNdx) % 4, 0) = 1.0f;
                m_userAttribTransforms[attribNdx]((1 + attribNdx) % 4, 1) = 1.0f;
                m_userAttribTransforms[attribNdx]((2 + attribNdx) % 4, 2) = 1.0f;