Issues with multiple shader attachments
System information
- OS: Windows 10
- GPU: NVidia GTX 3070 Ti
- Mesa version: 24.0.1 (from https://github.com/pal1000/mesa-dist-win)
Describe the issue
As mentioned above I'm actually using Mesa on Windows, but I hope this is the right place to report (I've also reported to the downstream project building for Windows at https://github.com/pal1000/mesa-dist-win/issues/170, but they said to report here)
I've tested a project locally that seem to have issues when the shaders use multiple shader attachments, but only if the shader is written like:
out vec4 color;
out vec4 normal;
In this case, and for some reason, the Mesa driver inverts the outputs (I tried different backends and it happens with all of them IIRC), so the shader writes the normals to the color attachment, and vice versa.
If I change the shader to look like:
layout(location = 0, index = 0) out vec4 color;
layout(location = 1, index = 0) out vec4 normal;
the problem goes away, so it seems Mesa is assigning the wrong location to the attachments for some reason.
I unfortunately cannot share the project, but hopefully this is enough for a resolution.