If I am creating a shader like so:
#extension GL_ARB_shader_image_load_store : require
#extension GL_ARB_shading_language_420pack : require
layout(binding = 0, r16ui) uniform readonly uimage2D uZlutImage;
This currently gives the error:
"the "binding" qualifier only applies to uniform blocks, opaque variables, or arrays thereof"
If I set the first line of the shader to "#version 420" it compiles and works as expected (because both of those extensions are supported in Mesa, so although I'm using 420 behaviour which isn't yet fully supported in Mesa it should still be possible. I need to set the environment variable MESA_GLSL_VERSION_OVERRIDE=420 of course)
In the extension specification for GL_ARB_shading_language_420pack (https://www.opengl.org/registry/specs/ARB/shading_language_420pack.txt) it reads
"Add layout qualifier identifier "binding" to bind units to sampler and image variable declarations." I could be wrong, but I think I should be able to bind image variables without using the environment variables.
I think the fix here could be as simple as forcing "#extension GL_ARB_shading_language_420pack" to imply "#version 420". It might be more complex than that though.
If I'm wrong here, and my interpretation of how to use this extension is false, do you mind directing me in how to bind image variables using only extensions, and if that's even possible?
Thank-you very much
i965 (Ivybridge I think)
Created attachment 120401 [details] [review]
Please try the attached patch (also sent to the mailing list for review)
I pushed this as
Author: Matt Turner <email@example.com>
Date: Mon Dec 7 11:14:56 2015 -0800
glsl: Allow binding of image variables with 420pack.
It is tagged for the 11.0 and 11.1 branches so it will be available soon in the 11.0.8 and 11.1.0 releases.
Please confirm whether it fixes the issue you see, and reopen the bug if it does not.
Thanks for the report!
Fixed for me.
Thank-you for the quick response.