st/xa: Make sure unused samplers are set to NULL
authorThomas Hellstrom <thellstrom@vmware.com>
Mon, 7 Apr 2014 20:42:25 +0000 (13:42 -0700)
committerThomas Hellstrom <thellstrom@vmware.com>
Tue, 8 Apr 2014 05:34:10 +0000 (22:34 -0700)
renderer_copy_prepare was setting the first sampler but never telling
the cso code how many samplers were actually used. Fix this.

Cc: "10.1" <mesa-stable@freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/state_trackers/xa/xa_renderer.c

index 0f5044df9e2cc832b93cbdc6fd903bcc8f24b0b6..8a122dc2182e30a55aa57f07739ee4d776e87fa5 100644 (file)
@@ -425,6 +425,7 @@ renderer_copy_prepare(struct xa_context *r,
     /* sampler */
     {
        struct pipe_sampler_state sampler;
+        const struct pipe_sampler_state *p_sampler = &sampler;
 
        memset(&sampler, 0, sizeof(sampler));
        sampler.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
@@ -434,8 +435,8 @@ renderer_copy_prepare(struct xa_context *r,
        sampler.min_img_filter = PIPE_TEX_FILTER_NEAREST;
        sampler.mag_img_filter = PIPE_TEX_FILTER_NEAREST;
        sampler.normalized_coords = 1;
-       cso_single_sampler(r->cso, PIPE_SHADER_FRAGMENT, 0, &sampler);
-       cso_single_sampler_done(r->cso, PIPE_SHADER_FRAGMENT);
+        cso_set_samplers(r->cso, PIPE_SHADER_FRAGMENT, 1, &p_sampler);
+        r->num_bound_samplers = 1;
     }
 
     /* texture/sampler view */