[Mesa-dev] [PATCH] r600g: Implement BPTC texture support
Ilia Mirkin
imirkin at alum.mit.edu
Wed Jul 23 09:36:14 PDT 2014
On Wed, Jul 23, 2014 at 7:16 AM, 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;
[Usual disclaimer: I don't know much about radeon.]
For nvc0, there's a separate texture format for FLOAT and UFLOAT. How
does the hw tell which one to decode it as? [And I presume it figures
out RGBA vs SRGBA by looking at the format description's colorspace
field...]
> + goto out_word4;
> + default:
> + goto out_unknown;
> + }
> + }
> +
> if (desc->layout == UTIL_FORMAT_LAYOUT_SUBSAMPLED) {
> switch (format) {
> case PIPE_FORMAT_R8G8_B8G8_UNORM:
> --
> 1.8.3.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list