diff options
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_gen.cpp | 6 | ||||
-rw-r--r-- | src/video_core/shader/glsl_decompiler.cpp | 26 |
2 files changed, 17 insertions, 15 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index 743a9c90e..9fb2f9ace 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -84,11 +84,7 @@ ProgramResult GenerateGeometryShader(const ShaderSetup& setup) { out += "#extension GL_ARB_separate_shader_objects : enable\n"; out += GetCommonDeclarations(); - out += R"(out gl_PerVertex { - vec4 gl_Position; -}; - -layout (location = 0) in vec4 gs_position[]; + out += R"(layout (location = 0) in vec4 gs_position[]; layout (location = 0) out vec4 position; layout (std140) uniform gs_config { diff --git a/src/video_core/shader/glsl_decompiler.cpp b/src/video_core/shader/glsl_decompiler.cpp index 2ee8cefab..381be0e56 100644 --- a/src/video_core/shader/glsl_decompiler.cpp +++ b/src/video_core/shader/glsl_decompiler.cpp @@ -207,6 +207,22 @@ private: if (stage != ShaderStage::Vertex) return; + DeclareVertexRedeclarations(); + } + + void DeclareGeometry() { + if (stage != ShaderStage::Geometry) + return; + + const auto topology = GetTopologyName(header.common3.output_topology); + const auto max_vertices = std::to_string(header.common4.max_output_vertices); + code.AddLine("layout (" + topology + ", max_vertices = " + max_vertices + ") out;"); + code.AddNewLine(); + + DeclareVertexRedeclarations(); + } + + void DeclareVertexRedeclarations() { bool clip_distances_declared = false; code.AddLine("out gl_PerVertex {"); @@ -229,16 +245,6 @@ private: code.AddNewLine(); } - void DeclareGeometry() { - if (stage != ShaderStage::Geometry) - return; - - const auto topology = GetTopologyName(header.common3.output_topology); - const auto max_vertices = std::to_string(header.common4.max_output_vertices); - code.AddLine("layout (" + topology + ", max_vertices = " + max_vertices + ") out;"); - code.AddNewLine(); - } - void DeclareRegisters() { const auto& registers = ir.GetRegisters(); for (const u32 gpr : registers) { |