static const struct icd_format_info {
XGL_SIZE size;
XGL_UINT channel_count;
-} icd_format_table[XGL_MAX_CH_FMT + 1] = {
- [XGL_CH_FMT_UNDEFINED] = { 0, 0 },
- [XGL_CH_FMT_R4G4] = { 1, 2 },
- [XGL_CH_FMT_R4G4B4A4] = { 2, 4 },
- [XGL_CH_FMT_R5G6B5] = { 2, 3 },
- [XGL_CH_FMT_B5G6R5] = { 2, 3 },
- [XGL_CH_FMT_R5G5B5A1] = { 2, 4 },
- [XGL_CH_FMT_R8] = { 1, 1 },
- [XGL_CH_FMT_R8G8] = { 2, 2 },
- [XGL_CH_FMT_R8G8B8A8] = { 4, 4 },
- [XGL_CH_FMT_B8G8R8A8] = { 4, 4 },
- [XGL_CH_FMT_R10G11B11] = { 4, 3 },
- [XGL_CH_FMT_R11G11B10] = { 4, 3 },
- [XGL_CH_FMT_R10G10B10A2] = { 4, 4 },
- [XGL_CH_FMT_R16] = { 2, 1 },
- [XGL_CH_FMT_R16G16] = { 4, 2 },
- [XGL_CH_FMT_R16G16B16A16] = { 8, 4 },
- [XGL_CH_FMT_R32] = { 4, 1 },
- [XGL_CH_FMT_R32G32] = { 8, 2 },
- [XGL_CH_FMT_R32G32B32] = { 12, 3 },
- [XGL_CH_FMT_R32G32B32A32] = { 16, 4 },
- [XGL_CH_FMT_R16G8] = { 3, 2 },
- [XGL_CH_FMT_R32G8] = { 5, 2 },
- [XGL_CH_FMT_R9G9B9E5] = { 4, 3 },
- [XGL_CH_FMT_BC1] = { 8, 4 },
- [XGL_CH_FMT_BC2] = { 16, 4 },
- [XGL_CH_FMT_BC3] = { 16, 4 },
- [XGL_CH_FMT_BC4] = { 8, 4 },
- [XGL_CH_FMT_BC5] = { 16, 4 },
- [XGL_CH_FMT_BC6U] = { 16, 4 },
- [XGL_CH_FMT_BC6S] = { 16, 4 },
- [XGL_CH_FMT_BC7] = { 16, 4 },
- [XGL_CH_FMT_R8G8B8] = { 3, 3 },
- [XGL_CH_FMT_R16G16B16] = { 6, 3 },
- [XGL_CH_FMT_B10G10R10A2] = { 4, 4 },
- [XGL_CH_FMT_R64] = { 8, 1 },
- [XGL_CH_FMT_R64G64] = { 16, 2 },
- [XGL_CH_FMT_R64G64B64] = { 24, 3 },
- [XGL_CH_FMT_R64G64B64A64] = { 32, 4 },
+} icd_format_table[XGL_NUM_FMT] = {
+ [XGL_FMT_UNDEFINED] = { 0, 0 },
+ [XGL_FMT_R4G4_UNORM] = { 1, 2 },
+ [XGL_FMT_R4G4_USCALED] = { 1, 2 },
+ [XGL_FMT_R4G4B4A4_UNORM] = { 2, 4 },
+ [XGL_FMT_R4G4B4A4_USCALED] = { 2, 4 },
+ [XGL_FMT_R5G6B5_UNORM] = { 2, 3 },
+ [XGL_FMT_R5G6B5_USCALED] = { 2, 3 },
+ [XGL_FMT_R5G5B5A1_UNORM] = { 2, 4 },
+ [XGL_FMT_R5G5B5A1_USCALED] = { 2, 4 },
+ [XGL_FMT_R8_UNORM] = { 1, 1 },
+ [XGL_FMT_R8_SNORM] = { 1, 1 },
+ [XGL_FMT_R8_USCALED] = { 1, 1 },
+ [XGL_FMT_R8_SSCALED] = { 1, 1 },
+ [XGL_FMT_R8_UINT] = { 1, 1 },
+ [XGL_FMT_R8_SINT] = { 1, 1 },
+ [XGL_FMT_R8_SRGB] = { 1, 1 },
+ [XGL_FMT_R8G8_UNORM] = { 2, 2 },
+ [XGL_FMT_R8G8_SNORM] = { 2, 2 },
+ [XGL_FMT_R8G8_USCALED] = { 2, 2 },
+ [XGL_FMT_R8G8_SSCALED] = { 2, 2 },
+ [XGL_FMT_R8G8_UINT] = { 2, 2 },
+ [XGL_FMT_R8G8_SINT] = { 2, 2 },
+ [XGL_FMT_R8G8_SRGB] = { 2, 2 },
+ [XGL_FMT_R8G8B8_UNORM] = { 3, 3 },
+ [XGL_FMT_R8G8B8_SNORM] = { 3, 3 },
+ [XGL_FMT_R8G8B8_USCALED] = { 3, 3 },
+ [XGL_FMT_R8G8B8_SSCALED] = { 3, 3 },
+ [XGL_FMT_R8G8B8_UINT] = { 3, 3 },
+ [XGL_FMT_R8G8B8_SINT] = { 3, 3 },
+ [XGL_FMT_R8G8B8_SRGB] = { 3, 3 },
+ [XGL_FMT_R8G8B8A8_UNORM] = { 4, 4 },
+ [XGL_FMT_R8G8B8A8_SNORM] = { 4, 4 },
+ [XGL_FMT_R8G8B8A8_USCALED] = { 4, 4 },
+ [XGL_FMT_R8G8B8A8_SSCALED] = { 4, 4 },
+ [XGL_FMT_R8G8B8A8_UINT] = { 4, 4 },
+ [XGL_FMT_R8G8B8A8_SINT] = { 4, 4 },
+ [XGL_FMT_R8G8B8A8_SRGB] = { 4, 4 },
+ [XGL_FMT_R10G10B10A2_UNORM] = { 4, 4 },
+ [XGL_FMT_R10G10B10A2_SNORM] = { 4, 4 },
+ [XGL_FMT_R10G10B10A2_USCALED] = { 4, 4 },
+ [XGL_FMT_R10G10B10A2_SSCALED] = { 4, 4 },
+ [XGL_FMT_R10G10B10A2_UINT] = { 4, 4 },
+ [XGL_FMT_R10G10B10A2_SINT] = { 4, 4 },
+ [XGL_FMT_R16_UNORM] = { 2, 1 },
+ [XGL_FMT_R16_SNORM] = { 2, 1 },
+ [XGL_FMT_R16_USCALED] = { 2, 1 },
+ [XGL_FMT_R16_SSCALED] = { 2, 1 },
+ [XGL_FMT_R16_UINT] = { 2, 1 },
+ [XGL_FMT_R16_SINT] = { 2, 1 },
+ [XGL_FMT_R16_SFLOAT] = { 2, 1 },
+ [XGL_FMT_R16G16_UNORM] = { 4, 2 },
+ [XGL_FMT_R16G16_SNORM] = { 4, 2 },
+ [XGL_FMT_R16G16_USCALED] = { 4, 2 },
+ [XGL_FMT_R16G16_SSCALED] = { 4, 2 },
+ [XGL_FMT_R16G16_UINT] = { 4, 2 },
+ [XGL_FMT_R16G16_SINT] = { 4, 2 },
+ [XGL_FMT_R16G16_SFLOAT] = { 4, 2 },
+ [XGL_FMT_R16G16B16_UNORM] = { 6, 3 },
+ [XGL_FMT_R16G16B16_SNORM] = { 6, 3 },
+ [XGL_FMT_R16G16B16_USCALED] = { 6, 3 },
+ [XGL_FMT_R16G16B16_SSCALED] = { 6, 3 },
+ [XGL_FMT_R16G16B16_UINT] = { 6, 3 },
+ [XGL_FMT_R16G16B16_SINT] = { 6, 3 },
+ [XGL_FMT_R16G16B16_SFLOAT] = { 6, 3 },
+ [XGL_FMT_R16G16B16A16_UNORM] = { 8, 4 },
+ [XGL_FMT_R16G16B16A16_SNORM] = { 8, 4 },
+ [XGL_FMT_R16G16B16A16_USCALED] = { 8, 4 },
+ [XGL_FMT_R16G16B16A16_SSCALED] = { 8, 4 },
+ [XGL_FMT_R16G16B16A16_UINT] = { 8, 4 },
+ [XGL_FMT_R16G16B16A16_SINT] = { 8, 4 },
+ [XGL_FMT_R16G16B16A16_SFLOAT] = { 8, 4 },
+ [XGL_FMT_R32_UINT] = { 4, 1 },
+ [XGL_FMT_R32_SINT] = { 4, 1 },
+ [XGL_FMT_R32_SFLOAT] = { 4, 1 },
+ [XGL_FMT_R32G32_UINT] = { 8, 2 },
+ [XGL_FMT_R32G32_SINT] = { 8, 2 },
+ [XGL_FMT_R32G32_SFLOAT] = { 8, 2 },
+ [XGL_FMT_R32G32B32_UINT] = { 12, 3 },
+ [XGL_FMT_R32G32B32_SINT] = { 12, 3 },
+ [XGL_FMT_R32G32B32_SFLOAT] = { 12, 3 },
+ [XGL_FMT_R32G32B32A32_UINT] = { 16, 4 },
+ [XGL_FMT_R32G32B32A32_SINT] = { 16, 4 },
+ [XGL_FMT_R32G32B32A32_SFLOAT] = { 16, 4 },
+ [XGL_FMT_R64_SFLOAT] = { 8, 1 },
+ [XGL_FMT_R64G64_SFLOAT] = { 16, 2 },
+ [XGL_FMT_R64G64B64_SFLOAT] = { 24, 3 },
+ [XGL_FMT_R64G64B64A64_SFLOAT] = { 32, 4 },
+ [XGL_FMT_R11G11B10_UFLOAT] = { 4, 3 },
+ [XGL_FMT_R9G9B9E5_UFLOAT] = { 4, 3 },
+ [XGL_FMT_D16_UNORM] = { 2, 1 },
+ [XGL_FMT_D24_UNORM] = { 3, 1 },
+ [XGL_FMT_D32_SFLOAT] = { 4, 1 },
+ [XGL_FMT_S8_UINT] = { 1, 1 },
+ [XGL_FMT_D16_UNORM_S8_UINT] = { 3, 2 },
+ [XGL_FMT_D24_UNORM_S8_UINT] = { 4, 2 },
+ [XGL_FMT_D32_SFLOAT_S8_UINT] = { 4, 2 },
+ [XGL_FMT_BC1_UNORM] = { 8, 4 },
+ [XGL_FMT_BC1_SRGB] = { 8, 4 },
+ [XGL_FMT_BC2_UNORM] = { 16, 4 },
+ [XGL_FMT_BC2_SRGB] = { 16, 4 },
+ [XGL_FMT_BC3_UNORM] = { 16, 4 },
+ [XGL_FMT_BC3_SRGB] = { 16, 4 },
+ [XGL_FMT_BC4_UNORM] = { 8, 4 },
+ [XGL_FMT_BC4_SNORM] = { 8, 4 },
+ [XGL_FMT_BC5_UNORM] = { 16, 4 },
+ [XGL_FMT_BC5_SNORM] = { 16, 4 },
+ [XGL_FMT_BC6H_UFLOAT] = { 16, 4 },
+ [XGL_FMT_BC6H_SFLOAT] = { 16, 4 },
+ [XGL_FMT_BC7_UNORM] = { 16, 4 },
+ [XGL_FMT_BC7_SRGB] = { 16, 4 },
+ /* TODO: Initialize remaining compressed formats. */
+ [XGL_FMT_ETC2_R8G8B8_UNORM] = { 0, 0 },
+ [XGL_FMT_ETC2_R8G8B8A1_UNORM] = { 0, 0 },
+ [XGL_FMT_ETC2_R8G8B8A8_UNORM] = { 0, 0 },
+ [XGL_FMT_EAC_R11_UNORM] = { 0, 0 },
+ [XGL_FMT_EAC_R11_SNORM] = { 0, 0 },
+ [XGL_FMT_EAC_R11G11_UNORM] = { 0, 0 },
+ [XGL_FMT_EAC_R11G11_SNORM] = { 0, 0 },
+ [XGL_FMT_ASTC_4x4_UNORM] = { 0, 0 },
+ [XGL_FMT_ASTC_4x4_SRGB] = { 0, 0 },
+ [XGL_FMT_ASTC_4x5_UNORM] = { 0, 0 },
+ [XGL_FMT_ASTC_4x5_SRGB] = { 0, 0 },
+ [XGL_FMT_ASTC_5x5_UNORM] = { 0, 0 },
+ [XGL_FMT_ASTC_5x5_SRGB] = { 0, 0 },
+ [XGL_FMT_ASTC_6x5_UNORM] = { 0, 0 },
+ [XGL_FMT_ASTC_6x5_SRGB] = { 0, 0 },
+ [XGL_FMT_ASTC_6x6_UNORM] = { 0, 0 },
+ [XGL_FMT_ASTC_6x6_SRGB] = { 0, 0 },
+ [XGL_FMT_ASTC_8x5_UNORM] = { 0, 0 },
+ [XGL_FMT_ASTC_8x5_SRGB] = { 0, 0 },
+ [XGL_FMT_ASTC_8x6_UNORM] = { 0, 0 },
+ [XGL_FMT_ASTC_8x6_SRGB] = { 0, 0 },
+ [XGL_FMT_ASTC_8x8_UNORM] = { 0, 0 },
+ [XGL_FMT_ASTC_8x8_SRGB] = { 0, 0 },
+ [XGL_FMT_ASTC_10x5_UNORM] = { 0, 0 },
+ [XGL_FMT_ASTC_10x5_SRGB] = { 0, 0 },
+ [XGL_FMT_ASTC_10x6_UNORM] = { 0, 0 },
+ [XGL_FMT_ASTC_10x6_SRGB] = { 0, 0 },
+ [XGL_FMT_ASTC_10x8_UNORM] = { 0, 0 },
+ [XGL_FMT_ASTC_10x8_SRGB] = { 0, 0 },
+ [XGL_FMT_ASTC_10x10_UNORM] = { 0, 0 },
+ [XGL_FMT_ASTC_10x10_SRGB] = { 0, 0 },
+ [XGL_FMT_ASTC_12x10_UNORM] = { 0, 0 },
+ [XGL_FMT_ASTC_12x10_SRGB] = { 0, 0 },
+ [XGL_FMT_ASTC_12x12_UNORM] = { 0, 0 },
+ [XGL_FMT_ASTC_12x12_SRGB] = { 0, 0 },
+ [XGL_FMT_B5G6R5_UNORM] = { 2, 3 },
+ [XGL_FMT_B5G6R5_USCALED] = { 2, 3 },
+ [XGL_FMT_B8G8R8_UNORM] = { 3, 3 },
+ [XGL_FMT_B8G8R8_SNORM] = { 3, 3 },
+ [XGL_FMT_B8G8R8_USCALED] = { 3, 3 },
+ [XGL_FMT_B8G8R8_SSCALED] = { 3, 3 },
+ [XGL_FMT_B8G8R8_UINT] = { 3, 3 },
+ [XGL_FMT_B8G8R8_SINT] = { 3, 3 },
+ [XGL_FMT_B8G8R8_SRGB] = { 3, 3 },
+ [XGL_FMT_B8G8R8A8_UNORM] = { 4, 4 },
+ [XGL_FMT_B8G8R8A8_SNORM] = { 4, 4 },
+ [XGL_FMT_B8G8R8A8_USCALED] = { 4, 4 },
+ [XGL_FMT_B8G8R8A8_SSCALED] = { 4, 4 },
+ [XGL_FMT_B8G8R8A8_UINT] = { 4, 4 },
+ [XGL_FMT_B8G8R8A8_SINT] = { 4, 4 },
+ [XGL_FMT_B8G8R8A8_SRGB] = { 4, 4 },
+ [XGL_FMT_B10G10R10A2_UNORM] = { 4, 4 },
+ [XGL_FMT_B10G10R10A2_SNORM] = { 4, 4 },
+ [XGL_FMT_B10G10R10A2_USCALED] = { 4, 4 },
+ [XGL_FMT_B10G10R10A2_SSCALED] = { 4, 4 },
+ [XGL_FMT_B10G10R10A2_UINT] = { 4, 4 },
+ [XGL_FMT_B10G10R10A2_SINT] = { 4, 4 },
};
+bool icd_format_is_ds(XGL_FORMAT format)
+{
+ bool is_ds = false;
+
+ switch (format) {
+ case XGL_FMT_D16_UNORM:
+ case XGL_FMT_D24_UNORM:
+ case XGL_FMT_D32_SFLOAT:
+ case XGL_FMT_S8_UINT:
+ case XGL_FMT_D16_UNORM_S8_UINT:
+ case XGL_FMT_D24_UNORM_S8_UINT:
+ case XGL_FMT_D32_SFLOAT_S8_UINT:
+ is_ds = true;
+ break;
+ default:
+ break;
+ }
+
+ return is_ds;
+}
+
+bool icd_format_is_norm(XGL_FORMAT format)
+{
+ bool is_norm = false;
+
+ switch (format) {
+ case XGL_FMT_R4G4_UNORM:
+ case XGL_FMT_R4G4B4A4_UNORM:
+ case XGL_FMT_R5G6B5_UNORM:
+ case XGL_FMT_R5G5B5A1_UNORM:
+ case XGL_FMT_R8_UNORM:
+ case XGL_FMT_R8_SNORM:
+ case XGL_FMT_R8G8_UNORM:
+ case XGL_FMT_R8G8_SNORM:
+ case XGL_FMT_R8G8B8_UNORM:
+ case XGL_FMT_R8G8B8_SNORM:
+ case XGL_FMT_R8G8B8A8_UNORM:
+ case XGL_FMT_R8G8B8A8_SNORM:
+ case XGL_FMT_R10G10B10A2_UNORM:
+ case XGL_FMT_R10G10B10A2_SNORM:
+ case XGL_FMT_R16_UNORM:
+ case XGL_FMT_R16_SNORM:
+ case XGL_FMT_R16G16_UNORM:
+ case XGL_FMT_R16G16_SNORM:
+ case XGL_FMT_R16G16B16_UNORM:
+ case XGL_FMT_R16G16B16_SNORM:
+ case XGL_FMT_R16G16B16A16_UNORM:
+ case XGL_FMT_R16G16B16A16_SNORM:
+ case XGL_FMT_BC1_UNORM:
+ case XGL_FMT_BC2_UNORM:
+ case XGL_FMT_BC3_UNORM:
+ case XGL_FMT_BC4_UNORM:
+ case XGL_FMT_BC4_SNORM:
+ case XGL_FMT_BC5_UNORM:
+ case XGL_FMT_BC5_SNORM:
+ case XGL_FMT_BC7_UNORM:
+ case XGL_FMT_ETC2_R8G8B8_UNORM:
+ case XGL_FMT_ETC2_R8G8B8A1_UNORM:
+ case XGL_FMT_ETC2_R8G8B8A8_UNORM:
+ case XGL_FMT_EAC_R11_UNORM:
+ case XGL_FMT_EAC_R11_SNORM:
+ case XGL_FMT_EAC_R11G11_UNORM:
+ case XGL_FMT_EAC_R11G11_SNORM:
+ case XGL_FMT_ASTC_4x4_UNORM:
+ case XGL_FMT_ASTC_4x5_UNORM:
+ case XGL_FMT_ASTC_5x5_UNORM:
+ case XGL_FMT_ASTC_6x5_UNORM:
+ case XGL_FMT_ASTC_6x6_UNORM:
+ case XGL_FMT_ASTC_8x5_UNORM:
+ case XGL_FMT_ASTC_8x6_UNORM:
+ case XGL_FMT_ASTC_8x8_UNORM:
+ case XGL_FMT_ASTC_10x5_UNORM:
+ case XGL_FMT_ASTC_10x6_UNORM:
+ case XGL_FMT_ASTC_10x8_UNORM:
+ case XGL_FMT_ASTC_10x10_UNORM:
+ case XGL_FMT_ASTC_12x10_UNORM:
+ case XGL_FMT_ASTC_12x12_UNORM:
+ case XGL_FMT_B5G6R5_UNORM:
+ case XGL_FMT_B8G8R8_UNORM:
+ case XGL_FMT_B8G8R8_SNORM:
+ case XGL_FMT_B8G8R8A8_UNORM:
+ case XGL_FMT_B8G8R8A8_SNORM:
+ case XGL_FMT_B10G10R10A2_UNORM:
+ case XGL_FMT_B10G10R10A2_SNORM:
+ is_norm = true;
+ break;
+ default:
+ break;
+ }
+
+ return is_norm;
+};
+
+bool icd_format_is_int(XGL_FORMAT format)
+{
+ bool is_int = false;
+
+ switch (format) {
+ case XGL_FMT_R8_UINT:
+ case XGL_FMT_R8_SINT:
+ case XGL_FMT_R8G8_UINT:
+ case XGL_FMT_R8G8_SINT:
+ case XGL_FMT_R8G8B8_UINT:
+ case XGL_FMT_R8G8B8_SINT:
+ case XGL_FMT_R8G8B8A8_UINT:
+ case XGL_FMT_R8G8B8A8_SINT:
+ case XGL_FMT_R10G10B10A2_UINT:
+ case XGL_FMT_R10G10B10A2_SINT:
+ case XGL_FMT_R16_UINT:
+ case XGL_FMT_R16_SINT:
+ case XGL_FMT_R16G16_UINT:
+ case XGL_FMT_R16G16_SINT:
+ case XGL_FMT_R16G16B16_UINT:
+ case XGL_FMT_R16G16B16_SINT:
+ case XGL_FMT_R16G16B16A16_UINT:
+ case XGL_FMT_R16G16B16A16_SINT:
+ case XGL_FMT_R32_UINT:
+ case XGL_FMT_R32_SINT:
+ case XGL_FMT_R32G32_UINT:
+ case XGL_FMT_R32G32_SINT:
+ case XGL_FMT_R32G32B32_UINT:
+ case XGL_FMT_R32G32B32_SINT:
+ case XGL_FMT_R32G32B32A32_UINT:
+ case XGL_FMT_R32G32B32A32_SINT:
+ case XGL_FMT_B8G8R8_UINT:
+ case XGL_FMT_B8G8R8_SINT:
+ case XGL_FMT_B8G8R8A8_UINT:
+ case XGL_FMT_B8G8R8A8_SINT:
+ case XGL_FMT_B10G10R10A2_UINT:
+ case XGL_FMT_B10G10R10A2_SINT:
+ is_int = true;
+ break;
+ default:
+ break;
+ }
+
+ return is_int;
+}
+
+bool icd_format_is_float(XGL_FORMAT format)
+{
+ bool is_float = false;
+
+ switch (format) {
+ case XGL_FMT_R16_SFLOAT:
+ case XGL_FMT_R16G16_SFLOAT:
+ case XGL_FMT_R16G16B16_SFLOAT:
+ case XGL_FMT_R16G16B16A16_SFLOAT:
+ case XGL_FMT_R32_SFLOAT:
+ case XGL_FMT_R32G32_SFLOAT:
+ case XGL_FMT_R32G32B32_SFLOAT:
+ case XGL_FMT_R32G32B32A32_SFLOAT:
+ case XGL_FMT_R64_SFLOAT:
+ case XGL_FMT_R64G64_SFLOAT:
+ case XGL_FMT_R64G64B64_SFLOAT:
+ case XGL_FMT_R64G64B64A64_SFLOAT:
+ case XGL_FMT_R11G11B10_UFLOAT:
+ case XGL_FMT_R9G9B9E5_UFLOAT:
+ case XGL_FMT_BC6H_UFLOAT:
+ case XGL_FMT_BC6H_SFLOAT:
+ is_float = true;
+ break;
+ default:
+ break;
+ }
+
+ return is_float;
+}
+
+bool icd_format_is_srgb(XGL_FORMAT format)
+{
+ bool is_srgb = false;
+
+ switch (format) {
+ case XGL_FMT_R8_SRGB:
+ case XGL_FMT_R8G8_SRGB:
+ case XGL_FMT_R8G8B8_SRGB:
+ case XGL_FMT_R8G8B8A8_SRGB:
+ case XGL_FMT_BC1_SRGB:
+ case XGL_FMT_BC2_SRGB:
+ case XGL_FMT_BC3_SRGB:
+ case XGL_FMT_BC7_SRGB:
+ case XGL_FMT_ASTC_4x4_SRGB:
+ case XGL_FMT_ASTC_4x5_SRGB:
+ case XGL_FMT_ASTC_5x5_SRGB:
+ case XGL_FMT_ASTC_6x5_SRGB:
+ case XGL_FMT_ASTC_6x6_SRGB:
+ case XGL_FMT_ASTC_8x5_SRGB:
+ case XGL_FMT_ASTC_8x6_SRGB:
+ case XGL_FMT_ASTC_8x8_SRGB:
+ case XGL_FMT_ASTC_10x5_SRGB:
+ case XGL_FMT_ASTC_10x6_SRGB:
+ case XGL_FMT_ASTC_10x8_SRGB:
+ case XGL_FMT_ASTC_10x10_SRGB:
+ case XGL_FMT_ASTC_12x10_SRGB:
+ case XGL_FMT_ASTC_12x12_SRGB:
+ case XGL_FMT_B8G8R8_SRGB:
+ case XGL_FMT_B8G8R8A8_SRGB:
+ is_srgb = true;
+ break;
+ default:
+ break;
+ }
+
+ return is_srgb;
+}
+
+bool icd_format_is_compressed(XGL_FORMAT format)
+{
+ switch (format) {
+ case XGL_FMT_BC1_UNORM:
+ case XGL_FMT_BC1_SRGB:
+ case XGL_FMT_BC2_UNORM:
+ case XGL_FMT_BC2_SRGB:
+ case XGL_FMT_BC3_UNORM:
+ case XGL_FMT_BC3_SRGB:
+ case XGL_FMT_BC4_UNORM:
+ case XGL_FMT_BC4_SNORM:
+ case XGL_FMT_BC5_UNORM:
+ case XGL_FMT_BC5_SNORM:
+ case XGL_FMT_BC6H_UFLOAT:
+ case XGL_FMT_BC6H_SFLOAT:
+ case XGL_FMT_BC7_UNORM:
+ case XGL_FMT_BC7_SRGB:
+ case XGL_FMT_ETC2_R8G8B8_UNORM:
+ case XGL_FMT_ETC2_R8G8B8A1_UNORM:
+ case XGL_FMT_ETC2_R8G8B8A8_UNORM:
+ case XGL_FMT_EAC_R11_UNORM:
+ case XGL_FMT_EAC_R11_SNORM:
+ case XGL_FMT_EAC_R11G11_UNORM:
+ case XGL_FMT_EAC_R11G11_SNORM:
+ case XGL_FMT_ASTC_4x4_UNORM:
+ case XGL_FMT_ASTC_4x4_SRGB:
+ case XGL_FMT_ASTC_4x5_UNORM:
+ case XGL_FMT_ASTC_4x5_SRGB:
+ case XGL_FMT_ASTC_5x5_UNORM:
+ case XGL_FMT_ASTC_5x5_SRGB:
+ case XGL_FMT_ASTC_6x5_UNORM:
+ case XGL_FMT_ASTC_6x5_SRGB:
+ case XGL_FMT_ASTC_6x6_UNORM:
+ case XGL_FMT_ASTC_6x6_SRGB:
+ case XGL_FMT_ASTC_8x5_UNORM:
+ case XGL_FMT_ASTC_8x5_SRGB:
+ case XGL_FMT_ASTC_8x6_UNORM:
+ case XGL_FMT_ASTC_8x6_SRGB:
+ case XGL_FMT_ASTC_8x8_UNORM:
+ case XGL_FMT_ASTC_8x8_SRGB:
+ case XGL_FMT_ASTC_10x5_UNORM:
+ case XGL_FMT_ASTC_10x5_SRGB:
+ case XGL_FMT_ASTC_10x6_UNORM:
+ case XGL_FMT_ASTC_10x6_SRGB:
+ case XGL_FMT_ASTC_10x8_UNORM:
+ case XGL_FMT_ASTC_10x8_SRGB:
+ case XGL_FMT_ASTC_10x10_UNORM:
+ case XGL_FMT_ASTC_10x10_SRGB:
+ case XGL_FMT_ASTC_12x10_UNORM:
+ case XGL_FMT_ASTC_12x10_SRGB:
+ case XGL_FMT_ASTC_12x12_UNORM:
+ case XGL_FMT_ASTC_12x12_SRGB:
+ return true;
+ default:
+ return false;
+ }
+}
+
size_t icd_format_get_size(XGL_FORMAT format)
{
- return icd_format_table[format.channelFormat].size;
+ return icd_format_table[format].size;
}
XGL_IMAGE_FORMAT_CLASS icd_format_get_class(XGL_FORMAT format)
unsigned int icd_format_get_channel_count(XGL_FORMAT format)
{
- return icd_format_table[format.channelFormat].channel_count;
+ return icd_format_table[format].channel_count;
}
/**
void *value)
{
/* assume little-endian */
- switch (format.channelFormat) {
- case XGL_CH_FMT_UNDEFINED:
+ switch (format) {
+ case XGL_FMT_UNDEFINED:
break;
- case XGL_CH_FMT_R4G4:
+ case XGL_FMT_R4G4_UNORM:
+ case XGL_FMT_R4G4_USCALED:
((uint8_t *) value)[0] = (color[0] & 0xf) << 0 |
(color[1] & 0xf) << 4;
break;
- case XGL_CH_FMT_R4G4B4A4:
+ case XGL_FMT_R4G4B4A4_UNORM:
+ case XGL_FMT_R4G4B4A4_USCALED:
((uint16_t *) value)[0] = (color[0] & 0xf) << 0 |
(color[1] & 0xf) << 4 |
(color[2] & 0xf) << 8 |
(color[3] & 0xf) << 12;
break;
- case XGL_CH_FMT_R5G6B5:
+ case XGL_FMT_R5G6B5_UNORM:
+ case XGL_FMT_R5G6B5_USCALED:
((uint16_t *) value)[0] = (color[0] & 0x1f) << 0 |
(color[1] & 0x3f) << 5 |
(color[2] & 0x1f) << 11;
break;
- case XGL_CH_FMT_B5G6R5:
+ case XGL_FMT_B5G6R5_UNORM:
((uint16_t *) value)[0] = (color[2] & 0x1f) << 0 |
(color[1] & 0x3f) << 5 |
(color[0] & 0x1f) << 11;
break;
- case XGL_CH_FMT_R5G5B5A1:
+ case XGL_FMT_R5G5B5A1_UNORM:
+ case XGL_FMT_R5G5B5A1_USCALED:
((uint16_t *) value)[0] = (color[0] & 0x1f) << 0 |
(color[1] & 0x1f) << 5 |
(color[2] & 0x1f) << 10 |
(color[3] & 0x1) << 15;
break;
- case XGL_CH_FMT_R8:
+ case XGL_FMT_R8_UNORM:
+ case XGL_FMT_R8_SNORM:
+ case XGL_FMT_R8_USCALED:
+ case XGL_FMT_R8_SSCALED:
+ case XGL_FMT_R8_UINT:
+ case XGL_FMT_R8_SINT:
+ case XGL_FMT_R8_SRGB:
((uint8_t *) value)[0] = (uint8_t) color[0];
break;
- case XGL_CH_FMT_R8G8:
+ case XGL_FMT_R8G8_UNORM:
+ case XGL_FMT_R8G8_SNORM:
+ case XGL_FMT_R8G8_USCALED:
+ case XGL_FMT_R8G8_SSCALED:
+ case XGL_FMT_R8G8_UINT:
+ case XGL_FMT_R8G8_SINT:
+ case XGL_FMT_R8G8_SRGB:
((uint8_t *) value)[0] = (uint8_t) color[0];
((uint8_t *) value)[1] = (uint8_t) color[1];
break;
- case XGL_CH_FMT_R8G8B8A8:
+ case XGL_FMT_R8G8B8A8_UNORM:
+ case XGL_FMT_R8G8B8A8_SNORM:
+ case XGL_FMT_R8G8B8A8_USCALED:
+ case XGL_FMT_R8G8B8A8_SSCALED:
+ case XGL_FMT_R8G8B8A8_UINT:
+ case XGL_FMT_R8G8B8A8_SINT:
+ case XGL_FMT_R8G8B8A8_SRGB:
((uint8_t *) value)[0] = (uint8_t) color[0];
((uint8_t *) value)[1] = (uint8_t) color[1];
((uint8_t *) value)[2] = (uint8_t) color[2];
((uint8_t *) value)[3] = (uint8_t) color[3];
break;
- case XGL_CH_FMT_B8G8R8A8:
+ case XGL_FMT_B8G8R8A8_UNORM:
+ case XGL_FMT_B8G8R8A8_SRGB:
((uint8_t *) value)[0] = (uint8_t) color[2];
((uint8_t *) value)[1] = (uint8_t) color[1];
((uint8_t *) value)[2] = (uint8_t) color[0];
((uint8_t *) value)[3] = (uint8_t) color[3];
break;
- case XGL_CH_FMT_R10G11B11:
- ((uint32_t *) value)[0] = (color[0] & 0x3ff) << 0 |
- (color[1] & 0x7ff) << 10 |
- (color[2] & 0x7ff) << 21;
- break;
- case XGL_CH_FMT_R11G11B10:
+ case XGL_FMT_R11G11B10_UFLOAT:
((uint32_t *) value)[0] = (color[0] & 0x7ff) << 0 |
(color[1] & 0x7ff) << 11 |
(color[2] & 0x3ff) << 22;
break;
- case XGL_CH_FMT_R10G10B10A2:
+ case XGL_FMT_R10G10B10A2_UNORM:
+ case XGL_FMT_R10G10B10A2_SNORM:
+ case XGL_FMT_R10G10B10A2_USCALED:
+ case XGL_FMT_R10G10B10A2_SSCALED:
+ case XGL_FMT_R10G10B10A2_UINT:
+ case XGL_FMT_R10G10B10A2_SINT:
((uint32_t *) value)[0] = (color[0] & 0x3ff) << 0 |
(color[1] & 0x3ff) << 10 |
(color[2] & 0x3ff) << 20 |
(color[3] & 0x3) << 30;
break;
- case XGL_CH_FMT_R16:
+ case XGL_FMT_R16_UNORM:
+ case XGL_FMT_R16_SNORM:
+ case XGL_FMT_R16_USCALED:
+ case XGL_FMT_R16_SSCALED:
+ case XGL_FMT_R16_UINT:
+ case XGL_FMT_R16_SINT:
+ case XGL_FMT_R16_SFLOAT:
((uint16_t *) value)[0] = (uint16_t) color[0];
break;
- case XGL_CH_FMT_R16G16:
+ case XGL_FMT_R16G16_UNORM:
+ case XGL_FMT_R16G16_SNORM:
+ case XGL_FMT_R16G16_USCALED:
+ case XGL_FMT_R16G16_SSCALED:
+ case XGL_FMT_R16G16_UINT:
+ case XGL_FMT_R16G16_SINT:
+ case XGL_FMT_R16G16_SFLOAT:
((uint16_t *) value)[0] = (uint16_t) color[0];
((uint16_t *) value)[1] = (uint16_t) color[1];
break;
- case XGL_CH_FMT_R16G16B16A16:
+ case XGL_FMT_R16G16B16A16_UNORM:
+ case XGL_FMT_R16G16B16A16_SNORM:
+ case XGL_FMT_R16G16B16A16_USCALED:
+ case XGL_FMT_R16G16B16A16_SSCALED:
+ case XGL_FMT_R16G16B16A16_UINT:
+ case XGL_FMT_R16G16B16A16_SINT:
+ case XGL_FMT_R16G16B16A16_SFLOAT:
((uint16_t *) value)[0] = (uint16_t) color[0];
((uint16_t *) value)[1] = (uint16_t) color[1];
((uint16_t *) value)[2] = (uint16_t) color[2];
((uint16_t *) value)[3] = (uint16_t) color[3];
break;
- case XGL_CH_FMT_R32:
+ case XGL_FMT_R32_UINT:
+ case XGL_FMT_R32_SINT:
+ case XGL_FMT_R32_SFLOAT:
((uint32_t *) value)[0] = color[0];
break;
- case XGL_CH_FMT_R32G32:
+ case XGL_FMT_R32G32_UINT:
+ case XGL_FMT_R32G32_SINT:
+ case XGL_FMT_R32G32_SFLOAT:
((uint32_t *) value)[0] = color[0];
((uint32_t *) value)[1] = color[1];
break;
- case XGL_CH_FMT_R32G32B32:
+ case XGL_FMT_R32G32B32_UINT:
+ case XGL_FMT_R32G32B32_SINT:
+ case XGL_FMT_R32G32B32_SFLOAT:
((uint32_t *) value)[0] = color[0];
((uint32_t *) value)[1] = color[1];
((uint32_t *) value)[2] = color[2];
break;
- case XGL_CH_FMT_R32G32B32A32:
+ case XGL_FMT_R32G32B32A32_UINT:
+ case XGL_FMT_R32G32B32A32_SINT:
+ case XGL_FMT_R32G32B32A32_SFLOAT:
((uint32_t *) value)[0] = color[0];
((uint32_t *) value)[1] = color[1];
((uint32_t *) value)[2] = color[2];
((uint32_t *) value)[3] = color[3];
break;
- case XGL_CH_FMT_R16G8:
+ case XGL_FMT_D16_UNORM_S8_UINT:
((uint16_t *) value)[0] = (uint16_t) color[0];
((char *) value)[2] = (uint8_t) color[1];
break;
- case XGL_CH_FMT_R32G8:
+ case XGL_FMT_D32_SFLOAT_S8_UINT:
((uint32_t *) value)[0] = (uint32_t) color[0];
((char *) value)[4] = (uint8_t) color[1];
break;
- case XGL_CH_FMT_R9G9B9E5:
+ case XGL_FMT_R9G9B9E5_UFLOAT:
((uint32_t *) value)[0] = (color[0] & 0x1ff) << 0 |
(color[1] & 0x1ff) << 9 |
(color[2] & 0x1ff) << 18 |
(color[3] & 0x1f) << 27;
break;
- case XGL_CH_FMT_BC1:
- case XGL_CH_FMT_BC4:
+ case XGL_FMT_BC1_UNORM:
+ case XGL_FMT_BC1_SRGB:
+ case XGL_FMT_BC4_UNORM:
+ case XGL_FMT_BC4_SNORM:
memcpy(value, color, 8);
break;
- case XGL_CH_FMT_BC2:
- case XGL_CH_FMT_BC3:
- case XGL_CH_FMT_BC5:
- case XGL_CH_FMT_BC6U:
- case XGL_CH_FMT_BC6S:
- case XGL_CH_FMT_BC7:
+ case XGL_FMT_BC2_UNORM:
+ case XGL_FMT_BC2_SRGB:
+ case XGL_FMT_BC3_UNORM:
+ case XGL_FMT_BC3_SRGB:
+ case XGL_FMT_BC5_UNORM:
+ case XGL_FMT_BC5_SNORM:
+ case XGL_FMT_BC6H_UFLOAT:
+ case XGL_FMT_BC6H_SFLOAT:
+ case XGL_FMT_BC7_UNORM:
+ case XGL_FMT_BC7_SRGB:
memcpy(value, color, 16);
break;
- case XGL_CH_FMT_R8G8B8:
+ case XGL_FMT_R8G8B8_UNORM:
+ case XGL_FMT_R8G8B8_SNORM:
+ case XGL_FMT_R8G8B8_USCALED:
+ case XGL_FMT_R8G8B8_SSCALED:
+ case XGL_FMT_R8G8B8_UINT:
+ case XGL_FMT_R8G8B8_SINT:
+ case XGL_FMT_R8G8B8_SRGB:
((uint8_t *) value)[0] = (uint8_t) color[0];
((uint8_t *) value)[1] = (uint8_t) color[1];
((uint8_t *) value)[2] = (uint8_t) color[2];
break;
- case XGL_CH_FMT_R16G16B16:
+ case XGL_FMT_R16G16B16_UNORM:
+ case XGL_FMT_R16G16B16_SNORM:
+ case XGL_FMT_R16G16B16_USCALED:
+ case XGL_FMT_R16G16B16_SSCALED:
+ case XGL_FMT_R16G16B16_UINT:
+ case XGL_FMT_R16G16B16_SINT:
+ case XGL_FMT_R16G16B16_SFLOAT:
((uint16_t *) value)[0] = (uint16_t) color[0];
((uint16_t *) value)[1] = (uint16_t) color[1];
((uint16_t *) value)[2] = (uint16_t) color[2];
break;
- case XGL_CH_FMT_B10G10R10A2:
+ case XGL_FMT_B10G10R10A2_UNORM:
+ case XGL_FMT_B10G10R10A2_SNORM:
+ case XGL_FMT_B10G10R10A2_USCALED:
+ case XGL_FMT_B10G10R10A2_SSCALED:
+ case XGL_FMT_B10G10R10A2_UINT:
+ case XGL_FMT_B10G10R10A2_SINT:
((uint32_t *) value)[0] = (color[2] & 0x3ff) << 0 |
(color[1] & 0x3ff) << 10 |
(color[0] & 0x3ff) << 20 |
(color[3] & 0x3) << 30;
break;
- case XGL_CH_FMT_R64:
+ case XGL_FMT_R64_SFLOAT:
/* higher 32 bits always 0 */
((uint64_t *) value)[0] = color[0];
break;
- case XGL_CH_FMT_R64G64:
+ case XGL_FMT_R64G64_SFLOAT:
((uint64_t *) value)[0] = color[0];
((uint64_t *) value)[1] = color[1];
break;
- case XGL_CH_FMT_R64G64B64:
+ case XGL_FMT_R64G64B64_SFLOAT:
((uint64_t *) value)[0] = color[0];
((uint64_t *) value)[1] = color[1];
((uint64_t *) value)[2] = color[2];
break;
- case XGL_CH_FMT_R64G64B64A64:
+ case XGL_FMT_R64G64B64A64_SFLOAT:
((uint64_t *) value)[0] = color[0];
((uint64_t *) value)[1] = color[1];
((uint64_t *) value)[2] = color[2];
#include "xglPlatform.h"
// XGL API version supported by this file
-#define XGL_API_VERSION XGL_MAKE_VERSION(0, 30, 7)
+#define XGL_API_VERSION XGL_MAKE_VERSION(0, 30, 8)
#ifdef __cplusplus
extern "C"
// ------------------------------------------------------------------------------------------------
// XGL format definitions
-typedef enum _XGL_CHANNEL_FORMAT
-{
- XGL_CH_FMT_UNDEFINED = 0,
- XGL_CH_FMT_R4G4 = 1,
- XGL_CH_FMT_R4G4B4A4 = 2,
- XGL_CH_FMT_R5G6B5 = 3,
- XGL_CH_FMT_B5G6R5 = 4,
- XGL_CH_FMT_R5G5B5A1 = 5,
- XGL_CH_FMT_R8 = 6,
- XGL_CH_FMT_R8G8 = 7,
- XGL_CH_FMT_R8G8B8A8 = 8,
- XGL_CH_FMT_B8G8R8A8 = 9,
- XGL_CH_FMT_R10G11B11 = 10,
- XGL_CH_FMT_R11G11B10 = 11,
- XGL_CH_FMT_R10G10B10A2 = 12,
- XGL_CH_FMT_R16 = 13,
- XGL_CH_FMT_R16G16 = 14,
- XGL_CH_FMT_R16G16B16A16 = 15,
- XGL_CH_FMT_R32 = 16,
- XGL_CH_FMT_R32G32 = 17,
- XGL_CH_FMT_R32G32B32 = 18,
- XGL_CH_FMT_R32G32B32A32 = 19,
- XGL_CH_FMT_R16G8 = 20,
- XGL_CH_FMT_R32G8 = 21,
- XGL_CH_FMT_R9G9B9E5 = 22,
- XGL_CH_FMT_BC1 = 23,
- XGL_CH_FMT_BC2 = 24,
- XGL_CH_FMT_BC3 = 25,
- XGL_CH_FMT_BC4 = 26,
- XGL_CH_FMT_BC5 = 27,
- XGL_CH_FMT_BC6U = 28,
- XGL_CH_FMT_BC6S = 29,
- XGL_CH_FMT_BC7 = 30,
- XGL_CH_FMT_R8G8B8 = 31,
- XGL_CH_FMT_R16G16B16 = 32,
- XGL_CH_FMT_B10G10R10A2 = 33,
- XGL_CH_FMT_R64 = 34, // Optional
- XGL_CH_FMT_R64G64 = 35, // Optional
- XGL_CH_FMT_R64G64B64 = 36, // Optional
- XGL_CH_FMT_R64G64B64A64 = 37, // Optional
- XGL_MAX_CH_FMT = XGL_CH_FMT_R64G64B64A64,
- XGL_MAX_ENUM(_XGL_CHANNEL_FORMAT)
-} XGL_CHANNEL_FORMAT;
-
-typedef enum _XGL_NUM_FORMAT
-{
- XGL_NUM_FMT_UNDEFINED = 0,
- XGL_NUM_FMT_UNORM = 1,
- XGL_NUM_FMT_SNORM = 2,
- XGL_NUM_FMT_UINT = 3,
- XGL_NUM_FMT_SINT = 4,
- XGL_NUM_FMT_FLOAT = 5,
- XGL_NUM_FMT_SRGB = 6,
- XGL_NUM_FMT_DS = 7,
- XGL_NUM_FMT_USCALED = 8,
- XGL_NUM_FMT_SSCALED = 9,
- XGL_MAX_NUM_FMT = XGL_NUM_FMT_SSCALED,
- XGL_MAX_ENUM(_XGL_NUM_FORMAT)
-} XGL_NUM_FORMAT;
typedef enum _XGL_VERTEX_INPUT_STEP_RATE
{
XGL_MAX_ENUM(_XGL_VERTEX_INPUT_STEP_RATE)
} XGL_VERTEX_INPUT_STEP_RATE;
-typedef struct _XGL_FORMAT
-{
- XGL_CHANNEL_FORMAT channelFormat;
- XGL_NUM_FORMAT numericFormat;
-
-// XGL_FMT_BEGIN_RANGE = XGL_FMT_UNDEFINED, ////LUGMAL
-// XGL_FMT_END_RANGE = XGL_FMT_ASTC_12x12_SRGB,
-// XGL_NUM_FMT = (XGL_FMT_END_RANGE - XGL_FMT_BEGIN_RANGE + 1),
+typedef enum _XGL_FORMAT
+{
+ XGL_FMT_UNDEFINED = 0x00000000,
+ XGL_FMT_R4G4_UNORM = 0x00000001,
+ XGL_FMT_R4G4_USCALED = 0x00000002,
+ XGL_FMT_R4G4B4A4_UNORM = 0x00000003,
+ XGL_FMT_R4G4B4A4_USCALED = 0x00000004,
+ XGL_FMT_R5G6B5_UNORM = 0x00000005,
+ XGL_FMT_R5G6B5_USCALED = 0x00000006,
+ XGL_FMT_R5G5B5A1_UNORM = 0x00000007,
+ XGL_FMT_R5G5B5A1_USCALED = 0x00000008,
+ XGL_FMT_R8_UNORM = 0x00000009,
+ XGL_FMT_R8_SNORM = 0x0000000A,
+ XGL_FMT_R8_USCALED = 0x0000000B,
+ XGL_FMT_R8_SSCALED = 0x0000000C,
+ XGL_FMT_R8_UINT = 0x0000000D,
+ XGL_FMT_R8_SINT = 0x0000000E,
+ XGL_FMT_R8_SRGB = 0x0000000F,
+ XGL_FMT_R8G8_UNORM = 0x00000010,
+ XGL_FMT_R8G8_SNORM = 0x00000011,
+ XGL_FMT_R8G8_USCALED = 0x00000012,
+ XGL_FMT_R8G8_SSCALED = 0x00000013,
+ XGL_FMT_R8G8_UINT = 0x00000014,
+ XGL_FMT_R8G8_SINT = 0x00000015,
+ XGL_FMT_R8G8_SRGB = 0x00000016,
+ XGL_FMT_R8G8B8_UNORM = 0x00000017,
+ XGL_FMT_R8G8B8_SNORM = 0x00000018,
+ XGL_FMT_R8G8B8_USCALED = 0x00000019,
+ XGL_FMT_R8G8B8_SSCALED = 0x0000001A,
+ XGL_FMT_R8G8B8_UINT = 0x0000001B,
+ XGL_FMT_R8G8B8_SINT = 0x0000001C,
+ XGL_FMT_R8G8B8_SRGB = 0x0000001D,
+ XGL_FMT_R8G8B8A8_UNORM = 0x0000001E,
+ XGL_FMT_R8G8B8A8_SNORM = 0x0000001F,
+ XGL_FMT_R8G8B8A8_USCALED = 0x00000020,
+ XGL_FMT_R8G8B8A8_SSCALED = 0x00000021,
+ XGL_FMT_R8G8B8A8_UINT = 0x00000022,
+ XGL_FMT_R8G8B8A8_SINT = 0x00000023,
+ XGL_FMT_R8G8B8A8_SRGB = 0x00000024,
+ XGL_FMT_R10G10B10A2_UNORM = 0x00000025,
+ XGL_FMT_R10G10B10A2_SNORM = 0x00000026,
+ XGL_FMT_R10G10B10A2_USCALED = 0x00000027,
+ XGL_FMT_R10G10B10A2_SSCALED = 0x00000028,
+ XGL_FMT_R10G10B10A2_UINT = 0x00000029,
+ XGL_FMT_R10G10B10A2_SINT = 0x0000002A,
+ XGL_FMT_R16_UNORM = 0x0000002B,
+ XGL_FMT_R16_SNORM = 0x0000002C,
+ XGL_FMT_R16_USCALED = 0x0000002D,
+ XGL_FMT_R16_SSCALED = 0x0000002E,
+ XGL_FMT_R16_UINT = 0x0000002F,
+ XGL_FMT_R16_SINT = 0x00000030,
+ XGL_FMT_R16_SFLOAT = 0x00000031,
+ XGL_FMT_R16G16_UNORM = 0x00000032,
+ XGL_FMT_R16G16_SNORM = 0x00000033,
+ XGL_FMT_R16G16_USCALED = 0x00000034,
+ XGL_FMT_R16G16_SSCALED = 0x00000035,
+ XGL_FMT_R16G16_UINT = 0x00000036,
+ XGL_FMT_R16G16_SINT = 0x00000037,
+ XGL_FMT_R16G16_SFLOAT = 0x00000038,
+ XGL_FMT_R16G16B16_UNORM = 0x00000039,
+ XGL_FMT_R16G16B16_SNORM = 0x0000003A,
+ XGL_FMT_R16G16B16_USCALED = 0x0000003B,
+ XGL_FMT_R16G16B16_SSCALED = 0x0000003C,
+ XGL_FMT_R16G16B16_UINT = 0x0000003D,
+ XGL_FMT_R16G16B16_SINT = 0x0000003E,
+ XGL_FMT_R16G16B16_SFLOAT = 0x0000003F,
+ XGL_FMT_R16G16B16A16_UNORM = 0x00000040,
+ XGL_FMT_R16G16B16A16_SNORM = 0x00000041,
+ XGL_FMT_R16G16B16A16_USCALED = 0x00000042,
+ XGL_FMT_R16G16B16A16_SSCALED = 0x00000043,
+ XGL_FMT_R16G16B16A16_UINT = 0x00000044,
+ XGL_FMT_R16G16B16A16_SINT = 0x00000045,
+ XGL_FMT_R16G16B16A16_SFLOAT = 0x00000046,
+ XGL_FMT_R32_UINT = 0x00000047,
+ XGL_FMT_R32_SINT = 0x00000048,
+ XGL_FMT_R32_SFLOAT = 0x00000049,
+ XGL_FMT_R32G32_UINT = 0x0000004A,
+ XGL_FMT_R32G32_SINT = 0x0000004B,
+ XGL_FMT_R32G32_SFLOAT = 0x0000004C,
+ XGL_FMT_R32G32B32_UINT = 0x0000004D,
+ XGL_FMT_R32G32B32_SINT = 0x0000004E,
+ XGL_FMT_R32G32B32_SFLOAT = 0x0000004F,
+ XGL_FMT_R32G32B32A32_UINT = 0x00000050,
+ XGL_FMT_R32G32B32A32_SINT = 0x00000051,
+ XGL_FMT_R32G32B32A32_SFLOAT = 0x00000052,
+ XGL_FMT_R64_SFLOAT = 0x00000053,
+ XGL_FMT_R64G64_SFLOAT = 0x00000054,
+ XGL_FMT_R64G64B64_SFLOAT = 0x00000055,
+ XGL_FMT_R64G64B64A64_SFLOAT = 0x00000056,
+ XGL_FMT_R11G11B10_UFLOAT = 0x00000057,
+ XGL_FMT_R9G9B9E5_UFLOAT = 0x00000058,
+ XGL_FMT_D16_UNORM = 0x00000059,
+ XGL_FMT_D24_UNORM = 0x0000005A,
+ XGL_FMT_D32_SFLOAT = 0x0000005B,
+ XGL_FMT_S8_UINT = 0x0000005C,
+ XGL_FMT_D16_UNORM_S8_UINT = 0x0000005D,
+ XGL_FMT_D24_UNORM_S8_UINT = 0x0000005E,
+ XGL_FMT_D32_SFLOAT_S8_UINT = 0x0000005F,
+ XGL_FMT_BC1_UNORM = 0x00000060,
+ XGL_FMT_BC1_SRGB = 0x00000061,
+ XGL_FMT_BC2_UNORM = 0x00000062,
+ XGL_FMT_BC2_SRGB = 0x00000063,
+ XGL_FMT_BC3_UNORM = 0x00000064,
+ XGL_FMT_BC3_SRGB = 0x00000065,
+ XGL_FMT_BC4_UNORM = 0x00000066,
+ XGL_FMT_BC4_SNORM = 0x00000067,
+ XGL_FMT_BC5_UNORM = 0x00000068,
+ XGL_FMT_BC5_SNORM = 0x00000069,
+ XGL_FMT_BC6H_UFLOAT = 0x0000006A,
+ XGL_FMT_BC6H_SFLOAT = 0x0000006B,
+ XGL_FMT_BC7_UNORM = 0x0000006C,
+ XGL_FMT_BC7_SRGB = 0x0000006D,
+ XGL_FMT_ETC2_R8G8B8_UNORM = 0x0000006E,
+ XGL_FMT_ETC2_R8G8B8A1_UNORM = 0x0000006F,
+ XGL_FMT_ETC2_R8G8B8A8_UNORM = 0x00000070,
+ XGL_FMT_EAC_R11_UNORM = 0x00000071,
+ XGL_FMT_EAC_R11_SNORM = 0x00000072,
+ XGL_FMT_EAC_R11G11_UNORM = 0x00000073,
+ XGL_FMT_EAC_R11G11_SNORM = 0x00000074,
+ XGL_FMT_ASTC_4x4_UNORM = 0x00000075,
+ XGL_FMT_ASTC_4x4_SRGB = 0x00000076,
+ XGL_FMT_ASTC_4x5_UNORM = 0x00000077,
+ XGL_FMT_ASTC_4x5_SRGB = 0x00000078,
+ XGL_FMT_ASTC_5x5_UNORM = 0x00000079,
+ XGL_FMT_ASTC_5x5_SRGB = 0x0000007A,
+ XGL_FMT_ASTC_6x5_UNORM = 0x0000007B,
+ XGL_FMT_ASTC_6x5_SRGB = 0x0000007C,
+ XGL_FMT_ASTC_6x6_UNORM = 0x0000007D,
+ XGL_FMT_ASTC_6x6_SRGB = 0x0000007E,
+ XGL_FMT_ASTC_8x5_UNORM = 0x0000007F,
+ XGL_FMT_ASTC_8x5_SRGB = 0x00000080,
+ XGL_FMT_ASTC_8x6_UNORM = 0x00000081,
+ XGL_FMT_ASTC_8x6_SRGB = 0x00000082,
+ XGL_FMT_ASTC_8x8_UNORM = 0x00000083,
+ XGL_FMT_ASTC_8x8_SRGB = 0x00000084,
+ XGL_FMT_ASTC_10x5_UNORM = 0x00000085,
+ XGL_FMT_ASTC_10x5_SRGB = 0x00000086,
+ XGL_FMT_ASTC_10x6_UNORM = 0x00000087,
+ XGL_FMT_ASTC_10x6_SRGB = 0x00000088,
+ XGL_FMT_ASTC_10x8_UNORM = 0x00000089,
+ XGL_FMT_ASTC_10x8_SRGB = 0x0000008A,
+ XGL_FMT_ASTC_10x10_UNORM = 0x0000008B,
+ XGL_FMT_ASTC_10x10_SRGB = 0x0000008C,
+ XGL_FMT_ASTC_12x10_UNORM = 0x0000008D,
+ XGL_FMT_ASTC_12x10_SRGB = 0x0000008E,
+ XGL_FMT_ASTC_12x12_UNORM = 0x0000008F,
+ XGL_FMT_ASTC_12x12_SRGB = 0x00000090,
+ XGL_FMT_B5G6R5_UNORM = 0x00000091,
+ XGL_FMT_B5G6R5_USCALED = 0x00000092,
+ XGL_FMT_B8G8R8_UNORM = 0x00000093,
+ XGL_FMT_B8G8R8_SNORM = 0x00000094,
+ XGL_FMT_B8G8R8_USCALED = 0x00000095,
+ XGL_FMT_B8G8R8_SSCALED = 0x00000096,
+ XGL_FMT_B8G8R8_UINT = 0x00000097,
+ XGL_FMT_B8G8R8_SINT = 0x00000098,
+ XGL_FMT_B8G8R8_SRGB = 0x00000099,
+ XGL_FMT_B8G8R8A8_UNORM = 0x0000009A,
+ XGL_FMT_B8G8R8A8_SNORM = 0x0000009B,
+ XGL_FMT_B8G8R8A8_USCALED = 0x0000009C,
+ XGL_FMT_B8G8R8A8_SSCALED = 0x0000009D,
+ XGL_FMT_B8G8R8A8_UINT = 0x0000009E,
+ XGL_FMT_B8G8R8A8_SINT = 0x0000009F,
+ XGL_FMT_B8G8R8A8_SRGB = 0x000000A0,
+ XGL_FMT_B10G10R10A2_UNORM = 0x000000A1,
+ XGL_FMT_B10G10R10A2_SNORM = 0x000000A2,
+ XGL_FMT_B10G10R10A2_USCALED = 0x000000A3,
+ XGL_FMT_B10G10R10A2_SSCALED = 0x000000A4,
+ XGL_FMT_B10G10R10A2_UINT = 0x000000A5,
+ XGL_FMT_B10G10R10A2_SINT = 0x000000A6,
+
+ XGL_FMT_BEGIN_RANGE = XGL_FMT_UNDEFINED,
+ XGL_FMT_END_RANGE = XGL_FMT_B10G10R10A2_SINT,
+ XGL_NUM_FMT = (XGL_FMT_END_RANGE - XGL_FMT_BEGIN_RANGE + 1),
+ XGL_MAX_ENUM(_XGL_FORMAT)
} XGL_FORMAT;
// Shader stage enumerant