diff --git a/src/common/range_sets.inc b/src/common/range_sets.inc index 3edd8c8a43..31382f5c51 100644 --- a/src/common/range_sets.inc +++ b/src/common/range_sets.inc @@ -116,28 +116,25 @@ struct OverlapRangeSet::OverlapRangeSetImpl { } AddressType end_address = base_address + static_cast(size); IntervalType interval{base_address, end_address}; - bool any_removals = false; m_split_ranges_set += std::make_pair(interval, -amount); - do { - any_removals = false; - auto it = m_split_ranges_set.lower_bound(interval); - if (it == m_split_ranges_set.end()) { - return; - } - auto end_it = m_split_ranges_set.upper_bound(interval); - for (; it != end_it; it++) { - if (it->second <= 0) { - if constexpr (has_on_delete) { - if (it->second == 0) { - on_delete(it->first.lower(), it->first.upper()); - } + auto it = m_split_ranges_set.lower_bound(interval); + if (it == m_split_ranges_set.end()) { + return; + } + auto end_it = m_split_ranges_set.upper_bound(interval); + while (it != end_it) { + if (it->second <= 0) { + if constexpr (has_on_delete) { + if (it->second == 0) { + on_delete(it->first.lower(), it->first.upper()); } - any_removals = true; - m_split_ranges_set.erase(it); - break; } + auto to_erase = it++; + m_split_ranges_set.erase(to_erase); + continue; } - } while (any_removals); + ++it; + } } template diff --git a/src/video_core/gpu_thread.h b/src/video_core/gpu_thread.h index dc0fce9f82..90c455fdd9 100644 --- a/src/video_core/gpu_thread.h +++ b/src/video_core/gpu_thread.h @@ -89,7 +89,7 @@ struct CommandDataContainer { /// Struct used to synchronize the GPU thread struct SynchState final { - using CommandQueue = Common::MPSCQueue; + using CommandQueue = Common::SPSCQueue; std::mutex write_lock; CommandQueue queue; u64 last_fence{};