summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3DBase
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-10-05 04:51:33 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-10-05 04:51:33 +0000
commitc7391919d2e9d34e7f4fc18e8ffc174a9eabfb5e (patch)
tree1ff73fa0f1ae15b057db84bdeb12de1c5b19b97f /Graphics/GraphicsEngineD3DBase
parentAdded ReleaseStaleResources() to IRenderDevice interface + a bunch of minor c... (diff)
downloadDiligentCore-c7391919d2e9d34e7f4fc18e8ffc174a9eabfb5e.tar.gz
DiligentCore-c7391919d2e9d34e7f4fc18e8ffc174a9eabfb5e.zip
Reworked context pool management in D3D12
Diffstat (limited to 'Graphics/GraphicsEngineD3DBase')
-rw-r--r--Graphics/GraphicsEngineD3DBase/include/ShaderResources.h2
-rw-r--r--Graphics/GraphicsEngineD3DBase/src/ShaderResources.cpp9
2 files changed, 4 insertions, 7 deletions
diff --git a/Graphics/GraphicsEngineD3DBase/include/ShaderResources.h b/Graphics/GraphicsEngineD3DBase/include/ShaderResources.h
index 68925551..c468eebd 100644
--- a/Graphics/GraphicsEngineD3DBase/include/ShaderResources.h
+++ b/Graphics/GraphicsEngineD3DBase/include/ShaderResources.h
@@ -273,7 +273,7 @@ static_assert(sizeof(D3DShaderResourceAttribs) == sizeof(void*) + sizeof(Uint32)
class ShaderResources
{
public:
- ShaderResources(IMemoryAllocator &Allocator, SHADER_TYPE ShaderType);
+ ShaderResources(SHADER_TYPE ShaderType);
ShaderResources (const ShaderResources&) = delete;
ShaderResources (ShaderResources&&) = delete;
diff --git a/Graphics/GraphicsEngineD3DBase/src/ShaderResources.cpp b/Graphics/GraphicsEngineD3DBase/src/ShaderResources.cpp
index f0585f9d..f3045121 100644
--- a/Graphics/GraphicsEngineD3DBase/src/ShaderResources.cpp
+++ b/Graphics/GraphicsEngineD3DBase/src/ShaderResources.cpp
@@ -60,8 +60,6 @@ void ShaderResources::Initialize(IMemoryAllocator& Allocator,
Uint32 NumSamplers,
size_t ResourceNamesPoolSize)
{
- VERIFY( &m_MemoryBuffer.get_deleter().m_Allocator == &Allocator, "Incosistent allocators provided");
-
const auto MaxOffset = static_cast<Uint32>(std::numeric_limits<OffsetType>::max());
VERIFY(NumCBs <= MaxOffset, "Max offset exceeded");
m_TexSRVOffset = 0 + static_cast<OffsetType>(NumCBs);
@@ -92,15 +90,14 @@ void ShaderResources::Initialize(IMemoryAllocator& Allocator,
if( MemorySize )
{
- auto *pRawMem = ALLOCATE(Allocator, "Allocator for shader resources", MemorySize );
- m_MemoryBuffer.reset(pRawMem);
+ auto* pRawMem = ALLOCATE(Allocator, "Allocator for shader resources", MemorySize );
+ m_MemoryBuffer = std::unique_ptr< void, STDDeleterRawMem<void> >(pRawMem, Allocator);
char* NamesPool = reinterpret_cast<char*>(reinterpret_cast<D3DShaderResourceAttribs*>(pRawMem) + m_TotalResources);
m_ResourceNames.AssignMemory(NamesPool, ResourceNamesPoolSize);
}
}
-ShaderResources::ShaderResources(IMemoryAllocator &Allocator, SHADER_TYPE ShaderType):
- m_MemoryBuffer(nullptr, STDDeleterRawMem<void>(Allocator)),
+ShaderResources::ShaderResources(SHADER_TYPE ShaderType):
m_ShaderType(ShaderType)
{
}