create stack scoped helper macro

This commit is contained in:
Samuliak 2025-01-25 08:59:48 +01:00
parent b50b9135a0
commit 14f42fc653
No known key found for this signature in database
10 changed files with 39 additions and 64 deletions

View file

@ -21,7 +21,7 @@ MTL::SamplerState* MetalSamplerCache::GetSamplerState(const LatteContextRegister
// Sampler state
const _LatteRegisterSetSampler* samplerWords = lcr.SQ_TEX_SAMPLER + samplerIndex;
MTL::SamplerDescriptor* samplerDescriptor = MTL::SamplerDescriptor::alloc()->init();
NS_STACK_SCOPED MTL::SamplerDescriptor* samplerDescriptor = MTL::SamplerDescriptor::alloc()->init();
// lod
uint32 iMinLOD = samplerWords->WORD1.get_MIN_LOD();
@ -115,7 +115,6 @@ MTL::SamplerState* MetalSamplerCache::GetSamplerState(const LatteContextRegister
}
samplerState = m_mtlr->GetDevice()->newSamplerState(samplerDescriptor);
samplerDescriptor->release();
return samplerState;
}