diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-03-07 16:44:55 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-03-07 16:44:55 +0000 |
| commit | 3f579a5ff60f5e54959abe2c85fc612e674ef91c (patch) | |
| tree | 92e4aabb6997d86698baeaab8c216c8fbdf0caab /Graphics/GraphicsEngineD3D11 | |
| parent | Few minor improvements to shader resource management in Vk backend (diff) | |
| download | DiligentCore-3f579a5ff60f5e54959abe2c85fc612e674ef91c.tar.gz DiligentCore-3f579a5ff60f5e54959abe2c85fc612e674ef91c.zip | |
Improved handling input layout elements in the pipeline state
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
3 files changed, 7 insertions, 6 deletions
diff --git a/Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.h b/Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.h index 16e76c9c..3041c8f4 100644 --- a/Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.h +++ b/Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.h @@ -158,8 +158,8 @@ D3D11_COMPARISON_FUNC ComparisonFuncToD3D11ComparisonFunc(COMPARISON_FUNCTION Fu void DepthStencilStateDesc_To_D3D11_DEPTH_STENCIL_DESC(const DepthStencilStateDesc &DepthStencilDesc, D3D11_DEPTH_STENCIL_DESC &d3d11DSSDesc); void RasterizerStateDesc_To_D3D11_RASTERIZER_DESC(const RasterizerStateDesc &RasterizerDesc, D3D11_RASTERIZER_DESC &d3d11RSDesc); void BlendStateDesc_To_D3D11_BLEND_DESC(const BlendStateDesc &BSDesc, D3D11_BLEND_DESC &D3D11BSDesc); -void LayoutElements_To_D3D11_INPUT_ELEMENT_DESCs(const std::vector<LayoutElement, STDAllocatorRawMem<LayoutElement> > &LayoutElements, - std::vector<D3D11_INPUT_ELEMENT_DESC, STDAllocatorRawMem<D3D11_INPUT_ELEMENT_DESC> > &D3D11InputElements); +void LayoutElements_To_D3D11_INPUT_ELEMENT_DESCs(const InputLayoutDesc& InputLayout, + std::vector<D3D11_INPUT_ELEMENT_DESC, STDAllocatorRawMem<D3D11_INPUT_ELEMENT_DESC> >& D3D11InputElements); void TextureViewDesc_to_D3D11_SRV_DESC(const TextureViewDesc& TexViewDesc, D3D11_SHADER_RESOURCE_VIEW_DESC &D3D11SRVDesc, Uint32 SampleCount); void TextureViewDesc_to_D3D11_RTV_DESC(const TextureViewDesc& TexViewDesc, D3D11_RENDER_TARGET_VIEW_DESC &D3D11RTVDesc, Uint32 SampleCount); diff --git a/Graphics/GraphicsEngineD3D11/src/D3D11TypeConversions.cpp b/Graphics/GraphicsEngineD3D11/src/D3D11TypeConversions.cpp index 5cade5d1..c730a5e0 100644 --- a/Graphics/GraphicsEngineD3D11/src/D3D11TypeConversions.cpp +++ b/Graphics/GraphicsEngineD3D11/src/D3D11TypeConversions.cpp @@ -72,10 +72,10 @@ void BlendStateDesc_To_D3D11_BLEND_DESC(const BlendStateDesc& BSDesc, D3D11_BLEN } } -void LayoutElements_To_D3D11_INPUT_ELEMENT_DESCs(const std::vector<LayoutElement, STDAllocatorRawMem<LayoutElement> >& LayoutElements, +void LayoutElements_To_D3D11_INPUT_ELEMENT_DESCs(const InputLayoutDesc& InputLayout, std::vector<D3D11_INPUT_ELEMENT_DESC, STDAllocatorRawMem<D3D11_INPUT_ELEMENT_DESC> >& D3D11InputElements) { - LayoutElements_To_D3D_INPUT_ELEMENT_DESCs<D3D11_INPUT_ELEMENT_DESC>(LayoutElements, D3D11InputElements); + LayoutElements_To_D3D_INPUT_ELEMENT_DESCs<D3D11_INPUT_ELEMENT_DESC>(InputLayout, D3D11InputElements); } D3D11_PRIMITIVE_TOPOLOGY TopologyToD3D11Topology(PRIMITIVE_TOPOLOGY Topology) diff --git a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp index d9cc1c21..ff165df6 100644 --- a/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp @@ -98,10 +98,11 @@ PipelineStateD3D11Impl::PipelineStateD3D11Impl(IReferenceCounters* pRefCoun "Failed to create D3D11 depth stencil state" ); // Create input layout - if( m_LayoutElements.size() > 0 ) + const auto& InputLayout = m_Desc.GraphicsPipeline.InputLayout; + if (InputLayout.NumElements > 0) { std::vector<D3D11_INPUT_ELEMENT_DESC, STDAllocatorRawMem<D3D11_INPUT_ELEMENT_DESC> > d311InputElements(STD_ALLOCATOR_RAW_MEM(D3D11_INPUT_ELEMENT_DESC, GetRawAllocator(), "Allocator for vector<D3D11_INPUT_ELEMENT_DESC>") ); - LayoutElements_To_D3D11_INPUT_ELEMENT_DESCs(m_LayoutElements, d311InputElements); + LayoutElements_To_D3D11_INPUT_ELEMENT_DESCs(InputLayout, d311InputElements); ID3DBlob* pVSByteCode = m_pVS.RawPtr<ShaderD3D11Impl>()->GetBytecode(); if( !pVSByteCode ) |
