1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-29 19:24:10 +01:00

[d3d9] Handle zero-sized draws

These return S_OK, because ofc they do.
This commit is contained in:
Joshua Ashton 2021-05-01 10:00:53 +01:00 committed by Joshie
parent 0f52c85d21
commit f0c1e89443

View File

@ -2333,6 +2333,9 @@ namespace dxvk {
D3DPRIMITIVETYPE PrimitiveType, D3DPRIMITIVETYPE PrimitiveType,
UINT StartVertex, UINT StartVertex,
UINT PrimitiveCount) { UINT PrimitiveCount) {
if (unlikely(!PrimitiveCount))
return S_OK;
D3D9DeviceLock lock = LockDevice(); D3D9DeviceLock lock = LockDevice();
PrepareDraw(PrimitiveType); PrepareDraw(PrimitiveType);
@ -2363,6 +2366,9 @@ namespace dxvk {
UINT NumVertices, UINT NumVertices,
UINT StartIndex, UINT StartIndex,
UINT PrimitiveCount) { UINT PrimitiveCount) {
if (unlikely(!PrimitiveCount))
return S_OK;
D3D9DeviceLock lock = LockDevice(); D3D9DeviceLock lock = LockDevice();
PrepareDraw(PrimitiveType); PrepareDraw(PrimitiveType);
@ -2393,6 +2399,9 @@ namespace dxvk {
UINT PrimitiveCount, UINT PrimitiveCount,
const void* pVertexStreamZeroData, const void* pVertexStreamZeroData,
UINT VertexStreamZeroStride) { UINT VertexStreamZeroStride) {
if (unlikely(!PrimitiveCount))
return S_OK;
D3D9DeviceLock lock = LockDevice(); D3D9DeviceLock lock = LockDevice();
PrepareDraw(PrimitiveType); PrepareDraw(PrimitiveType);
@ -2440,6 +2449,9 @@ namespace dxvk {
D3DFORMAT IndexDataFormat, D3DFORMAT IndexDataFormat,
const void* pVertexStreamZeroData, const void* pVertexStreamZeroData,
UINT VertexStreamZeroStride) { UINT VertexStreamZeroStride) {
if (unlikely(!PrimitiveCount))
return S_OK;
D3D9DeviceLock lock = LockDevice(); D3D9DeviceLock lock = LockDevice();
PrepareDraw(PrimitiveType); PrepareDraw(PrimitiveType);