mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
VideoBackends:Metal: Create samplers on demand
This commit is contained in:
@ -76,13 +76,19 @@ public:
|
||||
|
||||
id<MTLDepthStencilState> GetDepthStencil(DepthStencilSelector sel) { return m_dss[sel.value]; }
|
||||
|
||||
id<MTLSamplerState> GetSampler(SamplerSelector sel) { return m_samplers[sel.value]; }
|
||||
id<MTLSamplerState> GetSampler(SamplerSelector sel)
|
||||
{
|
||||
if (__builtin_expect(!m_samplers[sel.value], false))
|
||||
m_samplers[sel.value] = CreateSampler(sel);
|
||||
return m_samplers[sel.value];
|
||||
}
|
||||
|
||||
id<MTLSamplerState> GetSampler(SamplerState state) { return GetSampler(SamplerSelector(state)); }
|
||||
|
||||
void ReloadSamplers();
|
||||
|
||||
private:
|
||||
MRCOwned<id<MTLSamplerState>> CreateSampler(SamplerSelector sel);
|
||||
MRCOwned<id<MTLDepthStencilState>> m_dss[DepthStencilSelector::N_VALUES];
|
||||
MRCOwned<id<MTLSamplerState>> m_samplers[SamplerSelector::N_VALUES];
|
||||
};
|
||||
|
Reference in New Issue
Block a user