radeonsi: fix cubemaps viewed as 2D
authorMarek Olšák <marek.olsak@amd.com>
Fri, 19 Aug 2016 17:52:14 +0000 (19:52 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 5 Sep 2016 16:01:15 +0000 (18:01 +0200)
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 <airlied@redhat.com> (v1)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> (v1)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_state.c

index a1c8720ce702c1639676f0b6f8d19a6c78b27232..41ff320029418f13a16888e72dbf9ee635b2d30c 100644 (file)
@@ -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: