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

Dave Airlie airlied at gmail.com
Mon Aug 29 20:34:57 UTC 2016


On 30 August 2016 at 01:28, Marek Olšák <maraeo at gmail.com> wrote:
> From: Marek Olšák <marek.olsak at amd.com>
>
> This fixes: GL43-CTS.texture_view.view_sampling

Reviewed-by: Dave Airlie <airlied at redhat.com>

>
> 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
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list