mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-19 20:19:13 +12:00
Texture caching stuff pt1
This commit is contained in:
parent
0c6c455d4d
commit
fe6fc4cfa3
6 changed files with 52 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue