diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2021-02-19 22:03:18 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2021-03-19 00:38:09 +0000 |
| commit | 87e70a1a99396767ab519aceebd843c1eb2da223 (patch) | |
| tree | fefacfc8cc6cb83360bfcdcf63afab5289af8b1f /Graphics/GraphicsEngine | |
| parent | D3D12 comamnd context: updated state transitions for RT acceleration structures (diff) | |
| download | DiligentCore-87e70a1a99396767ab519aceebd843c1eb2da223.tar.gz DiligentCore-87e70a1a99396767ab519aceebd843c1eb2da223.zip | |
PipelineResourceSignatureD3D12Impl: some refactoring
Diffstat (limited to 'Graphics/GraphicsEngine')
| -rw-r--r-- | Graphics/GraphicsEngine/include/PipelineResourceSignatureBase.hpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Graphics/GraphicsEngine/include/PipelineResourceSignatureBase.hpp b/Graphics/GraphicsEngine/include/PipelineResourceSignatureBase.hpp index 9f5b6cdc..50a52dad 100644 --- a/Graphics/GraphicsEngine/include/PipelineResourceSignatureBase.hpp +++ b/Graphics/GraphicsEngine/include/PipelineResourceSignatureBase.hpp @@ -57,6 +57,19 @@ Int32 FindImmutableSampler(const ImmutableSamplerDesc* ImtblSamplers, const char* ResourceName, const char* SamplerSuffix); +/// Returns true if two pipeline resources are compatible +inline bool PipelineResourcesCompatible(const PipelineResourceDesc& lhs, const PipelineResourceDesc& rhs) +{ + // Ignore resource names. + // clang-format off + return lhs.ShaderStages == rhs.ShaderStages && + lhs.ArraySize == rhs.ArraySize && + lhs.ResourceType == rhs.ResourceType && + lhs.VarType == rhs.VarType && + lhs.Flags == rhs.Flags; + // clang-format on +} + /// Template class implementing base functionality of the pipeline resource signature object. /// \tparam BaseInterface - Base interface that this class will inheret @@ -165,8 +178,8 @@ protected: void CopyDescription(FixedLinearAllocator& Allocator, const PipelineResourceSignatureDesc& Desc) noexcept(false) { - PipelineResourceDesc* pResources = Allocator.Allocate<PipelineResourceDesc>(Desc.NumResources); - ImmutableSamplerDesc* pSamplers = Allocator.Allocate<ImmutableSamplerDesc>(Desc.NumImmutableSamplers); + PipelineResourceDesc* pResources = Allocator.ConstructArray<PipelineResourceDesc>(Desc.NumResources); + ImmutableSamplerDesc* pSamplers = Allocator.ConstructArray<ImmutableSamplerDesc>(Desc.NumImmutableSamplers); for (Uint32 i = 0; i < Desc.NumResources; ++i) { |
