Mesa (master): nv50: rebind bo to bufctx when invalidating idxbuf storage

Ilia Mirkin imirkin at kemper.freedesktop.org
Sun Sep 6 03:09:14 UTC 2015


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

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Fri Jul  3 20:16:48 2015 -0400

nv50: rebind bo to bufctx when invalidating idxbuf storage

There is nothing to be done on a dirty idxbuf, but the bo may have
changed, so we have to rebind it to the bufctx.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Cc: mesa-stable at lists.freedesktop.org

---

 src/gallium/drivers/nouveau/nv50/nv50_context.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/nouveau/nv50/nv50_context.c b/src/gallium/drivers/nouveau/nv50/nv50_context.c
index 4949459..4108f48 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_context.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_context.c
@@ -199,9 +199,13 @@ nv50_invalidate_resource_storage(struct nouveau_context *ctx,
          }
       }
 
-      if (nv50->idxbuf.buffer == res)
+      if (nv50->idxbuf.buffer == res) {
+         /* Just rebind to the bufctx as there is no separate dirty bit */
+         nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_INDEX);
+         BCTX_REFN(nv50->bufctx_3d, INDEX, nv04_resource(res), RD);
          if (!--ref)
             return ref;
+      }
 
       for (s = 0; s < 3; ++s) {
       assert(nv50->num_textures[s] <= PIPE_MAX_SAMPLERS);




More information about the mesa-commit mailing list