diff options
author | Brian Paul <[email protected]> | 2016-05-02 10:24:43 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-05-03 15:40:49 -0600 |
commit | 68116dcd5a05508af06cd41ca14faab1b910a934 (patch) | |
tree | 0ece9bc3c154712f4b93acb3d1ca4f71d73cde36 /src/gallium/auxiliary | |
parent | 05abaa65c745d74fb296006285b85d253cb11525 (diff) |
cso: null-out previously bound sampler states
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 <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/cso_cache/cso_context.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index 4e0cbdd8f9a..4cf3b2bddd5 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -1203,6 +1203,7 @@ void 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 */ @@ -1212,7 +1213,8 @@ cso_single_sampler_done(struct cso_context *ctx, unsigned shader_stage) } 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); } |