mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-28 07:25:32 +03:00
Use lower_bound to speedup texture hostMapping lookup
This commit is contained in:
parent
e7fda28ac6
commit
b6f49884b3
@ -25,13 +25,11 @@ namespace skyline::gpu {
|
||||
|
||||
std::shared_ptr<Texture> match{};
|
||||
boost::container::small_vector<std::shared_ptr<Texture>, 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<Texture> fullMatch{};
|
||||
std::shared_ptr<Texture> layerMipMatch{};
|
||||
|
Loading…
Reference in New Issue
Block a user