From 1dfd5042779a493285c397d46f8d903d67c9f972 Mon Sep 17 00:00:00 2001 From: assiduous Date: Mon, 8 Mar 2021 10:27:35 -0800 Subject: Resource singature: moved allocation of static resource cache and var managers to PipelineResourceSignatureBase --- .../src/PipelineResourceSignatureD3D12Impl.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'Graphics/GraphicsEngineD3D12') 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(Desc.NumResources); - MemPool.AddSpace(Desc.NumImmutableSamplers); - }); + auto MemPool = AllocateInternalObjects(RawAllocator, Desc, + [&Desc](FixedLinearAllocator& MemPool) // + { + MemPool.AddSpace(Desc.NumResources); + MemPool.AddSpace(Desc.NumImmutableSamplers); + }); static_assert(std::is_trivially_destructible::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(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(NumStaticResStages, std::ref(*this), std::ref(*m_pStaticResCache)); - m_pStaticResCache->Initialize(RawAllocator, static_cast(StaticResCacheTblSizes.size()), StaticResCacheTblSizes.data()); constexpr SHADER_RESOURCE_VARIABLE_TYPE AllowedVarTypes[] = {SHADER_RESOURCE_VARIABLE_TYPE_STATIC}; -- cgit v1.2.3