summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2014-08-30 13:35:47 -0400
committerEmil Velikov <emil.l.velikov@gmail.com>2014-09-02 13:35:01 +0100
commiteb38556137a92e6a4985e1d350fc5f4ecc4c81e4 (patch)
tree2229e86667201adfe727272c996b3c67a0df77c2 /src
parent836b0ae8b618e857a0f12ed725a091cf81da3000 (diff)
nv50: zero out unbound samplers
Samplers are only defined up to num_samplers, so set all samplers above nr to NULL so that we don't try to read them again later. Tested-by: Christian Ruppert <idl0r@qasl.de> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 362cd26960aff2e997584064443dcc0418516ae6)
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_state.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state.c b/src/gallium/drivers/nouveau/nv50/nv50_state.c
index d0bc7ff1a2a..c140d6e73bc 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_state.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_state.c
@@ -585,9 +585,12 @@ nv50_stage_sampler_states_bind(struct nv50_context *nv50, int s,
nv50_screen_tsc_unlock(nv50->screen, old);
}
assert(nv50->num_samplers[s] <= PIPE_MAX_SAMPLERS);
- for (; i < nv50->num_samplers[s]; ++i)
- if (nv50->samplers[s][i])
+ for (; i < nv50->num_samplers[s]; ++i) {
+ if (nv50->samplers[s][i]) {
nv50_screen_tsc_unlock(nv50->screen, nv50->samplers[s][i]);
+ nv50->samplers[s][i] = NULL;
+ }
+ }
nv50->num_samplers[s] = nr;