choose the closest matching sampler border color

This commit is contained in:
Samuliak 2025-01-26 10:23:07 +01:00
parent 0c216e40e0
commit 24e1bba31c
No known key found for this signature in database
3 changed files with 63 additions and 18 deletions

View file

@ -2,6 +2,7 @@
#include <Metal/Metal.hpp>
#include "HW/Latte/Core/LatteConst.h"
#include "HW/Latte/ISA/LatteReg.h"
class MetalSamplerCache
@ -10,12 +11,12 @@ public:
MetalSamplerCache(class MetalRenderer* metalRenderer) : m_mtlr{metalRenderer} {}
~MetalSamplerCache();
MTL::SamplerState* GetSamplerState(const LatteContextRegister& lcr, uint32 samplerIndex);
MTL::SamplerState* GetSamplerState(const LatteContextRegister& lcr, LatteConst::ShaderType shaderType, uint32 stageSamplerIndex);
private:
class MetalRenderer* m_mtlr;
std::map<uint64, MTL::SamplerState*> m_samplerCache;
uint64 CalculateSamplerHash(const LatteContextRegister& lcr, uint32 samplerIndex);
uint64 CalculateSamplerHash(const LatteContextRegister& lcr, LatteConst::ShaderType shaderType, uint32 stageSamplerIndex, uint32 samplerIndex);
};