Skip to content

Commit af59a53

Browse files
committed
Skip CommitShaderResources for PRS that has no resources bound on it.
1 parent fb87222 commit af59a53

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -648,15 +648,12 @@ void DeviceContextVkImpl::CommitShaderResources(IShaderResourceBinding* pShaderR
648648
const Uint32 SRBIndex = pResBindingVkImpl->GetBindingIndex();
649649
const PipelineResourceSignatureVkImpl* pSignature = pResBindingVkImpl->GetSignature();
650650

651-
// Use PSO's pipeline type as fallback when PRS has no resources and thus PIPELINE_TYPE_INVALID
652-
PIPELINE_TYPE SrbPipelineType = pResBindingVkImpl->GetPipelineType();
653-
if (SrbPipelineType == PIPELINE_TYPE_INVALID)
654-
{
655-
VERIFY_EXPR(m_pPipelineState != nullptr);
656-
SrbPipelineType = m_pPipelineState->GetDesc().PipelineType;
657-
}
651+
// PRS has no resources and thus PIPELINE_TYPE_INVALID ?
652+
PIPELINE_TYPE SRBPipelineType = pResBindingVkImpl->GetPipelineType();
653+
if (SRBPipelineType == PIPELINE_TYPE_INVALID)
654+
return;
658655

659-
ResourceBindInfo& BindInfo = GetBindInfo(SrbPipelineType);
656+
ResourceBindInfo& BindInfo = GetBindInfo(SRBPipelineType);
660657
ResourceBindInfo::DescriptorSetInfo& SetInfo = BindInfo.SetInfo[SRBIndex];
661658

662659
// Always bind the SRB, even if it has no descriptor sets (e.g., only push constants)

0 commit comments

Comments
 (0)