mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-14 22:50:45 +00:00
Update the render state whenever the constant buffer is written to
This commit is contained in:
parent
47d68fb6e0
commit
a7f83bf631
3 changed files with 14 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue