mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-22 15:05:46 +00:00
texture_cache: Avoid unnecessary surface copies within PickStrategy() and TryReconstructSurface()
We can take these by const reference and avoid making unnecessary copies, preventing some atomic reference count increments and decrements.
This commit is contained in:
parent
32588f88da
commit
1a9c05b197
1 changed files with 2 additions and 2 deletions
|
@ -402,7 +402,7 @@ private:
|
|||
if (params.block_depth > 1 || params.target == SurfaceTarget::Texture3D) {
|
||||
return RecycleStrategy::Flush;
|
||||
}
|
||||
for (auto s : overlaps) {
|
||||
for (const auto& s : overlaps) {
|
||||
const auto& s_params = s->GetSurfaceParams();
|
||||
if (s_params.block_depth > 1 || s_params.target == SurfaceTarget::Texture3D) {
|
||||
return RecycleStrategy::Flush;
|
||||
|
@ -575,7 +575,7 @@ private:
|
|||
} else if (Settings::values.use_accurate_gpu_emulation && passed_tests != overlaps.size()) {
|
||||
return {};
|
||||
}
|
||||
for (auto surface : overlaps) {
|
||||
for (const auto& surface : overlaps) {
|
||||
Unregister(surface);
|
||||
}
|
||||
new_surface->MarkAsModified(modified, Tick());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue