google / graphicsfuzz

A testing framework for automatically finding and simplifying bugs in graphics shader compilers.
Apache License 2.0
562 stars 117 forks source link

Adding memory qualifiers support for buffers / shader storage blocks #1149

Closed AaronGhost closed 3 years ago

AaronGhost commented 3 years ago

It is impossible to add memory qualifiers to buffers (also described as shader storage blocks).

The specifications are described by the 4.9 Memory qualifiers in OpenGL ES3.1 and 4.10 Memory qualifiers in OpenGL ES3.2 / OpenGL 4.5. The specification of OpenGL 4.5 is a bit confusing: it first states that memory qualifiers can only be applied to image variables and then they also may be used with buffers and shader storages.

Glslangvalidator correctly recognizes code such as:

coherent buffer Block {
    readonly vec4 member1;
    vec4 member2;
};

But it is not recognized by Graphicsfuzz unless it is transformed as the equivalent code:

buffer Block {
    coherent readonly vec4 member1;
    coherent vec4 member2;
};