From 104ffa2f0b42be3fde1606cfb84883c912f41f3c Mon Sep 17 00:00:00 2001 From: assiduous Date: Wed, 27 Jan 2021 20:39:30 -0800 Subject: More refactorin of PipelineResourceSignatureVkImpl --- Graphics/GraphicsEngine/include/PrivateConstants.h | 5 +---- Graphics/GraphicsEngine/src/PipelineResourceSignatureBase.cpp | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'Graphics/GraphicsEngine') diff --git a/Graphics/GraphicsEngine/include/PrivateConstants.h b/Graphics/GraphicsEngine/include/PrivateConstants.h index e84e7992..ca25e180 100644 --- a/Graphics/GraphicsEngine/include/PrivateConstants.h +++ b/Graphics/GraphicsEngine/include/PrivateConstants.h @@ -39,10 +39,7 @@ namespace Diligent /// (Vertex, Hull, Domain, Geometry, Pixel) or (Amplification, Mesh, Pixel), or (Compute) or (RayGen, Miss, ClosestHit, AnyHit, Intersection, Callable) static constexpr Uint32 MAX_SHADERS_IN_PIPELINE = 6; -// Static/mutable and dynamic descriptor sets (Vulkan only) -static constexpr Uint32 MAX_DESCR_SET_PER_SIGNATURE = 2; - // The maximum number of resources in pipeline resources signature. -static constexpr Uint32 MAX_RESOURCES_IN_SIGNATURE = 1u << 16; +static constexpr Uint32 MAX_RESOURCES_IN_SIGNATURE = (1u << 16u) - 1u; } // namespace Diligent diff --git a/Graphics/GraphicsEngine/src/PipelineResourceSignatureBase.cpp b/Graphics/GraphicsEngine/src/PipelineResourceSignatureBase.cpp index cf2cff2e..a1f0556b 100644 --- a/Graphics/GraphicsEngine/src/PipelineResourceSignatureBase.cpp +++ b/Graphics/GraphicsEngine/src/PipelineResourceSignatureBase.cpp @@ -41,6 +41,9 @@ void ValidatePipelineResourceSignatureDesc(const PipelineResourceSignatureDesc& if (Desc.BindingIndex >= MAX_RESOURCE_SIGNATURES) LOG_PRS_ERROR_AND_THROW("Desc.BindingIndex (", Uint32{Desc.BindingIndex}, ") exceeds the maximum allowed value (", MAX_RESOURCE_SIGNATURES - 1, ")."); + if (Desc.NumResources > MAX_RESOURCES_IN_SIGNATURE) + LOG_PRS_ERROR_AND_THROW("Desc.NumResources (", Uint32{Desc.NumResources}, ") exceeds the maximum allowed value (", MAX_RESOURCES_IN_SIGNATURE, ")."); + std::unordered_map ResourceShaderStages; for (Uint32 i = 0; i < Desc.NumResources; ++i) -- cgit v1.2.3