Mark gl_Position as invariant in invariance tests
authorMax Andersson <max.andersson@arm.com>
Mon, 7 Feb 2022 11:31:13 +0000 (12:31 +0100)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 3 Mar 2022 16:47:50 +0000 (16:47 +0000)
Always marks gl_Position as invariant. The reason
for this is that there is no guarantee that it
will be computed in an invariant way otherwise,
which may cause test failures.

Affects:

dEQP-VK.glsl.invariance.*user_defined*

VK-GL-CTS issue: 3493

Change-Id: Ia172664b454182458dbd13146c2d1688ecf4161f

external/vulkancts/modules/vulkan/shaderrender/vktShaderRenderInvarianceTests.cpp

index 1dbaeb6..d20a69e 100644 (file)
@@ -391,7 +391,8 @@ tcu::TestCaseGroup* createShaderInvarianceTests (tcu::TestContext& testCtx)
                { glu::PRECISION_LOWP,          "lowp",         "0.9",          "1.1",          "1.1",          "1.15",         "0.87",         6,      2,      0,      "2.0",          "1.1",  "1.0"   },
        };
 
-       static const std::string invariantDeclaration[] = { "invariant gl_Position;", "layout(location = 1) invariant highp out vec4 v_value;" };
+       // gl_Position must always be invariant for comparisons on gl_Position to be valid.
+       static const std::string invariantDeclaration[] = { "invariant gl_Position;", "invariant gl_Position;\nlayout(location = 1) invariant highp out vec4 v_value;" };
        static const std::string invariantAssignment0[] = { "gl_Position", "v_value" };
        static const std::string invariantAssignment1[] = { "", "gl_Position = v_value;" };
        static const std::string fragDeclaration[]              = { "", "layout(location = 1) highp in vec4 v_value;" };