implement sampler cache

This commit is contained in:
Samuliak 2024-08-15 11:44:06 +02:00
parent 9982ac7acb
commit d79d7fea63
7 changed files with 181 additions and 122 deletions

View file

@ -0,0 +1,21 @@
#pragma once
#include <Metal/Metal.hpp>
#include "HW/Latte/ISA/LatteReg.h"
class MetalSamplerCache
{
public:
MetalSamplerCache(class MetalRenderer* metalRenderer) : m_mtlr{metalRenderer} {}
~MetalSamplerCache();
MTL::SamplerState* GetSamplerState(const LatteContextRegister& lcr, uint32 samplerIndex);
private:
class MetalRenderer* m_mtlr;
std::map<uint64, MTL::SamplerState*> m_samplerCache;
uint64 CalculateSamplerHash(const LatteContextRegister& lcr, uint32 samplerIndex);
};