From c12ef63b6940d35584ca8a808c70ee926a02569d Mon Sep 17 00:00:00 2001 From: Charmaine Lee Date: Fri, 1 Sep 2017 12:34:01 -0700 Subject: [PATCH] svga: move index buffer bind flag assertion The buffer bind flags can be promoted in svga_buffer_handle(), so move the assertion after it. This has already been done for vertex buffer in commit 6b4bf7e8be, but it misses the one for index buffer. Fixes assertion running WarThunder. Reviewed-by: Neha Bhende --- src/gallium/drivers/svga/svga_draw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/svga/svga_draw.c b/src/gallium/drivers/svga/svga_draw.c index 0639d5eaebe..5771903955f 100644 --- a/src/gallium/drivers/svga/svga_draw.c +++ b/src/gallium/drivers/svga/svga_draw.c @@ -589,12 +589,12 @@ draw_vgpu10(struct svga_hwtnl *hwtnl, if (ib) { struct svga_buffer *sbuf = svga_buffer(ib); - assert(sbuf->key.flags & SVGA3D_SURFACE_BIND_INDEX_BUFFER); - (void) sbuf; /* silence unused var warning */ - ib_handle = svga_buffer_handle(svga, ib, PIPE_BIND_INDEX_BUFFER); if (!ib_handle) return PIPE_ERROR_OUT_OF_MEMORY; + + assert(sbuf->key.flags & SVGA3D_SURFACE_BIND_INDEX_BUFFER); + (void) sbuf; /* silence unused var warning */ } else { ib_handle = NULL; -- 2.30.2