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

@ -172,6 +172,7 @@ class RendererGL final : public Renderer {
void textureCopy(u32 inputAddr, u32 outputAddr, u32 totalBytes, u32 inputSize, u32 outputSize, u32 flags) override;
void drawVertices(PICA::PrimType primType, std::span<const PICA::Vertex> vertices) override; // Draw the given vertices
void deinitGraphicsContext() override;
void invalidateRegion(u32 start, u32 size) override;
virtual bool supportsShaderReload() override { return true; }
virtual std::string getUbershader() override;

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();
}
}
}
};