mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-15 07:00:58 +00:00
Only add valid entries to the binding sets
This commit is contained in:
parent
a63c5ba5f1
commit
f1a499093f
1 changed files with 22 additions and 0 deletions
|
@ -60,6 +60,7 @@ nvrhi::BindingSetHandle BindingCache::GetOrCreateBindingSet( const nvrhi::Bindin
|
|||
|
||||
if( !result )
|
||||
{
|
||||
/*
|
||||
mutex.Lock();
|
||||
|
||||
int entryIndex = bindingSets.Append( result );
|
||||
|
@ -77,6 +78,16 @@ nvrhi::BindingSetHandle BindingCache::GetOrCreateBindingSet( const nvrhi::Bindin
|
|||
result = entry;
|
||||
}
|
||||
|
||||
mutex.Unlock();
|
||||
*/
|
||||
|
||||
mutex.Lock();
|
||||
|
||||
result = device->createBindingSet( desc, layout );
|
||||
|
||||
int entryIndex = bindingSets.Append( result );
|
||||
bindingHash.Add( hash, entryIndex );
|
||||
|
||||
mutex.Unlock();
|
||||
}
|
||||
|
||||
|
@ -130,6 +141,7 @@ nvrhi::SamplerHandle SamplerCache::GetOrCreateSampler( nvrhi::SamplerDesc desc )
|
|||
|
||||
if( !result )
|
||||
{
|
||||
/*
|
||||
mutex.Lock();
|
||||
|
||||
int entryIndex = samplers.Append( result );
|
||||
|
@ -147,6 +159,16 @@ nvrhi::SamplerHandle SamplerCache::GetOrCreateSampler( nvrhi::SamplerDesc desc )
|
|||
result = entry;
|
||||
}
|
||||
|
||||
mutex.Unlock();
|
||||
*/
|
||||
|
||||
mutex.Lock();
|
||||
|
||||
result = device->createSampler( desc );
|
||||
|
||||
int entryIndex = samplers.Append( result );
|
||||
samplerHash.Add( hash, entryIndex );
|
||||
|
||||
mutex.Unlock();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue