diff options
author | Brian Paul <brianp@vmware.com> | 2013-09-12 17:30:50 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2013-09-12 18:14:19 -0600 |
commit | 9dde4876e112718e082335fdbfc08c22948e685f (patch) | |
tree | fc9aba364a5d1d9f67ca92e3ddaff89aa07f267e | |
parent | eb284c79bed658caf91b5dd9a00298406004c42f (diff) |
cso: make sure all sampler states are set/cleared
-rw-r--r-- | src/gallium/auxiliary/cso_cache/cso_context.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index 95df28e924..6642c454e5 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -1089,10 +1089,17 @@ single_sampler_done(struct cso_context *ctx, unsigned shader_stage) memcpy(info->hw.samplers, info->samplers, info->nr_samplers * sizeof(void *)); - info->hw.nr_samplers = info->nr_samplers; + + /* set remaining slots/pointers to null */ + for (i = info->nr_samplers; i < info->hw.nr_samplers; i++) + info->samplers[i] = NULL; ctx->pipe->bind_sampler_states(ctx->pipe, shader_stage, 0, - info->nr_samplers, info->samplers); + MAX2(info->nr_samplers, + info->hw.nr_samplers), + info->samplers); + + info->hw.nr_samplers = info->nr_samplers; } } |