Minor tweaks
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -160,7 +160,6 @@ private:
|
||||
void UpdateDescriptorSets(const struct SpirvShaderDescriptorInfo& descriptorInfo, class DescriptorSetWriterVulkan& dsWriter, bool& needsWrite);
|
||||
void UpdateDescriptorSets(GPUPipelineStateVulkan* pipelineState);
|
||||
void UpdateDescriptorSets(ComputePipelineStateVulkan* pipelineState);
|
||||
void BindPipeline();
|
||||
void OnDrawCall();
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user