This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

GLSL read+write image2D

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."

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

Parents
  • That looks like a bug in the driver you have; specifying neither is valid. To specify both you literally specify "readonly writeonly", but that means you can't read or write to it and can therefore only use it for metadata operations such as imageSize(), which probably isn't what you want.

    I don't have an r7p0 device to hand, but I've tried all DDK versions that the offline compiler supports, and all of those seem to accept specifying neither qualifier all the way back to r5p0 which was the first release supporting compute shaders.

    1) What exact device are you using so I can try and hunt down what is causing problems?
    2) Can you share the complete shader causing the problem, just so we are sure we are looking at the right thing?

    Cheers,
    Pete

Reply
  • That looks like a bug in the driver you have; specifying neither is valid. To specify both you literally specify "readonly writeonly", but that means you can't read or write to it and can therefore only use it for metadata operations such as imageSize(), which probably isn't what you want.

    I don't have an r7p0 device to hand, but I've tried all DDK versions that the offline compiler supports, and all of those seem to accept specifying neither qualifier all the way back to r5p0 which was the first release supporting compute shaders.

    1) What exact device are you using so I can try and hunt down what is causing problems?
    2) Can you share the complete shader causing the problem, just so we are sure we are looking at the right thing?

    Cheers,
    Pete

Children