1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 18:53:28 +01:00

rsx: Propagate surface format changes to shader ROP control

This commit is contained in:
kd-11 2022-12-19 21:01:01 +03:00 committed by kd-11
parent 1a60fb3c96
commit 388d090b91
3 changed files with 20 additions and 5 deletions

View File

@ -3335,6 +3335,11 @@ struct registers_decoder<NV4097_SET_SURFACE_FORMAT>
{
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)

View File

@ -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<NV4097_SET_SURFACE_FORMAT>(arg);
const auto previous = method_registers.decode<NV4097_SET_SURFACE_FORMAT>(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);

View File

@ -454,6 +454,12 @@ namespace rsx
return decoded_type<opcode>(register_value);
}
template<u32 opcode>
decoded_type<opcode> decode(u32 register_value) const
{
return decoded_type<opcode>(register_value);
}
rsx_state& operator=(const rsx_state& in)
{
registers = in.registers;