[Piglit] [PATCH 4/8] arb_gpu_shader_fp64: gl_FragColor is deprecated in glsl >= 1.30

Andres Gomez agomez at igalia.com
Tue Mar 15 15:50:45 UTC 2016


From: "Juan A. Suarez Romero" <jasuarez at igalia.com>

An explicit output vec4 in the FS must be defined.

Contributed by Andres Gomez.

Signed-off-by: Juan A. Suarez Romero <jasuarez at igalia.com>
Signed-off-by: Andres Gomez <agomez at igalia.com>
---
 .../execution/fs-indirect-temp-double-const-src.shader_test  |  9 ++++++++-
 .../execution/fs-indirect-temp-double-dst.shader_test        | 10 +++++++++-
 .../execution/fs-indirect-temp-double-src.shader_test        | 10 +++++++++-
 .../execution/gs-fs-vs-double.shader_test                    | 12 ++++++++++--
 4 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-const-src.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-const-src.shader_test
index 7cf4d70..d09e6e8 100644
--- a/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-const-src.shader_test
+++ b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-const-src.shader_test
@@ -4,6 +4,8 @@ GLSL >= 1.50
 GL_ARB_gpu_shader_fp64
 
 [vertex shader]
+#version 150
+
 in vec4 vertex;
 void main()
 {
@@ -11,17 +13,22 @@ void main()
 }
 
 [fragment shader]
+#version 150
 #extension GL_ARB_gpu_shader_fp64 : require
+
 uniform double arg0;
 uniform double tval[5];
 uniform double tolerance;
 uniform double expected;
 uniform int pick;
+
+out vec4 color;
+
 void main()
 {
   double result;
   result = (tval[pick] + arg0);
-  gl_FragColor = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+  color = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
 }
 
 [vertex data]
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-dst.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-dst.shader_test
index e620e9d..b96dd98 100644
--- a/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-dst.shader_test
+++ b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-dst.shader_test
@@ -4,25 +4,33 @@ GLSL >= 1.50
 GL_ARB_gpu_shader_fp64
 
 [vertex shader]
+#version 150
+
 in vec4 vertex;
+
 void main()
 {
         gl_Position = vertex;
 }
 
 [fragment shader]
+#version 150
 #extension GL_ARB_gpu_shader_fp64 : require
+
 uniform double arg0;
 uniform double arg1;
 uniform double tolerance;
 uniform double expected;
 uniform int pick;
+
+out vec4 color;
+
 void main()
 {
   double result[5];
 
   result[pick] = (arg0 + arg1);
-  gl_FragColor = distance(result[pick], expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+  color = distance(result[pick], expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
 }
 
 [vertex data]
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-src.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-src.shader_test
index 2f50c63..26c7c7f 100644
--- a/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-src.shader_test
+++ b/tests/spec/arb_gpu_shader_fp64/execution/fs-indirect-temp-double-src.shader_test
@@ -4,18 +4,26 @@ GLSL >= 1.50
 GL_ARB_gpu_shader_fp64
 
 [vertex shader]
+#version 150
+
 in vec4 vertex;
+
 void main()
 {
         gl_Position = vertex;
 }
 
 [fragment shader]
+#version 150
 #extension GL_ARB_gpu_shader_fp64 : require
+
 uniform double arg0;
 uniform double tolerance;
 uniform double expected;
 uniform int pick;
+
+out vec4 color;
+
 void main()
 {
   double tval[5];
@@ -25,7 +33,7 @@ void main()
   tval[2] = 0.5lf;
   tval[3] = 0.75lf;
   result = (tval[pick] + arg0);
-  gl_FragColor = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+  color = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
 }
 
 [vertex data]
diff --git a/tests/spec/arb_gpu_shader_fp64/execution/gs-fs-vs-double.shader_test b/tests/spec/arb_gpu_shader_fp64/execution/gs-fs-vs-double.shader_test
index d4a3c8c..16545d8 100644
--- a/tests/spec/arb_gpu_shader_fp64/execution/gs-fs-vs-double.shader_test
+++ b/tests/spec/arb_gpu_shader_fp64/execution/gs-fs-vs-double.shader_test
@@ -6,10 +6,13 @@ GL_ARB_gpu_shader_fp64
 [vertex shader]
 #version 150
 #extension GL_ARB_gpu_shader_fp64 : require
+
 uniform dvec4 arg0;
+
 in vec4 vertex;
 out vec4 vertex_to_gs;
 out dvec4 dout1_to_gs;
+
 void main()
 {
         vertex_to_gs = vertex;
@@ -19,8 +22,10 @@ void main()
 [geometry shader]
 #version 150
 #extension GL_ARB_gpu_shader_fp64 : require
+
 layout(triangles) in;
 layout(triangle_strip, max_vertices = 3) out;
+
 in vec4 vertex_to_gs[3];
 in dvec4 dout1_to_gs[3];
 flat out dvec4 out_to_fs;
@@ -37,14 +42,17 @@ void main()
 [fragment shader]
 #version 150
 #extension GL_ARB_gpu_shader_fp64 : require
-flat in dvec4 out_to_fs;
+
 uniform double tolerance;
 uniform dvec4 expected;
 
+flat in dvec4 out_to_fs;
+out vec4 color;
+
 void main()
 {
   dvec4 result = trunc(out_to_fs);
-  gl_FragColor = distance(result, dvec4(expected)) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+  color = distance(result, dvec4(expected)) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
 }
 
 [vertex data]
-- 
2.1.0



More information about the Piglit mailing list