git.s-ol.nu ~forks/DiligentCore / ext-vk
GLTF: hacky VR rendering support s-ol 4 months ago
4 changed file(s) with 28 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
962962 if (m_UsingImplicitSignature)
963963 {
964964 VERIFY_EXPR(CreateInfo.ResourceSignaturesCount == 0 || CreateInfo.ppResourceSignatures == nullptr);
965 m_SignatureCount = 1;
965 m_SignatureCount = CreateInfo.PSODesc.SeparateGeometrySignature ? 2 : 1;
966966 }
967967 else
968968 {
331331 /// Pipeline layout description
332332 PipelineResourceLayoutDesc ResourceLayout;
333333
334 bool SeparateGeometrySignature DEFAULT_INITIALIZER(false);
335
334336 #if DILIGENT_CPP_INTERFACE
335337 bool IsAnyGraphicsPipeline() const { return PipelineType == PIPELINE_TYPE_GRAPHICS || PipelineType == PIPELINE_TYPE_MESH; }
336338 bool IsComputePipeline() const { return PipelineType == PIPELINE_TYPE_COMPUTE; }
115115
116116 RefCntAutoPtr<PipelineResourceSignatureVkImpl> CreateDefaultSignature(
117117 const PipelineStateCreateInfo& CreateInfo,
118 const TShaderStages& ShaderStages);
118 const TShaderStages& ShaderStages,
119 Uint32 BindingIndex);
119120
120121 void Destruct();
121122
737737
738738 RefCntAutoPtr<PipelineResourceSignatureVkImpl> PipelineStateVkImpl::CreateDefaultSignature(
739739 const PipelineStateCreateInfo& CreateInfo,
740 const TShaderStages& ShaderStages)
740 const TShaderStages& ShaderStages,
741 Uint32 BindingIndex)
741742 {
742743 struct UniqueResource
743744 {
840841 RefCntAutoPtr<PipelineResourceSignatureVkImpl> pSignature;
841842 if (Resources.size())
842843 {
843 String SignName = String{"Implicit signature of PSO '"} + m_Desc.Name + '\'';
844 String SignName = String{"Implicit signature of PSO '"} + m_Desc.Name + String{BindingIndex ? "':1" : "':0"};
844845
845846 PipelineResourceSignatureDesc ResSignDesc;
846847 ResSignDesc.Name = SignName.c_str();
847848 ResSignDesc.Resources = Resources.data();
848849 ResSignDesc.NumResources = static_cast<Uint32>(Resources.size());
849 ResSignDesc.ImmutableSamplers = LayoutDesc.ImmutableSamplers;
850 ResSignDesc.NumImmutableSamplers = LayoutDesc.NumImmutableSamplers;
851 ResSignDesc.BindingIndex = 0;
850 ResSignDesc.ImmutableSamplers = BindingIndex ? nullptr : LayoutDesc.ImmutableSamplers;
851 ResSignDesc.NumImmutableSamplers = BindingIndex ? 0 : LayoutDesc.NumImmutableSamplers;
852 ResSignDesc.BindingIndex = BindingIndex;
852853 ResSignDesc.SRBAllocationGranularity = CreateInfo.PSODesc.SRBAllocationGranularity;
853854 ResSignDesc.UseCombinedTextureSamplers = pCombinedSamplerSuffix != nullptr;
854855 ResSignDesc.CombinedSamplerSuffix = pCombinedSamplerSuffix;
869870 void PipelineStateVkImpl::InitPipelineLayout(const PipelineStateCreateInfo& CreateInfo,
870871 TShaderStages& ShaderStages)
871872 {
872 if (m_UsingImplicitSignature)
873 if (m_Desc.SeparateGeometrySignature) {
874 TShaderStages AllOtherStages;
875 TShaderStages GeometryStage;
876
877 for (const auto& Stage : ShaderStages)
878 {
879 if (Stage.Type == SHADER_TYPE_GEOMETRY)
880 GeometryStage.push_back(Stage);
881 else
882 AllOtherStages.push_back(Stage);
883 }
884
885 VERIFY_EXPR(m_SignatureCount == 2);
886 m_Signatures[1] = CreateDefaultSignature(CreateInfo, GeometryStage, 1);
887 m_Signatures[0] = CreateDefaultSignature(CreateInfo, AllOtherStages, 0);
888 } else if (m_UsingImplicitSignature)
873889 {
874890 VERIFY_EXPR(m_SignatureCount == 1);
875 m_Signatures[0] = CreateDefaultSignature(CreateInfo, ShaderStages);
891 m_Signatures[0] = CreateDefaultSignature(CreateInfo, ShaderStages, 0);
876892 VERIFY_EXPR(!m_Signatures[0] || m_Signatures[0]->GetDesc().BindingIndex == 0);
877893 }
878894