diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/shader_recompiler/frontend/maxwell/translate/impl/exit_program.cpp | 3 | ||||
| -rw-r--r-- | src/shader_recompiler/program_header.h | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/exit_program.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/exit_program.cpp index 1abe0dda6..537b5bde2 100644 --- a/src/shader_recompiler/frontend/maxwell/translate/impl/exit_program.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate/impl/exit_program.cpp | |||
| @@ -12,6 +12,9 @@ void ExitFragment(TranslatorVisitor& v) { | |||
| 12 | const ProgramHeader sph{v.env.SPH()}; | 12 | const ProgramHeader sph{v.env.SPH()}; |
| 13 | IR::Reg src_reg{IR::Reg::R0}; | 13 | IR::Reg src_reg{IR::Reg::R0}; |
| 14 | for (u32 render_target = 0; render_target < 8; ++render_target) { | 14 | for (u32 render_target = 0; render_target < 8; ++render_target) { |
| 15 | if (!sph.ps.HasOutputComponents(render_target)) { | ||
| 16 | continue; | ||
| 17 | } | ||
| 15 | const std::array<bool, 4> mask{sph.ps.EnabledOutputComponents(render_target)}; | 18 | const std::array<bool, 4> mask{sph.ps.EnabledOutputComponents(render_target)}; |
| 16 | for (u32 component = 0; component < 4; ++component) { | 19 | for (u32 component = 0; component < 4; ++component) { |
| 17 | if (!mask[component]) { | 20 | if (!mask[component]) { |
diff --git a/src/shader_recompiler/program_header.h b/src/shader_recompiler/program_header.h index bd6c2bfb5..5e42ab5a3 100644 --- a/src/shader_recompiler/program_header.h +++ b/src/shader_recompiler/program_header.h | |||
| @@ -196,6 +196,11 @@ struct ProgramHeader { | |||
| 196 | return {(bits & 1) != 0, (bits & 2) != 0, (bits & 4) != 0, (bits & 8) != 0}; | 196 | return {(bits & 1) != 0, (bits & 2) != 0, (bits & 4) != 0, (bits & 8) != 0}; |
| 197 | } | 197 | } |
| 198 | 198 | ||
| 199 | [[nodiscard]] bool HasOutputComponents(u32 rt) const noexcept { | ||
| 200 | const u32 bits{omap.target >> (rt * 4)}; | ||
| 201 | return bits & (1 | 2 | 4 | 8); | ||
| 202 | } | ||
| 203 | |||
| 199 | [[nodiscard]] std::array<PixelImap, 4> GenericInputMap(u32 attribute) const { | 204 | [[nodiscard]] std::array<PixelImap, 4> GenericInputMap(u32 attribute) const { |
| 200 | const auto& vector{imap_generic_vector[attribute]}; | 205 | const auto& vector{imap_generic_vector[attribute]}; |
| 201 | return {vector.x, vector.y, vector.z, vector.w}; | 206 | return {vector.x, vector.y, vector.z, vector.w}; |