nvc0: make sure handles for unbound textures/samplers are uploaded on nve4
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Wed, 11 Jul 2012 18:52:58 +0000 (20:52 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Sun, 30 Sep 2012 21:09:37 +0000 (23:09 +0200)
src/gallium/drivers/nvc0/nvc0_context.c
src/gallium/drivers/nvc0/nvc0_tex.c

index ee131d29bbf6ff7acb9a67f3bb27172ac3b50556..2c032ab74202978317b4d17b6a55ea737c9e797c 100644 (file)
@@ -194,6 +194,8 @@ nvc0_create(struct pipe_screen *pscreen, void *priv)
 
    nvc0->base.scratch.bo_size = 2 << 20;
 
+   memset(nvc0->tex_handles, ~0, sizeof(nvc0->tex_handles));
+
    return pipe;
 
 out_err:
index 0930212a350149fcdcc6e23e73fa3c4d76a118a3..b52918e1319f03e30b5591f433f9cccd90be3478 100644 (file)
@@ -338,8 +338,10 @@ nve4_validate_tic(struct nvc0_context *nvc0, unsigned s)
       if (dirty)
          BCTX_REFN(nvc0->bufctx_3d, TEX(s, i), res, RD);
    }
-   for (; i < nvc0->state.num_textures[s]; ++i)
+   for (; i < nvc0->state.num_textures[s]; ++i) {
       nvc0->tex_handles[s][i] |= NVE4_TIC_ENTRY_INVALID;
+      nvc0->textures_dirty[s] |= 1 << i;
+   }
 
    nvc0->state.num_textures[s] = nvc0->num_textures[s];
 
@@ -446,8 +448,10 @@ nve4_validate_tsc(struct nvc0_context *nvc0, int s)
       nvc0->tex_handles[s][i] &= ~NVE4_TSC_ENTRY_INVALID;
       nvc0->tex_handles[s][i] |= tsc->id << 20;
    }
-   for (; i < nvc0->state.num_samplers[s]; ++i)
+   for (; i < nvc0->state.num_samplers[s]; ++i) {
       nvc0->tex_handles[s][i] |= NVE4_TSC_ENTRY_INVALID;
+      nvc0->samplers_dirty[s] |= 1 << i;
+   }
 
    nvc0->state.num_samplers[s] = nvc0->num_samplers[s];