diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index 0bb5c1a50ee..42b64b34c1d 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -386,6 +386,14 @@ void cso_unbind_context(struct cso_context *ctx) memset(&ctx->samplers, 0, sizeof(ctx->samplers)); memset(&ctx->nr_so_targets, 0, offsetof(struct cso_context, cache) - offsetof(struct cso_context, nr_so_targets)); + ctx->sample_mask = ~0; + /* + * If the cso context is reused (with the same pipe context), + * need to really make sure the context state doesn't get out of sync. + */ + ctx->pipe->set_sample_mask(ctx->pipe, ctx->sample_mask); + if (ctx->pipe->set_min_samples) + ctx->pipe->set_min_samples(ctx->pipe, ctx->min_samples); } /**