diff options
author | Brian Paul <brianp@vmware.com> | 2017-11-10 15:11:04 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2017-11-13 21:41:37 -0700 |
commit | 168e9c41db98d6c53b57e43fe3e2606eb82d60b5 (patch) | |
tree | b0a6de75ca95b24a001f4f077543e33d100cc63a | |
parent | 307c8fc0867e60f397ac9c380d81697df625d791 (diff) |
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.
Reviewed-by: Neha Bhende <bhenden@vmware.com>
-rw-r--r-- | tests/spec/arb_sample_shading/execution/ignore-centroid-qualifier.cpp | 9 | ||||
-rw-r--r-- | tests/spec/arb_sample_shading/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 c286c5c75..105f8377e 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 6d0123bff..36ede0d7e 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"); |