[Mesa-dev] [PATCH 03/10] radeonsi: fix incorrect FMASK checking in bind_sampler_states

Marek Olšák maraeo at gmail.com
Fri Dec 2 20:39:22 UTC 2016


From: Marek Olšák <marek.olsak at amd.com>

Cc: 13.0 12.0 <mesa-stable at lists.freedesktop.org>
---
 src/gallium/drivers/radeonsi/si_descriptors.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 8777f36..cf66102 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -801,24 +801,24 @@ static void si_bind_sampler_states(struct pipe_context *ctx,
 
 		if (!sstates[i] ||
 		    sstates[i] == samplers->views.sampler_states[slot])
 			continue;
 
 		samplers->views.sampler_states[slot] = sstates[i];
 
 		/* If FMASK is bound, don't overwrite it.
 		 * The sampler state will be set after FMASK is unbound.
 		 */
-		if (samplers->views.views[i] &&
-		    samplers->views.views[i]->texture &&
-		    samplers->views.views[i]->texture->target != PIPE_BUFFER &&
-		    ((struct r600_texture*)samplers->views.views[i]->texture)->fmask.size)
+		if (samplers->views.views[slot] &&
+		    samplers->views.views[slot]->texture &&
+		    samplers->views.views[slot]->texture->target != PIPE_BUFFER &&
+		    ((struct r600_texture*)samplers->views.views[slot]->texture)->fmask.size)
 			continue;
 
 		memcpy(desc->list + slot * 16 + 12, sstates[i]->val, 4*4);
 		desc->dirty_mask |= 1u << slot;
 		sctx->descriptors_dirty |= 1u << si_sampler_descriptors_idx(shader);
 	}
 }
 
 /* BUFFER RESOURCES */
 
-- 
2.7.4



More information about the mesa-dev mailing list