rsx: Force invalidate of children by issuing a resolve notification whenever the parent is written to

- Fixes successive reads of an antialiased surface that is still bound between reads
This commit is contained in:
kd-11 2019-06-11 20:06:48 +03:00 committed by kd-11
commit 9d166c5bed
2 changed files with 26 additions and 1 deletions

View file

@ -58,6 +58,8 @@ namespace rsx
rsx::address_range m_render_targets_memory_range;
rsx::address_range m_depth_stencil_memory_range;
bool m_invalidate_on_write = false;
public:
std::pair<u8, u8> m_bound_render_targets_config = {};
std::array<std::pair<u32, surface_type>, 4> m_bound_render_targets = {};
@ -531,6 +533,7 @@ namespace rsx
u32 clip_height = clip_vertical_reg;
cache_tag = rsx::get_shared_tag();
m_invalidate_on_write = (antialias != rsx::surface_antialiasing::center_1_sample);
// Make previous RTTs sampleable
for (int i = m_bound_render_targets_config.first, count = 0;
@ -800,7 +803,21 @@ namespace rsx
{
if (write_tag == cache_tag)
{
// Nothing to do
if (m_invalidate_on_write)
{
for (int i = m_bound_render_targets_config.first, count = 0;
count < m_bound_render_targets_config.second;
++i, ++count)
{
m_bound_render_targets[i].second->on_invalidate_children();
}
if (m_bound_depth_stencil.first)
{
m_bound_depth_stencil.second->on_invalidate_children();
}
}
return;
}
else

View file

@ -474,6 +474,14 @@ namespace rsx
}
}
void on_invalidate_children()
{
if (resolve_surface)
{
msaa_flags = rsx::surface_state_flags::require_resolve;
}
}
// Returns the rect area occupied by this surface expressed as an 8bpp image with no AA
areau get_normalized_memory_area() const
{