nvc0: invalidate texture buffers for compute
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 12 May 2016 18:54:41 +0000 (20:54 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 12 May 2016 19:37:08 +0000 (21:37 +0200)
This is a pretty rare situation but this can happen though.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nvc0/nvc0_context.c

index 428b33d3318f21bc9fda0e97cb88b709bb85dfd6..d51e89d672fad5fefb08aea90d34fdadb8bc56ab 100644 (file)
@@ -263,13 +263,18 @@ nvc0_invalidate_resource_storage(struct nouveau_context *ctx,
             return ref;
       }
 
-      for (s = 0; s < 5; ++s) {
+      for (s = 0; s < 6; ++s) {
       for (i = 0; i < nvc0->num_textures[s]; ++i) {
          if (nvc0->textures[s][i] &&
              nvc0->textures[s][i]->texture == res) {
             nvc0->textures_dirty[s] |= 1 << i;
-            nvc0->dirty_3d |= NVC0_NEW_3D_TEXTURES;
-            nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_TEX(s, i));
+            if (unlikely(s == 5)) {
+               nvc0->dirty_cp |= NVC0_NEW_CP_TEXTURES;
+               nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_TEX(i));
+            } else {
+               nvc0->dirty_3d |= NVC0_NEW_3D_TEXTURES;
+               nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_3D_TEX(s, i));
+            }
             if (!--ref)
                return ref;
          }