[Mesa-dev] [PATCH] r600g: Implement BPTC texture support

Marek Olšák maraeo at gmail.com
Wed Jul 23 13:40:27 PDT 2014


On Wed, Jul 23, 2014 at 1:16 PM, Glenn Kennard <glenn.kennard at gmail.com> wrote:
> Signed-off-by: Glenn Kennard <glenn.kennard at gmail.com>
> ---
> This patch depends on Ilia Mirkin's "nvc0: add BPTC format support"
> and Neil Robert's core BPTC support patches.
>
>  src/gallium/drivers/r600/r600_state_common.c | 23 +++++++++++++++++++++++
>  1 file changed, 23 insertions(+)
>
> diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c
> index 8c37d0d..2f39df3 100644
> --- a/src/gallium/drivers/r600/r600_state_common.c
> +++ b/src/gallium/drivers/r600/r600_state_common.c
> @@ -1967,6 +1967,29 @@ uint32_t r600_translate_texformat(struct pipe_screen *screen,
>                 }
>         }
>
> +       if (desc->layout == UTIL_FORMAT_LAYOUT_BPTC) {
> +               if (!enable_s3tc)
> +                       goto out_unknown;
> +
> +               if (rscreen->b.chip_class < EVERGREEN)
> +                       goto out_unknown;
> +
> +               switch (format) {
> +                       case PIPE_FORMAT_BPTC_RGBA_UNORM:
> +                       case PIPE_FORMAT_BPTC_SRGBA_UNORM:
> +                               result = FMT_BC7;
> +                               is_srgb_valid = TRUE;
> +                               goto out_word4;
> +                       case PIPE_FORMAT_BPTC_RGB_FLOAT:
> +                       case PIPE_FORMAT_BPTC_RGB_UFLOAT:
> +                               result = FMT_BC6;
> +                               is_srgb_valid = TRUE;

BC6 shouldn't be "srgb_valid". It won't have any effect though,
because we don't have any formats which are both float and srgb.

Marek


More information about the mesa-dev mailing list