summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngine
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-08-27 00:42:27 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-08-27 00:42:27 +0000
commitc69223c93a2e53b5cfa3de2d013f094cb500716a (patch)
tree4586a26aacc763eea8d9158f4380fb55f898a01a /Graphics/GraphicsEngine
parentFixed issue with buffer view offset in VK backend (diff)
downloadDiligentCore-c69223c93a2e53b5cfa3de2d013f094cb500716a.tar.gz
DiligentCore-c69223c93a2e53b5cfa3de2d013f094cb500716a.zip
Fixed false warning about zero indices for indirect draw/dispatch commands
Diffstat (limited to 'Graphics/GraphicsEngine')
-rw-r--r--Graphics/GraphicsEngine/include/DeviceContextBase.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/Graphics/GraphicsEngine/include/DeviceContextBase.h b/Graphics/GraphicsEngine/include/DeviceContextBase.h
index a1052c9b..1e2911fa 100644
--- a/Graphics/GraphicsEngine/include/DeviceContextBase.h
+++ b/Graphics/GraphicsEngine/include/DeviceContextBase.h
@@ -640,15 +640,16 @@ inline bool DeviceContextBase<BaseInterface, BufferImplType, TextureViewImplType
return false;
}
- if (drawAttribs.NumIndices == 0)
+ if(drawAttribs.pIndirectDrawAttribs == nullptr)
{
- LOG_WARNING_MESSAGE(drawAttribs.IsIndexed ? "Number of indices to draw is zero" : "Number of vertices to draw is zero");
- }
+ if (drawAttribs.NumIndices == 0)
+ LOG_WARNING_MESSAGE(drawAttribs.IsIndexed ? "Number of indices to draw is zero" : "Number of vertices to draw is zero");
- if (drawAttribs.NumInstances == 0)
- {
- LOG_ERROR("Number of instances cannot be 0. Use 1 for a non-instanced draw command.");
- return false;
+ if (drawAttribs.NumInstances == 0)
+ {
+ LOG_ERROR("Number of instances cannot be 0. Use 1 for a non-instanced draw command.");
+ return false;
+ }
}
if (drawAttribs.IsIndexed && drawAttribs.IndexType != VT_UINT16 && drawAttribs.IndexType != VT_UINT32)
@@ -675,14 +676,17 @@ inline bool DeviceContextBase<BaseInterface, BufferImplType, TextureViewImplType
return false;
}
- if (DispatchAttrs.ThreadGroupCountX == 0)
- LOG_WARNING_MESSAGE("ThreadGroupCountX is zero");
+ if(DispatchAttrs.pIndirectDispatchAttribs == nullptr)
+ {
+ if (DispatchAttrs.ThreadGroupCountX == 0)
+ LOG_WARNING_MESSAGE("ThreadGroupCountX is zero");
- if (DispatchAttrs.ThreadGroupCountY == 0)
- LOG_WARNING_MESSAGE("ThreadGroupCountY is zero");
+ if (DispatchAttrs.ThreadGroupCountY == 0)
+ LOG_WARNING_MESSAGE("ThreadGroupCountY is zero");
- if (DispatchAttrs.ThreadGroupCountZ == 0)
- LOG_WARNING_MESSAGE("ThreadGroupCountZ is zero");
+ if (DispatchAttrs.ThreadGroupCountZ == 0)
+ LOG_WARNING_MESSAGE("ThreadGroupCountZ is zero");
+ }
return true;
}