OpenGL 4.6 core program linking fails, interface matching issue
System information
System: Host: linux-0q0x.suse Kernel: 5.3.18-lp152.26-default x86_64 bits: 64 compiler: gcc v: 7.5.0
Desktop: KDE Plasma 5.18.5 tk: Qt 5.12.7 wm: kwin_x11 dm: SDDM Distro: openSUSE Leap 15.2
CPU: Topology: 8-Core model: AMD Ryzen Threadripper 1900X bits: 64 type: MT MCP arch: Zen rev: 1 L2 cache: 4096 KiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 121380
Speed: 2603 MHz min/max: 2200/3800 MHz Core speeds (MHz): 1: 1932 2: 1895 3: 1789 4: 1758 5: 1734 6: 1730 7: 3869
8: 1912 9: 1934 10: 1986 11: 1995 12: 3893 13: 3932 14: 1910 15: 1943
Graphics: Device-1: Advanced Micro Devices [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590]
vendor: Sapphire Limited driver: amdgpu v: kernel bus ID: 07:00.0 chip ID: 1002:67df
Device-2: NVIDIA GP104 [GeForce GTX 1070] vendor: eVga.com. driver: nouveau v: kernel bus ID: 41:00.0
chip ID: 10de:1b81
Display: x11 server: X.Org 1.20.8 compositor: kwin_x11 driver: amdgpu,nouveau FAILED: ati
unloaded: fbdev,modesetting,vesa alternate: nv,nvidia resolution: 1: 1920x1080~60Hz 2: 1920x1080~60Hz s-dpi: 96
OpenGL: renderer: Radeon RX 580 Series (POLARIS10 DRM 3.33.0 5.3.18-lp152.26-default LLVM 10.0.1)
v: 4.6 Mesa 20.1.4 direct render: Yes
Describe the issue
I have a shader program where linking fails with the error error: fragment shader input
gpi' with explicit location has no matching output`. As far as I can tell, all inputs and outputs of that interface block are both written and consumed.
These are the shaders, as they're dumped by mesa.
Vertex shader:
/* Shader 34 source */
#version 460
#define IN_OUT out
// 8<--- snip ----
layout(location=11) IN_OUT GeometryPipelineInterface {
vec2 texCoord;
vec3 color;
flat float texIndex;
vec3 vertexPos;
vec4 vertexPosLight[3];
vec3 normal;
vec3 ssaoNormal;
} gpi;
// 8<--- snip ----
/* Compile status: ok */
/* Log Info: */
Fragment shader:
/* Shader 35 source */
#version 460
#define IN_OUT in
layout(location=11) IN_OUT GeometryPipelineInterface {
vec2 texCoord;
vec3 color;
flat float texIndex;
vec3 vertexPos;
vec4 vertexPosLight[3];
vec3 normal;
vec3 ssaoNormal;
} gpi;
// 8<--- snip ----
/* Compile status: ok */
/* Log Info: */