summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glasm/emit_context.cpp
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-05-30 03:40:19 -0300
committerGravatar ameerj2021-07-22 21:51:34 -0400
commit916ca7432474e891864524dcbc6c879d5cdbfb72 (patch)
tree07ff6cc3f9737b20b4e65786f94cabe1dd3b254f /src/shader_recompiler/backend/glasm/emit_context.cpp
parentbuffer_cache: Mark uniform buffers as dirty if any enable bit changes (diff)
downloadyuzu-916ca7432474e891864524dcbc6c879d5cdbfb72.tar.gz
yuzu-916ca7432474e891864524dcbc6c879d5cdbfb72.tar.xz
yuzu-916ca7432474e891864524dcbc6c879d5cdbfb72.zip
opengl: Declare fragment outputs even if they are not used
Fixes Ori and the Blind Forest's menu on GLASM. For some reason (probably high level optimizations) it is not sanitized on SPIR-V for OpenGL. Vulkan is unaffected by this change.
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_context.cpp')
-rw-r--r--src/shader_recompiler/backend/glasm/emit_context.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_context.cpp b/src/shader_recompiler/backend/glasm/emit_context.cpp
index e18526816..08918a5c2 100644
--- a/src/shader_recompiler/backend/glasm/emit_context.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_context.cpp
@@ -117,13 +117,9 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
117 index, index); 117 index, index);
118 } 118 }
119 } 119 }
120 for (size_t index = 0; index < info.stores_frag_color.size(); ++index) { 120 if (stage == Stage::Fragment) {
121 if (!info.stores_frag_color[index]) { 121 Add("OUTPUT frag_color0=result.color;");
122 continue; 122 for (size_t index = 1; index < info.stores_frag_color.size(); ++index) {
123 }
124 if (index == 0) {
125 Add("OUTPUT frag_color0=result.color;");
126 } else {
127 Add("OUTPUT frag_color{}=result.color[{}];", index, index); 123 Add("OUTPUT frag_color{}=result.color[{}];", index, index);
128 } 124 }
129 } 125 }