Using gl_FragCoord in a fragment shader results in a "incompatible signatures" error
This fragment code:
frag :: Code
frag = fromString
[glsl|
#version 450
#extension GL_EXT_nonuniform_qualifier : enable
${set0binding0}
layout(location = 0) out vec4 oColor;
void main() {
vec2 uv = gl_FragCoord.xy / vec2(800, 600);
vec3 color = vec3(uv, sin(scene.tweaks[3]) * 0.5 + 0.5);
oColor = vec4(color, 1.0);
}
|]
Fails with this error:
Starting stage: Main
animation-fractal: UnliftIO.Exception.throwString called with:
Between vert and frag (location=4294967295): incompatible signatures
requested: InterfaceSignature {format = FORMAT_R32G32B32A32_SFLOAT, flags = 264, matrix = Nothing}
provided: InterfaceSignature {format = FORMAT_UNDEFINED, flags = 268959744, matrix = Nothing}
Called from:
throwString (src/Engine/Vulkan/Pipeline/External.hs:165:11 in keid-core-0.1.7.1-inplace:Engine.Vulkan.Pipeline.External)
Commenting the validation code https://gitlab.com/keid/engine/-/blob/9be294319efb1208458f334deee06e1855ff0ddf/core/src/Engine/Vulkan/Pipeline/External.hs#L152-169 fixes the issue and the shader works as expected.