[Piglit] [Patch 1/1] texelFetch, textureSize: replace deprecated gl_FragColor

Sebastian Olender sebastian.d.olender at intel.com
Wed Nov 9 14:18:36 UTC 2016


According to GLSLLangSpec: Use of gl_FragData and gl_FragColor
is deprecated in version 1.3, using user-defined out instead.
---
 tests/texturing/shaders/texelFetch.c  | 9 ++++++---
 tests/texturing/shaders/textureSize.c | 9 ++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/tests/texturing/shaders/texelFetch.c b/tests/texturing/shaders/texelFetch.c
index 0291a12..2e1d223 100644
--- a/tests/texturing/shaders/texelFetch.c
+++ b/tests/texturing/shaders/texelFetch.c
@@ -627,9 +627,10 @@ generate_GLSL(enum shader_target test_stage)
 			 "#version %d\n"
 			 "flat in %s color;\n"
 			 "uniform vec4 divisor;\n"
+			 "out vec4 fragColor;\n"
 			 "void main()\n"
 			 "{\n"
-			 "    gl_FragColor = vec4(color)/divisor;\n"
+			 "    fragColor = vec4(color)/divisor;\n"
 			 "}\n",
 			 shader_version,
 			 sampler.return_type);
@@ -676,9 +677,10 @@ generate_GLSL(enum shader_target test_stage)
 			 "#version %d\n"
 			 "flat in %s color;\n"
 			 "uniform vec4 divisor;\n"
+			 "out vec4 fragColor;\n"
 			 "void main()\n"
 			 "{\n"
-			 "    gl_FragColor = vec4(color)/divisor;\n"
+			 "    fragColor = vec4(color)/divisor;\n"
 			 "}\n",
 			 shader_version,
 			 sampler.return_type);
@@ -703,10 +705,11 @@ generate_GLSL(enum shader_target test_stage)
 			 "flat in ivec4 tc;\n"
 			 "uniform vec4 divisor;\n"
 			 "uniform %s tex;\n"
+			 "out vec4 fragColor;\n"
 			 "void main()\n"
 			 "{\n"
 			 "    vec4 color = texelFetch%s(tex, ivec%d(tc)%s%s);\n"
-			 "    gl_FragColor = color/divisor;\n"
+			 "    fragColor = color/divisor;\n"
 			 "}\n",
 			 shader_version,
 			 has_samples() ? "#extension GL_ARB_texture_multisample: require" : "",
diff --git a/tests/texturing/shaders/textureSize.c b/tests/texturing/shaders/textureSize.c
index c02c566..ac3df04 100644
--- a/tests/texturing/shaders/textureSize.c
+++ b/tests/texturing/shaders/textureSize.c
@@ -284,9 +284,10 @@ generate_GLSL(enum shader_target test_stage)
 			 "#define ivec1 int\n"
 			 "#define vec1 float\n"
 			 "flat in ivec%d size;\n"
+			 "out vec4 fragColor;\n"
 			 "void main()\n"
 			 "{\n"
-			 "    gl_FragColor = vec4(0.01 * size,%s 1);\n"
+			 "    fragColor = vec4(0.01 * size,%s 1);\n"
 			 "}\n",
 			 shader_version, size, zeroes[3 - size]);
 		break;
@@ -325,9 +326,10 @@ generate_GLSL(enum shader_target test_stage)
 			 "#define ivec1 int\n"
 			 "#define vec1 float\n"
 			 "flat in ivec%d size;\n"
+			 "out vec4 fragColor;\n"
 			 "void main()\n"
 			 "{\n"
-			 "    gl_FragColor = vec4(0.01 * size,%s 1);\n"
+			 "    fragColor = vec4(0.01 * size,%s 1);\n"
 			 "}\n",
 			 shader_version, size, zeroes[3 - size]);
 		break;
@@ -345,10 +347,11 @@ generate_GLSL(enum shader_target test_stage)
 			 "#define ivec1 int\n"
 			 "uniform int lod;\n"
 			 "uniform %s tex;\n"
+			 "out vec4 fragColor;\n"
 			 "void main()\n"
 			 "{\n"
 			 "    ivec%d size = textureSize(tex%s);\n"
-			 "    gl_FragColor = vec4(0.01 * size,%s 1);\n"
+			 "    fragColor = vec4(0.01 * size,%s 1);\n"
 			 "}\n",
 			 shader_version, extension, sampler.name, size, lod_arg,
 			 zeroes[3 - size]);
-- 
2.7.4



More information about the Piglit mailing list