Minor tweaks

This commit is contained in:
Wojtek Figat
2023-10-08 23:33:51 +02:00
parent fd7ef38639
commit 481a3cfba5
2 changed files with 9 additions and 22 deletions

View File

@@ -649,22 +649,6 @@ void GPUContextVulkan::UpdateDescriptorSets(ComputePipelineStateVulkan* pipeline
}
}
void GPUContextVulkan::BindPipeline()
{
if (_psDirtyFlag && _currentState && (_rtDepth || _rtCount))
{
// Clear flag
_psDirtyFlag = false;
// Change state
const auto cmdBuffer = _cmdBufferManager->GetCmdBuffer();
const auto pipeline = _currentState->GetState(_renderPass);
vkCmdBindPipeline(cmdBuffer->GetHandle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
RENDER_STAT_PS_STATE_CHANGE();
}
}
void GPUContextVulkan::OnDrawCall()
{
GPUPipelineStateVulkan* pipelineState = _currentState;
@@ -704,7 +688,15 @@ void GPUContextVulkan::OnDrawCall()
BeginRenderPass();
}
BindPipeline();
// Bind pipeline
if (_psDirtyFlag && _currentState && (_rtDepth || _rtCount))
{
_psDirtyFlag = false;
const auto cmdBuffer = _cmdBufferManager->GetCmdBuffer();
const auto pipeline = _currentState->GetState(_renderPass);
vkCmdBindPipeline(cmdBuffer->GetHandle(), VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
RENDER_STAT_PS_STATE_CHANGE();
}
//UpdateDynamicStates();
@@ -1104,9 +1096,7 @@ void GPUContextVulkan::Dispatch(GPUShaderProgramCS* shader, uint32 threadGroupCo
EndRenderPass();
auto pipelineState = shaderVulkan->GetOrCreateState();
UpdateDescriptorSets(pipelineState);
FlushBarriers();
// Bind pipeline
@@ -1141,10 +1131,8 @@ void GPUContextVulkan::DispatchIndirect(GPUShaderProgramCS* shader, GPUBuffer* b
EndRenderPass();
auto pipelineState = shaderVulkan->GetOrCreateState();
UpdateDescriptorSets(pipelineState);
AddBufferBarrier(bufferForArgsVulkan, VK_ACCESS_INDIRECT_COMMAND_READ_BIT);
FlushBarriers();
// Bind pipeline