Mesa (master): nvc0: make sure handles for unbound textures/ samplers are uploaded on nve4

Christoph Bumiller chrisbmr at kemper.freedesktop.org
Sun Sep 30 21:10:35 UTC 2012


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

Author: Christoph Bumiller <e0425955 at student.tuwien.ac.at>
Date:   Wed Jul 11 20:52:58 2012 +0200

nvc0: make sure handles for unbound textures/samplers are uploaded on nve4

---

 src/gallium/drivers/nvc0/nvc0_context.c |    2 ++
 src/gallium/drivers/nvc0/nvc0_tex.c     |    8 ++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nvc0/nvc0_context.c b/src/gallium/drivers/nvc0/nvc0_context.c
index ee131d2..2c032ab 100644
--- a/src/gallium/drivers/nvc0/nvc0_context.c
+++ b/src/gallium/drivers/nvc0/nvc0_context.c
@@ -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:
diff --git a/src/gallium/drivers/nvc0/nvc0_tex.c b/src/gallium/drivers/nvc0/nvc0_tex.c
index 0930212..b52918e 100644
--- a/src/gallium/drivers/nvc0/nvc0_tex.c
+++ b/src/gallium/drivers/nvc0/nvc0_tex.c
@@ -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];
 




More information about the mesa-commit mailing list