diff --git a/rpcs3/Emu/RSX/rsx_decode.h b/rpcs3/Emu/RSX/rsx_decode.h index 6874968163..1e361d56e5 100644 --- a/rpcs3/Emu/RSX/rsx_decode.h +++ b/rpcs3/Emu/RSX/rsx_decode.h @@ -3335,6 +3335,11 @@ struct registers_decoder { return bf_decoder<24, 8>(value); } + + bool is_integer_color_format() const + { + return color_fmt() < surface_color_format::w16z16y16x16; + } }; static std::string dump(const decoded_type& decoded) diff --git a/rpcs3/Emu/RSX/rsx_methods.cpp b/rpcs3/Emu/RSX/rsx_methods.cpp index 14f37e793f..e588697a8c 100644 --- a/rpcs3/Emu/RSX/rsx_methods.cpp +++ b/rpcs3/Emu/RSX/rsx_methods.cpp @@ -801,12 +801,16 @@ namespace rsx void set_surface_format(thread* rsx, u32 reg, u32 arg) { - // Special consideration - antialiasing control can affect ROP state - const auto aa_mask = (0xF << 12); - if ((arg & aa_mask) != (method_registers.register_previous_value & aa_mask)) + if (reg == NV4097_SET_SURFACE_FORMAT) { - // Antialias control has changed, update ROP parameters - rsx->m_graphics_state |= rsx::pipeline_state::fragment_state_dirty; + const auto current = method_registers.decode(arg); + const auto previous = method_registers.decode(method_registers.register_previous_value); + + if (current.antialias() != previous.antialias() || // Antialias control has changed, update ROP parameters + current.is_integer_color_format() != previous.is_integer_color_format()) // The type of color format also requires ROP control update + { + rsx->m_graphics_state |= rsx::pipeline_state::fragment_state_dirty; + } } set_surface_dirty_bit(rsx, reg, arg); diff --git a/rpcs3/Emu/RSX/rsx_methods.h b/rpcs3/Emu/RSX/rsx_methods.h index f9bce70ea6..88e7a02d87 100644 --- a/rpcs3/Emu/RSX/rsx_methods.h +++ b/rpcs3/Emu/RSX/rsx_methods.h @@ -454,6 +454,12 @@ namespace rsx return decoded_type(register_value); } + template + decoded_type decode(u32 register_value) const + { + return decoded_type(register_value); + } + rsx_state& operator=(const rsx_state& in) { registers = in.registers;