diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2018-12-25 01:28:44 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-01-15 21:54:53 +0100 |
commit | dbed6c64853aa80c0462dcda8582d49a99f6ee29 (patch) | |
tree | bc6b61489d565117bdab4704933e959e522c93b8 /src/video_core/shader/glsl_decompiler.cpp | |
parent | shader_decode: Fixup WriteLogicOperation zero comparison (diff) | |
download | yuzu-dbed6c64853aa80c0462dcda8582d49a99f6ee29.tar yuzu-dbed6c64853aa80c0462dcda8582d49a99f6ee29.tar.gz yuzu-dbed6c64853aa80c0462dcda8582d49a99f6ee29.tar.bz2 yuzu-dbed6c64853aa80c0462dcda8582d49a99f6ee29.tar.lz yuzu-dbed6c64853aa80c0462dcda8582d49a99f6ee29.tar.xz yuzu-dbed6c64853aa80c0462dcda8582d49a99f6ee29.tar.zst yuzu-dbed6c64853aa80c0462dcda8582d49a99f6ee29.zip |
Diffstat (limited to 'src/video_core/shader/glsl_decompiler.cpp')
-rw-r--r-- | src/video_core/shader/glsl_decompiler.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
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) { |