Since driver version 310, the GLSL driver crashes when using the “restrict” keyword. I can reproduce this on different machines running windows or linux. Latest driver version I have tried is 320.18.
The following code for a fragment shader crashes the compiler. Remove the “restrict” keyword and it works.
Quote from the ARB_shader_image_load_store specification:
The position of the qualifier is meaningful. Qualifiers
before the type name apply to the data referenced by the variable.
Qualifiers after the type name apply to the variable itself.
...
For "coherent", "volatile", and "const", the qualifier should typically
go before the image type. For "restrict", the qualifier must go after
the image type, since "restrict" applies to the pointer, not the data
being pointed to.
It’d be nice if the compiler could automatically optimize the memory layout, especially for use in the fragment shader. Seems like a pretty daunting task to implement though.