diff options
Diffstat (limited to 'src/mesa/main/format_pack.c')
-rw-r--r-- | src/mesa/main/format_pack.c | 267 |
1 files changed, 133 insertions, 134 deletions
diff --git a/src/mesa/main/format_pack.c b/src/mesa/main/format_pack.c index 0da0f854d61..281efc089b4 100644 --- a/src/mesa/main/format_pack.c +++ b/src/mesa/main/format_pack.c @@ -43,7 +43,7 @@ #include "../../gallium/auxiliary/util/u_format_r11g11b10f.h" -/** Helper struct for MESA_FORMAT_Z32_FLOAT_X24S8 */ +/** Helper struct for MESA_FORMAT_Z32_FLOAT_S8X24_UINT */ struct z32f_x24s8 { float z; @@ -447,7 +447,7 @@ pack_row_float_BGR888(GLuint n, const GLfloat src[][4], void *dst) /* - * MESA_FORMAT_RGB565 + * MESA_FORMAT_B5G6R5_UNORM */ static void @@ -491,7 +491,7 @@ pack_row_float_RGB565(GLuint n, const GLfloat src[][4], void *dst) /* - * MESA_FORMAT_RGB565_REV + * MESA_FORMAT_R5G6B5_UNORM */ static void @@ -536,7 +536,7 @@ pack_row_float_RGB565_REV(GLuint n, const GLfloat src[][4], void *dst) /* - * MESA_FORMAT_ARGB4444 + * MESA_FORMAT_B4G4R4A4_UNORM */ static void @@ -558,7 +558,7 @@ pack_float_ARGB4444(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_ARGB4444_REV + * MESA_FORMAT_A4R4G4B4_UNORM */ static void @@ -580,7 +580,7 @@ pack_float_ARGB4444_REV(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_RGBA5551 + * MESA_FORMAT_A1B5G5R5_UNORM */ static void @@ -602,7 +602,7 @@ pack_float_RGBA5551(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_ARGB1555 + * MESA_FORMAT_B5G5R5A1_UNORM */ static void @@ -621,7 +621,7 @@ pack_float_ARGB1555(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_ARGB1555_REV */ +/* MESA_FORMAT_A1R5G5B5_UNORM */ static void pack_ubyte_ARGB1555_REV(const GLubyte src[4], void *dst) @@ -640,7 +640,7 @@ pack_float_ARGB1555_REV(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_AL44 */ +/* MESA_FORMAT_L4A4_UNORM */ static void pack_ubyte_AL44(const GLubyte src[4], void *dst) @@ -659,7 +659,7 @@ pack_float_AL44(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_AL88 */ +/* MESA_FORMAT_L8A8_UNORM */ static void pack_ubyte_AL88(const GLubyte src[4], void *dst) @@ -678,7 +678,7 @@ pack_float_AL88(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_AL88_REV */ +/* MESA_FORMAT_A8L8_UNORM */ static void pack_ubyte_AL88_REV(const GLubyte src[4], void *dst) @@ -697,7 +697,7 @@ pack_float_AL88_REV(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_AL1616 */ +/* MESA_FORMAT_L16A16_UNORM */ static void pack_ubyte_AL1616(const GLubyte src[4], void *dst) @@ -719,7 +719,7 @@ pack_float_AL1616(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_AL1616_REV */ +/* MESA_FORMAT_A16L16_UNORM */ static void pack_ubyte_AL1616_REV(const GLubyte src[4], void *dst) @@ -741,7 +741,7 @@ pack_float_AL1616_REV(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_RGB332 */ +/* MESA_FORMAT_B2G3R3_UNORM */ static void pack_ubyte_RGB332(const GLubyte src[4], void *dst) @@ -878,7 +878,7 @@ pack_float_R8(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_GR88 */ +/* MESA_FORMAT_R8G8_UNORM */ static void pack_ubyte_GR88(const GLubyte src[4], void *dst) @@ -898,7 +898,7 @@ pack_float_GR88(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_RG88 */ +/* MESA_FORMAT_G8R8_UNORM */ static void pack_ubyte_RG88(const GLubyte src[4], void *dst) @@ -935,7 +935,7 @@ pack_float_R16(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_GR1616 */ +/* MESA_FORMAT_R16G16_UNORM */ static void pack_ubyte_GR1616(const GLubyte src[4], void *dst) @@ -957,7 +957,7 @@ pack_float_GR1616(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_RG1616 */ +/* MESA_FORMAT_G16R16_UNORM */ static void pack_ubyte_RG1616(const GLubyte src[4], void *dst) @@ -980,7 +980,7 @@ pack_float_RG1616(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_ARGB2101010 */ +/* MESA_FORMAT_B10G10R10A2_UNORM */ static void pack_ubyte_ARGB2101010(const GLubyte src[4], void *dst) @@ -1006,7 +1006,7 @@ pack_float_ARGB2101010(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_ABGR2101010_UINT */ +/* MESA_FORMAT_R10G10B10A2_UINT */ static void pack_ubyte_ABGR2101010_UINT(const GLubyte src[4], void *dst) @@ -1053,7 +1053,7 @@ pack_float_SRGB8(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_SRGBA8 */ +/* MESA_FORMAT_A8B8G8R8_SRGB */ static void pack_ubyte_SRGBA8(const GLubyte src[4], void *dst) @@ -1078,7 +1078,7 @@ pack_float_SRGBA8(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_SARGB8 */ +/* MESA_FORMAT_B8G8R8A8_SRGB */ static void pack_ubyte_SARGB8(const GLubyte src[4], void *dst) @@ -1121,7 +1121,7 @@ pack_float_SL8(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_SLA8 */ +/* MESA_FORMAT_L8A8_SRGB */ static void pack_ubyte_SLA8(const GLubyte src[4], void *dst) @@ -1624,7 +1624,7 @@ pack_float_SIGNED_AL1616(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_RGB9_E5_FLOAT; + * MESA_FORMAT_R9G9B9E5_FLOAT; */ static void @@ -1648,7 +1648,7 @@ pack_ubyte_RGB9_E5_FLOAT(const GLubyte src[4], void *dst) /* - * MESA_FORMAT_R11_G11_B10_FLOAT; + * MESA_FORMAT_R11G11B10_FLOAT; */ static void @@ -1671,7 +1671,7 @@ pack_float_R11_G11_B10_FLOAT(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_XRGB4444_UNORM + * MESA_FORMAT_B4G4R4X4_UNORM */ static void @@ -1691,7 +1691,7 @@ pack_float_XRGB4444_UNORM(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_XRGB1555_UNORM + * MESA_FORMAT_B5G5R5X1_UNORM */ static void @@ -1711,7 +1711,7 @@ pack_float_XRGB1555_UNORM(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_XBGR8888_SNORM + * MESA_FORMAT_R8G8B8X8_SNORM */ static void @@ -1726,7 +1726,7 @@ pack_float_XBGR8888_SNORM(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_XBGR8888_SRGB + * MESA_FORMAT_R8G8B8X8_SRGB */ static void @@ -1740,7 +1740,7 @@ pack_float_XBGR8888_SRGB(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_XRGB2101010_UNORM */ +/* MESA_FORMAT_B10G10R10X2_UNORM */ static void pack_ubyte_XRGB2101010_UNORM(const GLubyte src[4], void *dst) @@ -1824,7 +1824,7 @@ pack_float_XBGR32323232_FLOAT(const GLfloat src[4], void *dst) d[3] = 1.0; } -/* MESA_FORMAT_ABGR2101010 */ +/* MESA_FORMAT_R10G10B10A2_UNORM */ static void pack_ubyte_ABGR2101010(const GLubyte src[4], void *dst) @@ -1899,19 +1899,19 @@ _mesa_get_pack_ubyte_rgba_function(mesa_format format) table[MESA_FORMAT_X8R8G8B8_UNORM] = pack_ubyte_XRGB8888_REV; table[MESA_FORMAT_BGR_UNORM8] = pack_ubyte_RGB888; table[MESA_FORMAT_RGB_UNORM8] = pack_ubyte_BGR888; - table[MESA_FORMAT_RGB565] = pack_ubyte_RGB565; - table[MESA_FORMAT_RGB565_REV] = pack_ubyte_RGB565_REV; - table[MESA_FORMAT_ARGB4444] = pack_ubyte_ARGB4444; - table[MESA_FORMAT_ARGB4444_REV] = pack_ubyte_ARGB4444_REV; - table[MESA_FORMAT_RGBA5551] = pack_ubyte_RGBA5551; - table[MESA_FORMAT_ARGB1555] = pack_ubyte_ARGB1555; - table[MESA_FORMAT_ARGB1555_REV] = pack_ubyte_ARGB1555_REV; - table[MESA_FORMAT_AL44] = pack_ubyte_AL44; - table[MESA_FORMAT_AL88] = pack_ubyte_AL88; - table[MESA_FORMAT_AL88_REV] = pack_ubyte_AL88_REV; - table[MESA_FORMAT_AL1616] = pack_ubyte_AL1616; - table[MESA_FORMAT_AL1616_REV] = pack_ubyte_AL1616_REV; - table[MESA_FORMAT_RGB332] = pack_ubyte_RGB332; + table[MESA_FORMAT_B5G6R5_UNORM] = pack_ubyte_RGB565; + table[MESA_FORMAT_R5G6B5_UNORM] = pack_ubyte_RGB565_REV; + table[MESA_FORMAT_B4G4R4A4_UNORM] = pack_ubyte_ARGB4444; + table[MESA_FORMAT_A4R4G4B4_UNORM] = pack_ubyte_ARGB4444_REV; + table[MESA_FORMAT_A1B5G5R5_UNORM] = pack_ubyte_RGBA5551; + table[MESA_FORMAT_B5G5R5A1_UNORM] = pack_ubyte_ARGB1555; + table[MESA_FORMAT_A1R5G5B5_UNORM] = pack_ubyte_ARGB1555_REV; + table[MESA_FORMAT_L4A4_UNORM] = pack_ubyte_AL44; + table[MESA_FORMAT_L8A8_UNORM] = pack_ubyte_AL88; + table[MESA_FORMAT_A8L8_UNORM] = pack_ubyte_AL88_REV; + table[MESA_FORMAT_L16A16_UNORM] = pack_ubyte_AL1616; + table[MESA_FORMAT_A16L16_UNORM] = pack_ubyte_AL1616_REV; + table[MESA_FORMAT_B2G3R3_UNORM] = pack_ubyte_RGB332; table[MESA_FORMAT_A_UNORM8] = pack_ubyte_A8; table[MESA_FORMAT_A_UNORM16] = pack_ubyte_A16; table[MESA_FORMAT_L_UNORM8] = pack_ubyte_L8; @@ -1921,30 +1921,29 @@ _mesa_get_pack_ubyte_rgba_function(mesa_format format) table[MESA_FORMAT_YCBCR] = pack_ubyte_YCBCR; table[MESA_FORMAT_YCBCR_REV] = pack_ubyte_YCBCR_REV; table[MESA_FORMAT_R_UNORM8] = pack_ubyte_R8; - table[MESA_FORMAT_GR88] = pack_ubyte_GR88; - table[MESA_FORMAT_RG88] = pack_ubyte_RG88; + table[MESA_FORMAT_R8G8_UNORM] = pack_ubyte_GR88; + table[MESA_FORMAT_G8R8_UNORM] = pack_ubyte_RG88; table[MESA_FORMAT_R_UNORM16] = pack_ubyte_R16; - table[MESA_FORMAT_GR1616] = pack_ubyte_GR1616; - table[MESA_FORMAT_RG1616] = pack_ubyte_RG1616; - table[MESA_FORMAT_ARGB2101010] = pack_ubyte_ARGB2101010; - table[MESA_FORMAT_ABGR2101010_UINT] = pack_ubyte_ABGR2101010_UINT; + table[MESA_FORMAT_R16G16_UNORM] = pack_ubyte_GR1616; + table[MESA_FORMAT_G16R16_UNORM] = pack_ubyte_RG1616; + table[MESA_FORMAT_B10G10R10A2_UNORM] = pack_ubyte_ARGB2101010; + table[MESA_FORMAT_R10G10B10A2_UINT] = pack_ubyte_ABGR2101010_UINT; /* should never convert RGBA to these formats */ - table[MESA_FORMAT_Z24_S8] = NULL; - table[MESA_FORMAT_S8_Z24] = NULL; + table[MESA_FORMAT_S8_UINT_Z24_UNORM] = NULL; + table[MESA_FORMAT_Z24_UNORM_X8_UINT] = NULL; table[MESA_FORMAT_Z_UNORM16] = NULL; - table[MESA_FORMAT_X8_Z24] = NULL; - table[MESA_FORMAT_Z24_X8] = NULL; + table[MESA_FORMAT_Z24_UNORM_S8_UINT] = NULL; + table[MESA_FORMAT_X8Z24_UNORM] = NULL; table[MESA_FORMAT_Z_UNORM32] = NULL; table[MESA_FORMAT_S_UINT8] = NULL; /* sRGB */ table[MESA_FORMAT_BGR_SRGB8] = pack_ubyte_SRGB8; - table[MESA_FORMAT_SRGBA8] = pack_ubyte_SRGBA8; - table[MESA_FORMAT_SARGB8] = pack_ubyte_SARGB8; + table[MESA_FORMAT_A8B8G8R8_SRGB] = pack_ubyte_SRGBA8; + table[MESA_FORMAT_B8G8R8A8_SRGB] = pack_ubyte_SARGB8; table[MESA_FORMAT_L_SRGB8] = pack_ubyte_SL8; - table[MESA_FORMAT_SLA8] = pack_ubyte_SLA8; - + table[MESA_FORMAT_L8A8_SRGB] = pack_ubyte_SLA8; /* n/a */ table[MESA_FORMAT_SRGB_DXT1] = NULL; /* pack_ubyte_SRGB_DXT1; */ table[MESA_FORMAT_SRGBA_DXT1] = NULL; /* pack_ubyte_SRGBA_DXT1; */ @@ -2009,16 +2008,16 @@ _mesa_get_pack_ubyte_rgba_function(mesa_format format) table[MESA_FORMAT_RGBA_UNORM16] = pack_ubyte_RGBA_16; - table[MESA_FORMAT_RGB9_E5_FLOAT] = pack_ubyte_RGB9_E5_FLOAT; - table[MESA_FORMAT_R11_G11_B10_FLOAT] = pack_ubyte_R11_G11_B10_FLOAT; + table[MESA_FORMAT_R9G9B9E5_FLOAT] = pack_ubyte_RGB9_E5_FLOAT; + table[MESA_FORMAT_R11G11B10_FLOAT] = pack_ubyte_R11_G11_B10_FLOAT; - table[MESA_FORMAT_XRGB4444_UNORM] = pack_ubyte_XRGB4444_UNORM; - table[MESA_FORMAT_XRGB1555_UNORM] = pack_ubyte_XRGB1555_UNORM; - table[MESA_FORMAT_XBGR8888_SNORM] = NULL; - table[MESA_FORMAT_XBGR8888_SRGB] = NULL; + table[MESA_FORMAT_B4G4R4X4_UNORM] = pack_ubyte_XRGB4444_UNORM; + table[MESA_FORMAT_B5G5R5X1_UNORM] = pack_ubyte_XRGB1555_UNORM; + table[MESA_FORMAT_R8G8B8X8_SNORM] = NULL; + table[MESA_FORMAT_R8G8B8X8_SRGB] = NULL; table[MESA_FORMAT_RGBX_UINT8] = NULL; table[MESA_FORMAT_RGBX_SINT8] = NULL; - table[MESA_FORMAT_XRGB2101010_UNORM] = pack_ubyte_XRGB2101010_UNORM; + table[MESA_FORMAT_B10G10R10X2_UNORM] = pack_ubyte_XRGB2101010_UNORM; table[MESA_FORMAT_RGBX_UNORM16] = pack_ubyte_XBGR16161616_UNORM; table[MESA_FORMAT_RGBX_SNORM16] = NULL; table[MESA_FORMAT_RGBX_FLOAT16] = NULL; @@ -2028,7 +2027,7 @@ _mesa_get_pack_ubyte_rgba_function(mesa_format format) table[MESA_FORMAT_RGBX_UINT32] = NULL; table[MESA_FORMAT_RGBX_SINT32] = NULL; - table[MESA_FORMAT_ABGR2101010] = pack_ubyte_ABGR2101010; + table[MESA_FORMAT_R10G10B10A2_UNORM] = pack_ubyte_ABGR2101010; initialized = GL_TRUE; } @@ -2062,20 +2061,20 @@ _mesa_get_pack_float_rgba_function(mesa_format format) table[MESA_FORMAT_X8R8G8B8_UNORM] = pack_float_XRGB8888_REV; table[MESA_FORMAT_BGR_UNORM8] = pack_float_RGB888; table[MESA_FORMAT_RGB_UNORM8] = pack_float_BGR888; - table[MESA_FORMAT_RGB565] = pack_float_RGB565; - table[MESA_FORMAT_RGB565_REV] = pack_float_RGB565_REV; - table[MESA_FORMAT_ARGB4444] = pack_float_ARGB4444; - table[MESA_FORMAT_ARGB4444_REV] = pack_float_ARGB4444_REV; - table[MESA_FORMAT_RGBA5551] = pack_float_RGBA5551; - table[MESA_FORMAT_ARGB1555] = pack_float_ARGB1555; - table[MESA_FORMAT_ARGB1555_REV] = pack_float_ARGB1555_REV; - - table[MESA_FORMAT_AL44] = pack_float_AL44; - table[MESA_FORMAT_AL88] = pack_float_AL88; - table[MESA_FORMAT_AL88_REV] = pack_float_AL88_REV; - table[MESA_FORMAT_AL1616] = pack_float_AL1616; - table[MESA_FORMAT_AL1616_REV] = pack_float_AL1616_REV; - table[MESA_FORMAT_RGB332] = pack_float_RGB332; + table[MESA_FORMAT_B5G6R5_UNORM] = pack_float_RGB565; + table[MESA_FORMAT_R5G6B5_UNORM] = pack_float_RGB565_REV; + table[MESA_FORMAT_B4G4R4A4_UNORM] = pack_float_ARGB4444; + table[MESA_FORMAT_A4R4G4B4_UNORM] = pack_float_ARGB4444_REV; + table[MESA_FORMAT_A1B5G5R5_UNORM] = pack_float_RGBA5551; + table[MESA_FORMAT_B5G5R5A1_UNORM] = pack_float_ARGB1555; + table[MESA_FORMAT_A1R5G5B5_UNORM] = pack_float_ARGB1555_REV; + + table[MESA_FORMAT_L4A4_UNORM] = pack_float_AL44; + table[MESA_FORMAT_L8A8_UNORM] = pack_float_AL88; + table[MESA_FORMAT_A8L8_UNORM] = pack_float_AL88_REV; + table[MESA_FORMAT_L16A16_UNORM] = pack_float_AL1616; + table[MESA_FORMAT_A16L16_UNORM] = pack_float_AL1616_REV; + table[MESA_FORMAT_B2G3R3_UNORM] = pack_float_RGB332; table[MESA_FORMAT_A_UNORM8] = pack_float_A8; table[MESA_FORMAT_A_UNORM16] = pack_float_A16; table[MESA_FORMAT_L_UNORM8] = pack_float_L8; @@ -2085,28 +2084,28 @@ _mesa_get_pack_float_rgba_function(mesa_format format) table[MESA_FORMAT_YCBCR] = pack_float_YCBCR; table[MESA_FORMAT_YCBCR_REV] = pack_float_YCBCR_REV; table[MESA_FORMAT_R_UNORM8] = pack_float_R8; - table[MESA_FORMAT_GR88] = pack_float_GR88; - table[MESA_FORMAT_RG88] = pack_float_RG88; + table[MESA_FORMAT_R8G8_UNORM] = pack_float_GR88; + table[MESA_FORMAT_G8R8_UNORM] = pack_float_RG88; table[MESA_FORMAT_R_UNORM16] = pack_float_R16; - table[MESA_FORMAT_GR1616] = pack_float_GR1616; - table[MESA_FORMAT_RG1616] = pack_float_RG1616; - table[MESA_FORMAT_ARGB2101010] = pack_float_ARGB2101010; - table[MESA_FORMAT_ABGR2101010_UINT] = pack_float_ABGR2101010_UINT; + table[MESA_FORMAT_R16G16_UNORM] = pack_float_GR1616; + table[MESA_FORMAT_G16R16_UNORM] = pack_float_RG1616; + table[MESA_FORMAT_B10G10R10A2_UNORM] = pack_float_ARGB2101010; + table[MESA_FORMAT_R10G10B10A2_UINT] = pack_float_ABGR2101010_UINT; /* should never convert RGBA to these formats */ - table[MESA_FORMAT_Z24_S8] = NULL; - table[MESA_FORMAT_S8_Z24] = NULL; + table[MESA_FORMAT_S8_UINT_Z24_UNORM] = NULL; + table[MESA_FORMAT_Z24_UNORM_X8_UINT] = NULL; table[MESA_FORMAT_Z_UNORM16] = NULL; - table[MESA_FORMAT_X8_Z24] = NULL; - table[MESA_FORMAT_Z24_X8] = NULL; + table[MESA_FORMAT_Z24_UNORM_S8_UINT] = NULL; + table[MESA_FORMAT_X8Z24_UNORM] = NULL; table[MESA_FORMAT_Z_UNORM32] = NULL; table[MESA_FORMAT_S_UINT8] = NULL; table[MESA_FORMAT_BGR_SRGB8] = pack_float_SRGB8; - table[MESA_FORMAT_SRGBA8] = pack_float_SRGBA8; - table[MESA_FORMAT_SARGB8] = pack_float_SARGB8; + table[MESA_FORMAT_A8B8G8R8_SRGB] = pack_float_SRGBA8; + table[MESA_FORMAT_B8G8R8A8_SRGB] = pack_float_SARGB8; table[MESA_FORMAT_L_SRGB8] = pack_float_SL8; - table[MESA_FORMAT_SLA8] = pack_float_SLA8; + table[MESA_FORMAT_L8A8_SRGB] = pack_float_SLA8; /* n/a */ table[MESA_FORMAT_SRGB_DXT1] = NULL; @@ -2169,16 +2168,16 @@ _mesa_get_pack_float_rgba_function(mesa_format format) table[MESA_FORMAT_SIGNED_AL1616] = pack_float_SIGNED_AL1616; table[MESA_FORMAT_SIGNED_I16] = pack_float_SIGNED_L16; /* reused */ - table[MESA_FORMAT_RGB9_E5_FLOAT] = pack_float_RGB9_E5_FLOAT; - table[MESA_FORMAT_R11_G11_B10_FLOAT] = pack_float_R11_G11_B10_FLOAT; + table[MESA_FORMAT_R9G9B9E5_FLOAT] = pack_float_RGB9_E5_FLOAT; + table[MESA_FORMAT_R11G11B10_FLOAT] = pack_float_R11_G11_B10_FLOAT; - table[MESA_FORMAT_XRGB4444_UNORM] = pack_float_XRGB4444_UNORM; - table[MESA_FORMAT_XRGB1555_UNORM] = pack_float_XRGB1555_UNORM; - table[MESA_FORMAT_XBGR8888_SNORM] = pack_float_XBGR8888_SNORM; - table[MESA_FORMAT_XBGR8888_SRGB] = pack_float_XBGR8888_SRGB; + table[MESA_FORMAT_B4G4R4X4_UNORM] = pack_float_XRGB4444_UNORM; + table[MESA_FORMAT_B5G5R5X1_UNORM] = pack_float_XRGB1555_UNORM; + table[MESA_FORMAT_R8G8B8X8_SNORM] = pack_float_XBGR8888_SNORM; + table[MESA_FORMAT_R8G8B8X8_SRGB] = pack_float_XBGR8888_SRGB; table[MESA_FORMAT_RGBX_UINT8] = NULL; table[MESA_FORMAT_RGBX_SINT8] = NULL; - table[MESA_FORMAT_XRGB2101010_UNORM] = pack_float_XRGB2101010_UNORM; + table[MESA_FORMAT_B10G10R10X2_UNORM] = pack_float_XRGB2101010_UNORM; table[MESA_FORMAT_RGBX_UNORM16] = pack_float_XBGR16161616_UNORM; table[MESA_FORMAT_RGBX_SNORM16] = pack_float_XBGR16161616_SNORM; table[MESA_FORMAT_RGBX_FLOAT16] = pack_float_XBGR16161616_FLOAT; @@ -2188,7 +2187,7 @@ _mesa_get_pack_float_rgba_function(mesa_format format) table[MESA_FORMAT_RGBX_UINT32] = NULL; table[MESA_FORMAT_RGBX_SINT32] = NULL; - table[MESA_FORMAT_ABGR2101010] = pack_float_ABGR2101010; + table[MESA_FORMAT_R10G10B10A2_UNORM] = pack_float_ABGR2101010; table[MESA_FORMAT_SIGNED_RG88] = pack_float_SIGNED_RG88; table[MESA_FORMAT_SIGNED_RG1616] = pack_float_SIGNED_RG1616; @@ -2223,8 +2222,8 @@ get_pack_float_rgba_row_function(mesa_format format) table[MESA_FORMAT_X8R8G8B8_UNORM] = pack_row_float_XRGB8888_REV; table[MESA_FORMAT_BGR_UNORM8] = pack_row_float_RGB888; table[MESA_FORMAT_RGB_UNORM8] = pack_row_float_BGR888; - table[MESA_FORMAT_RGB565] = pack_row_float_RGB565; - table[MESA_FORMAT_RGB565_REV] = pack_row_float_RGB565_REV; + table[MESA_FORMAT_B5G6R5_UNORM] = pack_row_float_RGB565; + table[MESA_FORMAT_R5G6B5_UNORM] = pack_row_float_RGB565_REV; initialized = GL_TRUE; } @@ -2256,8 +2255,8 @@ get_pack_ubyte_rgba_row_function(mesa_format format) table[MESA_FORMAT_X8R8G8B8_UNORM] = pack_row_ubyte_XRGB8888_REV; table[MESA_FORMAT_BGR_UNORM8] = pack_row_ubyte_RGB888; table[MESA_FORMAT_RGB_UNORM8] = pack_row_ubyte_BGR888; - table[MESA_FORMAT_RGB565] = pack_row_ubyte_RGB565; - table[MESA_FORMAT_RGB565_REV] = pack_row_ubyte_RGB565_REV; + table[MESA_FORMAT_B5G6R5_UNORM] = pack_row_ubyte_RGB565; + table[MESA_FORMAT_R5G6B5_UNORM] = pack_row_ubyte_RGB565_REV; initialized = GL_TRUE; } @@ -2426,18 +2425,18 @@ gl_pack_float_z_func _mesa_get_pack_float_z_func(mesa_format format) { switch (format) { - case MESA_FORMAT_Z24_S8: - case MESA_FORMAT_Z24_X8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: + case MESA_FORMAT_X8Z24_UNORM: return pack_float_z_Z24_S8; - case MESA_FORMAT_S8_Z24: - case MESA_FORMAT_X8_Z24: + case MESA_FORMAT_Z24_UNORM_X8_UINT: + case MESA_FORMAT_Z24_UNORM_S8_UINT: return pack_float_z_S8_Z24; case MESA_FORMAT_Z_UNORM16: return pack_float_z_Z16; case MESA_FORMAT_Z_UNORM32: return pack_float_z_Z32; case MESA_FORMAT_Z_FLOAT32: - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: return pack_float_z_Z32_FLOAT; default: _mesa_problem(NULL, @@ -2511,11 +2510,11 @@ gl_pack_uint_z_func _mesa_get_pack_uint_z_func(mesa_format format) { switch (format) { - case MESA_FORMAT_Z24_S8: - case MESA_FORMAT_Z24_X8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: + case MESA_FORMAT_X8Z24_UNORM: return pack_uint_z_Z24_S8; - case MESA_FORMAT_S8_Z24: - case MESA_FORMAT_X8_Z24: + case MESA_FORMAT_Z24_UNORM_X8_UINT: + case MESA_FORMAT_Z24_UNORM_S8_UINT: return pack_uint_z_S8_Z24; case MESA_FORMAT_Z_UNORM16: return pack_uint_z_Z16; @@ -2523,7 +2522,7 @@ _mesa_get_pack_uint_z_func(mesa_format format) return pack_uint_z_Z32; case MESA_FORMAT_Z_FLOAT32: return pack_uint_z_Z32_FLOAT; - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: return pack_uint_z_Z32_FLOAT_X24S8; default: _mesa_problem(NULL, "unexpected format in _mesa_get_pack_uint_z_func()"); @@ -2575,13 +2574,13 @@ gl_pack_ubyte_stencil_func _mesa_get_pack_ubyte_stencil_func(mesa_format format) { switch (format) { - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: return pack_ubyte_stencil_Z24_S8; - case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_Z24_UNORM_X8_UINT: return pack_ubyte_stencil_S8_Z24; case MESA_FORMAT_S_UINT8: return pack_ubyte_stencil_S8; - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: return pack_ubyte_stencil_Z32_FLOAT_X24S8; default: _mesa_problem(NULL, @@ -2597,8 +2596,8 @@ _mesa_pack_float_z_row(mesa_format format, GLuint n, const GLfloat *src, void *dst) { switch (format) { - case MESA_FORMAT_Z24_S8: - case MESA_FORMAT_Z24_X8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: + case MESA_FORMAT_X8Z24_UNORM: { /* don't disturb the stencil values */ GLuint *d = ((GLuint *) dst); @@ -2612,8 +2611,8 @@ _mesa_pack_float_z_row(mesa_format format, GLuint n, } } break; - case MESA_FORMAT_S8_Z24: - case MESA_FORMAT_X8_Z24: + case MESA_FORMAT_Z24_UNORM_X8_UINT: + case MESA_FORMAT_Z24_UNORM_S8_UINT: { /* don't disturb the stencil values */ GLuint *d = ((GLuint *) dst); @@ -2650,7 +2649,7 @@ _mesa_pack_float_z_row(mesa_format format, GLuint n, case MESA_FORMAT_Z_FLOAT32: memcpy(dst, src, n * sizeof(GLfloat)); break; - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: { struct z32f_x24s8 *d = (struct z32f_x24s8 *) dst; GLuint i; @@ -2673,8 +2672,8 @@ _mesa_pack_uint_z_row(mesa_format format, GLuint n, const GLuint *src, void *dst) { switch (format) { - case MESA_FORMAT_Z24_S8: - case MESA_FORMAT_Z24_X8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: + case MESA_FORMAT_X8Z24_UNORM: { /* don't disturb the stencil values */ GLuint *d = ((GLuint *) dst); @@ -2686,8 +2685,8 @@ _mesa_pack_uint_z_row(mesa_format format, GLuint n, } } break; - case MESA_FORMAT_S8_Z24: - case MESA_FORMAT_X8_Z24: + case MESA_FORMAT_Z24_UNORM_X8_UINT: + case MESA_FORMAT_Z24_UNORM_S8_UINT: { /* don't disturb the stencil values */ GLuint *d = ((GLuint *) dst); @@ -2723,7 +2722,7 @@ _mesa_pack_uint_z_row(mesa_format format, GLuint n, } } break; - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: { struct z32f_x24s8 *d = (struct z32f_x24s8 *) dst; const GLdouble scale = 1.0 / (GLdouble) 0xffffffff; @@ -2746,7 +2745,7 @@ _mesa_pack_ubyte_stencil_row(mesa_format format, GLuint n, const GLubyte *src, void *dst) { switch (format) { - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: { /* don't disturb the Z values */ GLuint *d = ((GLuint *) dst); @@ -2758,7 +2757,7 @@ _mesa_pack_ubyte_stencil_row(mesa_format format, GLuint n, } } break; - case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_Z24_UNORM_X8_UINT: { /* don't disturb the Z values */ GLuint *d = ((GLuint *) dst); @@ -2773,7 +2772,7 @@ _mesa_pack_ubyte_stencil_row(mesa_format format, GLuint n, case MESA_FORMAT_S_UINT8: memcpy(dst, src, n * sizeof(GLubyte)); break; - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: { struct z32f_x24s8 *d = (struct z32f_x24s8 *) dst; GLuint i; @@ -2796,10 +2795,10 @@ _mesa_pack_uint_24_8_depth_stencil_row(mesa_format format, GLuint n, const GLuint *src, void *dst) { switch (format) { - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: memcpy(dst, src, n * sizeof(GLuint)); break; - case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_Z24_UNORM_X8_UINT: { GLuint *d = ((GLuint *) dst); GLuint i; @@ -2810,7 +2809,7 @@ _mesa_pack_uint_24_8_depth_stencil_row(mesa_format format, GLuint n, } } break; - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: { const GLdouble scale = 1.0 / (GLdouble) 0xffffff; struct z32f_x24s8 *d = (struct z32f_x24s8 *) dst; |