summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2020-10-18 20:06:48 +0000
committerassiduous <assiduous@diligentgraphics.com>2020-10-18 20:06:48 +0000
commit645ef7e425d6ff4ee64b782d27767e0a5732be50 (patch)
tree8502aea9ba6100af3a0908c5975a75debc5fd7de /Graphics/GraphicsEngineD3D11
parentRefactored LinearAllocator (diff)
downloadDiligentCore-645ef7e425d6ff4ee64b782d27767e0a5732be50.tar.gz
DiligentCore-645ef7e425d6ff4ee64b782d27767e0a5732be50.zip
A number of fixes for PSO creation refactoring (API240075)
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
-rw-r--r--Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.hpp6
-rw-r--r--Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.hpp3
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp4
-rw-r--r--Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp93
-rw-r--r--Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp41
5 files changed, 68 insertions, 79 deletions
diff --git a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.hpp b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.hpp
index 99062706..eb184710 100644
--- a/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.hpp
+++ b/Graphics/GraphicsEngineD3D11/include/PipelineStateD3D11Impl.hpp
@@ -137,8 +137,10 @@ public:
void SetStaticSamplers(ShaderResourceCacheD3D11& ResourceCache, Uint32 ShaderInd) const;
private:
- void InitResourceLayouts(RenderDeviceD3D11Impl* pRenderDeviceD3D11,
- const PipelineStateCreateInfo& CreateInfo,
+ template <typename PSOCreateInfoType>
+ LinearAllocator InitInternalObjects(const PSOCreateInfoType& CreateInfo);
+
+ void InitResourceLayouts(const PipelineStateCreateInfo& CreateInfo,
const std::vector<std::pair<SHADER_TYPE, ShaderD3D11Impl*>>& ShaderStages);
CComPtr<ID3D11BlendState> m_pd3d11BlendState;
diff --git a/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.hpp b/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.hpp
index 1a1e01af..c2a1285c 100644
--- a/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.hpp
+++ b/Graphics/GraphicsEngineD3D11/include/RenderDeviceD3D11Impl.hpp
@@ -124,6 +124,9 @@ public:
Uint64 GetCommandQueueMask() const { return Uint64{1}; }
private:
+ template <typename PSOCreateInfoType>
+ void CreatePipelineState(const PSOCreateInfoType& PSOCreateInfo, IPipelineState** ppPipelineState);
+
virtual void TestTextureFormat(TEXTURE_FORMAT TexFormat) override final;
EngineD3D11CreateInfo m_EngineAttribs;
diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
index 39560453..7ee1ccec 100755
--- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
@@ -106,7 +106,7 @@ void DeviceContextD3D11Impl::SetPipelineState(IPipelineState* pPipelineState)
COMMIT_SHADER(DS, DomainShader);
#undef COMMIT_SHADER
- auto& GraphicsPipeline = pPipelineStateD3D11->GetGraphicsPipelineDesc();
+ const auto& GraphicsPipeline = pPipelineStateD3D11->GetGraphicsPipelineDesc();
m_pd3d11DeviceContext->OMSetBlendState(pPipelineStateD3D11->GetD3D11BlendState(), m_BlendFactors, GraphicsPipeline.SampleMask);
m_pd3d11DeviceContext->RSSetState(pPipelineStateD3D11->GetD3D11RasterizerState());
@@ -673,7 +673,7 @@ void DeviceContextD3D11Impl::SetBlendFactors(const float* pBlendFactors)
{
Uint32 SampleMask = 0xFFFFFFFF;
ID3D11BlendState* pd3d11BS = nullptr;
- if (m_pPipelineState)
+ if (m_pPipelineState && m_pPipelineState->GetDesc().IsAnyGraphicsPipeline())
{
SampleMask = m_pPipelineState->GetGraphicsPipelineDesc().SampleMask;
pd3d11BS = m_pPipelineState->GetD3D11BlendState();
diff --git a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp
index d20e0c32..292a9323 100644
--- a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp
@@ -35,42 +35,49 @@
namespace Diligent
{
-PipelineStateD3D11Impl::PipelineStateD3D11Impl(IReferenceCounters* pRefCounters,
- RenderDeviceD3D11Impl* pRenderDeviceD3D11,
- const GraphicsPipelineStateCreateInfo& CreateInfo) :
- // clang-format off
- TPipelineStateBase
- {
- pRefCounters,
- pRenderDeviceD3D11,
- CreateInfo.PSODesc
- },
- m_SRBMemAllocator{GetRawAllocator()},
- m_StaticSamplers (STD_ALLOCATOR_RAW_MEM(StaticSamplerInfo, GetRawAllocator(), "Allocator for vector<StaticSamplerInfo>"))
-// clang-format on
+template <typename PSOCreateInfoType>
+LinearAllocator PipelineStateD3D11Impl::InitInternalObjects(const PSOCreateInfoType& CreateInfo)
{
m_ResourceLayoutIndex.fill(-1);
- // We do not really need ShaderStages, but ExtractShaders() also initializes
- // shader stage types and shader stage counter.
std::vector<std::pair<SHADER_TYPE, ShaderD3D11Impl*>> ShaderStages;
ExtractShaders<ShaderD3D11Impl>(CreateInfo, ShaderStages);
// Memory must be released if an exception is thrown.
LinearAllocator MemPool{GetRawAllocator()};
- MemPool.AddRequiredSize<ShaderResourceLayoutD3D11>(GetNumShaderStages());
- MemPool.AddRequiredSize<ShaderResourceCacheD3D11>(GetNumShaderStages());
+ MemPool.AddSpace<ShaderResourceLayoutD3D11>(GetNumShaderStages());
+ MemPool.AddSpace<ShaderResourceCacheD3D11>(GetNumShaderStages());
- ValidateAndReserveSpace(CreateInfo, MemPool);
+ ReserveSpaceForPipelineDesc(CreateInfo, MemPool);
MemPool.Reserve();
m_pStaticResourceLayouts = MemPool.Allocate<ShaderResourceLayoutD3D11>(GetNumShaderStages());
m_pStaticResourceCaches = MemPool.Allocate<ShaderResourceCacheD3D11>(GetNumShaderStages());
- InitGraphicsPipeline(CreateInfo, MemPool);
- InitResourceLayouts(pRenderDeviceD3D11, CreateInfo, ShaderStages);
+ InitializePipelineDesc(CreateInfo, MemPool);
+ InitResourceLayouts(CreateInfo, ShaderStages);
+
+ return MemPool;
+}
+
+
+PipelineStateD3D11Impl::PipelineStateD3D11Impl(IReferenceCounters* pRefCounters,
+ RenderDeviceD3D11Impl* pRenderDeviceD3D11,
+ const GraphicsPipelineStateCreateInfo& CreateInfo) :
+ // clang-format off
+ TPipelineStateBase
+ {
+ pRefCounters,
+ pRenderDeviceD3D11,
+ CreateInfo
+ },
+ m_SRBMemAllocator{GetRawAllocator()},
+ m_StaticSamplers (STD_ALLOCATOR_RAW_MEM(StaticSamplerInfo, GetRawAllocator(), "Allocator for vector<StaticSamplerInfo>"))
+// clang-format on
+{
+ auto MemPool = InitInternalObjects(CreateInfo);
auto& GraphicsPipeline = GetGraphicsPipelineDesc();
@@ -131,7 +138,7 @@ PipelineStateD3D11Impl::PipelineStateD3D11Impl(IReferenceCounters*
"Failed to create the Direct3D11 input layout");
}
- void* Ptr = MemPool.Release();
+ auto* Ptr = MemPool.Release();
VERIFY_EXPR(Ptr == m_pStaticResourceLayouts);
}
@@ -143,49 +150,27 @@ PipelineStateD3D11Impl::PipelineStateD3D11Impl(IReferenceCounters*
{
pRefCounters,
pRenderDeviceD3D11,
- CreateInfo.PSODesc
+ CreateInfo
},
m_SRBMemAllocator{GetRawAllocator()},
m_StaticSamplers (STD_ALLOCATOR_RAW_MEM(StaticSamplerInfo, GetRawAllocator(), "Allocator for vector<StaticSamplerInfo>"))
// clang-format on
{
- m_ResourceLayoutIndex.fill(-1);
-
- // We do not really need ShaderStages, but ExtractShaders() also initializes
- // shader stage types and shader stage counter.
- std::vector<std::pair<SHADER_TYPE, ShaderD3D11Impl*>> ShaderStages;
- ExtractShaders<ShaderD3D11Impl>(CreateInfo, ShaderStages);
-
- // Memory must be released if an exception is thrown.
- LinearAllocator MemPool{GetRawAllocator()};
-
- MemPool.AddRequiredSize<ShaderResourceLayoutD3D11>(GetNumShaderStages());
- MemPool.AddRequiredSize<ShaderResourceCacheD3D11>(GetNumShaderStages());
-
- ValidateAndReserveSpace(CreateInfo, MemPool);
-
- MemPool.Reserve();
-
- m_pStaticResourceLayouts = MemPool.Allocate<ShaderResourceLayoutD3D11>(GetNumShaderStages());
- m_pStaticResourceCaches = MemPool.Allocate<ShaderResourceCacheD3D11>(GetNumShaderStages());
-
- InitComputePipeline(CreateInfo, MemPool);
- InitResourceLayouts(pRenderDeviceD3D11, CreateInfo, ShaderStages);
+ auto MemPool = InitInternalObjects(CreateInfo);
- auto* pCS = ValidatedCast<ShaderD3D11Impl>(CreateInfo.pCS);
- m_pCS = pCS;
+ m_pCS = ValidatedCast<ShaderD3D11Impl>(CreateInfo.pCS);
if (m_pCS == nullptr)
{
LOG_ERROR_AND_THROW("Compute shader is null");
}
- if (m_pCS && m_pCS->GetDesc().ShaderType != SHADER_TYPE_COMPUTE)
+ if (m_pCS->GetDesc().ShaderType != SHADER_TYPE_COMPUTE)
{
LOG_ERROR_AND_THROW(GetShaderTypeLiteralName(SHADER_TYPE_COMPUTE), " shader is expeceted while ", GetShaderTypeLiteralName(m_pCS->GetDesc().ShaderType), " provided");
}
- m_ShaderResourceLayoutHash = pCS->GetD3D11Resources()->GetHash();
+ m_ShaderResourceLayoutHash = m_pCS->GetD3D11Resources()->GetHash();
- void* Ptr = MemPool.Release();
+ auto* Ptr = MemPool.Release();
VERIFY_EXPR(Ptr == m_pStaticResourceLayouts);
}
@@ -209,8 +194,7 @@ PipelineStateD3D11Impl::~PipelineStateD3D11Impl()
IMPLEMENT_QUERY_INTERFACE(PipelineStateD3D11Impl, IID_PipelineStateD3D11, TPipelineStateBase)
-void PipelineStateD3D11Impl::InitResourceLayouts(RenderDeviceD3D11Impl* pRenderDeviceD3D11,
- const PipelineStateCreateInfo& CreateInfo,
+void PipelineStateD3D11Impl::InitResourceLayouts(const PipelineStateCreateInfo& CreateInfo,
const std::vector<std::pair<SHADER_TYPE, ShaderD3D11Impl*>>& ShaderStages)
{
const auto& ResourceLayout = m_Desc.ResourceLayout;
@@ -269,7 +253,7 @@ void PipelineStateD3D11Impl::InitResourceLayouts(RenderDeviceD3D11Impl*
{
const auto& SrcStaticSamplerInfo = ResourceLayout.StaticSamplers[SrcStaticSamplerInd];
RefCntAutoPtr<ISampler> pStaticSampler;
- pRenderDeviceD3D11->CreateSampler(SrcStaticSamplerInfo.Desc, &pStaticSampler);
+ GetDevice()->CreateSampler(SrcStaticSamplerInfo.Desc, &pStaticSampler);
StaticSamplers.emplace_back(SamplerAttribs, std::move(pStaticSampler));
}
}
@@ -328,9 +312,8 @@ ID3D11InputLayout* PipelineStateD3D11Impl::GetD3D11InputLayout()
void PipelineStateD3D11Impl::CreateShaderResourceBinding(IShaderResourceBinding** ppShaderResourceBinding, bool InitStaticResources)
{
- auto* pRenderDeviceD3D11 = ValidatedCast<RenderDeviceD3D11Impl>(GetDevice());
- auto& SRBAllocator = pRenderDeviceD3D11->GetSRBAllocator();
- auto pShaderResBinding = NEW_RC_OBJ(SRBAllocator, "ShaderResourceBindingD3D11Impl instance", ShaderResourceBindingD3D11Impl)(this, false);
+ auto& SRBAllocator = GetDevice()->GetSRBAllocator();
+ auto pShaderResBinding = NEW_RC_OBJ(SRBAllocator, "ShaderResourceBindingD3D11Impl instance", ShaderResourceBindingD3D11Impl)(this, false);
if (InitStaticResources)
pShaderResBinding->InitializeStaticResources(nullptr);
pShaderResBinding->QueryInterface(IID_ShaderResourceBinding, reinterpret_cast<IObject**>(static_cast<IShaderResourceBinding**>(ppShaderResourceBinding)));
diff --git a/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp
index 537d9db2..94847a51 100644
--- a/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/RenderDeviceD3D11Impl.cpp
@@ -254,7 +254,7 @@ void RenderDeviceD3D11Impl::CreateBufferFromD3DResource(ID3D11Buffer* pd3d11Buff
CreateDeviceObject("buffer", BuffDesc, ppBuffer,
[&]() //
{
- BufferD3D11Impl* pBufferD3D11(NEW_RC_OBJ(m_BufObjAllocator, "BufferD3D11Impl instance", BufferD3D11Impl)(m_BuffViewObjAllocator, this, BuffDesc, InitialState, pd3d11Buffer));
+ BufferD3D11Impl* pBufferD3D11{NEW_RC_OBJ(m_BufObjAllocator, "BufferD3D11Impl instance", BufferD3D11Impl)(m_BuffViewObjAllocator, this, BuffDesc, InitialState, pd3d11Buffer)};
pBufferD3D11->QueryInterface(IID_Buffer, reinterpret_cast<IObject**>(ppBuffer));
pBufferD3D11->CreateDefaultViews();
OnCreateDeviceObject(pBufferD3D11);
@@ -266,7 +266,7 @@ void RenderDeviceD3D11Impl::CreateBuffer(const BufferDesc& BuffDesc, const Buffe
CreateDeviceObject("buffer", BuffDesc, ppBuffer,
[&]() //
{
- BufferD3D11Impl* pBufferD3D11(NEW_RC_OBJ(m_BufObjAllocator, "BufferD3D11Impl instance", BufferD3D11Impl)(m_BuffViewObjAllocator, this, BuffDesc, pBuffData));
+ BufferD3D11Impl* pBufferD3D11{NEW_RC_OBJ(m_BufObjAllocator, "BufferD3D11Impl instance", BufferD3D11Impl)(m_BuffViewObjAllocator, this, BuffDesc, pBuffData)};
pBufferD3D11->QueryInterface(IID_Buffer, reinterpret_cast<IObject**>(ppBuffer));
pBufferD3D11->CreateDefaultViews();
OnCreateDeviceObject(pBufferD3D11);
@@ -278,7 +278,7 @@ void RenderDeviceD3D11Impl::CreateShader(const ShaderCreateInfo& ShaderCI, IShad
CreateDeviceObject("shader", ShaderCI.Desc, ppShader,
[&]() //
{
- ShaderD3D11Impl* pShaderD3D11(NEW_RC_OBJ(m_ShaderObjAllocator, "ShaderD3D11Impl instance", ShaderD3D11Impl)(this, ShaderCI));
+ ShaderD3D11Impl* pShaderD3D11{NEW_RC_OBJ(m_ShaderObjAllocator, "ShaderD3D11Impl instance", ShaderD3D11Impl)(this, ShaderCI)};
pShaderD3D11->QueryInterface(IID_Shader, reinterpret_cast<IObject**>(ppShader));
OnCreateDeviceObject(pShaderD3D11);
@@ -295,7 +295,7 @@ void RenderDeviceD3D11Impl::CreateTexture1DFromD3DResource(ID3D11Texture1D* pd3d
CreateDeviceObject("texture", TexDesc, ppTexture,
[&]() //
{
- TextureBaseD3D11* pTextureD3D11 = NEW_RC_OBJ(m_TexObjAllocator, "Texture1D_D3D11 instance", Texture1D_D3D11)(m_TexViewObjAllocator, this, InitialState, pd3d11Texture);
+ TextureBaseD3D11* pTextureD3D11{NEW_RC_OBJ(m_TexObjAllocator, "Texture1D_D3D11 instance", Texture1D_D3D11)(m_TexViewObjAllocator, this, InitialState, pd3d11Texture)};
pTextureD3D11->QueryInterface(IID_Texture, reinterpret_cast<IObject**>(ppTexture));
pTextureD3D11->CreateDefaultViews();
OnCreateDeviceObject(pTextureD3D11);
@@ -312,7 +312,7 @@ void RenderDeviceD3D11Impl::CreateTexture2DFromD3DResource(ID3D11Texture2D* pd3d
CreateDeviceObject("texture", TexDesc, ppTexture,
[&]() //
{
- TextureBaseD3D11* pTextureD3D11 = NEW_RC_OBJ(m_TexObjAllocator, "Texture2D_D3D11 instance", Texture2D_D3D11)(m_TexViewObjAllocator, this, InitialState, pd3d11Texture);
+ TextureBaseD3D11* pTextureD3D11{NEW_RC_OBJ(m_TexObjAllocator, "Texture2D_D3D11 instance", Texture2D_D3D11)(m_TexViewObjAllocator, this, InitialState, pd3d11Texture)};
pTextureD3D11->QueryInterface(IID_Texture, reinterpret_cast<IObject**>(ppTexture));
pTextureD3D11->CreateDefaultViews();
OnCreateDeviceObject(pTextureD3D11);
@@ -329,7 +329,7 @@ void RenderDeviceD3D11Impl::CreateTexture3DFromD3DResource(ID3D11Texture3D* pd3d
CreateDeviceObject("texture", TexDesc, ppTexture,
[&]() //
{
- TextureBaseD3D11* pTextureD3D11 = NEW_RC_OBJ(m_TexObjAllocator, "Texture3D_D3D11 instance", Texture3D_D3D11)(m_TexViewObjAllocator, this, InitialState, pd3d11Texture);
+ TextureBaseD3D11* pTextureD3D11{NEW_RC_OBJ(m_TexObjAllocator, "Texture3D_D3D11 instance", Texture3D_D3D11)(m_TexViewObjAllocator, this, InitialState, pd3d11Texture)};
pTextureD3D11->QueryInterface(IID_Texture, reinterpret_cast<IObject**>(ppTexture));
pTextureD3D11->CreateDefaultViews();
OnCreateDeviceObject(pTextureD3D11);
@@ -377,7 +377,7 @@ void RenderDeviceD3D11Impl::CreateSampler(const SamplerDesc& SamplerDesc, ISampl
m_SamplersRegistry.Find(SamplerDesc, reinterpret_cast<IDeviceObject**>(ppSampler));
if (*ppSampler == nullptr)
{
- SamplerD3D11Impl* pSamplerD3D11(NEW_RC_OBJ(m_SamplerObjAllocator, "SamplerD3D11Impl instance", SamplerD3D11Impl)(this, SamplerDesc));
+ SamplerD3D11Impl* pSamplerD3D11{NEW_RC_OBJ(m_SamplerObjAllocator, "SamplerD3D11Impl instance", SamplerD3D11Impl)(this, SamplerDesc)};
pSamplerD3D11->QueryInterface(IID_Sampler, reinterpret_cast<IObject**>(ppSampler));
OnCreateDeviceObject(pSamplerD3D11);
m_SamplersRegistry.Add(SamplerDesc, *ppSampler);
@@ -385,26 +385,27 @@ void RenderDeviceD3D11Impl::CreateSampler(const SamplerDesc& SamplerDesc, ISampl
});
}
-void RenderDeviceD3D11Impl::CreateGraphicsPipelineState(const GraphicsPipelineStateCreateInfo& PSOCreateInfo, IPipelineState** ppPipelineState)
+template <typename PSOCreateInfoType>
+void RenderDeviceD3D11Impl::CreatePipelineState(const PSOCreateInfoType& PSOCreateInfo, IPipelineState** ppPipelineState)
{
CreateDeviceObject("Pipeline state", PSOCreateInfo.PSODesc, ppPipelineState,
[&]() //
{
- PipelineStateD3D11Impl* pPipelineStateD3D11(NEW_RC_OBJ(m_PSOAllocator, "PipelineStateD3D11Impl instance", PipelineStateD3D11Impl)(this, PSOCreateInfo));
+ PipelineStateD3D11Impl* pPipelineStateD3D11{NEW_RC_OBJ(m_PSOAllocator, "PipelineStateD3D11Impl instance", PipelineStateD3D11Impl)(this, PSOCreateInfo)};
pPipelineStateD3D11->QueryInterface(IID_PipelineState, reinterpret_cast<IObject**>(ppPipelineState));
OnCreateDeviceObject(pPipelineStateD3D11);
});
}
+
+void RenderDeviceD3D11Impl::CreateGraphicsPipelineState(const GraphicsPipelineStateCreateInfo& PSOCreateInfo, IPipelineState** ppPipelineState)
+{
+ CreatePipelineState(PSOCreateInfo, ppPipelineState);
+}
+
void RenderDeviceD3D11Impl::CreateComputePipelineState(const ComputePipelineStateCreateInfo& PSOCreateInfo, IPipelineState** ppPipelineState)
{
- CreateDeviceObject("Pipeline state", PSOCreateInfo.PSODesc, ppPipelineState,
- [&]() //
- {
- PipelineStateD3D11Impl* pPipelineStateD3D11(NEW_RC_OBJ(m_PSOAllocator, "PipelineStateD3D11Impl instance", PipelineStateD3D11Impl)(this, PSOCreateInfo));
- pPipelineStateD3D11->QueryInterface(IID_PipelineState, reinterpret_cast<IObject**>(ppPipelineState));
- OnCreateDeviceObject(pPipelineStateD3D11);
- });
+ CreatePipelineState(PSOCreateInfo, ppPipelineState);
}
void RenderDeviceD3D11Impl::CreateFence(const FenceDesc& Desc, IFence** ppFence)
@@ -412,7 +413,7 @@ void RenderDeviceD3D11Impl::CreateFence(const FenceDesc& Desc, IFence** ppFence)
CreateDeviceObject("Fence", Desc, ppFence,
[&]() //
{
- FenceD3D11Impl* pFenceD3D11(NEW_RC_OBJ(m_FenceAllocator, "FenceD3D11Impl instance", FenceD3D11Impl)(this, Desc));
+ FenceD3D11Impl* pFenceD3D11{NEW_RC_OBJ(m_FenceAllocator, "FenceD3D11Impl instance", FenceD3D11Impl)(this, Desc)};
pFenceD3D11->QueryInterface(IID_Fence, reinterpret_cast<IObject**>(ppFence));
OnCreateDeviceObject(pFenceD3D11);
});
@@ -423,7 +424,7 @@ void RenderDeviceD3D11Impl::CreateQuery(const QueryDesc& Desc, IQuery** ppQuery)
CreateDeviceObject("Query", Desc, ppQuery,
[&]() //
{
- QueryD3D11Impl* pQueryD3D11(NEW_RC_OBJ(m_QueryAllocator, "QueryD3D11Impl instance", QueryD3D11Impl)(this, Desc));
+ QueryD3D11Impl* pQueryD3D11{NEW_RC_OBJ(m_QueryAllocator, "QueryD3D11Impl instance", QueryD3D11Impl)(this, Desc)};
pQueryD3D11->QueryInterface(IID_Query, reinterpret_cast<IObject**>(ppQuery));
OnCreateDeviceObject(pQueryD3D11);
});
@@ -434,7 +435,7 @@ void RenderDeviceD3D11Impl::CreateRenderPass(const RenderPassDesc& Desc, IRender
CreateDeviceObject("RenderPass", Desc, ppRenderPass,
[&]() //
{
- RenderPassD3D11Impl* pRenderPassD3D11(NEW_RC_OBJ(m_RenderPassAllocator, "RenderPassD3D11Impl instance", RenderPassD3D11Impl)(this, Desc));
+ RenderPassD3D11Impl* pRenderPassD3D11{NEW_RC_OBJ(m_RenderPassAllocator, "RenderPassD3D11Impl instance", RenderPassD3D11Impl)(this, Desc)};
pRenderPassD3D11->QueryInterface(IID_RenderPass, reinterpret_cast<IObject**>(ppRenderPass));
OnCreateDeviceObject(pRenderPassD3D11);
});
@@ -445,7 +446,7 @@ void RenderDeviceD3D11Impl::CreateFramebuffer(const FramebufferDesc& Desc, IFram
CreateDeviceObject("Framebuffer", Desc, ppFramebuffer,
[&]() //
{
- FramebufferD3D11Impl* pFramebufferD3D11(NEW_RC_OBJ(m_FramebufferAllocator, "FramebufferD3D11Impl instance", FramebufferD3D11Impl)(this, Desc));
+ FramebufferD3D11Impl* pFramebufferD3D11{NEW_RC_OBJ(m_FramebufferAllocator, "FramebufferD3D11Impl instance", FramebufferD3D11Impl)(this, Desc)};
pFramebufferD3D11->QueryInterface(IID_Framebuffer, reinterpret_cast<IObject**>(ppFramebuffer));
OnCreateDeviceObject(pFramebufferD3D11);
});