summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D11
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-10-23 02:02:06 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-10-23 02:02:06 +0000
commitc616fb6343e940f2240e1ed39ad46dd56069ba1d (patch)
treec09fb83aa362a094b6c01b699bca976f8587aadb /Graphics/GraphicsEngineD3D11
parentRenamed DRAW_FLAG_DYNAMIC_BUFFERS_INTACT to DRAW_FLAG_DYNAMIC_RESOURCE_BUFFER... (diff)
downloadDiligentCore-c616fb6343e940f2240e1ed39ad46dd56069ba1d.tar.gz
DiligentCore-c616fb6343e940f2240e1ed39ad46dd56069ba1d.zip
D3D11 and GL backends: fixed instanced draw calls with one instance and non-zero FirstInstanceLocation
Diffstat (limited to 'Graphics/GraphicsEngineD3D11')
-rwxr-xr-xGraphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
index 40be5457..9bcf8152 100755
--- a/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
+++ b/Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp
@@ -813,7 +813,7 @@ namespace Diligent
PrepareForDraw(Attribs.Flags);
- if (Attribs.NumInstances > 1)
+ if (Attribs.NumInstances > 1 || Attribs.FirstInstanceLocation != 0)
m_pd3d11DeviceContext->DrawInstanced(Attribs.NumVertices, Attribs.NumInstances, Attribs.StartVertexLocation, Attribs.FirstInstanceLocation);
else
m_pd3d11DeviceContext->Draw(Attribs.NumVertices, Attribs.StartVertexLocation);
@@ -826,7 +826,7 @@ namespace Diligent
PrepareForIndexedDraw(Attribs.Flags, Attribs.IndexType);
- if (Attribs.NumInstances > 1)
+ if (Attribs.NumInstances > 1 || Attribs.FirstInstanceLocation != 0)
m_pd3d11DeviceContext->DrawIndexedInstanced(Attribs.NumIndices, Attribs.NumInstances, Attribs.FirstIndexLocation, Attribs.BaseVertex, Attribs.FirstInstanceLocation);
else
m_pd3d11DeviceContext->DrawIndexed(Attribs.NumIndices, Attribs.FirstIndexLocation, Attribs.BaseVertex);