diff --git a/app/src/main/cpp/skyline/gpu/texture_manager.cpp b/app/src/main/cpp/skyline/gpu/texture_manager.cpp index 5880d575..d259533f 100644 --- a/app/src/main/cpp/skyline/gpu/texture_manager.cpp +++ b/app/src/main/cpp/skyline/gpu/texture_manager.cpp @@ -25,13 +25,11 @@ namespace skyline::gpu { std::shared_ptr match{}; boost::container::small_vector, 4> matches{}; - auto mappingEnd{std::upper_bound(textures.begin(), textures.end(), guestMapping, [](const auto &value, const auto &element) { - return value.end() < element.end(); - })}, hostMapping{mappingEnd}; - - - while (hostMapping != textures.end() && guestMapping.begin() < hostMapping->end()) - hostMapping++; + auto mappingEnd{std::upper_bound(textures.begin(), textures.end(), guestMapping, [guestMapping](const auto &value, const auto &element) { + return guestMapping.end() < element.end(); + })}, hostMapping{std::lower_bound(mappingEnd, textures.end(), guestMapping, [guestMapping](const auto &value, const auto &element) { + return guestMapping.begin() < element.end(); + })}; std::shared_ptr fullMatch{}; std::shared_ptr layerMipMatch{};