Module: Mesa
Branch: master
Commit: 2355a6441435b8e66a032c44f0794066338e30a3
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2355a6441435b8e66a032c44f0794066338e30a3

Author: Brian Paul <[email protected]>
Date:   Wed Apr  2 08:54:41 2014 -0600

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" <[email protected]>
Reviewed-by: Thomas Hellstrom <[email protected]>
Tested-by: Thomas Hellstrom <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>

---

 src/gallium/auxiliary/cso_cache/cso_context.c |    7 ++++---
 1 file 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 9146684..dda3c20 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -1187,11 +1187,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;
 }
 
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to