From 500f817a2842acdc5a29ae65e91e80056596abbd Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sun, 9 Oct 2022 16:34:49 +0100 Subject: [PATCH] Synchronize all non-matching textures back to host before recreation --- app/src/main/cpp/skyline/gpu/texture_manager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/cpp/skyline/gpu/texture_manager.cpp b/app/src/main/cpp/skyline/gpu/texture_manager.cpp index 64070598..1147f7ca 100644 --- a/app/src/main/cpp/skyline/gpu/texture_manager.cpp +++ b/app/src/main/cpp/skyline/gpu/texture_manager.cpp @@ -24,6 +24,7 @@ namespace skyline::gpu { */ std::shared_ptr match{}; + boost::container::small_vector, 4> matches{}; auto mappingEnd{std::upper_bound(textures.begin(), textures.end(), guestMapping)}, hostMapping{mappingEnd}; while (hostMapping != textures.begin() && (--hostMapping)->end() > guestMapping.begin()) { auto &hostMappings{hostMapping->texture->guest->mappings}; @@ -58,6 +59,8 @@ namespace skyline::gpu { .levelCount = guestTexture.viewMipCount, .layerCount = guestTexture.GetViewLayerCount(), }, guestTexture.format, guestTexture.swizzle); + } else { + matches.push_back(hostMapping->texture); } } /* else if (mappingMatch) { // We've gotten a partial match with a certain subset of contiguous mappings matching, we need to check if this is a meaningful overlap @@ -73,6 +76,9 @@ namespace skyline::gpu { } */ } + for (auto &texture : matches) + texture->SynchronizeGuest(false, true); + // Create a texture as we cannot find one that matches auto texture{std::make_shared(gpu, guestTexture)}; texture->SetupGuestMappings();