[Piglit] [PATCH] arb_gpu_shader_fp64: emit GS output for every vertex

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon Jun 6 22:21:16 UTC 2016


Because EmitVertex() will invalidate all previous output writes, we
need to emit the output for every vertex. This fixes is similar to
the one in the GS tests generator.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 .../execution/gs-isnan-dvec.shader_test            | 36 +++++++++++-----------
 .../uniform_buffers/gs-array-copy.shader_test      |  4 +--
 .../uniform_buffers/gs-dmat4-row-major.shader_test |  4 +--
 .../uniform_buffers/gs-dmat4.shader_test           |  4 +--
 .../gs-double-array-const-index.shader_test        |  4 +--
 .../gs-double-array-variable-index.shader_test     |  4 +--
 .../gs-double-bool-double.shader_test              |  4 +--
 ...ouble-uniform-array-direct-indirect.shader_test |  4 +--
 .../gs-doubles-float-mixed.shader_test             |  4 +--
 ...dvec4-uniform-array-direct-indirect.shader_test |  4 +--
 .../uniform_buffers/gs-nested-struct.shader_test   |  4 +--
 11 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/tests/spec/arb_gpu_shader_fp64/execution/gs-isnan-dvec.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/gs-isnan-dvec.shader_test
index 28f7505..314a87c 100644
--- a/tests/spec/arb_gpu_shader_fp64/execution/gs-isnan-dvec.shader_test
+++ b/tests/spec/arb_gpu_shader_fp64/execution/gs-isnan-dvec.shader_test
@@ -38,29 +38,29 @@ out vec4 fs_color;
 
 void main()
 {
-	fs_color = vec4(0.0);
+	for (int i = 0; i < 3; i++) {
+		fs_color = vec4(0.0);
 
-	dvec4 r4 = numerator/denominator;
-	dvec4 bl4 = dvec4(isnan(r4));
-	if (distance(bl4, expected) > tolerance)
-		fs_color.x = 1.0;
+		dvec4 r4 = numerator/denominator;
+		dvec4 bl4 = dvec4(isnan(r4));
+		if (distance(bl4, expected) > tolerance)
+			fs_color.x = 1.0;
 
-	dvec3 r3 = numerator.xyz/denominator.xyz;
-	dvec3 bl3 = dvec3(isnan(r3));
-	if (distance(bl3, expected.xyz) > tolerance)
-		fs_color.y = 1.0;
+		dvec3 r3 = numerator.xyz/denominator.xyz;
+		dvec3 bl3 = dvec3(isnan(r3));
+		if (distance(bl3, expected.xyz) > tolerance)
+			fs_color.y = 1.0;
 
-	dvec2 r2 = numerator.zw/denominator.zw;
-	dvec2 bl2 = dvec2(isnan(r2));
-	if (distance(bl2, expected.zw) > tolerance)
-		fs_color.z = 1.0;
+		dvec2 r2 = numerator.zw/denominator.zw;
+		dvec2 bl2 = dvec2(isnan(r2));
+		if (distance(bl2, expected.zw) > tolerance)
+			fs_color.z = 1.0;
 
-	double r1 = numerator.x/denominator.x;
-	double bl1 = double(isnan(r1));
-	if (distance(bl1, expected.x) > tolerance)
-		fs_color.w = 1.0;
+		double r1 = numerator.x/denominator.x;
+		double bl1 = double(isnan(r1));
+		if (distance(bl1, expected.x) > tolerance)
+			fs_color.w = 1.0;
 
-	for (int i = 0; i < 3; i++) {
 		gl_Position = vertex_to_gs[i];
 		EmitVertex();
 	}
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-array-copy.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-array-copy.shader_test
index 0e86c11..efefdf0 100644
--- a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-array-copy.shader_test
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-array-copy.shader_test
@@ -38,10 +38,10 @@ void main()
 	dvec4 temp[4] = colors;
 	temp[0] = dvec4(1.0, 0.0, 0.0, arg0);
 	dvec4 result = temp[i];
-	v = distance(result, expected) <= tolerance
-		? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 
 	for (int j = 0; j < 3; j++) {
+		v = distance(result, expected) <= tolerance
+			? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 		gl_Position = vertex_to_gs[j];
 		EmitVertex();
 	}
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-dmat4-row-major.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-dmat4-row-major.shader_test
index 4c2c8d4..a9c5036 100644
--- a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-dmat4-row-major.shader_test
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-dmat4-row-major.shader_test
@@ -34,10 +34,10 @@ out vec4 v;
 void main()
 {
 	dvec4 result = dvec4(m[0] + m[1] + m[2] + m[3] + arg0);
-	v = distance(result, expected) <= tolerance
-		? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 
 	for (int i = 0; i < 3; i++) {
+		v = distance(result, expected) <= tolerance
+			? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 		gl_Position = vertex_to_gs[i];
 		EmitVertex();
 	}
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-dmat4.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-dmat4.shader_test
index f66507c..77a90c5 100644
--- a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-dmat4.shader_test
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-dmat4.shader_test
@@ -34,10 +34,10 @@ out vec4 v;
 void main()
 {
 	dvec4 result = dvec4(m[0] + m[1] + m[2] + m[3] + arg0);
-	v = distance(result, expected) <= tolerance
-		? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 
 	for (int i = 0; i < 3; i++) {
+		v = distance(result, expected) <= tolerance
+			? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 		gl_Position = vertex_to_gs[i];
 		EmitVertex();
 	}
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-double-array-const-index.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-double-array-const-index.shader_test
index 5dc89a6..e05e83d 100644
--- a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-double-array-const-index.shader_test
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-double-array-const-index.shader_test
@@ -34,10 +34,10 @@ out vec4 v;
 void main()
 {
 	dvec4 result = dvec4(d[0] + arg0, d[1], d[2], d[3]);
-	v = distance(result, expected) <= tolerance
-		? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 
 	for (int i = 0; i < 3; i++) {
+		v = distance(result, expected) <= tolerance
+			? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 		gl_Position = vertex_to_gs[i];
 		EmitVertex();
 	}
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-double-array-variable-index.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-double-array-variable-index.shader_test
index 83cdc07..9b9985e 100644
--- a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-double-array-variable-index.shader_test
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-double-array-variable-index.shader_test
@@ -36,10 +36,10 @@ out vec4 v;
 void main()
 {
 	dvec4 result = dvec4(d[ri] + arg0, d[gi], d[bi], d[ai]);
-	v = distance(result, expected) <= tolerance
-		? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 
 	for (int i = 0; i < 3; i++) {
+		v = distance(result, expected) <= tolerance
+			? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 		gl_Position = vertex_to_gs[i];
 		EmitVertex();
 	}
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-double-bool-double.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-double-bool-double.shader_test
index 7fd4249..3647671 100644
--- a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-double-bool-double.shader_test
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-double-bool-double.shader_test
@@ -37,10 +37,10 @@ void main()
 		result = dvec4(arg0, arg2, 0.0, 0.0);
 	else
 		result = dvec4(arg0, arg2, 1.0, 0.0);
-	v = distance(result, expected) <= tolerance
-		? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 
 	for (int i = 0; i < 3; i++) {
+		v = distance(result, expected) <= tolerance
+			? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 		gl_Position = vertex_to_gs[i];
 		EmitVertex();
 	}
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-double-uniform-array-direct-indirect.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-double-uniform-array-direct-indirect.shader_test
index 926cf24..9089e71 100644
--- a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-double-uniform-array-direct-indirect.shader_test
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-double-uniform-array-direct-indirect.shader_test
@@ -32,10 +32,10 @@ out vec4 v;
 void main()
 {
 	dvec4 result =  dvec4(arg[int(arg[6])] + arg0);
-	v = distance(result, expected) <= tolerance
-		? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 
 	for (int i = 0; i < 3; i++) {
+		v = distance(result, expected) <= tolerance
+			? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 		gl_Position = vertex_to_gs[i];
 		EmitVertex();
 	}
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-doubles-float-mixed.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-doubles-float-mixed.shader_test
index e5368d6..0ef827c 100644
--- a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-doubles-float-mixed.shader_test
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-doubles-float-mixed.shader_test
@@ -37,10 +37,10 @@ out vec4 v;
 void main()
 {
 	dvec4 result = dvec4(r + arg0, g, b, a);
-	v = distance(result, expected) <= tolerance
-		? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 
 	for (int i = 0; i < 3; i++) {
+		v = distance(result, expected) <= tolerance
+			? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 		gl_Position = vertex_to_gs[i];
 		EmitVertex();
 	}
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-dvec4-uniform-array-direct-indirect.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-dvec4-uniform-array-direct-indirect.shader_test
index d88e6fb..bedf059 100644
--- a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-dvec4-uniform-array-direct-indirect.shader_test
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-dvec4-uniform-array-direct-indirect.shader_test
@@ -31,10 +31,10 @@ out vec4 v;
 void main()
 {
 	dvec4 result = dvec4(arg[int(arg[6].w)]);
-	v = distance(result, expected) <= tolerance
-		? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 
 	for (int i = 0; i < 3; i++) {
+		v = distance(result, expected) <= tolerance
+			? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 		gl_Position = vertex_to_gs[i];
 		EmitVertex();
 	}
diff --git a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-nested-struct.shader_test b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-nested-struct.shader_test
index ca648c3..5ce7ddf 100644
--- a/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-nested-struct.shader_test
+++ b/tests/spec/arb_gpu_shader_fp64/uniform_buffers/gs-nested-struct.shader_test
@@ -52,10 +52,10 @@ out vec4 v;
 void main()
 {
 	dvec4 result = dvec4(s.s1.r + arg0, s.s2.g, s.s2.b, s.s2.a);
-	v = distance(result, expected) <= tolerance
-		? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 
 	for (int i = 0; i < 3; i++) {
+		v = distance(result, expected) <= tolerance
+			? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 1.0, 0.0, 1.0);
 		gl_Position = vertex_to_gs[i];
 		EmitVertex();
 	}
-- 
2.8.3



More information about the Piglit mailing list