diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-05-16 22:52:30 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:31 +0200 |
commit | db2f0f410810d3d8310a6a476a8bcfd5e509869e (patch) | |
tree | 8431a001ed82b69250d45047e5efd2405851f92f | |
parent | emit_glasm: Add support for reading position attributes (diff) | |
download | yuzu-db2f0f410810d3d8310a6a476a8bcfd5e509869e.tar yuzu-db2f0f410810d3d8310a6a476a8bcfd5e509869e.tar.gz yuzu-db2f0f410810d3d8310a6a476a8bcfd5e509869e.tar.bz2 yuzu-db2f0f410810d3d8310a6a476a8bcfd5e509869e.tar.lz yuzu-db2f0f410810d3d8310a6a476a8bcfd5e509869e.tar.xz yuzu-db2f0f410810d3d8310a6a476a8bcfd5e509869e.tar.zst yuzu-db2f0f410810d3d8310a6a476a8bcfd5e509869e.zip |
-rw-r--r-- | src/shader_recompiler/backend/glasm/emit_context.cpp | 2 | ||||
-rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm.cpp | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_context.cpp b/src/shader_recompiler/backend/glasm/emit_context.cpp index 66c954ff6..4903e9d8e 100644 --- a/src/shader_recompiler/backend/glasm/emit_context.cpp +++ b/src/shader_recompiler/backend/glasm/emit_context.cpp @@ -71,7 +71,7 @@ EmitContext::EmitContext(IR::Program& program) { if (index == 0) { Add("OUTPUT frag_color0=result.color;"); } else { - Add("OUTPUT frag_color{}[]=result.color[{}];", index, index); + Add("OUTPUT frag_color{}=result.color[{}];", index, index); } } for (size_t index = 0; index < program.info.stores_generics.size(); ++index) { diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp index 0a76423f4..0c591f73c 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp @@ -283,6 +283,10 @@ void SetupOptions(std::string& header, Info info) { if (info.uses_subgroup_shuffles) { header += "OPTION NV_shader_thread_shuffle;"; } + const auto non_zero_frag_colors{info.stores_frag_color | std::views::drop(1)}; + if (std::ranges::find(non_zero_frag_colors, true) != non_zero_frag_colors.end()) { + header += "OPTION ARB_draw_buffers;"; + } } std::string_view StageHeader(Stage stage) { |