From: Christoph Bumiller Date: Wed, 11 Jul 2012 18:52:58 +0000 (+0200) Subject: nvc0: make sure handles for unbound textures/samplers are uploaded on nve4 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c321b1bef15e2807de3f6225c4abcbf48969997a;p=mesa.git nvc0: make sure handles for unbound textures/samplers are uploaded on nve4 --- diff --git a/src/gallium/drivers/nvc0/nvc0_context.c b/src/gallium/drivers/nvc0/nvc0_context.c index ee131d29bbf..2c032ab7420 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 0930212a350..b52918e1319 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];