[Piglit] [PATCH 07/10] arb_tessellation_shader: Simplify tcs-input tests.

Marek Olšák maraeo at gmail.com
Mon Jul 27 17:02:36 PDT 2015


From: Chris Forbes <chrisf at ijw.co.nz>

The purpose of these tests is not to exercise the compiler's
optimization of writes from the TCS -- we'll explore that in
other tests.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
---
 generated_tests/gen_tcs_input_tests.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/generated_tests/gen_tcs_input_tests.py b/generated_tests/gen_tcs_input_tests.py
index 53d48e2..763c128 100644
--- a/generated_tests/gen_tcs_input_tests.py
+++ b/generated_tests/gen_tcs_input_tests.py
@@ -210,12 +210,13 @@ out int pass[];
 void main()
 {{
 	const int vertices_in = 3;
-	pass[gl_InvocationID] = 1;
+	int local_pass = 1;
 	for (int i = 0; i < vertices_in; ++i) {{
 		int vertex_ID = gl_PrimitiveID * vertices_in + i;
 		if ({self.interface_tcs_instance}[i]{self.tcs_var_ref} != reference[vertex_ID].v)
-			pass[gl_InvocationID] = 0;
+			local_pass = 0;
 	}}
+	pass[gl_InvocationID] = local_pass;
 	gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 1.0);
 	gl_TessLevelInner = float[2](1.0, 1.0);
 }}
@@ -230,7 +231,6 @@ out vec4 vert_color;
 
 void main()
 {{
-	const int vertices_in = 3;
 	const vec4 red = vec4(1, 0, 0, 1);
 	const vec4 green = vec4(0, 1, 0, 1);
 	vec2[3] position = vec2[3](
@@ -242,9 +242,8 @@ void main()
 	            + (position[1] - position[0]) * gl_TessCoord[0]
 	            + (position[2] - position[0]) * gl_TessCoord[1], 0.0, 1.0);
 	vert_color = green;
-	for (int i = 0; i < vertices_in; ++i) {{
-		if (pass[i] == 0)
-			vert_color = red;
+	if (pass[0] == 0 || pass[1] == 0 || pass[2] == 0) {{
+		vert_color = red;
 	}}
 }}
 
-- 
2.1.4



More information about the Piglit mailing list