Fix render-texture cache lookups

`[32bit loc | 32bit attributes]`
Use `std::map::lower_bound(loc << 32)` to find the first address that matches the key in O(logn) time, finer grained searchs can happen after the fact in O(n) time.

Fixes render-texture cache lookups
This commit is contained in:
Wunkolo 2023-08-24 10:39:53 -07:00
parent be5ebeefed
commit d781802eb0
2 changed files with 14 additions and 18 deletions

View file

@ -76,9 +76,6 @@ class RendererVK final : public Renderer {
// Hash(loc, size, format) -> Texture
std::map<u64, Texture> textureCache;
static u32 colorBufferHash(u32 loc, u32 size, PICA::ColorFmt format);
static u32 depthBufferHash(u32 loc, u32 size, PICA::DepthFmt format);
Texture* findColorRenderTexture(u32 addr);
Texture& getColorRenderTexture(u32 addr, PICA::ColorFmt format, u32 width, u32 height);
Texture& getDepthRenderTexture(u32 addr, PICA::DepthFmt format, u32 width, u32 height);