Texture caching stuff pt1

This commit is contained in:
wheremyfoodat 2025-01-03 18:27:19 +02:00
parent 0c6c455d4d
commit fe6fc4cfa3
6 changed files with 52 additions and 1 deletions

View file

@ -104,4 +104,19 @@ public:
const SurfaceType& operator[](size_t i) const {
return buffer[i];
}
void invalidateRegion(u32 start, u32 size) {
if (size == 0) {
return;
}
boost::icl::right_open_interval<u32> interval(start, start + size);
for (auto& e : buffer) {
if (e.valid && boost::icl::intersects(e.range, interval)) {
e.valid = false;
e.free();
}
}
}
};