mirror of
https://github.com/yuzu-mirror/yuzu.git
synced 2024-11-18 07:47:32 +01:00
Implement GetInRange in the Rasterizer Cache
This commit is contained in:
parent
fd9e2d0073
commit
dbc34db6ce
@ -105,6 +105,22 @@ protected:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<T> GetInRange(Tegra::GPUVAddr addr, size_t size) {
|
||||
std::vector<T> objects;
|
||||
if (size == 0)
|
||||
return objects;
|
||||
|
||||
const ObjectInterval interval{addr, addr + size};
|
||||
for (auto& pair : boost::make_iterator_range(object_cache.equal_range(interval))) {
|
||||
for (auto& cached_object : pair.second) {
|
||||
if (!cached_object)
|
||||
continue;
|
||||
objects.push_back(cached_object);
|
||||
}
|
||||
}
|
||||
return objects;
|
||||
}
|
||||
|
||||
/// Register an object into the cache
|
||||
void Register(const T& object) {
|
||||
object->SetIsRegistered(true);
|
||||
|
Loading…
Reference in New Issue
Block a user