Commit af4e471e authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Return early in d3d_device7_DrawIndexedPrimitive() with a 0 vertex or index count.

parent 41975efe
......@@ -3689,6 +3689,12 @@ static HRESULT d3d_device7_DrawIndexedPrimitive(IDirect3DDevice7 *iface,
"indices %p, index_count %u, flags %#x.\n",
iface, primitive_type, fvf, vertices, vertex_count, indices, index_count, flags);
if (!vertex_count || !index_count)
{
WARN("0 vertex or index count.\n");
return D3D_OK;
}
/* Set the D3DDevice's FVF */
wined3d_mutex_lock();
......
......@@ -10132,15 +10132,15 @@ static void test_draw_primitive(void)
IDirect3D2_Release(d3d);
hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, NULL, 0, NULL, 0, 0);
todo_wine ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, NULL, 0, 0);
todo_wine ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, NULL, 0, indices, 4, 0);
todo_wine ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, NULL, 0, 0);
todo_wine ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, 0);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, quad, 4, indices, 4, 0);
......
......@@ -11420,7 +11420,7 @@ static void test_draw_primitive(void)
memset(&strided, 0, sizeof(strided));
hr = IDirect3DDevice3_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, NULL, 0, NULL, 0, 0);
todo_wine ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice3_DrawIndexedPrimitiveStrided(device,
D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 0, NULL, 0, 0);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
......@@ -11434,7 +11434,7 @@ static void test_draw_primitive(void)
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice3_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, NULL, 0, indices, 4, 0);
todo_wine ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice3_DrawIndexedPrimitiveStrided(device,
D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 0, indices, 4, 0);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
......
......@@ -11685,7 +11685,7 @@ static void test_draw_primitive(void)
memset(&strided, 0, sizeof(strided));
hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, NULL, 0, NULL, 0, 0);
todo_wine ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice7_DrawIndexedPrimitiveStrided(device,
D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 0, NULL, 0, 0);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
......@@ -11701,7 +11701,7 @@ static void test_draw_primitive(void)
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice7_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, NULL, 0, indices, 4, 0);
todo_wine ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice7_DrawIndexedPrimitiveStrided(device,
D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 0, indices, 4, 0);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment