mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-20 16:37:03 +00:00
implement sampler cache
This commit is contained in:
parent
9982ac7acb
commit
d79d7fea63
7 changed files with 181 additions and 122 deletions
21
src/Cafe/HW/Latte/Renderer/Metal/MetalSamplerCache.h
Normal file
21
src/Cafe/HW/Latte/Renderer/Metal/MetalSamplerCache.h
Normal 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);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue