[Mesa-dev] [PATCH] st/xa: Make sure unused samplers are set to NULL
Thomas Hellstrom
thellstrom at vmware.com
Mon Apr 7 13:48:32 PDT 2014
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 at freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
---
src/gallium/state_trackers/xa/xa_renderer.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/gallium/state_trackers/xa/xa_renderer.c b/src/gallium/state_trackers/xa/xa_renderer.c
index 9ba78be..bbd35f0 100644
--- a/src/gallium/state_trackers/xa/xa_renderer.c
+++ b/src/gallium/state_trackers/xa/xa_renderer.c
@@ -422,6 +422,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;
@@ -431,8 +432,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;
}
renderer_bind_destination(r, dst_surface,
--
1.9.1
More information about the mesa-dev
mailing list