diff --git a/neo/renderer/NVRHI/RenderBackend_NVRHI.cpp b/neo/renderer/NVRHI/RenderBackend_NVRHI.cpp index ebc6896d..d1339dfe 100644 --- a/neo/renderer/NVRHI/RenderBackend_NVRHI.cpp +++ b/neo/renderer/NVRHI/RenderBackend_NVRHI.cpp @@ -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( 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* 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( depthBias ), slopeScaleBias, currentFrameBuffer }; + const PipelineKey key{ glStateBits, program, static_cast( depthBias ), slopeScaleBias, currentFrameBuffer }; const auto pipeline = pipelineCache.GetOrCreatePipeline( key ); if( currentPipeline != pipeline )