From 21d725daa584fc1a12de592005f75665caba10de Mon Sep 17 00:00:00 2001 From: Eladash Date: Sat, 2 Jan 2021 09:51:39 +0200 Subject: [PATCH] rsx: Fix shader cache of 2 or less pipelines --- rpcs3/Emu/RSX/rsx_cache.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/RSX/rsx_cache.h b/rpcs3/Emu/RSX/rsx_cache.h index 1cea35906c..c793adabf7 100644 --- a/rpcs3/Emu/RSX/rsx_cache.h +++ b/rpcs3/Emu/RSX/rsx_cache.h @@ -596,9 +596,9 @@ namespace rsx return; } - u32 entry_count = 0; std::vector entries; - for (auto It = root.begin(); It != root.end(); ++It, entry_count++) + + for (auto&& tmp : root) { if (tmp.is_directory) continue; @@ -606,7 +606,9 @@ namespace rsx entries.push_back(tmp); } - if ((entry_count = ::size32(entries)) <= 2) + u32 entry_count = ::size32(entries); + + if (!entry_count) return; root.rewind();