[Mesa-dev] [PATCH 3/5] r600g: Set the correct value of COLOR*_DIM for RATs

Tom Stellard tom at stellard.net
Mon Sep 17 14:08:58 PDT 2012


From: Tom Stellard <thomas.stellard at amd.com>

For buffers (which is what is being used for RATs), the
COLOR*_DIM.WIDTH_MASK field needs to be set to the low 16-bits of the
buffer size, and the COLOR*_DIM.HEIEGHT_MAX needs to be set to the
high bits.
---
 src/gallium/drivers/r600/evergreen_state.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index f244e8a..47bd826 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -1312,8 +1312,8 @@ void evergreen_init_color_surface(struct r600_context *rctx,
 
 	if (rtex->is_rat) {
 		color_info |= S_028C70_RAT(1);
-		color_dim = S_028C78_WIDTH_MAX(pipe_tex->width0)
-				| S_028C78_HEIGHT_MAX(pipe_tex->height0);
+		color_dim = S_028C78_WIDTH_MAX(pipe_tex->width0 & 0xffff)
+			| S_028C78_HEIGHT_MAX((pipe_tex->width0 >> 16) & 0xffff);
 	}
 
 	/* EXPORT_NORM is an optimzation that can be enabled for better
-- 
1.7.11.4



More information about the mesa-dev mailing list