diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-01-24 05:15:50 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-01-24 05:16:21 +0100 |
commit | 1690f1adba2c6971256d939f260d865689f517ce (patch) | |
tree | c604933e3b3d201931affbc90a8dcf1bb7f7e479 /src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | |
parent | Merge pull request #3330 from ReinUsesLisp/vk-blit-screen (diff) | |
download | yuzu-1690f1adba2c6971256d939f260d865689f517ce.tar yuzu-1690f1adba2c6971256d939f260d865689f517ce.tar.gz yuzu-1690f1adba2c6971256d939f260d865689f517ce.tar.bz2 yuzu-1690f1adba2c6971256d939f260d865689f517ce.tar.lz yuzu-1690f1adba2c6971256d939f260d865689f517ce.tar.xz yuzu-1690f1adba2c6971256d939f260d865689f517ce.tar.zst yuzu-1690f1adba2c6971256d939f260d865689f517ce.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_shader_decompiler.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp index dd6d2ef03..b53078721 100644 --- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp +++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp @@ -542,11 +542,10 @@ private: return; } - for (u32 rt = 0; rt < static_cast<u32>(frag_colors.size()); ++rt) { - if (!specialization.enabled_rendertargets[rt]) { + for (u32 rt = 0; rt < static_cast<u32>(std::size(frag_colors)); ++rt) { + if (!IsRenderTargetEnabled(rt)) { continue; } - const Id id = AddGlobalVariable(OpVariable(t_out_float4, spv::StorageClass::Output)); Name(id, fmt::format("frag_color{}", rt)); Decorate(id, spv::Decoration::Location, rt); @@ -852,6 +851,15 @@ private: return binding; } + bool IsRenderTargetEnabled(u32 rt) const { + for (u32 component = 0; component < 4; ++component) { + if (header.ps.IsColorComponentOutputEnabled(rt, component)) { + return true; + } + } + return false; + } + bool IsInputAttributeArray() const { return stage == ShaderType::TesselationControl || stage == ShaderType::TesselationEval || stage == ShaderType::Geometry; @@ -1889,19 +1897,14 @@ private: // rendertargets/components are skipped in the register assignment. u32 current_reg = 0; for (u32 rt = 0; rt < Maxwell::NumRenderTargets; ++rt) { - if (!specialization.enabled_rendertargets[rt]) { - // Skip rendertargets that are not enabled - continue; - } // TODO(Subv): Figure out how dual-source blending is configured in the Switch. for (u32 component = 0; component < 4; ++component) { - const Id pointer = AccessElement(t_out_float, frag_colors.at(rt), component); - if (header.ps.IsColorComponentOutputEnabled(rt, component)) { - OpStore(pointer, SafeGetRegister(current_reg)); - ++current_reg; - } else { - OpStore(pointer, component == 3 ? v_float_one : v_float_zero); + if (!header.ps.IsColorComponentOutputEnabled(rt, component)) { + continue; } + const Id pointer = AccessElement(t_out_float, frag_colors[rt], component); + OpStore(pointer, SafeGetRegister(current_reg)); + ++current_reg; } } if (header.ps.omap.depth) { |