CullDistanceTests/coverage: Fix a couple issues in the shaders
authorEduardo Lima Mitev <elima@igalia.com>
Mon, 6 Mar 2017 14:45:35 +0000 (15:45 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 10 Mar 2017 16:51:45 +0000 (11:51 -0500)
There are two specific problems in the shaders of this test, both
preventing the fragment shader from receiving any fragment (no geometry
is renderer), and thus the gl_maxCullDistances value read back from the
texture is always zero.

The first issue is in the geometry shader. The 4 emitted vertices have
a 0.0 normal, the quad is not visible.

The second issue is in the tessellation evaluation shader, where the
value of gl_Position is not explicitly set, so the point is rendered
at an undefined location.

Components: OpenGL

Affects:
GL45-CTS.cull_distance.coverage

VL-GL-CTS issue: 197

Change-Id: I145894192fe9504808666e2c2fcd6cf53dbb03df

external/openglcts/modules/gl/gl3cCullDistanceTests.cpp

index 742c785..8c20842 100644 (file)
@@ -723,19 +723,19 @@ tcu::TestNode::IterateResult CullDistance::APICoverageTest::iterate()
                                "    int result_value = (INPUT_GS_NAME[0] == TOKEN) ? TOKEN : -1;\n"
                                "\n"
                                /* Draw a full-screen quad */
-                               "    gl_Position = vec4(-1.0, 1.0, 0.0, 0.0);\n"
+                               "    gl_Position = vec4(-1.0, 1.0, 0.0, 1.0);\n"
                                "    out_gs      = result_value;\n"
                                "    EmitVertex();\n"
                                "\n"
-                               "    gl_Position = vec4(-1.0, -1.0, 0.0, 0.0);\n"
+                               "    gl_Position = vec4(-1.0, -1.0, 0.0, 1.0);\n"
                                "    out_gs      = result_value;\n"
                                "    EmitVertex();\n"
                                "\n"
-                               "    gl_Position = vec4(1.0, 1.0, 0.0, 0.0);\n"
+                               "    gl_Position = vec4(1.0, 1.0, 0.0, 1.0);\n"
                                "    out_gs      = result_value;\n"
                                "    EmitVertex();\n"
                                "\n"
-                               "    gl_Position = vec4(1.0, -1.0, 0.0, 0.0);\n"
+                               "    gl_Position = vec4(1.0, -1.0, 0.0, 1.0);\n"
                                "    out_gs      = result_value;\n"
                                "    EmitVertex();\n"
                                "    EndPrimitive();\n"
@@ -782,6 +782,8 @@ tcu::TestNode::IterateResult CullDistance::APICoverageTest::iterate()
                                "    int result_value = (INPUT_TE_NAME[0] == TOKEN) ? TOKEN : 0;\n"
                                "\n"
                                "    out_te = result_value;\n"
+                               "\n"
+                               "    gl_Position = vec4(0.0, 0.0, 0.0, 1.);\n"
                                "}\n";
                        std::string te_body = te_body_template;