st/nine: Avoid crash on empty Draw*Up
authorAxel Davy <axel.davy@ens.fr>
Sun, 23 Oct 2016 20:27:30 +0000 (22:27 +0200)
committerAxel Davy <axel.davy@ens.fr>
Tue, 20 Dec 2016 22:44:20 +0000 (23:44 +0100)
Ignore empty draw calls.
Avoid assertion fault when such draw calls happen
in u_upload_mgr.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/device9.c

index 8b03e9bc033345c6fe3cf6c40c9b4d9be2ef6762..ddac548418f2f66f11e71151f7b8e8d9ff68a68f 100644 (file)
@@ -3023,6 +3023,7 @@ NineDevice9_DrawPrimitiveUP( struct NineDevice9 *This,
 
     user_assert(pVertexStreamZeroData && VertexStreamZeroStride,
                 D3DERR_INVALIDCALL);
+    user_assert(PrimitiveCount, D3D_OK);
 
     nine_update_state(This);
 
@@ -3089,6 +3090,7 @@ NineDevice9_DrawIndexedPrimitiveUP( struct NineDevice9 *This,
     user_assert(VertexStreamZeroStride, D3DERR_INVALIDCALL);
     user_assert(IndexDataFormat == D3DFMT_INDEX16 ||
                 IndexDataFormat == D3DFMT_INDEX32, D3DERR_INVALIDCALL);
+    user_assert(PrimitiveCount, D3D_OK);
 
     nine_update_state(This);