From 1e2fbf26572dd6e3112cb5e4c5a1014da99c85d3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Sep 2013 17:30:50 -0600 Subject: [PATCH] cso: make sure all sampler states are set/cleared --- src/gallium/auxiliary/cso_cache/cso_context.c | 11 +++++++++-- 1 file 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; } } -- 2.30.2