diff options
| author | 2021-06-16 04:48:05 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:38 -0400 | |
| commit | 892b8aa2adbadf1935aa5e9d87abbc686702cb2c (patch) | |
| tree | 301f819f20c27a14b111f8d94e6ba2b9433e2f36 /src/shader_recompiler/backend | |
| parent | shader: Split profile and runtime info headers (diff) | |
| download | yuzu-892b8aa2adbadf1935aa5e9d87abbc686702cb2c.tar.gz yuzu-892b8aa2adbadf1935aa5e9d87abbc686702cb2c.tar.xz yuzu-892b8aa2adbadf1935aa5e9d87abbc686702cb2c.zip | |
glsl: Only declare fragment outputs on fragment shaders
Diffstat (limited to 'src/shader_recompiler/backend')
| -rw-r--r-- | src/shader_recompiler/backend/glsl/emit_context.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp index 93057ebb9..bd40356a1 100644 --- a/src/shader_recompiler/backend/glsl/emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/emit_context.cpp | |||
| @@ -340,11 +340,13 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile | |||
| 340 | const auto qualifier{stage == Stage::TessellationControl ? "out" : "in"}; | 340 | const auto qualifier{stage == Stage::TessellationControl ? "out" : "in"}; |
| 341 | header += fmt::format("layout(location={})patch {} vec4 patch{};", index, qualifier, index); | 341 | header += fmt::format("layout(location={})patch {} vec4 patch{};", index, qualifier, index); |
| 342 | } | 342 | } |
| 343 | for (size_t index = 0; index < info.stores_frag_color.size(); ++index) { | 343 | if (stage == Stage::Fragment) { |
| 344 | if (!info.stores_frag_color[index] && !profile.need_declared_frag_colors) { | 344 | for (size_t index = 0; index < info.stores_frag_color.size(); ++index) { |
| 345 | continue; | 345 | if (!info.stores_frag_color[index] && !profile.need_declared_frag_colors) { |
| 346 | continue; | ||
| 347 | } | ||
| 348 | header += fmt::format("layout(location={})out vec4 frag_color{};", index, index); | ||
| 346 | } | 349 | } |
| 347 | header += fmt::format("layout(location={})out vec4 frag_color{};", index, index); | ||
| 348 | } | 350 | } |
| 349 | for (size_t index = 0; index < info.stores_generics.size(); ++index) { | 351 | for (size_t index = 0; index < info.stores_generics.size(); ++index) { |
| 350 | // TODO: Properly resolve attribute issues | 352 | // TODO: Properly resolve attribute issues |