Module: Mesa
Branch: master
Commit: 47cfc83440c3030999a08c0b5fccae860294608c
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=47cfc83440c3030999a08c0b5fccae860294608c

Author: Charmaine Lee <[email protected]>
Date:   Tue Jan 19 20:25:39 2016 -0800

svga: rebind index buffer

Similar to other resources, current index buffer needs to be
rebound at the first draw of the current command buffer to make
sure the buffer is available for the draw command.

Fixes bug 1587263.

Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Jose Fonseca <[email protected]>

---

 src/gallium/drivers/svga/svga_context.c | 1 +
 src/gallium/drivers/svga/svga_draw.c    | 8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/src/gallium/drivers/svga/svga_context.c 
b/src/gallium/drivers/svga/svga_context.c
index da42814..896dcdf 100644
--- a/src/gallium/drivers/svga/svga_context.c
+++ b/src/gallium/drivers/svga/svga_context.c
@@ -247,6 +247,7 @@ struct pipe_context *svga_context_create(struct pipe_screen 
*screen,
           sizeof(svga->state.hw_draw.default_constbuf_size));
    memset(svga->state.hw_draw.enabled_constbufs, 0,
           sizeof(svga->state.hw_draw.enabled_constbufs));
+   svga->state.hw_draw.ib = NULL;
 
    /* Create a no-operation blend state which we will bind whenever the
     * requested blend state is impossible (e.g. due to having an integer
diff --git a/src/gallium/drivers/svga/svga_draw.c 
b/src/gallium/drivers/svga/svga_draw.c
index fe6cf71..3eda09a 100644
--- a/src/gallium/drivers/svga/svga_draw.c
+++ b/src/gallium/drivers/svga/svga_draw.c
@@ -458,6 +458,14 @@ draw_vgpu10(struct svga_hwtnl *hwtnl,
       ret = svga_rebind_shaders(svga);
       if (ret != PIPE_OK)
          return ret;
+
+      /* Rebind index buffer */
+      if (svga->state.hw_draw.ib) {
+         struct svga_winsys_context *swc = svga->swc;
+         ret = swc->resource_rebind(swc, svga->state.hw_draw.ib, NULL, 
SVGA_RELOC_READ);
+         if (ret != PIPE_OK)
+            return ret;
+      }
    }
 
    ret = validate_sampler_resources(svga);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to