Browse Source

[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 <lizzie@eden-emu.dev>

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3357
Reviewed-by: Maufeat <sahyno1996@gmail.com>
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: DraVee <dravee@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
pull/3360/head
lizzie 2 weeks ago
committed by crueter
parent
commit
cb40b310f5
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 10
      src/shader_recompiler/backend/glsl/glsl_emit_context.cpp

10
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-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
@ -298,10 +298,12 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
stage_name = "gs"; stage_name = "gs";
header += fmt::format("layout({})in;", InputPrimitive(runtime_info.input_topology)); header += fmt::format("layout({})in;", InputPrimitive(runtime_info.input_topology));
if (uses_geometry_passthrough) { 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; 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"); LOG_WARNING(Shader_GLSL, "Passthrough geometry program used but not supported");
} }
header += fmt::format( header += fmt::format(

Loading…
Cancel
Save