Closed nicovize closed 5 years ago
I think this is a problem with GLSL itself, which Khronos is currently looking into.
The types don't match, because one has the layout rgba32f and the other does not, yet GLSL seems to require it on the global (unless it is writeonly) and generally does not allow qualifiers on the function parameter (though perhaps it should for this purpose).
Given your variable name, I doubt it helps, but the following works:
#version 450
writeonly layout (binding=0) uniform image2D TestRWTex;
void f(writeonly image2D rwTexture)
{
}
void main()
{
f(TestRWTex);
}
See https://github.com/KhronosGroup/GLSL/issues/57.
This is pending an extension that enables the use of the qualifiers needed.
In the meantime, I'll see if glslang should be issuing an error for this at the GLSL level.
Hi John, Thanks for sharing this info! This is great that an extension is coming to handle this case. If the issue can be resolved at GLSL level, still better :) best regards
Hello,
I get the following error from spirv-val when I try to pass an image to a function :
error: line 24: OpFunctionCall Argument '15[%TestRWTex]'s type does not match Function '8[%_ptr_UniformConstant_7]'s parameter type.
%16 = OpFunctionCall %void %fI21 %TestRWTex
Here is the minimal compute shader that causes the problem from the validator (this compiles fine, however) :
I used the following command line to get the error :
I'm not sure if there is a workaround, as declaring a "uniform image2D" in nested function scope is not allowed in GLSL, it seems.
glslangvalidator version infos (version from 1.1.101.0 Vulkan SDK) :
best regards,