Compiler diagnostic for sampler declared as "out" parameter of function is terrible
Submitted by xinghua
Assigned to mes..@..op.org
Link to original bug (#106996)
Description
Steps:
- Attached file is the source code;
- build the source code, "gcc -o compileshader compileshader.c -lX11 -lepoxy";
- run executable file, "./compileshader", mesa explicitly reports "invalid input layout qualifier used", compute shader compiling fails.
Notes:
-
I am nearly sure that this issue is not mesa bug. It is possible that my shader is not correct, but I could not find the root cause, so I file the bug to get some help.
-
Compute shader is as below, defines a user-defined function, with image type parameter, if uses "in" key to qualify the parameter, error happens, but if remove "in" and "out" keys, shader compiling successfully. Quotes OpenGL ES GLSL 3.1 spec section 6.1.1, "A function parameter declared with no such qualifier(in, out, inout) means the same thing as specifying in". Here explicitly specifies "in" key, why reports an error. #version 310 es layout(local_size_x=1, local_size_y=1, local_size_z=1) in; layout(r32ui, binding = 0) uniform readonly highp uimage2D uImage_1; layout(r32ui, binding = 1) uniform writeonly highp uimage2D uImage_2; void dataCopy(in readonly highp uimage2D src, out writeonly highp uimage2D dst, ivec2 pos) { uvec4 value = imageLoad(src, pos); imageStore(dst, pos, value); } void main() { dataCopy(uImage_1, uImage_2, ivec2(gl_LocalInvocationID.xy)); }
Version: 17.1