diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2021-03-08 18:27:35 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2021-03-19 00:38:17 +0000 |
| commit | 1dfd5042779a493285c397d46f8d903d67c9f972 (patch) | |
| tree | 4fbb33befdb618afc58a806da4d274596f47261b /Graphics/GraphicsEngineD3D12 | |
| parent | ShaderResourceBinding{D3D12, Vk, GL} - removed the remaining duplicate code (diff) | |
| download | DiligentCore-1dfd5042779a493285c397d46f8d903d67c9f972.tar.gz DiligentCore-1dfd5042779a493285c397d46f8d903d67c9f972.zip | |
Resource singature: moved allocation of static resource cache and var managers to PipelineResourceSignatureBase
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
| -rw-r--r-- | Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp index a0d7f6ed..3375cf2c 100644 --- a/Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp +++ b/Graphics/GraphicsEngineD3D12/src/PipelineResourceSignatureD3D12Impl.cpp @@ -137,12 +137,12 @@ PipelineResourceSignatureD3D12Impl::PipelineResourceSignatureD3D12Impl(IReferenc ValidatePipelineResourceSignatureDescD3D12(Desc); auto& RawAllocator{GetRawAllocator()}; - auto MemPool = ReserveSpace(RawAllocator, Desc, - [&Desc](FixedLinearAllocator& MemPool) // - { - MemPool.AddSpace<ResourceAttribs>(Desc.NumResources); - MemPool.AddSpace<ImmutableSamplerAttribs>(Desc.NumImmutableSamplers); - }); + auto MemPool = AllocateInternalObjects(RawAllocator, Desc, + [&Desc](FixedLinearAllocator& MemPool) // + { + MemPool.AddSpace<ResourceAttribs>(Desc.NumResources); + MemPool.AddSpace<ImmutableSamplerAttribs>(Desc.NumImmutableSamplers); + }); static_assert(std::is_trivially_destructible<ResourceAttribs>::value, "ResourceAttribs objects must be constructed to be properly destructed in case an excpetion is thrown"); @@ -155,11 +155,6 @@ PipelineResourceSignatureD3D12Impl::PipelineResourceSignatureD3D12Impl(IReferenc const auto NumStaticResStages = GetNumStaticResStages(); if (NumStaticResStages > 0) { - m_pStaticResCache = MemPool.Construct<ShaderResourceCacheD3D12>(ResourceCacheContentType::Signature); - // Constructor of ShaderVariableManagerD3D12 is noexcept, so we can safely construct all manager objects. - // Moreover, all objects must be constructed if an exception is thrown for Destruct() method to work properly. - m_StaticVarsMgrs = MemPool.ConstructArray<ShaderVariableManagerD3D12>(NumStaticResStages, std::ref(*this), std::ref(*m_pStaticResCache)); - m_pStaticResCache->Initialize(RawAllocator, static_cast<Uint32>(StaticResCacheTblSizes.size()), StaticResCacheTblSizes.data()); constexpr SHADER_RESOURCE_VARIABLE_TYPE AllowedVarTypes[] = {SHADER_RESOURCE_VARIABLE_TYPE_STATIC}; |
