summaryrefslogtreecommitdiffstats
path: root/Graphics/GLSLTools
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/GLSLTools
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/GLSLTools')
-rw-r--r--Graphics/GLSLTools/src/SPIRVShaderResources.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/Graphics/GLSLTools/src/SPIRVShaderResources.cpp b/Graphics/GLSLTools/src/SPIRVShaderResources.cpp
index c4256b9b..eda4a18f 100644
--- a/Graphics/GLSLTools/src/SPIRVShaderResources.cpp
+++ b/Graphics/GLSLTools/src/SPIRVShaderResources.cpp
@@ -91,7 +91,6 @@ SPIRVShaderResources::SPIRVShaderResources(IMemoryAllocator& Allocator,
IRenderDevice* pRenderDevice,
std::vector<uint32_t> spirv_binary,
const ShaderDesc& shaderDesc) :
- m_MemoryBuffer(nullptr, STDDeleterRawMem<void>(Allocator)),
m_ShaderType(shaderDesc.ShaderType)
{
// https://github.com/KhronosGroup/SPIRV-Cross/wiki/Reflection-API-user-guide
@@ -327,8 +326,6 @@ void SPIRVShaderResources::Initialize(IMemoryAllocator& Allocator,
Uint32 NumStaticSamplers,
size_t ResourceNamesPoolSize)
{
- VERIFY(&m_MemoryBuffer.get_deleter().m_Allocator == &Allocator, "Incosistent allocators provided");
-
static constexpr OffsetType UniformBufferOffset = 0;
const auto MaxOffset = static_cast<Uint32>(std::numeric_limits<OffsetType>::max());
@@ -373,7 +370,7 @@ void SPIRVShaderResources::Initialize(IMemoryAllocator& Allocator,
if (MemorySize)
{
auto *pRawMem = Allocator.Allocate(MemorySize, "Memory for shader resources", __FILE__, __LINE__);
- m_MemoryBuffer.reset(pRawMem);
+ m_MemoryBuffer = std::unique_ptr<void, STDDeleterRawMem<void>>(pRawMem, Allocator);
char* NamesPool = reinterpret_cast<char*>(m_MemoryBuffer.get()) +
m_TotalResources * sizeof(SPIRVShaderResourceAttribs) +
m_NumStaticSamplers * sizeof(SamplerPtrType);