From: Jonathan Marek Date: Tue, 5 Feb 2019 15:59:42 +0000 (-0500) Subject: gallium: add ATC format support X-Git-Tag: upstream/19.3.0~7073 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ea254fcd3c1050d691b43f0e2c5570e32d0783dd;p=platform%2Fupstream%2Fmesa.git gallium: add ATC format support Signed-off-by: Ilia Mirkin Signed-off-by: Jonathan Marek Reviewed-by: Roland Scheidegger --- diff --git a/src/gallium/auxiliary/util/u_format.csv b/src/gallium/auxiliary/util/u_format.csv index 3a2a633..51a08bd 100644 --- a/src/gallium/auxiliary/util/u_format.csv +++ b/src/gallium/auxiliary/util/u_format.csv @@ -237,6 +237,10 @@ PIPE_FORMAT_ASTC_10x10_SRGB , astc,10,10, x128, , , , xyzw, sr PIPE_FORMAT_ASTC_12x10_SRGB , astc,12,10, x128, , , , xyzw, srgb PIPE_FORMAT_ASTC_12x12_SRGB , astc,12,12, x128, , , , xyzw, srgb +PIPE_FORMAT_ATC_RGB , atc, 4, 4, x64, , , , xyz1, rgb +PIPE_FORMAT_ATC_RGBA_EXPLICIT , atc, 4, 4, x128, , , , xyzw, rgb +PIPE_FORMAT_ATC_RGBA_INTERPOLATED , atc, 4, 4, x128, , , , xyzw, rgb + # Straightforward D3D10-like formats (also used for # vertex buffer element description) # diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index cb11389..cf69460 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -89,9 +89,14 @@ enum util_format_layout { UTIL_FORMAT_LAYOUT_ASTC = 8, /** + * ATC + */ + UTIL_FORMAT_LAYOUT_ATC = 9, + + /** * Everything else that doesn't fit in any of the above layouts. */ - UTIL_FORMAT_LAYOUT_OTHER = 9 + UTIL_FORMAT_LAYOUT_OTHER = 10 }; @@ -485,6 +490,7 @@ util_format_is_compressed(enum pipe_format format) case UTIL_FORMAT_LAYOUT_ETC: case UTIL_FORMAT_LAYOUT_BPTC: case UTIL_FORMAT_LAYOUT_ASTC: + case UTIL_FORMAT_LAYOUT_ATC: /* XXX add other formats in the future */ return TRUE; default: diff --git a/src/gallium/auxiliary/util/u_format_pack.py b/src/gallium/auxiliary/util/u_format_pack.py index 62e5317..b438517 100644 --- a/src/gallium/auxiliary/util/u_format_pack.py +++ b/src/gallium/auxiliary/util/u_format_pack.py @@ -696,7 +696,7 @@ def generate_format_fetch(format, dst_channel, dst_native_type, dst_suffix): def is_format_hand_written(format): - return format.layout in ('s3tc', 'rgtc', 'etc', 'bptc', 'astc', 'subsampled', 'other') or format.colorspace == ZS + return format.layout in ('s3tc', 'rgtc', 'etc', 'bptc', 'astc', 'atc', 'subsampled', 'other') or format.colorspace == ZS def generate(formats): diff --git a/src/gallium/auxiliary/util/u_format_table.py b/src/gallium/auxiliary/util/u_format_table.py index 97cd047..731e2fb 100644 --- a/src/gallium/auxiliary/util/u_format_table.py +++ b/src/gallium/auxiliary/util/u_format_table.py @@ -142,7 +142,7 @@ def write_format_table(formats): u_format_pack.print_channels(format, do_swizzle_array) print(" %s," % (colorspace_map(format.colorspace),)) access = True - if format.layout == 'astc': + if format.layout == 'astc' or format.layout == 'atc': access = False if format.layout == 'etc' and format.short_name() != 'etc1_rgb8': access = False diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index c81fc67..a440165 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -403,6 +403,10 @@ enum pipe_format { PIPE_FORMAT_A8B8G8R8_SINT = 315, PIPE_FORMAT_X8B8G8R8_SINT = 316, + PIPE_FORMAT_ATC_RGB = 317, + PIPE_FORMAT_ATC_RGBA_EXPLICIT = 318, + PIPE_FORMAT_ATC_RGBA_INTERPOLATED = 319, + PIPE_FORMAT_COUNT };