Cemu/src/Cafe/HW/Latte/Renderer/Metal/MetalSamplerCache.h
SamoZ256 26e40a4bce
Some checks are pending
Build check / build (push) Waiting to run
Generate translation template / generate-pot (push) Waiting to run
Add Metal backend (#1287)
2025-12-06 17:14:25 +01:00

23 lines
720 B
C++

#pragma once
#include <Metal/Metal.hpp>
#include "HW/Latte/Core/LatteConst.h"
#include "HW/Latte/ISA/LatteReg.h"
class MetalSamplerCache
{
public:
MetalSamplerCache(class MetalRenderer* metalRenderer) : m_mtlr{metalRenderer} {}
~MetalSamplerCache();
MTL::SamplerState* GetSamplerState(const LatteContextRegister& lcr, LatteConst::ShaderType shaderType, uint32 stageSamplerIndex, const _LatteRegisterSetSampler* samplerWords);
private:
class MetalRenderer* m_mtlr;
std::map<uint64, MTL::SamplerState*> m_samplerCache;
uint64 CalculateSamplerHash(const LatteContextRegister& lcr, LatteConst::ShaderType shaderType, uint32 stageSamplerIndex, const _LatteRegisterSetSampler* samplerWords);
};