summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-03-07 16:44:55 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-03-07 16:44:55 +0000
commit3f579a5ff60f5e54959abe2c85fc612e674ef91c (patch)
tree92e4aabb6997d86698baeaab8c216c8fbdf0caab /Graphics/GraphicsEngineD3D12
parentFew minor improvements to shader resource management in Vk backend (diff)
downloadDiligentCore-3f579a5ff60f5e54959abe2c85fc612e674ef91c.tar.gz
DiligentCore-3f579a5ff60f5e54959abe2c85fc612e674ef91c.zip
Improved handling input layout elements in the pipeline state
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/include/D3D12TypeConversions.h2
-rw-r--r--Graphics/GraphicsEngineD3D12/src/D3D12TypeConversions.cpp6
-rw-r--r--Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp5
3 files changed, 7 insertions, 6 deletions
diff --git a/Graphics/GraphicsEngineD3D12/include/D3D12TypeConversions.h b/Graphics/GraphicsEngineD3D12/include/D3D12TypeConversions.h
index aab656eb..16c3a3e8 100644
--- a/Graphics/GraphicsEngineD3D12/include/D3D12TypeConversions.h
+++ b/Graphics/GraphicsEngineD3D12/include/D3D12TypeConversions.h
@@ -40,7 +40,7 @@ void DepthStencilStateDesc_To_D3D12_DEPTH_STENCIL_DESC(const DepthStencilStateDe
void RasterizerStateDesc_To_D3D12_RASTERIZER_DESC(const RasterizerStateDesc &RasterizerDesc, D3D12_RASTERIZER_DESC &d3d11RSDesc);
void BlendStateDesc_To_D3D12_BLEND_DESC(const BlendStateDesc &BSDesc, D3D12_BLEND_DESC &d3d12BlendDesc);
-void LayoutElements_To_D3D12_INPUT_ELEMENT_DESCs(const std::vector<LayoutElement, STDAllocatorRawMem<LayoutElement>> &LayoutElements,
+void LayoutElements_To_D3D12_INPUT_ELEMENT_DESCs(const InputLayoutDesc& InputLayout,
std::vector<D3D12_INPUT_ELEMENT_DESC, STDAllocatorRawMem<D3D12_INPUT_ELEMENT_DESC> > &d3d12InputElements);
void TextureViewDesc_to_D3D12_SRV_DESC(const TextureViewDesc& SRVDesc, D3D12_SHADER_RESOURCE_VIEW_DESC &D3D12SRVDesc, Uint32 SampleCount);
diff --git a/Graphics/GraphicsEngineD3D12/src/D3D12TypeConversions.cpp b/Graphics/GraphicsEngineD3D12/src/D3D12TypeConversions.cpp
index b533aec9..55d5bfed 100644
--- a/Graphics/GraphicsEngineD3D12/src/D3D12TypeConversions.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/D3D12TypeConversions.cpp
@@ -128,10 +128,10 @@ void BlendStateDesc_To_D3D12_BLEND_DESC(const BlendStateDesc& BSDesc, D3D12_BLEN
}
}
-void LayoutElements_To_D3D12_INPUT_ELEMENT_DESCs(const std::vector<LayoutElement, STDAllocatorRawMem<LayoutElement>> &LayoutElements,
- std::vector<D3D12_INPUT_ELEMENT_DESC, STDAllocatorRawMem<D3D12_INPUT_ELEMENT_DESC> > &d3d12InputElements)
+void LayoutElements_To_D3D12_INPUT_ELEMENT_DESCs(const InputLayoutDesc& InputLayout,
+ std::vector<D3D12_INPUT_ELEMENT_DESC, STDAllocatorRawMem<D3D12_INPUT_ELEMENT_DESC> >& d3d12InputElements)
{
- LayoutElements_To_D3D_INPUT_ELEMENT_DESCs<D3D12_INPUT_ELEMENT_DESC>(LayoutElements, d3d12InputElements);
+ LayoutElements_To_D3D_INPUT_ELEMENT_DESCs<D3D12_INPUT_ELEMENT_DESC>(InputLayout, d3d12InputElements);
}
D3D12_PRIMITIVE_TOPOLOGY TopologyToD3D12Topology(PRIMITIVE_TOPOLOGY Topology)
diff --git a/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp
index 46530860..d1f015f3 100644
--- a/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/PipelineStateD3D12Impl.cpp
@@ -218,9 +218,10 @@ PipelineStateD3D12Impl :: PipelineStateD3D12Impl(IReferenceCounters* pRefCo
DepthStencilStateDesc_To_D3D12_DEPTH_STENCIL_DESC(GraphicsPipeline.DepthStencilDesc, d3d12PSODesc.DepthStencilState);
std::vector<D3D12_INPUT_ELEMENT_DESC, STDAllocatorRawMem<D3D12_INPUT_ELEMENT_DESC>> d312InputElements( STD_ALLOCATOR_RAW_MEM(D3D12_INPUT_ELEMENT_DESC, GetRawAllocator(), "Allocator for vector<D3D12_INPUT_ELEMENT_DESC>") );
- if (m_LayoutElements.size() > 0)
+ const auto& InputLayout = m_Desc.GraphicsPipeline.InputLayout;
+ if (InputLayout.NumElements > 0)
{
- LayoutElements_To_D3D12_INPUT_ELEMENT_DESCs(m_LayoutElements, d312InputElements);
+ LayoutElements_To_D3D12_INPUT_ELEMENT_DESCs(InputLayout, d312InputElements);
d3d12PSODesc.InputLayout.NumElements = static_cast<UINT>(d312InputElements.size());
d3d12PSODesc.InputLayout.pInputElementDescs = d312InputElements.data();
}