From: Marek Olšák Date: Fri, 19 Aug 2016 17:52:14 +0000 (+0200) Subject: radeonsi: fix cubemaps viewed as 2D X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a4fa21505883ec9eef905079a5160d07ffc67ae7;p=mesa.git radeonsi: fix cubemaps viewed as 2D This fixes: GL43-CTS.texture_view.view_sampling v2: fix a typo, merge both if statements Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Dave Airlie (v1) Reviewed-by: Bas Nieuwenhuizen (v1) Reviewed-by: Nicolai Hähnle --- diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index a1c8720ce70..41ff3200294 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -1610,6 +1610,10 @@ static unsigned si_tex_dim(unsigned res_target, unsigned view_target, if (view_target == PIPE_TEXTURE_CUBE || view_target == PIPE_TEXTURE_CUBE_ARRAY) res_target = view_target; + /* If interpreting cubemaps as something else, set 2D_ARRAY. */ + else if (res_target == PIPE_TEXTURE_CUBE || + res_target == PIPE_TEXTURE_CUBE_ARRAY) + res_target = PIPE_TEXTURE_2D_ARRAY; switch (res_target) { default: