summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2014-04-02 17:12:02 -0600
committerBrian Paul <[email protected]>2014-04-03 19:39:23 -0600
commit5a2f8b2c48a1497ed65bdf1fbdb39957de3f1a88 (patch)
tree36f48dab3a60d957a33901352ea67472ee60cd77
parentffa39ab067ae360ceffdf8f1eb6d84f0ebdf6c94 (diff)
cso: check for no sampler view changes in cso_set_sampler_views()
As we do for sampler states in single_sampler_done() and many other CSO functions. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index dda3c205e22..dd0e3df8537 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -1177,20 +1177,25 @@ cso_set_sampler_views(struct cso_context *ctx,
{
struct sampler_info *info = &ctx->samplers[shader_stage];
unsigned i;
+ boolean any_change = FALSE;
/* reference new views */
for (i = 0; i < count; i++) {
+ any_change |= info->views[i] != views[i];
pipe_sampler_view_reference(&info->views[i], views[i]);
}
/* unref extra old views, if any */
for (; i < info->nr_views; i++) {
+ any_change |= info->views[i] != NULL;
pipe_sampler_view_reference(&info->views[i], NULL);
}
/* bind the new sampler views */
- ctx->pipe->set_sampler_views(ctx->pipe, shader_stage, 0,
- MAX2(info->nr_views, count),
- info->views);
+ if (any_change) {
+ ctx->pipe->set_sampler_views(ctx->pipe, shader_stage, 0,
+ MAX2(info->nr_views, count),
+ info->views);
+ }
info->nr_views = count;
}