svga: move assertion in draw_vgpu10()
authorBrian Paul <brianp@vmware.com>
Fri, 30 Jun 2017 21:07:08 +0000 (14:07 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 3 Jul 2017 16:10:13 +0000 (10:10 -0600)
The buffer binding flags aren't ensured until after the
svga_buffer_handle() call, so move the assertion after it.

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

index 6510c4244339bba4e899c2812bd2238cdb585d4a..5919bd35daeae8214efd029003878a7a949f5f28 100644 (file)
@@ -548,9 +548,9 @@ draw_vgpu10(struct svga_hwtnl *hwtnl,
       struct svga_buffer *sbuf = svga_buffer(hwtnl->cmd.vbufs[i].buffer.resource);
 
       if (sbuf) {
-         assert(sbuf->key.flags & SVGA3D_SURFACE_BIND_VERTEX_BUFFER);
          vbuffer_handles[i] = svga_buffer_handle(svga, &sbuf->b.b,
                                                  PIPE_BIND_VERTEX_BUFFER);
+         assert(sbuf->key.flags & SVGA3D_SURFACE_BIND_VERTEX_BUFFER);
          if (vbuffer_handles[i] == NULL)
             return PIPE_ERROR_OUT_OF_MEMORY;
          vbuffers[i] = &sbuf->b.b;