diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index f7723723..242e6f3f 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -2333,6 +2333,9 @@ namespace dxvk { D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) { + if (unlikely(!PrimitiveCount)) + return S_OK; + D3D9DeviceLock lock = LockDevice(); PrepareDraw(PrimitiveType); @@ -2363,6 +2366,9 @@ namespace dxvk { UINT NumVertices, UINT StartIndex, UINT PrimitiveCount) { + if (unlikely(!PrimitiveCount)) + return S_OK; + D3D9DeviceLock lock = LockDevice(); PrepareDraw(PrimitiveType); @@ -2393,6 +2399,9 @@ namespace dxvk { UINT PrimitiveCount, const void* pVertexStreamZeroData, UINT VertexStreamZeroStride) { + if (unlikely(!PrimitiveCount)) + return S_OK; + D3D9DeviceLock lock = LockDevice(); PrepareDraw(PrimitiveType); @@ -2440,6 +2449,9 @@ namespace dxvk { D3DFORMAT IndexDataFormat, const void* pVertexStreamZeroData, UINT VertexStreamZeroStride) { + if (unlikely(!PrimitiveCount)) + return S_OK; + D3D9DeviceLock lock = LockDevice(); PrepareDraw(PrimitiveType);