svga: unbind index buffer when drawing non-indexed primitives
authorBrian Paul <brianp@vmware.com>
Mon, 22 Feb 2016 15:53:47 +0000 (08:53 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 22 Feb 2016 19:14:48 +0000 (12:14 -0700)
Silences a warning reported by the svga3d device.

v2: also null-out the index buffer pointer

Reviewed-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/drivers/svga/svga_draw.c

index 80526ed4d1578c5e3c2424bd104a1a3f66d0cde0..fe6cf71a6e570dfbf659986db4e85765a3a48b13 100644 (file)
@@ -590,6 +590,16 @@ draw_vgpu10(struct svga_hwtnl *hwtnl,
    }
    else {
       /* non-indexed drawing */
+      if (svga->state.hw_draw.ib_format != SVGA3D_FORMAT_INVALID) {
+         /* Unbind previously bound index buffer */
+         ret = SVGA3D_vgpu10_SetIndexBuffer(svga->swc, NULL,
+                                            SVGA3D_FORMAT_INVALID, 0);
+         if (ret != PIPE_OK)
+            return ret;
+         svga->state.hw_draw.ib_format = SVGA3D_FORMAT_INVALID;
+         svga->state.hw_draw.ib = NULL;
+      }
+
       if (instance_count > 1) {
          ret = SVGA3D_vgpu10_DrawInstanced(svga->swc,
                                            vcount,