If, for example, we previously had 2 sampler states bound and now we
are binding one, we'd leave the second sampler state unchanged.
This change nulls-out the second sampler state in this situation.
We're already doing the same thing for sampler views.
This silences an occasional warning issued by the VMware driver when
the number of sampler views and sampler states disagreed.
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
cso_single_sampler_done(struct cso_context *ctx, unsigned shader_stage)
{
struct sampler_info *info = &ctx->samplers[shader_stage];
+ const unsigned old_nr_samplers = info->nr_samplers;
unsigned i;
/* find highest non-null sampler */
}
info->nr_samplers = i;
- ctx->pipe->bind_sampler_states(ctx->pipe, shader_stage, 0, i,
+ ctx->pipe->bind_sampler_states(ctx->pipe, shader_stage, 0,
+ MAX2(old_nr_samplers, info->nr_samplers),
info->samplers);
}