summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/formats.c
diff options
context:
space:
mode:
authorNanley Chery <[email protected]>2015-05-19 10:35:39 -0700
committerNanley Chery <[email protected]>2015-08-26 14:36:42 -0700
commit8ae37365f30594498184fe5428f961a9c310fd8c (patch)
treef6cb1eb1e21003099973db5cea81e073498d1bf8 /src/mesa/main/formats.c
parentc4cbaca327174135e28353c3438241b08bf96755 (diff)
mesa/formats: define the 2D ASTC formats
Define the mesa formats and make changes necessary for compilation without errors. Also add support for _mesa_get_srgb_format_linear(). v2. conform the ASTC MESA_FORMAT enums to the existing naming convention. v3. remove ASTC cases for _mesa_get_uncompressed_format(). This function is only used for generating mipmaps - something ASTC formats do not support due to lack of online compression. Reviewed-by: Anuj Phogat <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
Diffstat (limited to 'src/mesa/main/formats.c')
-rw-r--r--src/mesa/main/formats.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 34a4434c3ba..587221ca5a0 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -197,6 +197,7 @@ _mesa_get_format_max_bits(mesa_format format)
* MESA_FORMAT_LAYOUT_ETC1
* MESA_FORMAT_LAYOUT_ETC2
* MESA_FORMAT_LAYOUT_BPTC
+ * MESA_FORMAT_LAYOUT_ASTC
* MESA_FORMAT_LAYOUT_OTHER
*/
extern enum mesa_format_layout
@@ -663,6 +664,48 @@ _mesa_get_srgb_format_linear(mesa_format format)
case MESA_FORMAT_BPTC_SRGB_ALPHA_UNORM:
format = MESA_FORMAT_BPTC_RGBA_UNORM;
break;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x4:
+ format = MESA_FORMAT_RGBA_ASTC_4x4;
+ break;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x4:
+ format = MESA_FORMAT_RGBA_ASTC_5x4;
+ break;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x5:
+ format = MESA_FORMAT_RGBA_ASTC_5x5;
+ break;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x5:
+ format = MESA_FORMAT_RGBA_ASTC_6x5;
+ break;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x6:
+ format = MESA_FORMAT_RGBA_ASTC_6x6;
+ break;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_8x5:
+ format = MESA_FORMAT_RGBA_ASTC_8x5;
+ break;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_8x6:
+ format = MESA_FORMAT_RGBA_ASTC_8x6;
+ break;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_8x8:
+ format = MESA_FORMAT_RGBA_ASTC_8x8;
+ break;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_10x5:
+ format = MESA_FORMAT_RGBA_ASTC_10x5;
+ break;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_10x6:
+ format = MESA_FORMAT_RGBA_ASTC_10x6;
+ break;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_10x8:
+ format = MESA_FORMAT_RGBA_ASTC_10x8;
+ break;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_10x10:
+ format = MESA_FORMAT_RGBA_ASTC_10x10;
+ break;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_12x10:
+ format = MESA_FORMAT_RGBA_ASTC_12x10;
+ break;
+ case MESA_FORMAT_SRGB8_ALPHA8_ASTC_12x12:
+ format = MESA_FORMAT_RGBA_ASTC_12x12;
+ break;
case MESA_FORMAT_B8G8R8X8_SRGB:
format = MESA_FORMAT_B8G8R8X8_UNORM;
break;