* staying in sync, so we initialize to 0 even though
* ISL_FORMAT_R32G32B32A32_FLOAT happens to also be 0.
*/
- static const uint32_t table[MESA_FORMAT_COUNT] =
- {
- [MESA_FORMAT_A8B8G8R8_UNORM] = 0,
+ static const enum isl_format table[MESA_FORMAT_COUNT] = {
+ [0 ... MESA_FORMAT_COUNT-1] = ISL_FORMAT_UNSUPPORTED,
+
[MESA_FORMAT_R8G8B8A8_UNORM] = ISL_FORMAT_R8G8B8A8_UNORM,
[MESA_FORMAT_B8G8R8A8_UNORM] = ISL_FORMAT_B8G8R8A8_UNORM,
- [MESA_FORMAT_A8R8G8B8_UNORM] = 0,
- [MESA_FORMAT_X8B8G8R8_UNORM] = 0,
[MESA_FORMAT_R8G8B8X8_UNORM] = ISL_FORMAT_R8G8B8X8_UNORM,
[MESA_FORMAT_B8G8R8X8_UNORM] = ISL_FORMAT_B8G8R8X8_UNORM,
- [MESA_FORMAT_X8R8G8B8_UNORM] = 0,
- [MESA_FORMAT_BGR_UNORM8] = 0,
[MESA_FORMAT_RGB_UNORM8] = ISL_FORMAT_R8G8B8_UNORM,
[MESA_FORMAT_B5G6R5_UNORM] = ISL_FORMAT_B5G6R5_UNORM,
- [MESA_FORMAT_R5G6B5_UNORM] = 0,
[MESA_FORMAT_B4G4R4A4_UNORM] = ISL_FORMAT_B4G4R4A4_UNORM,
- [MESA_FORMAT_A4R4G4B4_UNORM] = 0,
- [MESA_FORMAT_A1B5G5R5_UNORM] = 0,
[MESA_FORMAT_B5G5R5A1_UNORM] = ISL_FORMAT_B5G5R5A1_UNORM,
- [MESA_FORMAT_A1R5G5B5_UNORM] = 0,
- [MESA_FORMAT_L4A4_UNORM] = 0,
[MESA_FORMAT_L8A8_UNORM] = ISL_FORMAT_L8A8_UNORM,
- [MESA_FORMAT_A8L8_UNORM] = 0,
[MESA_FORMAT_L16A16_UNORM] = ISL_FORMAT_L16A16_UNORM,
- [MESA_FORMAT_A16L16_UNORM] = 0,
- [MESA_FORMAT_B2G3R3_UNORM] = 0,
[MESA_FORMAT_A_UNORM8] = ISL_FORMAT_A8_UNORM,
[MESA_FORMAT_A_UNORM16] = ISL_FORMAT_A16_UNORM,
[MESA_FORMAT_L_UNORM8] = ISL_FORMAT_L8_UNORM,
[MESA_FORMAT_YCBCR] = ISL_FORMAT_YCRCB_SWAPUVY,
[MESA_FORMAT_R_UNORM8] = ISL_FORMAT_R8_UNORM,
[MESA_FORMAT_R8G8_UNORM] = ISL_FORMAT_R8G8_UNORM,
- [MESA_FORMAT_G8R8_UNORM] = 0,
[MESA_FORMAT_R_UNORM16] = ISL_FORMAT_R16_UNORM,
[MESA_FORMAT_R16G16_UNORM] = ISL_FORMAT_R16G16_UNORM,
- [MESA_FORMAT_G16R16_UNORM] = 0,
[MESA_FORMAT_B10G10R10A2_UNORM] = ISL_FORMAT_B10G10R10A2_UNORM,
- [MESA_FORMAT_S8_UINT_Z24_UNORM] = 0,
- [MESA_FORMAT_Z24_UNORM_S8_UINT] = 0,
- [MESA_FORMAT_Z_UNORM16] = 0,
- [MESA_FORMAT_Z24_UNORM_X8_UINT] = 0,
- [MESA_FORMAT_X8_UINT_Z24_UNORM] = 0,
- [MESA_FORMAT_Z_UNORM32] = 0,
[MESA_FORMAT_S_UINT8] = ISL_FORMAT_R8_UINT,
- [MESA_FORMAT_BGR_SRGB8] = 0,
- [MESA_FORMAT_A8B8G8R8_SRGB] = 0,
[MESA_FORMAT_B8G8R8A8_SRGB] = ISL_FORMAT_B8G8R8A8_UNORM_SRGB,
- [MESA_FORMAT_A8R8G8B8_SRGB] = 0,
[MESA_FORMAT_R8G8B8A8_SRGB] = ISL_FORMAT_R8G8B8A8_UNORM_SRGB,
- [MESA_FORMAT_X8R8G8B8_SRGB] = 0,
[MESA_FORMAT_B8G8R8X8_SRGB] = ISL_FORMAT_B8G8R8X8_UNORM_SRGB,
[MESA_FORMAT_L_SRGB8] = ISL_FORMAT_L8_UNORM_SRGB,
[MESA_FORMAT_L8A8_SRGB] = ISL_FORMAT_L8A8_UNORM_SRGB,
- [MESA_FORMAT_A8L8_SRGB] = 0,
[MESA_FORMAT_SRGB_DXT1] = ISL_FORMAT_BC1_UNORM_SRGB,
[MESA_FORMAT_SRGBA_DXT1] = ISL_FORMAT_BC1_UNORM_SRGB,
[MESA_FORMAT_SRGBA_DXT3] = ISL_FORMAT_BC2_UNORM_SRGB,
[MESA_FORMAT_RGBA_FLOAT32] = ISL_FORMAT_R32G32B32A32_FLOAT,
[MESA_FORMAT_RGBA_FLOAT16] = ISL_FORMAT_R16G16B16A16_FLOAT,
[MESA_FORMAT_RGB_FLOAT32] = ISL_FORMAT_R32G32B32_FLOAT,
- [MESA_FORMAT_RGB_FLOAT16] = 0,
[MESA_FORMAT_A_FLOAT32] = ISL_FORMAT_A32_FLOAT,
[MESA_FORMAT_A_FLOAT16] = ISL_FORMAT_A16_FLOAT,
[MESA_FORMAT_L_FLOAT32] = ISL_FORMAT_L32_FLOAT,
[MESA_FORMAT_RG_FLOAT32] = ISL_FORMAT_R32G32_FLOAT,
[MESA_FORMAT_RG_FLOAT16] = ISL_FORMAT_R16G16_FLOAT,
- [MESA_FORMAT_A_UINT8] = 0,
- [MESA_FORMAT_A_UINT16] = 0,
- [MESA_FORMAT_A_UINT32] = 0,
- [MESA_FORMAT_A_SINT8] = 0,
- [MESA_FORMAT_A_SINT16] = 0,
- [MESA_FORMAT_A_SINT32] = 0,
-
- [MESA_FORMAT_I_UINT8] = 0,
- [MESA_FORMAT_I_UINT16] = 0,
- [MESA_FORMAT_I_UINT32] = 0,
- [MESA_FORMAT_I_SINT8] = 0,
- [MESA_FORMAT_I_SINT16] = 0,
- [MESA_FORMAT_I_SINT32] = 0,
-
- [MESA_FORMAT_L_UINT8] = 0,
- [MESA_FORMAT_L_UINT16] = 0,
- [MESA_FORMAT_L_UINT32] = 0,
- [MESA_FORMAT_L_SINT8] = 0,
- [MESA_FORMAT_L_SINT16] = 0,
- [MESA_FORMAT_L_SINT32] = 0,
-
- [MESA_FORMAT_LA_UINT8] = 0,
- [MESA_FORMAT_LA_UINT16] = 0,
- [MESA_FORMAT_LA_UINT32] = 0,
- [MESA_FORMAT_LA_SINT8] = 0,
- [MESA_FORMAT_LA_SINT16] = 0,
- [MESA_FORMAT_LA_SINT32] = 0,
-
[MESA_FORMAT_R_SINT8] = ISL_FORMAT_R8_SINT,
[MESA_FORMAT_RG_SINT8] = ISL_FORMAT_R8G8_SINT,
[MESA_FORMAT_RGB_SINT8] = ISL_FORMAT_R8G8B8_SINT,
[MESA_FORMAT_R_SNORM8] = ISL_FORMAT_R8_SNORM,
[MESA_FORMAT_R8G8_SNORM] = ISL_FORMAT_R8G8_SNORM,
- [MESA_FORMAT_X8B8G8R8_SNORM] = 0,
- [MESA_FORMAT_A8B8G8R8_SNORM] = 0,
[MESA_FORMAT_R8G8B8A8_SNORM] = ISL_FORMAT_R8G8B8A8_SNORM,
[MESA_FORMAT_R_SNORM16] = ISL_FORMAT_R16_SNORM,
[MESA_FORMAT_R16G16_SNORM] = ISL_FORMAT_R16G16_SNORM,
[MESA_FORMAT_RG_RGTC2_UNORM] = ISL_FORMAT_BC5_UNORM,
[MESA_FORMAT_RG_RGTC2_SNORM] = ISL_FORMAT_BC5_SNORM,
- [MESA_FORMAT_L_LATC1_UNORM] = 0,
- [MESA_FORMAT_L_LATC1_SNORM] = 0,
- [MESA_FORMAT_LA_LATC2_UNORM] = 0,
- [MESA_FORMAT_LA_LATC2_SNORM] = 0,
-
[MESA_FORMAT_ETC1_RGB8] = ISL_FORMAT_ETC1_RGB8,
[MESA_FORMAT_ETC2_RGB8] = ISL_FORMAT_ETC2_RGB8,
[MESA_FORMAT_ETC2_SRGB8] = ISL_FORMAT_ETC2_SRGB8,
[MESA_FORMAT_SRGB8_ALPHA8_ASTC_12x10] = ISL_FORMAT_ASTC_LDR_2D_12X10_U8SRGB,
[MESA_FORMAT_SRGB8_ALPHA8_ASTC_12x12] = ISL_FORMAT_ASTC_LDR_2D_12X12_U8SRGB,
- [MESA_FORMAT_A_SNORM8] = 0,
- [MESA_FORMAT_L_SNORM8] = 0,
- [MESA_FORMAT_L8A8_SNORM] = 0,
- [MESA_FORMAT_A8L8_SNORM] = 0,
- [MESA_FORMAT_I_SNORM8] = 0,
- [MESA_FORMAT_A_SNORM16] = 0,
- [MESA_FORMAT_L_SNORM16] = 0,
- [MESA_FORMAT_LA_SNORM16] = 0,
- [MESA_FORMAT_I_SNORM16] = 0,
-
[MESA_FORMAT_R9G9B9E5_FLOAT] = ISL_FORMAT_R9G9B9E5_SHAREDEXP,
[MESA_FORMAT_R11G11B10_FLOAT] = ISL_FORMAT_R11G11B10_FLOAT,
- [MESA_FORMAT_Z_FLOAT32] = 0,
- [MESA_FORMAT_Z32_FLOAT_S8X24_UINT] = 0,
-
[MESA_FORMAT_R10G10B10A2_UNORM] = ISL_FORMAT_R10G10B10A2_UNORM,
[MESA_FORMAT_B10G10R10A2_UINT] = ISL_FORMAT_B10G10R10A2_UINT,
[MESA_FORMAT_R10G10B10A2_UINT] = ISL_FORMAT_R10G10B10A2_UINT,
- [MESA_FORMAT_B4G4R4X4_UNORM] = 0,
[MESA_FORMAT_B5G5R5X1_UNORM] = ISL_FORMAT_B5G5R5X1_UNORM,
- [MESA_FORMAT_R8G8B8X8_SNORM] = 0,
[MESA_FORMAT_R8G8B8X8_SRGB] = ISL_FORMAT_R8G8B8X8_UNORM_SRGB,
- [MESA_FORMAT_X8B8G8R8_SRGB] = 0,
- [MESA_FORMAT_RGBX_UINT8] = 0,
- [MESA_FORMAT_RGBX_SINT8] = 0,
[MESA_FORMAT_B10G10R10X2_UNORM] = ISL_FORMAT_B10G10R10X2_UNORM,
[MESA_FORMAT_RGBX_UNORM16] = ISL_FORMAT_R16G16B16X16_UNORM,
- [MESA_FORMAT_RGBX_SNORM16] = 0,
[MESA_FORMAT_RGBX_FLOAT16] = ISL_FORMAT_R16G16B16X16_FLOAT,
- [MESA_FORMAT_RGBX_UINT16] = 0,
- [MESA_FORMAT_RGBX_SINT16] = 0,
[MESA_FORMAT_RGBX_FLOAT32] = ISL_FORMAT_R32G32B32X32_FLOAT,
- [MESA_FORMAT_RGBX_UINT32] = 0,
- [MESA_FORMAT_RGBX_SINT32] = 0,
};
+
assert(mesa_format < MESA_FORMAT_COUNT);
return table[mesa_format];
}
render = texture = brw_isl_format_for_mesa_format(format);
- /* The value of ISL_FORMAT_R32G32B32A32_FLOAT is 0, so don't skip
- * it.
- */
- if (texture == 0 && format != MESA_FORMAT_RGBA_FLOAT32)
+ if (texture == ISL_FORMAT_UNSUPPORTED)
continue;
/* Don't advertise 8 and 16-bit RGB formats to core mesa. This ensures