Details
Description
porting one of my shaders to qt6, i found one problem by chance: my shader worked for macos/metal, but it did not work on linux/opengl. running macos/opengl i eventually got a run-time error:
Failed to build graphics pipeline state Failed to link shader program: WARNING: Output of vertex shader 'vTexCoord' not read by fragment shader ERROR: Input of fragment shader 'texCoord' not written by vertex shader
my vertex shader was using using the output variable vTexCoord
layout(location = 0) in vec4 aVertex; layout(location = 1) in vec2 aTexCoord; layout(location = 0) out vec2 vTexCoord;
while the fragment shader was using the input variable texCoord
layout(location = 0) in vec2 texCoord; layout(location = 0) out vec4 fragColor;
the fix for this is obviously simple, the diagnostic not so much (as the opengl driver on linux silently failed instead of giving an error message). so i wonder if rhi could verify the names without relying on the driver?