From 3f579a5ff60f5e54959abe2c85fc612e674ef91c Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 7 Mar 2019 08:44:55 -0800 Subject: Improved handling input layout elements in the pipeline state --- Graphics/GraphicsEngineD3D11/include/D3D11TypeConversions.h | 4 ++-- Graphics/GraphicsEngineD3D11/src/D3D11TypeConversions.cpp | 4 ++-- Graphics/GraphicsEngineD3D11/src/PipelineStateD3D11Impl.cpp | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'Graphics/GraphicsEngineD3D11') 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 > &LayoutElements, - std::vector > &D3D11InputElements); +void LayoutElements_To_D3D11_INPUT_ELEMENT_DESCs(const InputLayoutDesc& InputLayout, + std::vector >& 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 >& LayoutElements, +void LayoutElements_To_D3D11_INPUT_ELEMENT_DESCs(const InputLayoutDesc& InputLayout, std::vector >& D3D11InputElements) { - LayoutElements_To_D3D_INPUT_ELEMENT_DESCs(LayoutElements, D3D11InputElements); + LayoutElements_To_D3D_INPUT_ELEMENT_DESCs(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 > d311InputElements(STD_ALLOCATOR_RAW_MEM(D3D11_INPUT_ELEMENT_DESC, GetRawAllocator(), "Allocator for vector") ); - LayoutElements_To_D3D11_INPUT_ELEMENT_DESCs(m_LayoutElements, d311InputElements); + LayoutElements_To_D3D11_INPUT_ELEMENT_DESCs(InputLayout, d311InputElements); ID3DBlob* pVSByteCode = m_pVS.RawPtr()->GetBytecode(); if( !pVSByteCode ) -- cgit v1.2.3