From c7391919d2e9d34e7f4fc18e8ffc174a9eabfb5e Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 4 Oct 2018 21:51:33 -0700 Subject: Reworked context pool management in D3D12 --- .../GraphicsEngineD3D11/include/ShaderResourceLayoutD3D11.h | 2 +- Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp | 2 +- .../src/ShaderResourceBindingD3D11Impl.cpp | 2 +- .../GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp | 11 ++++------- Graphics/GraphicsEngineD3D11/src/ShaderResourcesD3D11.cpp | 2 +- 5 files changed, 8 insertions(+), 11 deletions(-) (limited to 'Graphics/GraphicsEngineD3D11') diff --git a/Graphics/GraphicsEngineD3D11/include/ShaderResourceLayoutD3D11.h b/Graphics/GraphicsEngineD3D11/include/ShaderResourceLayoutD3D11.h index 080926b4..e0329a49 100644 --- a/Graphics/GraphicsEngineD3D11/include/ShaderResourceLayoutD3D11.h +++ b/Graphics/GraphicsEngineD3D11/include/ShaderResourceLayoutD3D11.h @@ -49,7 +49,7 @@ class IMemoryAllocator; class ShaderResourceLayoutD3D11 { public: - ShaderResourceLayoutD3D11(IObject &Owner, IMemoryAllocator& ResLayoutDataAllocator); + ShaderResourceLayoutD3D11(IObject &Owner); ~ShaderResourceLayoutD3D11(); // No copies or moves diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp index fc428cd0..9da40de3 100644 --- a/Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp @@ -35,7 +35,7 @@ ShaderD3D11Impl::ShaderD3D11Impl(IReferenceCounters* pRefCounters, const ShaderCreationAttribs& CreationAttribs) : TShaderBase(pRefCounters, pRenderDeviceD3D11, CreationAttribs.Desc), ShaderD3DBase(CreationAttribs), - m_StaticResLayout(*this, GetRawAllocator()), + m_StaticResLayout(*this), m_ShaderTypeIndex(Diligent::GetShaderTypeIndex(CreationAttribs.Desc.ShaderType)) { auto *pDeviceD3D11 = pRenderDeviceD3D11->GetD3D11Device(); diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp index 7255f215..e2dbc07e 100644 --- a/Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/ShaderResourceBindingD3D11Impl.cpp @@ -69,7 +69,7 @@ ShaderResourceBindingD3D11Impl::ShaderResourceBindingD3D11Impl( IReferenceCounte // Shader resource layout will only contain dynamic and mutable variables // http://diligentgraphics.com/diligent-engine/architecture/d3d11/shader-resource-cache#Shader-Resource-Cache-Initialization SHADER_VARIABLE_TYPE VarTypes[] = {SHADER_VARIABLE_TYPE_MUTABLE, SHADER_VARIABLE_TYPE_DYNAMIC}; - new (m_pResourceLayouts + s) ShaderResourceLayoutD3D11(*this, ResLayoutDataAllocator); + new (m_pResourceLayouts + s) ShaderResourceLayoutD3D11(*this); m_pResourceLayouts[s].Initialize(pShaderD3D11->GetResources(), VarTypes, _countof(VarTypes), m_pBoundResourceCaches[s], ResCacheDataAllocator, ResLayoutDataAllocator); Resources.InitStaticSamplers(m_pBoundResourceCaches[s]); diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp index 62a3746c..66f7a11b 100755 --- a/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp +++ b/Graphics/GraphicsEngineD3D11/src/ShaderResourceLayoutD3D11.cpp @@ -38,12 +38,11 @@ namespace Diligent { -ShaderResourceLayoutD3D11::ShaderResourceLayoutD3D11(IObject& Owner, IMemoryAllocator& ResLayoutDataAllocator) : - m_Owner(Owner), +ShaderResourceLayoutD3D11::ShaderResourceLayoutD3D11(IObject& Owner) : + m_Owner(Owner) #if USE_VARIABLE_HASH_MAP - m_VariableHash(STD_ALLOCATOR_RAW_MEM(VariableHashData, GetRawAllocator(), "Allocator for vector")), + , m_VariableHash(STD_ALLOCATOR_RAW_MEM(VariableHashData, GetRawAllocator(), "Allocator for vector")) #endif - m_ResourceBuffer(nullptr, STDDeleterRawMem(ResLayoutDataAllocator)) { } @@ -102,8 +101,6 @@ void ShaderResourceLayoutD3D11::Initialize(const std::shared_ptr >(pRawMem, ResLayoutDataAllocator); } VERIFY_EXPR(NumCBs < 255); diff --git a/Graphics/GraphicsEngineD3D11/src/ShaderResourcesD3D11.cpp b/Graphics/GraphicsEngineD3D11/src/ShaderResourcesD3D11.cpp index 6296deb9..1cf52f39 100755 --- a/Graphics/GraphicsEngineD3D11/src/ShaderResourcesD3D11.cpp +++ b/Graphics/GraphicsEngineD3D11/src/ShaderResourcesD3D11.cpp @@ -35,7 +35,7 @@ namespace Diligent ShaderResourcesD3D11::ShaderResourcesD3D11(RenderDeviceD3D11Impl* pDeviceD3D11Impl, ID3DBlob* pShaderBytecode, const ShaderDesc& ShdrDesc) : - ShaderResources(GetRawAllocator(), ShdrDesc.ShaderType), + ShaderResources(ShdrDesc.ShaderType), m_ShaderName(ShdrDesc.Name), m_StaticSamplers(nullptr, STDDeleterRawMem< void >(GetRawAllocator())) { -- cgit v1.2.3