mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
Fix off-by-one error in get_intersecting_set
When the trampled range changes, get_intersecting_set restarts the outer loop. However, due to an off-by-one error, it skips the first cache entry when doing so. This can cause a texture not to be correctly unlocked, which could lead to issues or even deadlocks. This commit fixes this off-by-one error.
This commit is contained in:
parent
f82ce06fdc
commit
b534d49e48
1 changed files with 7 additions and 1 deletions
|
@ -572,7 +572,8 @@ namespace rsx
|
||||||
std::pair<u32, u32> trampled_range = std::make_pair(address, address + range);
|
std::pair<u32, u32> trampled_range = std::make_pair(address, address + range);
|
||||||
const bool strict_range_check = g_cfg.video.write_color_buffers || g_cfg.video.write_depth_buffer;
|
const bool strict_range_check = g_cfg.video.write_color_buffers || g_cfg.video.write_depth_buffer;
|
||||||
|
|
||||||
for (auto It = m_cache.begin(); It != m_cache.end(); It++)
|
auto It = m_cache.begin();
|
||||||
|
while(It != m_cache.end())
|
||||||
{
|
{
|
||||||
auto &range_data = It->second;
|
auto &range_data = It->second;
|
||||||
const u32 base = It->first;
|
const u32 base = It->first;
|
||||||
|
@ -585,8 +586,11 @@ namespace rsx
|
||||||
{
|
{
|
||||||
//Only if a valid range, ignore empty sets
|
//Only if a valid range, ignore empty sets
|
||||||
if (trampled_range.first >= (range_data.max_addr + range_data.max_range) || range_data.min_addr >= trampled_range.second)
|
if (trampled_range.first >= (range_data.max_addr + range_data.max_range) || range_data.min_addr >= trampled_range.second)
|
||||||
|
{
|
||||||
|
It++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < range_data.data.size(); i++)
|
for (int i = 0; i < range_data.data.size(); i++)
|
||||||
{
|
{
|
||||||
|
@ -621,6 +625,8 @@ namespace rsx
|
||||||
last_dirty_block = base;
|
last_dirty_block = base;
|
||||||
It = m_cache.begin();
|
It = m_cache.begin();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
It++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue