We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I expected to be able to use both imageLoad and imageStore on the same image to read and modify it from within a compute shader.
Trying with a declaration of: layout(r32f, binding=0) uniform highp image2D x;Produces "Shader error: Image has to be qualified as 'readonly', 'writeonly' or both."
layout(r32f, binding=0) uniform highp image2D x;
I haven't been able to find yet how to specify "both" as the error implies is possible. Is there a keyword for this I've missed?
I'm using a Mali-T720 with GLES 3.1 v1.r7p0-02
Just to add an appendix to this one, as this post seems to get found in web searches for a related issue, which isn't a Mali bug.
There was a bug a long time ago, impacting r32* bindings, which was fixed in 2017 drivers.
You will still get this error for other binding formats because the OpenGL ES shader language spec requires this behavior:
Except for image variables qualified with the format qualifiers r32f, r32i, and r32ui, image variables must specify either memory qualifier readonly or the memory qualifier writeonly.
If you want read+write images you must make two separate variable definitions, one readonly and one writeonly, which can be bound to the same binding location.
Cheers,Pete