summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/frontend/maxwell/translate_program.h
diff options
context:
space:
mode:
authorLiam <byteslice@airmail.cc>2022-11-30 17:16:00 -0500
committerLiam <byteslice@airmail.cc>2022-12-01 09:51:27 -0500
commit3ef006b5abbe78bb2ae423a7cab74d7da2f8bc08 (patch)
treebf0c9ed637dc39faea655fb836b7a48a9f5d28ee /src/shader_recompiler/frontend/maxwell/translate_program.h
parentd6b63239ae5011cbe8aa59b44bfd813e30f75d56 (diff)
shader_recompiler: add gl_Layer translation GS for older hardware
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/translate_program.h')
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate_program.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate_program.h b/src/shader_recompiler/frontend/maxwell/translate_program.h
index 02ede8c9c..497afe7cb 100644
--- a/src/shader_recompiler/frontend/maxwell/translate_program.h
+++ b/src/shader_recompiler/frontend/maxwell/translate_program.h
@@ -25,4 +25,13 @@ namespace Shader::Maxwell {
void ConvertLegacyToGeneric(IR::Program& program, const RuntimeInfo& runtime_info);
+// Maxwell v1 and older Nvidia cards don't support setting gl_Layer from non-geometry stages.
+// This creates a workaround by setting the layer as a generic output and creating a
+// passthrough geometry shader that reads the generic and sets the layer.
+[[nodiscard]] IR::Program GenerateGeometryPassthrough(ObjectPool<IR::Inst>& inst_pool,
+ ObjectPool<IR::Block>& block_pool,
+ const HostTranslateInfo& host_info,
+ IR::Program& source_program,
+ Shader::OutputTopology output_topology);
+
} // namespace Shader::Maxwell