summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/cso_cache
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-09-12 17:30:50 -0600
committerBrian Paul <[email protected]>2013-10-03 14:05:28 -0600
commit1e2fbf26572dd6e3112cb5e4c5a1014da99c85d3 (patch)
tree0fa529c128df555b297f47b05c75f4a4e0d5b0e7 /src/gallium/auxiliary/cso_cache
parent7d7a9714d2f6cdceb9e9e6f6b43004008b56c8d2 (diff)
cso: make sure all sampler states are set/cleared
Diffstat (limited to 'src/gallium/auxiliary/cso_cache')
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.c11
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 95df28e9248..6642c454e56 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;
}
}