From 361eb1c6e765c393cb0b398124772b60a24ac36c Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 28 Jun 2017 15:10:34 -0700 Subject: main/formats: Autogenerate _mesa_get_srgb_format_linear Due to the wonders of autogeneration, this new version covers a few formats that the old version was missing: MESA_FORMAT_SRGB8_ALPHA8_ASTC_3x3x3 MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x3x3 MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x4x3 MESA_FORMAT_SRGB8_ALPHA8_ASTC_4x4x4 MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x4x4 MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x5x4 MESA_FORMAT_SRGB8_ALPHA8_ASTC_5x5x5 MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x5x5 MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x6x5 MESA_FORMAT_SRGB8_ALPHA8_ASTC_6x6x6 Reviewed-by: Chad Versace --- src/mesa/main/formats.c | 117 ------------------------------------------------ 1 file changed, 117 deletions(-) (limited to 'src/mesa/main/formats.c') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 9d9830f8bf4..5c29d37bb44 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -621,123 +621,6 @@ _mesa_is_format_etc2(mesa_format format) } -/** - * For an sRGB format, return the corresponding linear color space format. - * For non-sRGB formats, return the format as-is. - */ -mesa_format -_mesa_get_srgb_format_linear(mesa_format format) -{ - switch (format) { - case MESA_FORMAT_BGR_SRGB8: - format = MESA_FORMAT_BGR_UNORM8; - break; - case MESA_FORMAT_A8B8G8R8_SRGB: - format = MESA_FORMAT_A8B8G8R8_UNORM; - break; - case MESA_FORMAT_B8G8R8A8_SRGB: - format = MESA_FORMAT_B8G8R8A8_UNORM; - break; - case MESA_FORMAT_A8R8G8B8_SRGB: - format = MESA_FORMAT_A8R8G8B8_UNORM; - break; - case MESA_FORMAT_R8G8B8A8_SRGB: - format = MESA_FORMAT_R8G8B8A8_UNORM; - break; - case MESA_FORMAT_L_SRGB8: - format = MESA_FORMAT_L_UNORM8; - break; - case MESA_FORMAT_L8A8_SRGB: - format = MESA_FORMAT_L8A8_UNORM; - break; - case MESA_FORMAT_A8L8_SRGB: - format = MESA_FORMAT_A8L8_UNORM; - break; - case MESA_FORMAT_SRGB_DXT1: - format = MESA_FORMAT_RGB_DXT1; - break; - case MESA_FORMAT_SRGBA_DXT1: - format = MESA_FORMAT_RGBA_DXT1; - break; - case MESA_FORMAT_SRGBA_DXT3: - format = MESA_FORMAT_RGBA_DXT3; - break; - case MESA_FORMAT_SRGBA_DXT5: - format = MESA_FORMAT_RGBA_DXT5; - break; - case MESA_FORMAT_R8G8B8X8_SRGB: - format = MESA_FORMAT_R8G8B8X8_UNORM; - break; - case MESA_FORMAT_X8B8G8R8_SRGB: - format = MESA_FORMAT_X8B8G8R8_UNORM; - break; - case MESA_FORMAT_ETC2_SRGB8: - format = MESA_FORMAT_ETC2_RGB8; - break; - case MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC: - format = MESA_FORMAT_ETC2_RGBA8_EAC; - break; - case MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1: - format = MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1; - break; - 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; - case MESA_FORMAT_X8R8G8B8_SRGB: - format = MESA_FORMAT_X8R8G8B8_UNORM; - break; - default: - break; - } - return format; -} - - /** * If the given format is a compressed format, return a corresponding * uncompressed format. -- cgit v1.2.3