summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-08-21 13:17:54 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-08-21 13:17:54 +0000
commitd50d9030e3ba79a8ebe81c8982d5399c65073597 (patch)
treec6102e6d2428fe829d5e238b863cf57c7c9f0272 /Graphics/GraphicsEngineD3D11
parentRemoved dummy shader variable. Added final kw to implementation classes. (diff)
downloadDiligentCore-d50d9030e3ba79a8ebe81c8982d5399c65073597.tar.gz
DiligentCore-d50d9030e3ba79a8ebe81c8982d5399c65073597.zip
Fixed https://github.com/DiligentGraphics/DiligentCore/issues/19 (Add support for NULL buffers in SetVertexBuffers)
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
index 93a77faa..ecd91282 100755
--- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
@@ -708,13 +708,12 @@ namespace Diligent
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();
- ID3D11Buffer* pd3d11Buffer = pBuffD3D11Impl->m_pd3d11Buffer;
+ ID3D11Buffer* pd3d11Buffer = pBuffD3D11Impl ? pBuffD3D11Impl->m_pd3d11Buffer : nullptr;
auto Stride = Strides[Slot];
auto Offset = CurrStream.Offset;
- if(pBuffD3D11Impl->CheckState( D3D11BufferState::UnorderedAccess ))
+ if(pBuffD3D11Impl != nullptr && pBuffD3D11Impl->CheckState( D3D11BufferState::UnorderedAccess ))
{
UnbindResourceFromUAV(pBuffD3D11Impl, pd3d11Buffer);
pBuffD3D11Impl->ClearState( D3D11BufferState::UnorderedAccess );
@@ -732,7 +731,8 @@ namespace Diligent
m_CommittedD3D11VBStrides[Slot] = Stride;
m_CommittedD3D11VBOffsets[Slot] = Offset;
- pBuffD3D11Impl->AddState( D3D11BufferState::VertexBuffer );
+ if (pBuffD3D11Impl)
+ pBuffD3D11Impl->AddState( D3D11BufferState::VertexBuffer );
}
}