[Mesa-dev] [PATCH 07/20] radeonsi: fix cubemaps viewed as 2D

Marek Olšák maraeo at gmail.com
Mon Aug 29 15:28:22 UTC 2016


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

This fixes: GL43-CTS.texture_view.view_sampling

Cc: mesa-stable at lists.freedesktop.org
---
 src/gallium/drivers/radeonsi/si_state.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 25dfe26..026aded 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -1603,20 +1603,27 @@ static unsigned si_tex_compare(unsigned compare)
 	}
 }
 
 static unsigned si_tex_dim(unsigned res_target, unsigned view_target,
 			   unsigned nr_samples)
 {
 	if (view_target == PIPE_TEXTURE_CUBE ||
 	    view_target == PIPE_TEXTURE_CUBE_ARRAY)
 		res_target = view_target;
 
+	/* If interpretting cubemaps as something else, set 2D_ARRAY. */
+	if ((res_target == PIPE_TEXTURE_CUBE ||
+	     res_target == PIPE_TEXTURE_CUBE_ARRAY) &&
+	    view_target != PIPE_TEXTURE_CUBE &&
+	    view_target != PIPE_TEXTURE_CUBE_ARRAY)
+		res_target = PIPE_TEXTURE_2D_ARRAY;
+
 	switch (res_target) {
 	default:
 	case PIPE_TEXTURE_1D:
 		return V_008F1C_SQ_RSRC_IMG_1D;
 	case PIPE_TEXTURE_1D_ARRAY:
 		return V_008F1C_SQ_RSRC_IMG_1D_ARRAY;
 	case PIPE_TEXTURE_2D:
 	case PIPE_TEXTURE_RECT:
 		return nr_samples > 1 ? V_008F1C_SQ_RSRC_IMG_2D_MSAA :
 					V_008F1C_SQ_RSRC_IMG_2D;
-- 
2.7.4



More information about the mesa-dev mailing list