From cb40b310f567d0e890dd31c3ece143f841fd1d13 Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 21 Jan 2026 00:16:30 +0100 Subject: [PATCH] [opengl] fix GL_NV_geometry_shader_passthrough compiler complaints (#3357) this can be seen immediately on startup of switch sports where the passthru geometry shader will spectacularly fail to compile because the driver complains about re-declaration this is just a simple and quickie fix for that Signed-off-by: lizzie Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3357 Reviewed-by: Maufeat Reviewed-by: MaranBr Reviewed-by: DraVee Co-authored-by: lizzie Co-committed-by: lizzie --- .../backend/glsl/glsl_emit_context.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp index 2bf7f4de13..a2df6159fb 100644 --- a/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/glsl_emit_context.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project @@ -298,10 +298,12 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile stage_name = "gs"; header += fmt::format("layout({})in;", InputPrimitive(runtime_info.input_topology)); if (uses_geometry_passthrough) { - header += "layout(passthrough)in gl_PerVertex{vec4 gl_Position;};"; + // Passthru REQUIRES the layout to be defined with a corresponding name, for our sanity + // we will just use `gl_in[]`, if you don't the driver will complain with: + // 0(56) : error C7593: Builtin block member gl_Position not found in redeclaration of in gl_PerVertex + header += "layout(passthrough)in gl_PerVertex{vec4 gl_Position;}gl_in[];"; break; - } else if (program.is_geometry_passthrough && - !profile.support_geometry_shader_passthrough) { + } else if (program.is_geometry_passthrough && !profile.support_geometry_shader_passthrough) { LOG_WARNING(Shader_GLSL, "Passthrough geometry program used but not supported"); } header += fmt::format(