rsx: Add eng lock before flagging memory unmap

- This is much better than polling on atomics every cycle for something that happens a few times during gameplay
This commit is contained in:
kd-11 2022-05-16 22:20:40 +03:00 committed by kd-11
parent 93d93b4805
commit 257556bbf5
1 changed files with 3 additions and 0 deletions

View File

@ -2945,6 +2945,9 @@ namespace rsx
const bool existing_range_valid = m_invalidated_memory_range.valid(); const bool existing_range_valid = m_invalidated_memory_range.valid();
const auto unmap_range = address_range::start_length(address, size); const auto unmap_range = address_range::start_length(address, size);
// Pause RSX thread momentarily to handle unmapping
eng_lock elock(this);
if (existing_range_valid && m_invalidated_memory_range.touches(unmap_range)) if (existing_range_valid && m_invalidated_memory_range.touches(unmap_range))
{ {
// Merge range-to-invalidate in case of consecutive unmaps // Merge range-to-invalidate in case of consecutive unmaps