mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-16 03:59:18 +01: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{};
|
std::shared_ptr<Texture> match{};
|
||||||
boost::container::small_vector<std::shared_ptr<Texture>, 4> matches{};
|
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) {
|
auto mappingEnd{std::upper_bound(textures.begin(), textures.end(), guestMapping, [guestMapping](const auto &value, const auto &element) {
|
||||||
return value.end() < element.end();
|
return guestMapping.end() < element.end();
|
||||||
})}, hostMapping{mappingEnd};
|
})}, hostMapping{std::lower_bound(mappingEnd, textures.end(), guestMapping, [guestMapping](const auto &value, const auto &element) {
|
||||||
|
return guestMapping.begin() < element.end();
|
||||||
|
})};
|
||||||
while (hostMapping != textures.end() && guestMapping.begin() < hostMapping->end())
|
|
||||||
hostMapping++;
|
|
||||||
|
|
||||||
std::shared_ptr<Texture> fullMatch{};
|
std::shared_ptr<Texture> fullMatch{};
|
||||||
std::shared_ptr<Texture> layerMipMatch{};
|
std::shared_ptr<Texture> layerMipMatch{};
|
||||||
|
Loading…
Reference in New Issue
Block a user