svga: unbind index buffer when drawing non-indexed primitives

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>
This commit is contained in:
Brian Paul 2016-02-22 08:53:47 -07:00
parent 571bd9ac42
commit 9de3b0273d
1 changed files with 10 additions and 0 deletions

View 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,