NV_geometry_shader_passthrough: can't get shader to bind

Hello, i wanted to use the GL_NV_geometry_shader_passthrough extension to improve my geometry shader stage when rendering cubeshadow maps. I only need to update the gl_Layer in the geometry shader so i guess the extension should bring some decent speed improvement. In theory everything looks quite simply but my problem is that my shader simply does not bind without any error message from opengl although it compiles fine. I followed these instruction:


Maybe someone can help me. This is what i have:

  • I use a gtx 1080
  • Iam using opengl 4.6 core
  • Extension should be available according to this snipped (returns true):
 if (glfwExtensionSupported("GL_NV_geometry_shader_passthrough")) {
            std::cout << "GL_NV_geometry_shader_passthrough is supported" << std::endl;
        else {
            std::cout << "GL_NV_geometry_shader_passthrough is not supported" << std::endl;

From that side everything should be safe, i guess.
I integrated the extension to the geometry shader of my gbuffer-pass. The shaders look like this (vertex, geometry and fragment):

#shader vertex
#version 460 core

layout(location = 0) in vec3 Position;
layout(location = 1) in vec2 TexCoords;
layout(location = 2) in vec3 Normal;
layout(location = 3) in vec3 Tangent;
layout(location = 4) in vec3 Bitangent;

layout(location = 5) in mat4 u_MV;
layout(location = 9) in mat4 u_M;

out vec2 v_TexCoords;
out vec3 v_Normal;
out vec3 v_FragPos;
out mat3 v_TBN;
out vec3 v_SSAOPos;
out vec3 v_SSAONormal;

uniform mat4 u_Projection;

void main()
	v_SSAOPos = (u_MV * vec4(Position, 1)).xyz;
	v_SSAONormal = mat3(transpose(inverse(u_MV))) * Normal;

	gl_Position = (u_Projection * u_MV) * vec4(Position, 1);
	v_Normal = mat3(transpose(inverse(u_M))) * Normal;
	v_TexCoords = TexCoords;
	v_FragPos = (u_M * vec4(Position, 1)).xyz;

	mat3 m = mat3(u_M);
	vec3 T = normalize(m * Tangent);
	vec3 N = normalize(m * Normal);
	vec3 B = normalize(m * Bitangent);

	v_TBN = mat3(T, B, N);

#shader geometry
#version 460 core
#extension GL_NV_geometry_shader_passthrough : require

layout(triangles) in;

layout(passthrough) in gl_PerVertex{
	vec4 gl_Position;
} gl_in[];

layout(passthrough) in vec2 v_TexCoords[];
layout(passthrough) in vec3 v_Normal[];
layout(passthrough) in vec3 v_FragPos[];
layout(passthrough) in mat3 v_TBN[];
layout(passthrough) in vec3 v_SSAOPos[];
layout(passthrough) in vec3 v_SSAONormal[];

void main()
	// For testing statically set to 0
	gl_Layer = 0;

#shader fragment
#version 460 core

layout(location = 0) out vec4 gPosition;
layout(location = 1) out vec4 gNormal;
layout(location = 2) out vec4 gAlbedo;
layout(location = 3) out vec4 gMetalRough;
layout(location = 4) out vec4 ssaoPosition;
layout(location = 5) out vec4 ssaoNormal;

in vec2 v_TexCoords;
in vec3 v_FragPos;
in vec3 v_Normal;
in mat3 v_TBN;
in vec3 v_SSAOPos;
in vec3 v_SSAONormal;

uniform vec3 u_BaseColor;
uniform float u_Roughness;
uniform float u_Metalness;

uniform sampler2D u_Texture0;
uniform sampler2D u_Texture1;
uniform sampler2D u_Texture2;
uniform sampler2D u_Texture3;

void main()
	ssaoPosition = vec4(v_SSAOPos, 1);
	ssaoNormal = vec4(v_SSAONormal, 1);

	// store the fragment position vector in the first gbuffer texture
	gPosition = vec4(v_FragPos, 1);

	// also store the per-fragment normals into the gbuffer
	vec3 normal = texture(u_Texture1, v_TexCoords).xyz;

	normal = normal * 2.0 - 1.0;
	gNormal = vec4(normalize(v_TBN * normal), 1);
	// and the diffuse per-fragment color
	gAlbedo = texture(u_Texture0, v_TexCoords) * vec4(u_BaseColor, 1);

	//TODO: optimize and merge roughness and metalness during asset loading into one texture
	// Metal and roughness
	gMetalRough.r = texture(u_Texture3, v_TexCoords).r * u_Metalness;
	gMetalRough.g = texture(u_Texture2, v_TexCoords).g * u_Roughness;
	gMetalRough.a = 1;

I hope iam simply overlooking something. I already went over it thousand times and tested different ways to declare all the involved varaibles that travel between the shaders. Everything just ended up with the shader not beeing able to be bound when using “UseProgram”.

Thanks in advance.