mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-18 10:36:59 +00:00
22 lines
649 B
C++
22 lines
649 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);
|
|
|
|
private:
|
|
class MetalRenderer* m_mtlr;
|
|
|
|
std::map<uint64, MTL::SamplerState*> m_samplerCache;
|
|
|
|
uint64 CalculateSamplerHash(const LatteContextRegister& lcr, LatteConst::ShaderType shaderType, uint32 stageSamplerIndex, uint32 samplerIndex);
|
|
};
|