diff --git a/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXROPEpilogue.glsl b/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXROPEpilogue.glsl index 1862a13b5e..b740ce2b28 100644 --- a/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXROPEpilogue.glsl +++ b/rpcs3/Emu/RSX/Program/GLSLSnippets/RSXProg/RSXROPEpilogue.glsl @@ -21,7 +21,7 @@ R"( if (_test_bit(rop_control, INT_FRAMEBUFFER_BIT)) { col0 = round_to_8bit(col0); - col1 = round_to_8bit(col1); + col1 = round_to_8bit(col1); col2 = round_to_8bit(col2); col3 = round_to_8bit(col3); } @@ -49,10 +49,21 @@ R"( #endif #ifdef _ENABLE_PROGRAMMABLE_BLENDING - col0 = do_blend(col0, mrt_color[0]); - if (framebufferCount > 1) col1 = do_blend(col1, mrt_color[1]); - if (framebufferCount > 2) col2 = do_blend(col2, mrt_color[2]); - if (framebufferCount > 3) col3 = do_blend(col3, mrt_color[3]); + switch (framebufferCount) + { + case 4: + col3 = do_blend(col3, mrt_color[3]); + // Fallthrough + case 3: + col2 = do_blend(col2, mrt_color[2]); + // Fallthrough + case 2: + col1 = do_blend(col1, mrt_color[1]); + // Fallthrough + default: + col0 = do_blend(col0, mrt_color[0]); + break; + } #endif // Commit diff --git a/rpcs3/Emu/RSX/rsx_utils.h b/rpcs3/Emu/RSX/rsx_utils.h index c38eb7d8ed..eeef27c8c2 100644 --- a/rpcs3/Emu/RSX/rsx_utils.h +++ b/rpcs3/Emu/RSX/rsx_utils.h @@ -872,10 +872,10 @@ namespace rsx static inline const std::array get_write_output_mask(rsx::surface_color_format format) { - const std::array rgba = { true, true, true, true }; - const std::array rgb = { true, true, true, false }; - const std::array rg = { true, true, false, false }; - const std::array r = { true, false, false, false }; + constexpr std::array rgba = { true, true, true, true }; + constexpr std::array rgb = { true, true, true, false }; + constexpr std::array rg = { true, true, false, false }; + constexpr std::array r = { true, false, false, false }; switch (format) {