summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2014-04-02 08:54:41 -0600
committerCarl Worth <cworth@cworth.org>2014-04-14 15:05:35 -0700
commit68fef3983eafd90a6bf7b263f772a93100a6a7c1 (patch)
tree9948c79207f0f861b9f9d78a2ff077533ce46c2d
parent5ab0f978b73d9c6ece2656d2447a6f0044200e46 (diff)
cso: fix sampler view count in cso_set_sampler_views()
We want to call pipe->set_sampler_views() with count being the maximum of the old number of sampler views and the new number. This makes sure we null-out any old sampler views. We already do the same thing for sampler states in single_sampler_done(). Fixes some assertions seen in the VMware driver with XA tracker. Cc: "10.0" "10.1" <mesa-stable@lists.freedesktop.org> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Tested-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com> (cherry picked from commit 2355a6441435b8e66a032c44f0794066338e30a3)
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index 23d3245e881..90f86fe5bdd 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -1182,11 +1182,12 @@ cso_set_sampler_views(struct cso_context *ctx,
pipe_sampler_view_reference(&info->views[i], NULL);
}
- info->nr_views = count;
-
/* bind the new sampler views */
- ctx->pipe->set_sampler_views(ctx->pipe, shader_stage, 0, count,
+ ctx->pipe->set_sampler_views(ctx->pipe, shader_stage, 0,
+ MAX2(info->nr_views, count),
info->views);
+
+ info->nr_views = count;
}