[Piglit] [PATCH 4/4] arb_sample_shading: don't use gl_FragColor/Data in fragment shaders

Neha Bhende bhenden at vmware.com
Mon Nov 13 22:28:50 UTC 2017


For series,


Reviewed-by: Neha Bhende<bhenden at vmware.com>


Regards,

Neha

________________________________
From: Piglit <piglit-bounces at lists.freedesktop.org> on behalf of Brian Paul <brianp at vmware.com>
Sent: Friday, November 10, 2017 2:44:45 PM
To: piglit at lists.freedesktop.org
Subject: [Piglit] [PATCH 4/4] arb_sample_shading: don't use gl_FragColor/Data in fragment shaders

NVIDIA's driver fails to compile the fragment shaders with "Failed to
compile fragment shader: 0(4) : error C7533: global variable gl_FragData
is deprecated after version 120".

Use 'out fragdata' or 'out fragcolor' instead.

Tested with Mesa too.
---
 .../execution/ignore-centroid-qualifier.cpp                 |  9 ++++++---
 .../execution/interpolate-at-sample-position.cpp            | 13 ++++++++-----
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/tests/spec/arb_sample_shading/execution/ignore-centroid-qualifier.cpp b/tests/spec/arb_sample_shading/execution/ignore-centroid-qualifier.cpp
index c286c5c..105f837 100644
--- a/tests/spec/arb_sample_shading/execution/ignore-centroid-qualifier.cpp
+++ b/tests/spec/arb_sample_shading/execution/ignore-centroid-qualifier.cpp
@@ -147,8 +147,9 @@ piglit_init(int argc, char**argv)
                 "#version 130\n"
                 "#extension GL_ARB_sample_shading: require\n"
                 "centroid in vec2 test;\n"
+               "out vec4 fragcolor;\n"
                 "void main() {\n"
-               "       gl_FragColor = vec4(abs(test), 0, 1);\n"
+               "       fragcolor = vec4(abs(test), 0, 1);\n"
                 "}\n");

         draw_prog_right = piglit_build_simple_program(
@@ -169,8 +170,9 @@ piglit_init(int argc, char**argv)

                 "#version 130\n"
                 "in vec2 ref;\n"
+               "out vec4 fragcolor;\n"
                 "void main() {\n"
-               "       gl_FragColor = vec4(abs(ref), 0, 1);\n"
+               "       fragcolor = vec4(abs(ref), 0, 1);\n"
                 "}\n");
         sample_pos_loc = glGetUniformLocation(draw_prog_right, "sample_pos");

@@ -185,8 +187,9 @@ piglit_init(int argc, char**argv)
                 "#extension GL_ARB_texture_multisample: require\n"
                 "uniform int sample_id;\n"
                 "uniform sampler2DMS tex;\n"
+               "out vec4 fragcolor;\n"
                 "void main() {\n"
-               "       gl_FragColor =  texelFetch(tex, ivec2(gl_FragCoord.xy),\n"
+               "       fragcolor =  texelFetch(tex, ivec2(gl_FragCoord.xy),\n"
                 "                                  sample_id);\n"
                 "}\n");

diff --git a/tests/spec/arb_sample_shading/execution/interpolate-at-sample-position.cpp b/tests/spec/arb_sample_shading/execution/interpolate-at-sample-position.cpp
index 6d0123b..36ede0d 100644
--- a/tests/spec/arb_sample_shading/execution/interpolate-at-sample-position.cpp
+++ b/tests/spec/arb_sample_shading/execution/interpolate-at-sample-position.cpp
@@ -162,9 +162,10 @@ piglit_init(int argc, char**argv)
                 "#extension GL_ARB_sample_shading: require\n"
                 "in vec2 test_center;\n"
                 "centroid in vec2 test_centroid;\n"
+               "out vec4 fragdata[2];\n"
                 "void main() {\n"
-               "       gl_FragData[0] = vec4(abs(test_center), 0, 1);\n"
-               "       gl_FragData[1] = vec4(abs(test_centroid), 0, 1);\n"
+               "       fragdata[0] = vec4(abs(test_center), 0, 1);\n"
+               "       fragdata[1] = vec4(abs(test_centroid), 0, 1);\n"
                 "}\n");

         draw_prog_right = piglit_build_simple_program(
@@ -185,9 +186,10 @@ piglit_init(int argc, char**argv)

                 "#version 130\n"
                 "in vec2 ref;\n"
+               "out vec4 fragdata[2];\n"
                 "void main() {\n"
-               "       gl_FragData[0] = vec4(abs(ref), 0, 1);\n"
-               "       gl_FragData[1] = vec4(abs(ref), 0, 1);\n"
+               "       fragdata[0] = vec4(abs(ref), 0, 1);\n"
+               "       fragdata[1] = vec4(abs(ref), 0, 1);\n"
                 "}\n");
         sample_pos_loc = glGetUniformLocation(draw_prog_right, "sample_pos");

@@ -203,9 +205,10 @@ piglit_init(int argc, char**argv)
                 "uniform int sample_id;\n"
                 "uniform sampler2DMS tex_center;\n"
                 "uniform sampler2DMS tex_centroid;\n"
+               "out vec4 fragcolor;\n"
                 "void main() {\n"
                 "       ivec2 coord = ivec2(gl_FragCoord.xy);\n"
-               "       gl_FragColor = coord.y < 128 ? \n"
+               "       fragcolor = coord.y < 128 ? \n"
                 "               texelFetch(tex_center, coord, sample_id) :\n"
                 "               texelFetch(tex_centroid, coord - ivec2(0, 128), sample_id);\n"
                 "}\n");
--
1.9.1

_______________________________________________
Piglit mailing list
Piglit at lists.freedesktop.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_piglit&d=DwIGaQ&c=uilaK90D4TOVoH58JNXRgQ&r=U9C05uEFArICiTQ6FqFIgVCB-YGE5G2JTThVEccv_Ec&m=0p14veV0v53IcqR1i9LxGRcQgKTIa1wNr7XUCr9NVgY&s=GsSINHpOd7mNdnpu_ubOZ4lEHfCDx-cOWnpozp0D9qk&e=
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20171113/643ccced/attachment-0001.html>


More information about the Piglit mailing list