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

ddraw: Return early in d3d_device7_DrawPrimitive() with a 0 vertex count.

parent d71132ed
......@@ -3508,8 +3508,11 @@ static HRESULT d3d_device7_DrawPrimitive(IDirect3DDevice7 *iface,
TRACE("iface %p, primitive_type %#x, fvf %#x, vertices %p, vertex_count %u, flags %#x.\n",
iface, primitive_type, fvf, vertices, vertex_count, flags);
if (!vertices)
return DDERR_INVALIDPARAMS;
if (!vertex_count)
{
WARN("0 vertex count.\n");
return D3D_OK;
}
/* Get the stride */
stride = get_flexible_vertex_size(fvf);
......
......@@ -10134,7 +10134,7 @@ static void test_draw_primitive(void)
hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, NULL, 0, NULL, 0, 0);
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);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice2_DrawIndexedPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, NULL, 0, indices, 4, 0);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
......
......@@ -11427,7 +11427,7 @@ static void test_draw_primitive(void)
hr = IDirect3DDevice3_DrawIndexedPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, NULL, 0, 0);
todo_wine ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice3_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, 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_DrawPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 0, 0);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice3_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 0, 0);
......
......@@ -11694,7 +11694,7 @@ static void test_draw_primitive(void)
hr = IDirect3DDevice7_DrawIndexedPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 0, NULL, 0, 0);
todo_wine ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice7_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, 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_DrawPrimitiveStrided(device, D3DPT_TRIANGLESTRIP, D3DFVF_XYZ, &strided, 0, 0);
ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr);
hr = IDirect3DDevice7_DrawPrimitiveVB(device, D3DPT_TRIANGLESTRIP, vb, 0, 0, 0);
......
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