diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2018-05-29 04:16:33 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2018-05-29 04:16:33 +0000 |
| commit | 60e2802464102539b3e0302aa899e22b43b97c0b (patch) | |
| tree | 5a7f854bdcc4ac9d2da616060d33d60816e99965 /Graphics/GraphicsEngineD3D11 | |
| parent | Fixed issue with storage buffer not being bound through UAV in Vulkan; fixed ... (diff) | |
| download | DiligentCore-60e2802464102539b3e0302aa899e22b43b97c0b.tar.gz DiligentCore-60e2802464102539b3e0302aa899e22b43b97c0b.zip | |
Moved vertex buffer stride definition from IDeviceContext::SetVertexBuffers() to vertex layout description
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
| -rw-r--r-- | Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h | 2 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h index d35edc82..fb876a49 100644 --- a/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h +++ b/Graphics/GraphicsEngineD3D11/include/DeviceContextD3D11Impl.h @@ -56,7 +56,7 @@ public: virtual void SetBlendFactors(const float* pBlendFactors = nullptr)override final; - virtual void SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pStrides, Uint32 *pOffsets, Uint32 Flags )override final; + virtual void SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pOffsets, Uint32 Flags )override final; virtual void InvalidateState()override final; diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp index f9b59ede..77b70ea2 100644 --- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp +++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp @@ -616,14 +616,14 @@ namespace Diligent bool BindVBs = m_NumVertexStreams != m_NumCommittedD3D11VBs; - const auto *TightStrides = pPipelineStateD3D11->GetTightStrides(); + const auto *Strides = pPipelineStateD3D11->GetBufferStrides(); for( UINT Slot = 0; Slot < m_NumVertexStreams; ++Slot ) { auto &CurrStream = m_VertexStreams[Slot]; VERIFY( CurrStream.pBuffer, "Attempting to bind a null buffer for rendering" ); auto *pBuffD3D11Impl = CurrStream.pBuffer.RawPtr<BufferD3D11Impl>(); ID3D11Buffer *pd3d11Buffer = pBuffD3D11Impl->m_pd3d11Buffer; - auto Stride = CurrStream.Stride ? CurrStream.Stride : TightStrides[Slot]; + auto Stride = Strides[Slot]; auto Offset = CurrStream.Offset; if(pBuffD3D11Impl->CheckState( D3D11BufferState::UnorderedAccess )) @@ -688,6 +688,7 @@ namespace Diligent auto *pd3d11InputLayout = pPipelineStateD3D11->GetD3D11InputLayout(); if( pd3d11InputLayout != nullptr && !m_bCommittedD3D11VBsUpToDate ) { + VERIFY( m_NumVertexStreams >= pPipelineStateD3D11->GetNumBufferSlotsUsed(), "Currently bound pipeline state \"", pPipelineStateD3D11->GetDesc().Name, "\" expects ", pPipelineStateD3D11->GetNumBufferSlotsUsed(), " input buffer slots, but only ", m_NumVertexStreams, " is bound"); CommitD3D11VertexBuffers(pPipelineStateD3D11); } @@ -851,9 +852,9 @@ namespace Diligent m_pd3d11DeviceContext->Flush(); } - void DeviceContextD3D11Impl::SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pStrides, Uint32 *pOffsets, Uint32 Flags ) + void DeviceContextD3D11Impl::SetVertexBuffers( Uint32 StartSlot, Uint32 NumBuffersSet, IBuffer **ppBuffers, Uint32 *pOffsets, Uint32 Flags ) { - TDeviceContextBase::SetVertexBuffers( StartSlot, NumBuffersSet, ppBuffers, pStrides, pOffsets, Flags ); + TDeviceContextBase::SetVertexBuffers( StartSlot, NumBuffersSet, ppBuffers, pOffsets, Flags ); m_bCommittedD3D11VBsUpToDate = false; } |
