Update the render state whenever the constant buffer is written to

This commit is contained in:
Stephen Pridham 2022-11-19 17:28:56 -05:00 committed by Robert Beckebans
parent 47d68fb6e0
commit a7f83bf631
3 changed files with 14 additions and 3 deletions

View file

@ -469,7 +469,13 @@ void idRenderBackend::DrawElementsWithCounters( const drawSurf_t* surf )
}
#endif
renderProgManager.CommitConstantBuffer( commandList );
if( renderProgManager.CommitConstantBuffer( commandList ) )
{
// Reset the graphics state if the constant buffer is written to since
// the render pass is ended for vulkan. setGraphicsState will
// reinstate the render pass.
changeState = true;
}
//
// create new graphics state if necessary

View file

@ -307,11 +307,16 @@ void idRenderProgManager::ZeroUniforms()
}
// Only updates the constant buffer if it was updated at all
void idRenderProgManager::CommitConstantBuffer( nvrhi::ICommandList* commandList )
bool idRenderProgManager::CommitConstantBuffer( nvrhi::ICommandList* commandList )
{
if( uniformsChanged )
{
commandList->writeBuffer( constantBuffer[BindingLayoutType()], uniforms.Ptr(), uniforms.Allocated() );
uniformsChanged = false;
return true;
}
return false;
}

View file

@ -1017,7 +1017,7 @@ public:
int UniformSize();
#if defined( USE_NVRHI )
void CommitConstantBuffer( nvrhi::ICommandList* commandList );
bool CommitConstantBuffer( nvrhi::ICommandList* commandList );
ID_INLINE nvrhi::IBuffer* ConstantBuffer()
{