gl_PrimitiveIDIn tests have sketchy loop bounds.
authorMarcin Rogucki <marcin.rogucki@mobica.com>
Wed, 25 Oct 2017 11:33:44 +0000 (13:33 +0200)
committerChris Forbes <chrisforbes@google.com>
Fri, 6 Jul 2018 21:54:37 +0000 (17:54 -0400)
Components: Vulkan

VK-GL-CTS issue: 778

Updates:
dEQP-VK.geometry.basic.primitive_id_in
dEQP-VK.geometry.basic.primitive_id_in_restarted

Change-Id: Icd2be56814de18067ce058a5f2a1da80338f80d6
(cherry picked from commit 52b7de31e0bccf62ca28d820f4dc2d0d52793aa8)

external/vulkancts/modules/vulkan/geometry/vktGeometryBasicGeometryShaderTests.cpp

index 4508bb9..3afe635 100644 (file)
@@ -1035,12 +1035,13 @@ void BuiltinVariableRenderTest::initPrograms (SourceCollections& sourceCollectio
                                        << "    const vec4 blue = vec4(0.0, 0.0, 1.0, 1.0);\n"
                                        << "    const vec4 yellow = vec4(1.0, 1.0, 0.0, 1.0);\n"
                                        << "    const vec4 colors[4] = vec4[4](red, green, blue, yellow);\n"
-                                       << "    for (float percent=0.00; percent < 0.30; percent+=0.10)\n"
-                                                       "{\n"
-                                       << "            gl_Position = gl_in[0].gl_Position * vec4(1.0+percent, 1.0+percent, 1.0, 1.0);\n"
+                                       << "    for (int counter = 0; counter < 3; ++counter)\n"
+                                       << "    {\n"
+                                       << "            float percent = 0.1 * counter;\n"
+                                       << "            gl_Position = gl_in[0].gl_Position * vec4(1.0 + percent, 1.0 + percent, 1.0, 1.0);\n"
                                        << "            v_frag_FragColor = colors[gl_PrimitiveIDIn % 4];\n"
                                        << "            EmitVertex();\n"
-                                       << "            gl_Position = gl_in[1].gl_Position * vec4(1.0+percent, 1.0+percent, 1.0, 1.0);\n"
+                                       << "            gl_Position = gl_in[1].gl_Position * vec4(1.0 + percent, 1.0 + percent, 1.0, 1.0);\n"
                                        << "            v_frag_FragColor = colors[gl_PrimitiveIDIn % 4];\n"
                                        << "            EmitVertex();\n"
                                        << "    }\n"