Mark unsync textures dirty when deferred flushing

invalidate_range_impl_base does not mark all textures that will only be
unprotected as dirty when doing a deferred flush, since that is done by
flush_all.

However, if there are no sections to flush, the deferred flush will
use the same code path as non-deferred flushes for unprotecting textures
and forget to mark them as dirty.

This commit fixes this bug.
This commit is contained in:
Rui Pinheiro 2018-08-13 20:40:32 +01:00 committed by kd-11
parent fa6a5761b3
commit 23b52e1b1c
1 changed files with 5 additions and 1 deletions

View File

@ -739,6 +739,9 @@ namespace rsx
else if (deferred_flush) else if (deferred_flush)
{ {
//allow_flush = false and not synchronized //allow_flush = false and not synchronized
obj.first->set_dirty(true);
m_unreleased_texture_objects++;
result.sections_to_unprotect.push_back(obj.first); result.sections_to_unprotect.push_back(obj.first);
continue; continue;
} }
@ -776,6 +779,7 @@ namespace rsx
//Flushes happen in one go, now its time to remove protection //Flushes happen in one go, now its time to remove protection
for (auto& section : result.sections_to_unprotect) for (auto& section : result.sections_to_unprotect)
{ {
verify(HERE), section->is_flushed() || section->is_dirty();
section->unprotect(); section->unprotect();
m_cache[get_block_address(section->get_section_base())].remove_one(); m_cache[get_block_address(section->get_section_base())].remove_one();
} }
@ -1265,7 +1269,7 @@ namespace rsx
{ {
if (tex->is_locked()) if (tex->is_locked())
{ {
tex->set_dirty(true); verify(HERE), tex->is_dirty();
tex->unprotect(); tex->unprotect();
m_cache[get_block_address(tex->get_section_base())].remove_one(); m_cache[get_block_address(tex->get_section_base())].remove_one();
} }