[Mesa-dev] [PATCH 2/4] svga: move assertion in draw_vgpu10()

Brian Paul brianp at vmware.com
Sun Jul 2 15:12:24 UTC 2017


The buffer binding flags aren't ensured until after the
svga_buffer_handle() call, so move the assertion after it.
---
 src/gallium/drivers/svga/svga_draw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/svga/svga_draw.c b/src/gallium/drivers/svga/svga_draw.c
index 6510c42..5919bd3 100644
--- a/src/gallium/drivers/svga/svga_draw.c
+++ b/src/gallium/drivers/svga/svga_draw.c
@@ -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;
-- 
1.9.1



More information about the mesa-dev mailing list