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()
|
void GPUContextVulkan::OnDrawCall()
|
||||||
{
|
{
|
||||||
GPUPipelineStateVulkan* pipelineState = _currentState;
|
GPUPipelineStateVulkan* pipelineState = _currentState;
|
||||||
@@ -704,7 +688,15 @@ void GPUContextVulkan::OnDrawCall()
|
|||||||
BeginRenderPass();
|
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();
|
//UpdateDynamicStates();
|
||||||
|
|
||||||
@@ -1104,9 +1096,7 @@ void GPUContextVulkan::Dispatch(GPUShaderProgramCS* shader, uint32 threadGroupCo
|
|||||||
EndRenderPass();
|
EndRenderPass();
|
||||||
|
|
||||||
auto pipelineState = shaderVulkan->GetOrCreateState();
|
auto pipelineState = shaderVulkan->GetOrCreateState();
|
||||||
|
|
||||||
UpdateDescriptorSets(pipelineState);
|
UpdateDescriptorSets(pipelineState);
|
||||||
|
|
||||||
FlushBarriers();
|
FlushBarriers();
|
||||||
|
|
||||||
// Bind pipeline
|
// Bind pipeline
|
||||||
@@ -1141,10 +1131,8 @@ void GPUContextVulkan::DispatchIndirect(GPUShaderProgramCS* shader, GPUBuffer* b
|
|||||||
EndRenderPass();
|
EndRenderPass();
|
||||||
|
|
||||||
auto pipelineState = shaderVulkan->GetOrCreateState();
|
auto pipelineState = shaderVulkan->GetOrCreateState();
|
||||||
|
|
||||||
UpdateDescriptorSets(pipelineState);
|
UpdateDescriptorSets(pipelineState);
|
||||||
AddBufferBarrier(bufferForArgsVulkan, VK_ACCESS_INDIRECT_COMMAND_READ_BIT);
|
AddBufferBarrier(bufferForArgsVulkan, VK_ACCESS_INDIRECT_COMMAND_READ_BIT);
|
||||||
|
|
||||||
FlushBarriers();
|
FlushBarriers();
|
||||||
|
|
||||||
// Bind pipeline
|
// Bind pipeline
|
||||||
|
|||||||
@@ -160,7 +160,6 @@ private:
|
|||||||
void UpdateDescriptorSets(const struct SpirvShaderDescriptorInfo& descriptorInfo, class DescriptorSetWriterVulkan& dsWriter, bool& needsWrite);
|
void UpdateDescriptorSets(const struct SpirvShaderDescriptorInfo& descriptorInfo, class DescriptorSetWriterVulkan& dsWriter, bool& needsWrite);
|
||||||
void UpdateDescriptorSets(GPUPipelineStateVulkan* pipelineState);
|
void UpdateDescriptorSets(GPUPipelineStateVulkan* pipelineState);
|
||||||
void UpdateDescriptorSets(ComputePipelineStateVulkan* pipelineState);
|
void UpdateDescriptorSets(ComputePipelineStateVulkan* pipelineState);
|
||||||
void BindPipeline();
|
|
||||||
void OnDrawCall();
|
void OnDrawCall();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user