From: Brian Paul Date: Thu, 12 Sep 2013 23:30:50 +0000 (-0600) Subject: cso: make sure all sampler states are set/cleared X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1e2fbf26572dd6e3112cb5e4c5a1014da99c85d3;p=mesa.git cso: make sure all sampler states are set/cleared --- 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; } }