Mesa (master): radeonsi: Fix calculation of pitch value in sampler view state.

Michel Dänzer daenzer at kemper.freedesktop.org
Wed Apr 18 09:02:14 UTC 2012


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

Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Apr 18 10:37:15 2012 +0200

radeonsi: Fix calculation of pitch value in sampler view state.

---

 src/gallium/drivers/radeonsi/evergreen_state.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/evergreen_state.c b/src/gallium/drivers/radeonsi/evergreen_state.c
index f041f3d..5048761 100644
--- a/src/gallium/drivers/radeonsi/evergreen_state.c
+++ b/src/gallium/drivers/radeonsi/evergreen_state.c
@@ -1246,8 +1246,7 @@ static struct pipe_sampler_view *evergreen_create_sampler_view(struct pipe_conte
 	height = texture->height0;
 	depth = texture->depth0;
 
-	pitch = align(tmp->pitch_in_blocks[0] *
-		      util_format_get_blockwidth(state->format), 8);
+	pitch = tmp->pitch_in_blocks[0] * util_format_get_blockwidth(state->format);
 	array_mode = tmp->array_mode[0];
 	tile_type = tmp->tile_type;
 
@@ -1273,8 +1272,7 @@ static struct pipe_sampler_view *evergreen_create_sampler_view(struct pipe_conte
 			  S_008F1C_LAST_LEVEL(state->u.tex.last_level) |
 			  S_008F1C_TILING_INDEX(8) | /* XXX */
 			  S_008F1C_TYPE(si_tex_dim(texture->target)));
-	view->state[4] = (S_008F20_DEPTH(depth - 1) |
-			  S_008F20_PITCH((pitch / 8) - 1));
+	view->state[4] = (S_008F20_DEPTH(depth - 1) | S_008F20_PITCH(pitch - 1));
 	view->state[5] = (S_008F24_BASE_ARRAY(state->u.tex.first_layer) |
 			  S_008F24_LAST_ARRAY(state->u.tex.last_layer));
 	view->state[6] = 0;




More information about the mesa-commit mailing list