mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-14 22:50:45 +00:00
Invalid binding set cache if either vertex data or joint data changes
This commit is contained in:
parent
2ac23b0c9b
commit
47d68fb6e0
1 changed files with 6 additions and 7 deletions
|
@ -393,8 +393,6 @@ void idRenderBackend::DrawElementsWithCounters( const drawSurf_t* surf )
|
|||
}
|
||||
#endif
|
||||
|
||||
bool changedJointBuffer = false;
|
||||
|
||||
if( jointHandle )
|
||||
{
|
||||
const idUniformBuffer* jointBuffer = nullptr;
|
||||
|
@ -415,7 +413,10 @@ void idRenderBackend::DrawElementsWithCounters( const drawSurf_t* surf )
|
|||
}
|
||||
|
||||
uint offset = static_cast<uint>( jointHandle >> VERTCACHE_OFFSET_SHIFT ) & VERTCACHE_OFFSET_MASK;
|
||||
changedJointBuffer = ( currentJointBuffer != jointBuffer->GetAPIObject() ) || ( currentJointOffset != offset );
|
||||
if( currentJointBuffer != jointBuffer->GetAPIObject() || currentJointOffset != offset )
|
||||
{
|
||||
changeState = true;
|
||||
}
|
||||
|
||||
currentJointBuffer = jointBuffer->GetAPIObject();
|
||||
currentJointOffset = offset;
|
||||
|
@ -429,7 +430,7 @@ void idRenderBackend::DrawElementsWithCounters( const drawSurf_t* surf )
|
|||
idStaticList<nvrhi::BindingLayoutHandle, nvrhi::c_MaxBindingLayouts>* layouts
|
||||
= renderProgManager.GetBindingLayout( bindingLayoutType );
|
||||
|
||||
if( changedJointBuffer || bindingLayoutType != prevBindingLayoutType || context != prevContext )
|
||||
if( changeState || bindingLayoutType != prevBindingLayoutType || context != prevContext )
|
||||
{
|
||||
GetCurrentBindingLayout( bindingLayoutType );
|
||||
|
||||
|
@ -443,10 +444,8 @@ void idRenderBackend::DrawElementsWithCounters( const drawSurf_t* surf )
|
|||
}
|
||||
}
|
||||
|
||||
const uint64_t stateBits = glStateBits;
|
||||
|
||||
const int program = renderProgManager.CurrentProgram();
|
||||
const PipelineKey key{ stateBits, program, static_cast<int>( depthBias ), slopeScaleBias, currentFrameBuffer };
|
||||
const PipelineKey key{ glStateBits, program, static_cast<int>( depthBias ), slopeScaleBias, currentFrameBuffer };
|
||||
const auto pipeline = pipelineCache.GetOrCreatePipeline( key );
|
||||
|
||||
if( currentPipeline != pipeline )
|
||||
|
|
Loading…
Reference in a new issue