[Mesa-dev] [PATCH 4/8] glsl: Add new builtins required by GL_ARB_sample_shading
Kenneth Graunke
kenneth at whitecape.org
Thu Oct 17 08:25:33 CEST 2013
On 10/16/2013 03:49 PM, Ian Romanick wrote:
[snip]
> You are completely correct here. We should check what other vendors do.
> I think 5 tests will tell us everything we need to know (then we'll
> probably submit some spec bugs). I don't have any non-Intel hardware
> that supports either extension, so I can't actually try any of these.
Thanks for the tests, Ian!
I ran them on my Radeon HD 6870 with Catalyst 13.10 by doing:
$ PIGLIT_PLATFORM=glx glslparsertest --check-link 1.frag pass
> 1. Does this compile, link, and run:
>
> #version 130
> #extension GL_ARB_sample_shading: require
>
> out vec4 color;
>
> void main() {
> color = vec4(gl_SampleMask.length());
> gl_SampleMask[0] = ~0;
> }
Successfully compiled and linked fragment shader 1.frag: (no compiler output)
> 2. Does this compile and link:
>
> #version 130
> #extension GL_ARB_sample_shading: require
>
> out vec4 color;
>
> void main() {
> color = vec4(1);
> gl_SampleMask[0] = ~0;
> gl_SampleMask[1] = ~0;
> }
Failed to compile fragment shader 2.frag:
Fragment shader failed to compile with the following errors:
ERROR: 0:9: error(#147) "[" array index out of range: '1'
ERROR: error(#273) 1 compilation errors. No code generated
> 3. Does this compile and link:
>
> #version 130
> #extension GL_ARB_sample_shading: require
> #extension GL_ARB_gpu_shader5: require
>
> out vec4 color;
>
> void main() {
> color = vec4(1);
> gl_SampleMask = gl_SampleMaskIn;
> }
Successfully compiled and linked fragment shader 3.frag: (no compiler output)
> 4. Does this compile and link:
>
> #version 130
> #extension GL_ARB_sample_shading: require
>
> out vec4 color;
> in int gl_SampleMask[1];
>
> void main() {
> color = vec4(1);
> gl_SampleMask[0] = ~0;
> }
Successfully compiled and linked fragment shader 4.frag:
WARNING: 0:5: warning(#375) Redeclaration of built-in name: gl_SampleMask
WARNING: 0:9: warning(#398) l-value required: assign "gl_SampleMask" (can't modify an input)
Presumably you meant "out int gl_SampleMask[1];" instead. With that change,
Successfully compiled and linked fragment shader 4b.frag:
WARNING: 0:5: warning(#375) Redeclaration of built-in name: gl_SampleMask
> 5. Does this compile and link:
>
> #version 130
> #extension GL_ARB_sample_shading: require
>
> out vec4 color;
> in int gl_SampleMask[2];
>
> void main() {
> color = vec4(1);
> gl_SampleMask[0] = ~0;
> gl_SampleMask[1] = ~0;
> }
Successfully compiled and linked fragment shader 5.frag:
WARNING: 0:5: warning(#375) Redeclaration of built-in name: gl_SampleMask
WARNING: 0:9: warning(#398) l-value required: assign "gl_SampleMask" (can't modify an input)
WARNING: 0:10: warning(#398) l-value required: assign "gl_SampleMask" (can't modify an input)
Again changing "in" to "out":
Successfully compiled and linked fragment shader 5b.frag:
WARNING: 0:5: warning(#375) Redeclaration of built-in name: gl_SampleMask
I haven't actually tried drawing with the shaders.
--Ken
More information about the mesa-dev
mailing list