diff options
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/debug.c | 10 | ||||
-rw-r--r-- | src/mesa/main/fbobject.c | 2 | ||||
-rw-r--r-- | src/mesa/main/format_pack.c | 172 | ||||
-rw-r--r-- | src/mesa/main/format_unpack.c | 92 | ||||
-rw-r--r-- | src/mesa/main/formats.c | 240 | ||||
-rw-r--r-- | src/mesa/main/formats.h | 397 | ||||
-rw-r--r-- | src/mesa/main/shaderimage.c | 12 | ||||
-rw-r--r-- | src/mesa/main/texformat.c | 78 | ||||
-rw-r--r-- | src/mesa/main/teximage.c | 18 | ||||
-rw-r--r-- | src/mesa/main/texobj.c | 2 | ||||
-rw-r--r-- | src/mesa/main/texstore.c | 134 |
11 files changed, 745 insertions, 412 deletions
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 0b703134749..3a483e46d1f 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -615,17 +615,17 @@ _mesa_print_texture(struct gl_context *ctx, struct gl_texture_image *img) else { /* XXX add more formats or make into a new format utility function */ switch (img->TexFormat) { - case MESA_FORMAT_A8: - case MESA_FORMAT_L8: - case MESA_FORMAT_I8: + case MESA_FORMAT_A_UNORM8: + case MESA_FORMAT_L_UNORM8: + case MESA_FORMAT_I_UNORM8: c = 1; break; case MESA_FORMAT_AL88: case MESA_FORMAT_AL88_REV: c = 2; break; - case MESA_FORMAT_RGB888: - case MESA_FORMAT_BGR888: + case MESA_FORMAT_BGR_UNORM8: + case MESA_FORMAT_RGB_UNORM8: c = 3; break; case MESA_FORMAT_A8B8G8R8_UNORM: diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index aad111bd9e3..90ea870ca84 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -2899,7 +2899,7 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, return; } - if (format == MESA_FORMAT_S8) { + if (format == MESA_FORMAT_S_UINT8) { /* special cases */ *params = GL_INDEX; } diff --git a/src/mesa/main/format_pack.c b/src/mesa/main/format_pack.c index dfe4a06bd77..0da0f854d61 100644 --- a/src/mesa/main/format_pack.c +++ b/src/mesa/main/format_pack.c @@ -349,7 +349,7 @@ pack_row_float_XRGB8888_REV(GLuint n, const GLfloat src[][4], void *dst) /* - * MESA_FORMAT_RGB888 + * MESA_FORMAT_BGR_UNORM8 */ static void @@ -398,7 +398,7 @@ pack_row_float_RGB888(GLuint n, const GLfloat src[][4], void *dst) /* - * MESA_FORMAT_BGR888 + * MESA_FORMAT_RGB_UNORM8 */ static void @@ -761,7 +761,7 @@ pack_float_RGB332(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_A8 */ +/* MESA_FORMAT_A_UNORM8 */ static void pack_ubyte_A8(const GLubyte src[4], void *dst) @@ -778,7 +778,7 @@ pack_float_A8(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_A16 */ +/* MESA_FORMAT_A_UNORM16 */ static void pack_ubyte_A16(const GLubyte src[4], void *dst) @@ -795,7 +795,7 @@ pack_float_A16(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_L8 */ +/* MESA_FORMAT_L_UNORM8 */ static void pack_ubyte_L8(const GLubyte src[4], void *dst) @@ -812,7 +812,7 @@ pack_float_L8(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_L16 */ +/* MESA_FORMAT_L_UNORM16 */ static void pack_ubyte_L16(const GLubyte src[4], void *dst) @@ -859,7 +859,7 @@ pack_float_YCBCR_REV(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_R8 */ +/* MESA_FORMAT_R_UNORM8 */ static void pack_ubyte_R8(const GLubyte src[4], void *dst) @@ -918,7 +918,7 @@ pack_float_RG88(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_R16 */ +/* MESA_FORMAT_R_UNORM16 */ static void pack_ubyte_R16(const GLubyte src[4], void *dst) @@ -1032,7 +1032,7 @@ pack_float_ABGR2101010_UINT(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_SRGB8 */ +/* MESA_FORMAT_BGR_SRGB8 */ static void pack_ubyte_SRGB8(const GLubyte src[4], void *dst) @@ -1103,7 +1103,7 @@ pack_float_SARGB8(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_SL8 */ +/* MESA_FORMAT_L_SRGB8 */ static void pack_ubyte_SL8(const GLubyte src[4], void *dst) @@ -1394,7 +1394,7 @@ pack_float_DUDV8(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_RGBA_16 */ +/* MESA_FORMAT_RGBA_UNORM16 */ static void pack_ubyte_RGBA_16(const GLubyte src[4], void *dst) @@ -1764,7 +1764,7 @@ pack_float_XRGB2101010_UNORM(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_XBGR16161616_UNORM */ +/* MESA_FORMAT_RGBX_UNORM16 */ static void pack_ubyte_XBGR16161616_UNORM(const GLubyte src[4], void *dst) @@ -1787,7 +1787,7 @@ pack_float_XBGR16161616_UNORM(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_XBGR16161616_SNORM */ +/* MESA_FORMAT_RGBX_SNORM16 */ static void pack_float_XBGR16161616_SNORM(const GLfloat src[4], void *dst) @@ -1800,7 +1800,7 @@ pack_float_XBGR16161616_SNORM(const GLfloat src[4], void *dst) } -/* MESA_FORMAT_XBGR16161616_FLOAT */ +/* MESA_FORMAT_RGBX_FLOAT16 */ static void pack_float_XBGR16161616_FLOAT(const GLfloat src[4], void *dst) @@ -1812,7 +1812,7 @@ pack_float_XBGR16161616_FLOAT(const GLfloat src[4], void *dst) d[3] = _mesa_float_to_half(1.0); } -/* MESA_FORMAT_XBGR32323232_FLOAT */ +/* MESA_FORMAT_RGBX_FLOAT32 */ static void pack_float_XBGR32323232_FLOAT(const GLfloat src[4], void *dst) @@ -1897,8 +1897,8 @@ _mesa_get_pack_ubyte_rgba_function(mesa_format format) table[MESA_FORMAT_R8G8B8X8_UNORM] = pack_ubyte_RGBA8888_REV; /* reused */ table[MESA_FORMAT_B8G8R8X8_UNORM] = pack_ubyte_XRGB8888; table[MESA_FORMAT_X8R8G8B8_UNORM] = pack_ubyte_XRGB8888_REV; - table[MESA_FORMAT_RGB888] = pack_ubyte_RGB888; - table[MESA_FORMAT_BGR888] = pack_ubyte_BGR888; + 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; @@ -1912,18 +1912,18 @@ _mesa_get_pack_ubyte_rgba_function(mesa_format format) 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_A8] = pack_ubyte_A8; - table[MESA_FORMAT_A16] = pack_ubyte_A16; - table[MESA_FORMAT_L8] = pack_ubyte_L8; - table[MESA_FORMAT_L16] = pack_ubyte_L16; - table[MESA_FORMAT_I8] = pack_ubyte_L8; /* reuse pack_ubyte_L8 */ - table[MESA_FORMAT_I16] = pack_ubyte_L16; /* reuse pack_ubyte_L16 */ + table[MESA_FORMAT_A_UNORM8] = pack_ubyte_A8; + table[MESA_FORMAT_A_UNORM16] = pack_ubyte_A16; + table[MESA_FORMAT_L_UNORM8] = pack_ubyte_L8; + table[MESA_FORMAT_L_UNORM16] = pack_ubyte_L16; + table[MESA_FORMAT_I_UNORM8] = pack_ubyte_L8; /* reuse pack_ubyte_L8 */ + table[MESA_FORMAT_I_UNORM16] = pack_ubyte_L16; /* reuse pack_ubyte_L16 */ table[MESA_FORMAT_YCBCR] = pack_ubyte_YCBCR; table[MESA_FORMAT_YCBCR_REV] = pack_ubyte_YCBCR_REV; - table[MESA_FORMAT_R8] = pack_ubyte_R8; + 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_R16] = pack_ubyte_R16; + 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; @@ -1932,17 +1932,17 @@ _mesa_get_pack_ubyte_rgba_function(mesa_format format) /* should never convert RGBA to these formats */ table[MESA_FORMAT_Z24_S8] = NULL; table[MESA_FORMAT_S8_Z24] = NULL; - table[MESA_FORMAT_Z16] = NULL; + table[MESA_FORMAT_Z_UNORM16] = NULL; table[MESA_FORMAT_X8_Z24] = NULL; table[MESA_FORMAT_Z24_X8] = NULL; - table[MESA_FORMAT_Z32] = NULL; - table[MESA_FORMAT_S8] = NULL; + table[MESA_FORMAT_Z_UNORM32] = NULL; + table[MESA_FORMAT_S_UINT8] = NULL; /* sRGB */ - table[MESA_FORMAT_SRGB8] = pack_ubyte_SRGB8; + 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_SL8] = pack_ubyte_SL8; + table[MESA_FORMAT_L_SRGB8] = pack_ubyte_SL8; table[MESA_FORMAT_SLA8] = pack_ubyte_SLA8; /* n/a */ @@ -1985,7 +1985,7 @@ _mesa_get_pack_ubyte_rgba_function(mesa_format format) table[MESA_FORMAT_DUDV8] = pack_ubyte_DUDV8; - table[MESA_FORMAT_RGBA_16] = pack_ubyte_RGBA_16; + table[MESA_FORMAT_RGBA_UNORM16] = pack_ubyte_RGBA_16; /* n/a */ table[MESA_FORMAT_SIGNED_R8] = NULL; @@ -2007,7 +2007,7 @@ _mesa_get_pack_ubyte_rgba_function(mesa_format format) table[MESA_FORMAT_SIGNED_I16] = NULL; - table[MESA_FORMAT_RGBA_16] = pack_ubyte_RGBA_16; + 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; @@ -2016,17 +2016,17 @@ _mesa_get_pack_ubyte_rgba_function(mesa_format format) table[MESA_FORMAT_XRGB1555_UNORM] = pack_ubyte_XRGB1555_UNORM; table[MESA_FORMAT_XBGR8888_SNORM] = NULL; table[MESA_FORMAT_XBGR8888_SRGB] = NULL; - table[MESA_FORMAT_XBGR8888_UINT] = NULL; - table[MESA_FORMAT_XBGR8888_SINT] = 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_XBGR16161616_UNORM] = pack_ubyte_XBGR16161616_UNORM; - table[MESA_FORMAT_XBGR16161616_SNORM] = NULL; - table[MESA_FORMAT_XBGR16161616_FLOAT] = NULL; - table[MESA_FORMAT_XBGR16161616_UINT] = NULL; - table[MESA_FORMAT_XBGR16161616_SINT] = NULL; - table[MESA_FORMAT_XBGR32323232_FLOAT] = NULL; - table[MESA_FORMAT_XBGR32323232_UINT] = NULL; - table[MESA_FORMAT_XBGR32323232_SINT] = NULL; + table[MESA_FORMAT_RGBX_UNORM16] = pack_ubyte_XBGR16161616_UNORM; + table[MESA_FORMAT_RGBX_SNORM16] = NULL; + table[MESA_FORMAT_RGBX_FLOAT16] = NULL; + table[MESA_FORMAT_RGBX_UINT16] = NULL; + table[MESA_FORMAT_RGBX_SINT16] = NULL; + table[MESA_FORMAT_RGBX_FLOAT32] = NULL; + table[MESA_FORMAT_RGBX_UINT32] = NULL; + table[MESA_FORMAT_RGBX_SINT32] = NULL; table[MESA_FORMAT_ABGR2101010] = pack_ubyte_ABGR2101010; @@ -2060,8 +2060,8 @@ _mesa_get_pack_float_rgba_function(mesa_format format) table[MESA_FORMAT_R8G8B8X8_UNORM] = pack_float_RGBA8888_REV; /* reused */ table[MESA_FORMAT_B8G8R8X8_UNORM] = pack_float_XRGB8888; table[MESA_FORMAT_X8R8G8B8_UNORM] = pack_float_XRGB8888_REV; - table[MESA_FORMAT_RGB888] = pack_float_RGB888; - table[MESA_FORMAT_BGR888] = pack_float_BGR888; + 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; @@ -2076,18 +2076,18 @@ _mesa_get_pack_float_rgba_function(mesa_format format) 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_A8] = pack_float_A8; - table[MESA_FORMAT_A16] = pack_float_A16; - table[MESA_FORMAT_L8] = pack_float_L8; - table[MESA_FORMAT_L16] = pack_float_L16; - table[MESA_FORMAT_I8] = pack_float_L8; /* reuse pack_float_L8 */ - table[MESA_FORMAT_I16] = pack_float_L16; /* reuse pack_float_L16 */ + table[MESA_FORMAT_A_UNORM8] = pack_float_A8; + table[MESA_FORMAT_A_UNORM16] = pack_float_A16; + table[MESA_FORMAT_L_UNORM8] = pack_float_L8; + table[MESA_FORMAT_L_UNORM16] = pack_float_L16; + table[MESA_FORMAT_I_UNORM8] = pack_float_L8; /* reuse pack_float_L8 */ + table[MESA_FORMAT_I_UNORM16] = pack_float_L16; /* reuse pack_float_L16 */ table[MESA_FORMAT_YCBCR] = pack_float_YCBCR; table[MESA_FORMAT_YCBCR_REV] = pack_float_YCBCR_REV; - table[MESA_FORMAT_R8] = pack_float_R8; + 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_R16] = pack_float_R16; + 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; @@ -2096,16 +2096,16 @@ _mesa_get_pack_float_rgba_function(mesa_format format) /* should never convert RGBA to these formats */ table[MESA_FORMAT_Z24_S8] = NULL; table[MESA_FORMAT_S8_Z24] = NULL; - table[MESA_FORMAT_Z16] = NULL; + table[MESA_FORMAT_Z_UNORM16] = NULL; table[MESA_FORMAT_X8_Z24] = NULL; table[MESA_FORMAT_Z24_X8] = NULL; - table[MESA_FORMAT_Z32] = NULL; - table[MESA_FORMAT_S8] = NULL; + table[MESA_FORMAT_Z_UNORM32] = NULL; + table[MESA_FORMAT_S_UINT8] = NULL; - table[MESA_FORMAT_SRGB8] = pack_float_SRGB8; + 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_SL8] = pack_float_SL8; + table[MESA_FORMAT_L_SRGB8] = pack_float_SL8; table[MESA_FORMAT_SLA8] = pack_float_SLA8; /* n/a */ @@ -2149,7 +2149,7 @@ _mesa_get_pack_float_rgba_function(mesa_format format) table[MESA_FORMAT_DUDV8] = pack_float_DUDV8; - table[MESA_FORMAT_RGBA_16] = pack_float_RGBA_16; + table[MESA_FORMAT_RGBA_UNORM16] = pack_float_RGBA_16; table[MESA_FORMAT_SIGNED_R8] = pack_float_SIGNED_R8; table[MESA_FORMAT_SIGNED_RG88_REV] = pack_float_SIGNED_RG88_REV; @@ -2176,17 +2176,17 @@ _mesa_get_pack_float_rgba_function(mesa_format format) 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_XBGR8888_UINT] = NULL; - table[MESA_FORMAT_XBGR8888_SINT] = NULL; + table[MESA_FORMAT_RGBX_UINT8] = NULL; + table[MESA_FORMAT_RGBX_SINT8] = NULL; table[MESA_FORMAT_XRGB2101010_UNORM] = pack_float_XRGB2101010_UNORM; - table[MESA_FORMAT_XBGR16161616_UNORM] = pack_float_XBGR16161616_UNORM; - table[MESA_FORMAT_XBGR16161616_SNORM] = pack_float_XBGR16161616_SNORM; - table[MESA_FORMAT_XBGR16161616_FLOAT] = pack_float_XBGR16161616_FLOAT; - table[MESA_FORMAT_XBGR16161616_UINT] = NULL; - table[MESA_FORMAT_XBGR16161616_SINT] = NULL; - table[MESA_FORMAT_XBGR32323232_FLOAT] = pack_float_XBGR32323232_FLOAT; - table[MESA_FORMAT_XBGR32323232_UINT] = NULL; - table[MESA_FORMAT_XBGR32323232_SINT] = NULL; + 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; + table[MESA_FORMAT_RGBX_UINT16] = NULL; + table[MESA_FORMAT_RGBX_SINT16] = NULL; + table[MESA_FORMAT_RGBX_FLOAT32] = pack_float_XBGR32323232_FLOAT; + table[MESA_FORMAT_RGBX_UINT32] = NULL; + table[MESA_FORMAT_RGBX_SINT32] = NULL; table[MESA_FORMAT_ABGR2101010] = pack_float_ABGR2101010; @@ -2221,8 +2221,8 @@ get_pack_float_rgba_row_function(mesa_format format) table[MESA_FORMAT_R8G8B8X8_UNORM] = pack_row_float_RGBA8888_REV; /* reused */ table[MESA_FORMAT_B8G8R8X8_UNORM] = pack_row_float_XRGB8888; table[MESA_FORMAT_X8R8G8B8_UNORM] = pack_row_float_XRGB8888_REV; - table[MESA_FORMAT_RGB888] = pack_row_float_RGB888; - table[MESA_FORMAT_BGR888] = pack_row_float_BGR888; + 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; @@ -2254,8 +2254,8 @@ get_pack_ubyte_rgba_row_function(mesa_format format) table[MESA_FORMAT_R8G8B8X8_UNORM] = pack_row_ubyte_RGBA8888_REV; /* reused */ table[MESA_FORMAT_B8G8R8X8_UNORM] = pack_row_ubyte_XRGB8888; table[MESA_FORMAT_X8R8G8B8_UNORM] = pack_row_ubyte_XRGB8888_REV; - table[MESA_FORMAT_RGB888] = pack_row_ubyte_RGB888; - table[MESA_FORMAT_BGR888] = pack_row_ubyte_BGR888; + 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; @@ -2432,11 +2432,11 @@ _mesa_get_pack_float_z_func(mesa_format format) case MESA_FORMAT_S8_Z24: case MESA_FORMAT_X8_Z24: return pack_float_z_S8_Z24; - case MESA_FORMAT_Z16: + case MESA_FORMAT_Z_UNORM16: return pack_float_z_Z16; - case MESA_FORMAT_Z32: + case MESA_FORMAT_Z_UNORM32: return pack_float_z_Z32; - case MESA_FORMAT_Z32_FLOAT: + case MESA_FORMAT_Z_FLOAT32: case MESA_FORMAT_Z32_FLOAT_X24S8: return pack_float_z_Z32_FLOAT; default: @@ -2517,11 +2517,11 @@ _mesa_get_pack_uint_z_func(mesa_format format) case MESA_FORMAT_S8_Z24: case MESA_FORMAT_X8_Z24: return pack_uint_z_S8_Z24; - case MESA_FORMAT_Z16: + case MESA_FORMAT_Z_UNORM16: return pack_uint_z_Z16; - case MESA_FORMAT_Z32: + case MESA_FORMAT_Z_UNORM32: return pack_uint_z_Z32; - case MESA_FORMAT_Z32_FLOAT: + case MESA_FORMAT_Z_FLOAT32: return pack_uint_z_Z32_FLOAT; case MESA_FORMAT_Z32_FLOAT_X24S8: return pack_uint_z_Z32_FLOAT_X24S8; @@ -2579,7 +2579,7 @@ _mesa_get_pack_ubyte_stencil_func(mesa_format format) return pack_ubyte_stencil_Z24_S8; case MESA_FORMAT_S8_Z24: return pack_ubyte_stencil_S8_Z24; - case MESA_FORMAT_S8: + case MESA_FORMAT_S_UINT8: return pack_ubyte_stencil_S8; case MESA_FORMAT_Z32_FLOAT_X24S8: return pack_ubyte_stencil_Z32_FLOAT_X24S8; @@ -2627,7 +2627,7 @@ _mesa_pack_float_z_row(mesa_format format, GLuint n, } } break; - case MESA_FORMAT_Z16: + case MESA_FORMAT_Z_UNORM16: { GLushort *d = ((GLushort *) dst); const GLfloat scale = (GLfloat) 0xffff; @@ -2637,7 +2637,7 @@ _mesa_pack_float_z_row(mesa_format format, GLuint n, } } break; - case MESA_FORMAT_Z32: + case MESA_FORMAT_Z_UNORM32: { GLuint *d = ((GLuint *) dst); const GLdouble scale = (GLdouble) 0xffffffff; @@ -2647,7 +2647,7 @@ _mesa_pack_float_z_row(mesa_format format, GLuint n, } } break; - case MESA_FORMAT_Z32_FLOAT: + case MESA_FORMAT_Z_FLOAT32: memcpy(dst, src, n * sizeof(GLfloat)); break; case MESA_FORMAT_Z32_FLOAT_X24S8: @@ -2699,7 +2699,7 @@ _mesa_pack_uint_z_row(mesa_format format, GLuint n, } } break; - case MESA_FORMAT_Z16: + case MESA_FORMAT_Z_UNORM16: { GLushort *d = ((GLushort *) dst); GLuint i; @@ -2708,10 +2708,10 @@ _mesa_pack_uint_z_row(mesa_format format, GLuint n, } } break; - case MESA_FORMAT_Z32: + case MESA_FORMAT_Z_UNORM32: memcpy(dst, src, n * sizeof(GLfloat)); break; - case MESA_FORMAT_Z32_FLOAT: + case MESA_FORMAT_Z_FLOAT32: { GLuint *d = ((GLuint *) dst); const GLdouble scale = 1.0 / (GLdouble) 0xffffffff; @@ -2770,7 +2770,7 @@ _mesa_pack_ubyte_stencil_row(mesa_format format, GLuint n, } } break; - case MESA_FORMAT_S8: + case MESA_FORMAT_S_UINT8: memcpy(dst, src, n * sizeof(GLubyte)); break; case MESA_FORMAT_Z32_FLOAT_X24S8: diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c index be5ef9e28c4..33dc07d80c2 100644 --- a/src/mesa/main/format_unpack.c +++ b/src/mesa/main/format_unpack.c @@ -2327,8 +2327,8 @@ get_unpack_rgba_function(mesa_format format) table[MESA_FORMAT_R8G8B8X8_UNORM] = unpack_RGBX8888_REV; table[MESA_FORMAT_B8G8R8X8_UNORM] = unpack_XRGB8888; table[MESA_FORMAT_X8R8G8B8_UNORM] = unpack_XRGB8888_REV; - table[MESA_FORMAT_RGB888] = unpack_RGB888; - table[MESA_FORMAT_BGR888] = unpack_BGR888; + table[MESA_FORMAT_BGR_UNORM8] = unpack_RGB888; + table[MESA_FORMAT_RGB_UNORM8] = unpack_BGR888; table[MESA_FORMAT_RGB565] = unpack_RGB565; table[MESA_FORMAT_RGB565_REV] = unpack_RGB565_REV; table[MESA_FORMAT_ARGB4444] = unpack_ARGB4444; @@ -2342,18 +2342,18 @@ get_unpack_rgba_function(mesa_format format) table[MESA_FORMAT_AL1616] = unpack_AL1616; table[MESA_FORMAT_AL1616_REV] = unpack_AL1616_REV; table[MESA_FORMAT_RGB332] = unpack_RGB332; - table[MESA_FORMAT_A8] = unpack_A8; - table[MESA_FORMAT_A16] = unpack_A16; - table[MESA_FORMAT_L8] = unpack_L8; - table[MESA_FORMAT_L16] = unpack_L16; - table[MESA_FORMAT_I8] = unpack_I8; - table[MESA_FORMAT_I16] = unpack_I16; + table[MESA_FORMAT_A_UNORM8] = unpack_A8; + table[MESA_FORMAT_A_UNORM16] = unpack_A16; + table[MESA_FORMAT_L_UNORM8] = unpack_L8; + table[MESA_FORMAT_L_UNORM16] = unpack_L16; + table[MESA_FORMAT_I_UNORM8] = unpack_I8; + table[MESA_FORMAT_I_UNORM16] = unpack_I16; table[MESA_FORMAT_YCBCR] = unpack_YCBCR; table[MESA_FORMAT_YCBCR_REV] = unpack_YCBCR_REV; - table[MESA_FORMAT_R8] = unpack_R8; + table[MESA_FORMAT_R_UNORM8] = unpack_R8; table[MESA_FORMAT_GR88] = unpack_GR88; table[MESA_FORMAT_RG88] = unpack_RG88; - table[MESA_FORMAT_R16] = unpack_R16; + table[MESA_FORMAT_R_UNORM16] = unpack_R16; table[MESA_FORMAT_GR1616] = unpack_GR1616; table[MESA_FORMAT_RG1616] = unpack_RG1616; table[MESA_FORMAT_ARGB2101010] = unpack_ARGB2101010; @@ -2361,15 +2361,15 @@ get_unpack_rgba_function(mesa_format format) table[MESA_FORMAT_ABGR2101010_UINT] = unpack_ABGR2101010_UINT; table[MESA_FORMAT_Z24_S8] = unpack_Z24_S8; table[MESA_FORMAT_S8_Z24] = unpack_S8_Z24; - table[MESA_FORMAT_Z16] = unpack_Z16; + table[MESA_FORMAT_Z_UNORM16] = unpack_Z16; table[MESA_FORMAT_X8_Z24] = unpack_X8_Z24; table[MESA_FORMAT_Z24_X8] = unpack_Z24_X8; - table[MESA_FORMAT_Z32] = unpack_Z32; - table[MESA_FORMAT_S8] = unpack_S8; - table[MESA_FORMAT_SRGB8] = unpack_SRGB8; + table[MESA_FORMAT_Z_UNORM32] = unpack_Z32; + table[MESA_FORMAT_S_UINT8] = unpack_S8; + table[MESA_FORMAT_BGR_SRGB8] = unpack_SRGB8; table[MESA_FORMAT_SRGBA8] = unpack_SRGBA8; table[MESA_FORMAT_SARGB8] = unpack_SARGB8; - table[MESA_FORMAT_SL8] = unpack_SL8; + table[MESA_FORMAT_L_SRGB8] = unpack_SL8; table[MESA_FORMAT_SLA8] = unpack_SLA8; table[MESA_FORMAT_SRGB_DXT1] = unpack_SRGB_DXT1; table[MESA_FORMAT_SRGBA_DXT1] = unpack_SRGBA_DXT1; @@ -2463,7 +2463,7 @@ get_unpack_rgba_function(mesa_format format) table[MESA_FORMAT_SIGNED_GR1616] = unpack_SIGNED_GR1616; table[MESA_FORMAT_SIGNED_RGB_16] = unpack_SIGNED_RGB_16; table[MESA_FORMAT_SIGNED_RGBA_16] = unpack_SIGNED_RGBA_16; - table[MESA_FORMAT_RGBA_16] = unpack_RGBA_16; + table[MESA_FORMAT_RGBA_UNORM16] = unpack_RGBA_16; table[MESA_FORMAT_RED_RGTC1] = unpack_RED_RGTC1; table[MESA_FORMAT_SIGNED_RED_RGTC1] = unpack_SIGNED_RED_RGTC1; @@ -2500,24 +2500,24 @@ get_unpack_rgba_function(mesa_format format) table[MESA_FORMAT_RGB9_E5_FLOAT] = unpack_RGB9_E5_FLOAT; table[MESA_FORMAT_R11_G11_B10_FLOAT] = unpack_R11_G11_B10_FLOAT; - table[MESA_FORMAT_Z32_FLOAT] = unpack_Z32_FLOAT; + table[MESA_FORMAT_Z_FLOAT32] = unpack_Z32_FLOAT; table[MESA_FORMAT_Z32_FLOAT_X24S8] = unpack_Z32_FLOAT_X24S8; table[MESA_FORMAT_XRGB4444_UNORM] = unpack_XRGB4444_UNORM; table[MESA_FORMAT_XRGB1555_UNORM] = unpack_XRGB1555_UNORM; table[MESA_FORMAT_XBGR8888_SNORM] = unpack_XBGR8888_SNORM; table[MESA_FORMAT_XBGR8888_SRGB] = unpack_XBGR8888_SRGB; - table[MESA_FORMAT_XBGR8888_UINT] = unpack_XBGR8888_UINT; - table[MESA_FORMAT_XBGR8888_SINT] = unpack_XBGR8888_SINT; + table[MESA_FORMAT_RGBX_UINT8] = unpack_XBGR8888_UINT; + table[MESA_FORMAT_RGBX_SINT8] = unpack_XBGR8888_SINT; table[MESA_FORMAT_XRGB2101010_UNORM] = unpack_XRGB2101010_UNORM; - table[MESA_FORMAT_XBGR16161616_UNORM] = unpack_XBGR16161616_UNORM; - table[MESA_FORMAT_XBGR16161616_SNORM] = unpack_XBGR16161616_SNORM; - table[MESA_FORMAT_XBGR16161616_FLOAT] = unpack_XBGR16161616_FLOAT; - table[MESA_FORMAT_XBGR16161616_UINT] = unpack_XBGR16161616_UINT; - table[MESA_FORMAT_XBGR16161616_SINT] = unpack_XBGR16161616_SINT; - table[MESA_FORMAT_XBGR32323232_FLOAT] = unpack_XBGR32323232_FLOAT; - table[MESA_FORMAT_XBGR32323232_UINT] = unpack_XBGR32323232_UINT; - table[MESA_FORMAT_XBGR32323232_SINT] = unpack_XBGR32323232_SINT; + table[MESA_FORMAT_RGBX_UNORM16] = unpack_XBGR16161616_UNORM; + table[MESA_FORMAT_RGBX_SNORM16] = unpack_XBGR16161616_SNORM; + table[MESA_FORMAT_RGBX_FLOAT16] = unpack_XBGR16161616_FLOAT; + table[MESA_FORMAT_RGBX_UINT16] = unpack_XBGR16161616_UINT; + table[MESA_FORMAT_RGBX_SINT16] = unpack_XBGR16161616_SINT; + table[MESA_FORMAT_RGBX_FLOAT32] = unpack_XBGR32323232_FLOAT; + table[MESA_FORMAT_RGBX_UINT32] = unpack_XBGR32323232_UINT; + table[MESA_FORMAT_RGBX_SINT32] = unpack_XBGR32323232_SINT; table[MESA_FORMAT_ABGR2101010] = unpack_ABGR2101010; @@ -2941,10 +2941,10 @@ _mesa_unpack_ubyte_rgba_row(mesa_format format, GLuint n, case MESA_FORMAT_X8R8G8B8_UNORM: unpack_ubyte_XRGB8888_REV(src, dst, n); break; - case MESA_FORMAT_RGB888: + case MESA_FORMAT_BGR_UNORM8: unpack_ubyte_RGB888(src, dst, n); break; - case MESA_FORMAT_BGR888: + case MESA_FORMAT_RGB_UNORM8: unpack_ubyte_BGR888(src, dst, n); break; case MESA_FORMAT_RGB565: @@ -2980,16 +2980,16 @@ _mesa_unpack_ubyte_rgba_row(mesa_format format, GLuint n, case MESA_FORMAT_RGB332: unpack_ubyte_RGB332(src, dst, n); break; - case MESA_FORMAT_A8: + case MESA_FORMAT_A_UNORM8: unpack_ubyte_A8(src, dst, n); break; - case MESA_FORMAT_L8: + case MESA_FORMAT_L_UNORM8: unpack_ubyte_L8(src, dst, n); break; - case MESA_FORMAT_I8: + case MESA_FORMAT_I_UNORM8: unpack_ubyte_I8(src, dst, n); break; - case MESA_FORMAT_R8: + case MESA_FORMAT_R_UNORM8: unpack_ubyte_R8(src, dst, n); break; case MESA_FORMAT_GR88: @@ -3818,24 +3818,24 @@ _mesa_unpack_uint_rgba_row(mesa_format format, GLuint n, unpack_int_rgba_ARGB2101010(src, dst, n); break; - case MESA_FORMAT_XBGR8888_UINT: + case MESA_FORMAT_RGBX_UINT8: unpack_int_rgba_XBGR8888_UINT(src, dst, n); break; - case MESA_FORMAT_XBGR8888_SINT: + case MESA_FORMAT_RGBX_SINT8: unpack_int_rgba_XBGR8888_SINT(src, dst, n); break; - case MESA_FORMAT_XBGR16161616_UINT: + case MESA_FORMAT_RGBX_UINT16: unpack_int_rgba_XBGR16161616_UINT(src, dst, n); break; - case MESA_FORMAT_XBGR16161616_SINT: + case MESA_FORMAT_RGBX_SINT16: unpack_int_rgba_XBGR16161616_SINT(src, dst, n); break; - case MESA_FORMAT_XBGR32323232_UINT: - case MESA_FORMAT_XBGR32323232_SINT: + case MESA_FORMAT_RGBX_UINT32: + case MESA_FORMAT_RGBX_SINT32: unpack_int_rgba_XBGR32323232_UINT(src, dst, n); break; @@ -3978,13 +3978,13 @@ _mesa_unpack_float_z_row(mesa_format format, GLuint n, case MESA_FORMAT_X8_Z24: unpack = unpack_float_z_X8_Z24; break; - case MESA_FORMAT_Z16: + case MESA_FORMAT_Z_UNORM16: unpack = unpack_float_z_Z16; break; - case MESA_FORMAT_Z32: + case MESA_FORMAT_Z_UNORM32: unpack = unpack_float_z_Z32; break; - case MESA_FORMAT_Z32_FLOAT: + case MESA_FORMAT_Z_FLOAT32: unpack = unpack_float_z_Z32F; break; case MESA_FORMAT_Z32_FLOAT_X24S8: @@ -4083,13 +4083,13 @@ _mesa_unpack_uint_z_row(mesa_format format, GLuint n, case MESA_FORMAT_X8_Z24: unpack = unpack_uint_z_X8_Z24; break; - case MESA_FORMAT_Z16: + case MESA_FORMAT_Z_UNORM16: unpack = unpack_uint_z_Z16; break; - case MESA_FORMAT_Z32: + case MESA_FORMAT_Z_UNORM32: unpack = unpack_uint_z_Z32; break; - case MESA_FORMAT_Z32_FLOAT: + case MESA_FORMAT_Z_FLOAT32: unpack = unpack_uint_z_Z32_FLOAT; break; case MESA_FORMAT_Z32_FLOAT_X24S8: @@ -4146,7 +4146,7 @@ _mesa_unpack_ubyte_stencil_row(mesa_format format, GLuint n, const void *src, GLubyte *dst) { switch (format) { - case MESA_FORMAT_S8: + case MESA_FORMAT_S_UINT8: unpack_ubyte_s_S8(src, dst, n); break; case MESA_FORMAT_Z24_S8: diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index a1e573051f1..99d1e189d8d 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -160,8 +160,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_RGB888, /* Name */ - "MESA_FORMAT_RGB888", /* StrName */ + MESA_FORMAT_BGR_UNORM8, /* Name */ + "MESA_FORMAT_BGR_UNORM8", /* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ @@ -169,8 +169,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 3 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_BGR888, /* Name */ - "MESA_FORMAT_BGR888", /* StrName */ + MESA_FORMAT_RGB_UNORM8, /* Name */ + "MESA_FORMAT_RGB_UNORM8", /* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ @@ -295,8 +295,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_A8, /* Name */ - "MESA_FORMAT_A8", /* StrName */ + MESA_FORMAT_A_UNORM8, /* Name */ + "MESA_FORMAT_A_UNORM8", /* StrName */ GL_ALPHA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 8, /* Red/Green/Blue/AlphaBits */ @@ -304,8 +304,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_A16, /* Name */ - "MESA_FORMAT_A16", /* StrName */ + MESA_FORMAT_A_UNORM16, /* Name */ + "MESA_FORMAT_A_UNORM16", /* StrName */ GL_ALPHA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 16, /* Red/Green/Blue/AlphaBits */ @@ -313,8 +313,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_L8, /* Name */ - "MESA_FORMAT_L8", /* StrName */ + MESA_FORMAT_L_UNORM8, /* Name */ + "MESA_FORMAT_L_UNORM8", /* StrName */ GL_LUMINANCE, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -322,8 +322,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_L16, /* Name */ - "MESA_FORMAT_L16", /* StrName */ + MESA_FORMAT_L_UNORM16, /* Name */ + "MESA_FORMAT_L_UNORM16", /* StrName */ GL_LUMINANCE, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -331,8 +331,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_I8, /* Name */ - "MESA_FORMAT_I8", /* StrName */ + MESA_FORMAT_I_UNORM8, /* Name */ + "MESA_FORMAT_I_UNORM8", /* StrName */ GL_INTENSITY, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -340,8 +340,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_I16, /* Name */ - "MESA_FORMAT_I16", /* StrName */ + MESA_FORMAT_I_UNORM16, /* Name */ + "MESA_FORMAT_I_UNORM16", /* StrName */ GL_INTENSITY, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -367,8 +367,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_R8, - "MESA_FORMAT_R8", + MESA_FORMAT_R_UNORM8, + "MESA_FORMAT_R_UNORM8", GL_RED, GL_UNSIGNED_NORMALIZED, 8, 0, 0, 0, @@ -394,8 +394,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 }, { - MESA_FORMAT_R16, - "MESA_FORMAT_R16", + MESA_FORMAT_R_UNORM16, + "MESA_FORMAT_R_UNORM16", GL_RED, GL_UNSIGNED_NORMALIZED, 16, 0, 0, 0, @@ -448,8 +448,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_Z16, /* Name */ - "MESA_FORMAT_Z16", /* StrName */ + MESA_FORMAT_Z_UNORM16, /* Name */ + "MESA_FORMAT_Z_UNORM16", /* StrName */ GL_DEPTH_COMPONENT, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -475,8 +475,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_Z32, /* Name */ - "MESA_FORMAT_Z32", /* StrName */ + MESA_FORMAT_Z_UNORM32, /* Name */ + "MESA_FORMAT_Z_UNORM32", /* StrName */ GL_DEPTH_COMPONENT, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -484,8 +484,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_S8, /* Name */ - "MESA_FORMAT_S8", /* StrName */ + MESA_FORMAT_S_UINT8, /* Name */ + "MESA_FORMAT_S_UINT8", /* StrName */ GL_STENCIL_INDEX, /* BaseFormat */ GL_UNSIGNED_INT, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -493,8 +493,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_SRGB8, - "MESA_FORMAT_SRGB8", + MESA_FORMAT_BGR_SRGB8, + "MESA_FORMAT_BGR_SRGB8", GL_RGB, GL_UNSIGNED_NORMALIZED, 8, 8, 8, 0, @@ -520,8 +520,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_SL8, - "MESA_FORMAT_SL8", + MESA_FORMAT_L_SRGB8, + "MESA_FORMAT_L_SRGB8", GL_LUMINANCE, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 0, @@ -1306,8 +1306,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 8 }, { - MESA_FORMAT_RGBA_16, - "MESA_FORMAT_RGBA_16", + MESA_FORMAT_RGBA_UNORM16, + "MESA_FORMAT_RGBA_UNORM16", GL_RGBA, GL_UNSIGNED_NORMALIZED, 16, 16, 16, 16, @@ -1590,8 +1590,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, /* ARB_depth_buffer_float */ { - MESA_FORMAT_Z32_FLOAT, /* Name */ - "MESA_FORMAT_Z32_FLOAT", /* StrName */ + MESA_FORMAT_Z_FLOAT32, /* Name */ + "MESA_FORMAT_Z_FLOAT32", /* StrName */ GL_DEPTH_COMPONENT, /* BaseFormat */ GL_FLOAT, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -1665,8 +1665,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_XBGR8888_UINT, - "MESA_FORMAT_XBGR8888_UINT", + MESA_FORMAT_RGBX_UINT8, + "MESA_FORMAT_RGBX_UINT8", GL_RGB, GL_UNSIGNED_INT, 8, 8, 8, 0, @@ -1674,8 +1674,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_XBGR8888_SINT, - "MESA_FORMAT_XBGR8888_SINT", + MESA_FORMAT_RGBX_SINT8, + "MESA_FORMAT_RGBX_SINT8", GL_RGB, GL_INT, 8, 8, 8, 0, @@ -1692,8 +1692,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_XBGR16161616_UNORM, - "MESA_FORMAT_XBGR16161616_UNORM", + MESA_FORMAT_RGBX_UNORM16, + "MESA_FORMAT_RGBX_UNORM16", GL_RGB, GL_UNSIGNED_NORMALIZED, 16, 16, 16, 0, @@ -1701,8 +1701,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 8 }, { - MESA_FORMAT_XBGR16161616_SNORM, - "MESA_FORMAT_XBGR16161616_SNORM", + MESA_FORMAT_RGBX_SNORM16, + "MESA_FORMAT_RGBX_SNORM16", GL_RGB, GL_SIGNED_NORMALIZED, 16, 16, 16, 0, @@ -1710,8 +1710,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 8 }, { - MESA_FORMAT_XBGR16161616_FLOAT, - "MESA_FORMAT_XBGR16161616_FLOAT", + MESA_FORMAT_RGBX_FLOAT16, + "MESA_FORMAT_RGBX_FLOAT16", GL_RGB, GL_FLOAT, 16, 16, 16, 0, @@ -1719,8 +1719,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 8 }, { - MESA_FORMAT_XBGR16161616_UINT, - "MESA_FORMAT_XBGR16161616_UINT", + MESA_FORMAT_RGBX_UINT16, + "MESA_FORMAT_RGBX_UINT16", GL_RGB, GL_UNSIGNED_INT, 16, 16, 16, 0, @@ -1728,8 +1728,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 8 }, { - MESA_FORMAT_XBGR16161616_SINT, - "MESA_FORMAT_XBGR16161616_SINT", + MESA_FORMAT_RGBX_SINT16, + "MESA_FORMAT_RGBX_SINT16", GL_RGB, GL_INT, 16, 16, 16, 0, @@ -1737,8 +1737,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 8 }, { - MESA_FORMAT_XBGR32323232_FLOAT, - "MESA_FORMAT_XBGR32323232_FLOAT", + MESA_FORMAT_RGBX_FLOAT32, + "MESA_FORMAT_RGBX_FLOAT32", GL_RGB, GL_FLOAT, 32, 32, 32, 0, @@ -1746,8 +1746,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 16 }, { - MESA_FORMAT_XBGR32323232_UINT, - "MESA_FORMAT_XBGR32323232_UINT", + MESA_FORMAT_RGBX_UINT32, + "MESA_FORMAT_RGBX_UINT32", GL_RGB, GL_UNSIGNED_INT, 32, 32, 32, 0, @@ -1755,8 +1755,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 16 }, { - MESA_FORMAT_XBGR32323232_SINT, - "MESA_FORMAT_XBGR32323232_SINT", + MESA_FORMAT_RGBX_SINT32, + "MESA_FORMAT_RGBX_SINT32", GL_RGB, GL_INT, 32, 32, 32, 0, @@ -2022,10 +2022,10 @@ _mesa_get_format_color_encoding(mesa_format format) { /* XXX this info should be encoded in gl_format_info */ switch (format) { - case MESA_FORMAT_SRGB8: + case MESA_FORMAT_BGR_SRGB8: case MESA_FORMAT_SRGBA8: case MESA_FORMAT_SARGB8: - case MESA_FORMAT_SL8: + case MESA_FORMAT_L_SRGB8: case MESA_FORMAT_SLA8: case MESA_FORMAT_SRGB_DXT1: case MESA_FORMAT_SRGBA_DXT1: @@ -2050,8 +2050,8 @@ mesa_format _mesa_get_srgb_format_linear(mesa_format format) { switch (format) { - case MESA_FORMAT_SRGB8: - format = MESA_FORMAT_RGB888; + case MESA_FORMAT_BGR_SRGB8: + format = MESA_FORMAT_BGR_UNORM8; break; case MESA_FORMAT_SRGBA8: format = MESA_FORMAT_A8B8G8R8_UNORM; @@ -2059,8 +2059,8 @@ _mesa_get_srgb_format_linear(mesa_format format) case MESA_FORMAT_SARGB8: format = MESA_FORMAT_B8G8R8A8_UNORM; break; - case MESA_FORMAT_SL8: - format = MESA_FORMAT_L8; + case MESA_FORMAT_L_SRGB8: + format = MESA_FORMAT_L_UNORM8; break; case MESA_FORMAT_SLA8: format = MESA_FORMAT_AL88; @@ -2105,12 +2105,12 @@ _mesa_get_uncompressed_format(mesa_format format) { switch (format) { case MESA_FORMAT_RGB_FXT1: - return MESA_FORMAT_RGB888; + return MESA_FORMAT_BGR_UNORM8; case MESA_FORMAT_RGBA_FXT1: return MESA_FORMAT_A8B8G8R8_UNORM; case MESA_FORMAT_RGB_DXT1: case MESA_FORMAT_SRGB_DXT1: - return MESA_FORMAT_RGB888; + return MESA_FORMAT_BGR_UNORM8; case MESA_FORMAT_RGBA_DXT1: case MESA_FORMAT_SRGBA_DXT1: return MESA_FORMAT_A8B8G8R8_UNORM; @@ -2121,7 +2121,7 @@ _mesa_get_uncompressed_format(mesa_format format) case MESA_FORMAT_SRGBA_DXT5: return MESA_FORMAT_A8B8G8R8_UNORM; case MESA_FORMAT_RED_RGTC1: - return MESA_FORMAT_R8; + return MESA_FORMAT_R_UNORM8; case MESA_FORMAT_SIGNED_RED_RGTC1: return MESA_FORMAT_SIGNED_R8; case MESA_FORMAT_RG_RGTC2: @@ -2129,7 +2129,7 @@ _mesa_get_uncompressed_format(mesa_format format) case MESA_FORMAT_SIGNED_RG_RGTC2: return MESA_FORMAT_SIGNED_RG88_REV; case MESA_FORMAT_L_LATC1: - return MESA_FORMAT_L8; + return MESA_FORMAT_L_UNORM8; case MESA_FORMAT_SIGNED_L_LATC1: return MESA_FORMAT_SIGNED_L8; case MESA_FORMAT_LA_LATC2: @@ -2139,7 +2139,7 @@ _mesa_get_uncompressed_format(mesa_format format) case MESA_FORMAT_ETC1_RGB8: case MESA_FORMAT_ETC2_RGB8: case MESA_FORMAT_ETC2_SRGB8: - return MESA_FORMAT_RGB888; + return MESA_FORMAT_BGR_UNORM8; case MESA_FORMAT_ETC2_RGBA8_EAC: case MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC: case MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1: @@ -2147,7 +2147,7 @@ _mesa_get_uncompressed_format(mesa_format format) return MESA_FORMAT_A8B8G8R8_UNORM; case MESA_FORMAT_ETC2_R11_EAC: case MESA_FORMAT_ETC2_SIGNED_R11_EAC: - return MESA_FORMAT_R16; + return MESA_FORMAT_R_UNORM16; case MESA_FORMAT_ETC2_RG11_EAC: case MESA_FORMAT_ETC2_SIGNED_RG11_EAC: return MESA_FORMAT_GR1616; @@ -2383,8 +2383,8 @@ _mesa_format_to_type_and_comps(mesa_format format, *datatype = GL_UNSIGNED_BYTE; *comps = 4; return; - case MESA_FORMAT_RGB888: - case MESA_FORMAT_BGR888: + case MESA_FORMAT_BGR_UNORM8: + case MESA_FORMAT_RGB_UNORM8: *datatype = GL_UNSIGNED_BYTE; *comps = 3; return; @@ -2439,10 +2439,10 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 2; return; - case MESA_FORMAT_R16: - case MESA_FORMAT_A16: - case MESA_FORMAT_L16: - case MESA_FORMAT_I16: + case MESA_FORMAT_R_UNORM16: + case MESA_FORMAT_A_UNORM16: + case MESA_FORMAT_L_UNORM16: + case MESA_FORMAT_I_UNORM16: *datatype = GL_UNSIGNED_SHORT; *comps = 1; return; @@ -2452,11 +2452,11 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 3; return; - case MESA_FORMAT_A8: - case MESA_FORMAT_L8: - case MESA_FORMAT_I8: - case MESA_FORMAT_R8: - case MESA_FORMAT_S8: + case MESA_FORMAT_A_UNORM8: + case MESA_FORMAT_L_UNORM8: + case MESA_FORMAT_I_UNORM8: + case MESA_FORMAT_R_UNORM8: + case MESA_FORMAT_S_UINT8: *datatype = GL_UNSIGNED_BYTE; *comps = 1; return; @@ -2477,7 +2477,7 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 2; return; - case MESA_FORMAT_Z16: + case MESA_FORMAT_Z_UNORM16: *datatype = GL_UNSIGNED_SHORT; *comps = 1; return; @@ -2492,12 +2492,12 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 1; return; - case MESA_FORMAT_Z32: + case MESA_FORMAT_Z_UNORM32: *datatype = GL_UNSIGNED_INT; *comps = 1; return; - case MESA_FORMAT_Z32_FLOAT: + case MESA_FORMAT_Z_FLOAT32: *datatype = GL_FLOAT; *comps = 1; return; @@ -2531,7 +2531,7 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 4; return; - case MESA_FORMAT_RGBA_16: + case MESA_FORMAT_RGBA_UNORM16: *datatype = GL_UNSIGNED_SHORT; *comps = 4; return; @@ -2557,7 +2557,7 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 4; return; - case MESA_FORMAT_SRGB8: + case MESA_FORMAT_BGR_SRGB8: *datatype = GL_UNSIGNED_BYTE; *comps = 3; return; @@ -2566,7 +2566,7 @@ _mesa_format_to_type_and_comps(mesa_format format, *datatype = GL_UNSIGNED_BYTE; *comps = 4; return; - case MESA_FORMAT_SL8: + case MESA_FORMAT_L_SRGB8: *datatype = GL_UNSIGNED_BYTE; *comps = 1; return; @@ -2832,13 +2832,13 @@ _mesa_format_to_type_and_comps(mesa_format format, return; case MESA_FORMAT_XBGR8888_SRGB: - case MESA_FORMAT_XBGR8888_UINT: + case MESA_FORMAT_RGBX_UINT8: *datatype = GL_UNSIGNED_BYTE; *comps = 4; return; case MESA_FORMAT_XBGR8888_SNORM: - case MESA_FORMAT_XBGR8888_SINT: + case MESA_FORMAT_RGBX_SINT8: *datatype = GL_BYTE; *comps = 4; return; @@ -2848,34 +2848,34 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 4; return; - case MESA_FORMAT_XBGR16161616_UNORM: - case MESA_FORMAT_XBGR16161616_UINT: + case MESA_FORMAT_RGBX_UNORM16: + case MESA_FORMAT_RGBX_UINT16: *datatype = GL_UNSIGNED_SHORT; *comps = 4; return; - case MESA_FORMAT_XBGR16161616_SNORM: - case MESA_FORMAT_XBGR16161616_SINT: + case MESA_FORMAT_RGBX_SNORM16: + case MESA_FORMAT_RGBX_SINT16: *datatype = GL_SHORT; *comps = 4; return; - case MESA_FORMAT_XBGR16161616_FLOAT: + case MESA_FORMAT_RGBX_FLOAT16: *datatype = GL_HALF_FLOAT; *comps = 4; return; - case MESA_FORMAT_XBGR32323232_FLOAT: + case MESA_FORMAT_RGBX_FLOAT32: *datatype = GL_FLOAT; *comps = 4; return; - case MESA_FORMAT_XBGR32323232_UINT: + case MESA_FORMAT_RGBX_UINT32: *datatype = GL_UNSIGNED_INT; *comps = 4; return; - case MESA_FORMAT_XBGR32323232_SINT: + case MESA_FORMAT_RGBX_SINT32: *datatype = GL_INT; *comps = 4; return; @@ -3025,11 +3025,11 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, case MESA_FORMAT_X8R8G8B8_UNORM: return GL_FALSE; - case MESA_FORMAT_RGB888: - case MESA_FORMAT_SRGB8: + case MESA_FORMAT_BGR_UNORM8: + case MESA_FORMAT_BGR_SRGB8: return format == GL_BGR && type == GL_UNSIGNED_BYTE && littleEndian; - case MESA_FORMAT_BGR888: + case MESA_FORMAT_RGB_UNORM8: return format == GL_RGB && type == GL_UNSIGNED_BYTE && littleEndian; case MESA_FORMAT_RGB565: @@ -3076,18 +3076,18 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, case MESA_FORMAT_RGB332: return format == GL_RGB && type == GL_UNSIGNED_BYTE_3_3_2; - case MESA_FORMAT_A8: + case MESA_FORMAT_A_UNORM8: return format == GL_ALPHA && type == GL_UNSIGNED_BYTE; - case MESA_FORMAT_A16: + case MESA_FORMAT_A_UNORM16: return format == GL_ALPHA && type == GL_UNSIGNED_SHORT && !swapBytes; - case MESA_FORMAT_L8: - case MESA_FORMAT_SL8: + case MESA_FORMAT_L_UNORM8: + case MESA_FORMAT_L_SRGB8: return format == GL_LUMINANCE && type == GL_UNSIGNED_BYTE; - case MESA_FORMAT_L16: + case MESA_FORMAT_L_UNORM16: return format == GL_LUMINANCE && type == GL_UNSIGNED_SHORT && !swapBytes; - case MESA_FORMAT_I8: + case MESA_FORMAT_I_UNORM8: return format == GL_INTENSITY && type == GL_UNSIGNED_BYTE; - case MESA_FORMAT_I16: + case MESA_FORMAT_I_UNORM16: return format == GL_INTENSITY && type == GL_UNSIGNED_SHORT && !swapBytes; case MESA_FORMAT_YCBCR: @@ -3099,14 +3099,14 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, ((type == GL_UNSIGNED_SHORT_8_8_MESA && littleEndian == swapBytes) || (type == GL_UNSIGNED_SHORT_8_8_REV_MESA && littleEndian != swapBytes)); - case MESA_FORMAT_R8: + case MESA_FORMAT_R_UNORM8: return format == GL_RED && type == GL_UNSIGNED_BYTE; case MESA_FORMAT_GR88: return format == GL_RG && type == GL_UNSIGNED_BYTE && littleEndian; case MESA_FORMAT_RG88: return GL_FALSE; - case MESA_FORMAT_R16: + case MESA_FORMAT_R_UNORM16: return format == GL_RED && type == GL_UNSIGNED_SHORT && !swapBytes; case MESA_FORMAT_GR1616: @@ -3126,18 +3126,18 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, case MESA_FORMAT_S8_Z24: return GL_FALSE; - case MESA_FORMAT_Z16: + case MESA_FORMAT_Z_UNORM16: return format == GL_DEPTH_COMPONENT && type == GL_UNSIGNED_SHORT && !swapBytes; case MESA_FORMAT_X8_Z24: return GL_FALSE; - case MESA_FORMAT_Z32: + case MESA_FORMAT_Z_UNORM32: return format == GL_DEPTH_COMPONENT && type == GL_UNSIGNED_INT && !swapBytes; - case MESA_FORMAT_S8: + case MESA_FORMAT_S_UINT8: return format == GL_STENCIL_INDEX && type == GL_UNSIGNED_BYTE; case MESA_FORMAT_SRGB_DXT1: @@ -3346,7 +3346,7 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, return format == GL_RGB && type == GL_SHORT && !swapBytes; case MESA_FORMAT_SIGNED_RGBA_16: return format == GL_RGBA && type == GL_SHORT && !swapBytes; - case MESA_FORMAT_RGBA_16: + case MESA_FORMAT_RGBA_UNORM16: return format == GL_RGBA && type == GL_UNSIGNED_SHORT && !swapBytes; @@ -3413,7 +3413,7 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, return format == GL_RGB && type == GL_UNSIGNED_INT_10F_11F_11F_REV && !swapBytes; - case MESA_FORMAT_Z32_FLOAT: + case MESA_FORMAT_Z_FLOAT32: return format == GL_DEPTH_COMPONENT && type == GL_FLOAT && !swapBytes; case MESA_FORMAT_Z32_FLOAT_X24S8: @@ -3424,17 +3424,17 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, case MESA_FORMAT_XRGB1555_UNORM: case MESA_FORMAT_XBGR8888_SNORM: case MESA_FORMAT_XBGR8888_SRGB: - case MESA_FORMAT_XBGR8888_UINT: - case MESA_FORMAT_XBGR8888_SINT: + case MESA_FORMAT_RGBX_UINT8: + case MESA_FORMAT_RGBX_SINT8: case MESA_FORMAT_XRGB2101010_UNORM: - case MESA_FORMAT_XBGR16161616_UNORM: - case MESA_FORMAT_XBGR16161616_SNORM: - case MESA_FORMAT_XBGR16161616_FLOAT: - case MESA_FORMAT_XBGR16161616_UINT: - case MESA_FORMAT_XBGR16161616_SINT: - case MESA_FORMAT_XBGR32323232_FLOAT: - case MESA_FORMAT_XBGR32323232_UINT: - case MESA_FORMAT_XBGR32323232_SINT: + case MESA_FORMAT_RGBX_UNORM16: + case MESA_FORMAT_RGBX_SNORM16: + case MESA_FORMAT_RGBX_FLOAT16: + case MESA_FORMAT_RGBX_UINT16: + case MESA_FORMAT_RGBX_SINT16: + case MESA_FORMAT_RGBX_FLOAT32: + case MESA_FORMAT_RGBX_UINT32: + case MESA_FORMAT_RGBX_SINT32: return GL_FALSE; case MESA_FORMAT_ABGR2101010: diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 1e8ffb451b3..1e3fb8d43f5 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -61,11 +61,278 @@ typedef enum { MESA_FORMAT_NONE = 0, - /** + /** * \name Basic hardware formats + * + * The mesa format name specification is as follows: + * + * There shall be 3 naming format base types: those for component array + * formats (type A); those for compressed formats (type C); and those for packed + * component formats (type P). With type A formats, color component order does not + * change with endianess. Each format name shall begin with MESA_FORMAT_, + * followed by a component label (from the Component Label list below) for each + * component in the order that the component(s) occur in the format, except for + * non-linear color formats where the first letter shall be 'S'. For type P formats, + * each component label is followed by the number of bits that represent it in the + * fundamental data type used by the format. + * + * Following the listing of the component labels shall be an underscore; a compression + * type followed by an underscore for Type C formats only; a storage type from the list + * below; and a bit with for type A formats, which is the bit width for each array element. + * + * + * ---------- Format Base Type A: Array ---------- + * MESA_FORMAT_[component list]_[storage type][array element bit width] + * + * examples: + * MESA_FORMAT_A_SNORM8 - uchar[i] = A + * MESA_FORMAT_RGBA_16 - ushort[i * 4 + 0] = R, ushort[i * 4 + 1] = G, + * ushort[i * 4 + 2] = B, ushort[i * 4 + 3] = A + * MESA_FORMAT_Z_UNORM32 - float[i] = Z + * + * + * + * ---------- Format Base Type C: Compressed ---------- + * MESA_FORMAT_[component list*][_*][compression type][storage type*] + * * where required + * + * examples: + * MESA_FORMAT_RGB_ETC1 + * MESA_FORMAT_RGBA_ETC2 + * MESA_FORMAT_LATC1_UNORM + * MESA_FORMAT_RGBA_FXT1 + * + * + * + * ---------- Format Base Type P: Packed ---------- + * MESA_FORMAT_[[component list,bit width][storage type*][_]][_][storage type**] + * * when type differs between component + * ** when type applies to all components + * + * examples: msb <------ TEXEL BITS -----------> lsb + * MESA_FORMAT_A8B8G8R8_UNORM, AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR + * MESA_FORMAT_R5G6B5_UNORM RRRR RGGG GGGB BBBB + * MESA_FORMAT_B4G4R4X4_UNORM BBBB GGGG RRRR XXXX + * MESA_FORMAT_Z32_FLOAT_S8X24_UINT + * MESA_FORMAT_R10G10B10A2_UINT + * MESA_FORMAT_R9G9B9E5_FLOAT + * + * + * + * ---------- Component Labels: ---------- + * A - Alpha + * B - Blue + * DU - Delta U + * DV - Delta V + * E - Shared Exponent + * G - Green + * I - Intensity + * L - Luminance + * R - Red + * S - Stencil (when not followed by RGB or RGBA) + * U - Chrominance + * V - Chrominance + * Y - Luma + * X - Packing bits + * Z - Depth + * + * + * + * ---------- Type C Compression Types: ---------- + * DXT1 - Color component labels shall be given + * DXT3 - Color component labels shall be given + * DXT5 - Color component labels shall be given + * ETC1 - No other information required + * ETC2 - No other information required + * FXT1 - Color component labels shall be given + * FXT3 - Color component labels shall be given + * LATC1 - Fundamental data type shall be given + * LATC2 - Fundamental data type shall be given + * RGTC1 - Color component labels and data type shall be given + * RGTC2 - Color component labels and data type shall be given + * + * + * + * ---------- Storage Types: ---------- + * FLOAT + * SINT + * UINT + * SNORM + * UNORM + * SRGB - RGB components, or L are UNORMs in sRGB color space. Alpha, if present is linear. + * + * + * ---------- Type A Format List (based on format_unpack.c): + * BGR_UNORM8 + * RGB_UNORM8 + * A_UNORM8 + * A_UNORM16 + * L_UNORM8 + * L_UNORM16 + * I_UNORM8 + * I_UNOMR16 + * R_UNORM8 + * R_UNORM16 + * Z_UNORM16 + * Z_UNORM32 + * Z_FLOAT32 + * S_UINT8 + * BGR_SRGB8 + * L_SRGB8 + * RGBA_FLOAT32 + * RGBA_FLOAT16 + * RGB_FLOAT32 + * RGB_FLOAT16 + * A_FLOAT32 + * A_FLOAT16 + * L_FLOAT32 + * L_FLOAT16 + * LA_FLOAT32 + * LA_FLOAT16 + * I_FLOAT32 + * I_FLOAT16 + * R_FLOAT32 + * R_FLOAT16 + * RG_FLOAT32 + * RG_FLOAT16 + * A_UINT8 + * A_UINT16 + * A_UINT32 + * A_SINT8 + * A_SINT16 + * A_SINT32 + * I_UINT8 + * I_UINT16 + * I_UINT32 + * I_SINT8 + * I_SINT16 + * I_SINT32 + * L_UINT8 + * L_UINT16 + * L_UINT32 + * L_SINT8 + * L_SINT16 + * L_SINT32 + * LA_UINT8 + * LA_UINT16 + * LA_UINT32 + * LA_SINT8 + * LA_SINT16 + * LA_SINT32 + * R_SINT8 + * RG_SINT8 + * RGB_SINT8 + * RGBA_SINT8 + * R_SINT16 + * RG_SINT16 + * RGB_SINT16 + * RGBA_SINT16 + * R_SINT32 + * RG_SINT32 + * RGB_SINT32 + * RGBA_SINT32 + * R_SINT16 + * R_SINT32 + * R_UINT8 + * RG_UINT8 + * RGB_UINT8 + * RGBA_UINT8 + * R_UINT16 + * RG_UINT16 + * RGB_UINT16 + * RGBA_UINT16 + * R_UINT32 + * RG_UINT32 + * RGB_UINT32 + * RGBA_UINT32 + * R_UINT16 + * R_UINT32 + * R_SNORM8 + * R_SNORM16 + * RGB_SNORM16 + * RGBA_SNORM16 + * RGBA_UNORM16 + * A_SNORM8 + * L_SNORM8 + * I_SNORM8 + * A_SNORM16 + * L_SNORM16 + * LA_SNORM16 + * I_SNORM16 + * RGBX_UINT8 + * RGBX_SINT8 + * RGBX_UNORM16 + * RGBX_SNORM16 + * RGBX_FLOAT16 + * RGBX_UINT16 + * RGBX_SINT16 + * RGBX_FLOAT32 + * RGBX_UINT32 + * RGBX_SINT32 + * + * + * + * ---------- Type P Format List (based on format_unpack.c): + * A8B8G8R8_UNORM + * R8G8B8A8_UNORM + * B8G8R8A8_UNORM + * A8R8G8B8_UNORM + * X8B8G8R8_UNORM + * R8G8B8X8_UNORM + * B8G8R8X8_UNORM + * X8R8G8B8_UNORM + * B5G6R5_UNORM + * R5G6B5_UNORM + * B4G4R4A4_UNORM + * A4R4G4B4_UNORM + * A1B5G5R5_UNORM + * B5G5R5A1_UNORM + * A1R5G5B5_UNORM + * L4A4_UNORM + * L8A8_UNORM + * A8L8_UNORM + * L16A16_UNORM + * A16L16_UNORM + * B2G3R3_UNORM + * YCBCR + * YCBCR_REV + * R8G8_UNORM + * G8R8_UNORM + * R16G16_UNORM + * G16R16_UNORM + * B10G10R10A2_UNORM + * B10G10R10A2_UINT + * R10G10B10A2_UINT + * S8_UINT_Z24_UNORM + * Z24_UNORM_S8_UINT + * Z24_UNORM_X8_UINT + * X8_UINT_Z24_UNORM + * Z32_FLOAT_S8X24_UINT + * A8R8G8B8_SRGB + * B8G8R8A8_SRGB + * L8A8_SRGB + * R8G8_SNORM + * X8B8G8R8_SNORM + * A8B8G8R8_SNORM + * R8G8B8A8_SNORM + * R16G16_SNORM + * L8A8_SNORM + * R9G9B9E5_FLOAT + * R11G11B10_FLOAT + * B4G4R4X4_UNORM + * B5G5R5X1_UNORM + * R8G8_SNORM + * R8G8B8X8_SNORM + * R8G8B8X8_SRGB + * B10G10R10X2_UNORM + * R10G10B10A2_UNORM + * G8R8_SINT + * G16R16_SINT + * */ /*@{*/ - /* msb <------ TEXEL BITS -----------> lsb */ + + /* Type P formats */ /* msb <------ TEXEL BITS -----------> lsb */ /* ---- ---- ---- ---- ---- ---- ---- ---- */ MESA_FORMAT_A8B8G8R8_UNORM, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */ MESA_FORMAT_R8G8B8A8_UNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */ @@ -75,8 +342,12 @@ typedef enum MESA_FORMAT_R8G8B8X8_UNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB xxxx xxxx */ MESA_FORMAT_B8G8R8X8_UNORM, /* BBBB BBBB GGGG GGGG RRRR RRRR xxxx xxxx */ MESA_FORMAT_X8R8G8B8_UNORM, /* xxxx xxxx RRRR RRRR GGGG GGGG BBBB BBBB */ - MESA_FORMAT_RGB888, /* RRRR RRRR GGGG GGGG BBBB BBBB */ - MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */ + + /* Type A formats */ + MESA_FORMAT_BGR_UNORM8, /* uchar[i * 3] = B, [i * 3 + 1] = G, [i *3 + 2] = R */ + MESA_FORMAT_RGB_UNORM8, /* uchar[i * 3] = R, [i * 3 + 1] = G, [i *3 + 2] = B */ + + /* Type P formats */ MESA_FORMAT_RGB565, /* RRRR RGGG GGGB BBBB */ MESA_FORMAT_RGB565_REV, /* GGGB BBBB RRRR RGGG */ MESA_FORMAT_ARGB4444, /* AAAA RRRR GGGG BBBB */ @@ -90,39 +361,66 @@ typedef enum MESA_FORMAT_AL1616, /* AAAA AAAA AAAA AAAA LLLL LLLL LLLL LLLL */ MESA_FORMAT_AL1616_REV, /* LLLL LLLL LLLL LLLL AAAA AAAA AAAA AAAA */ MESA_FORMAT_RGB332, /* RRRG GGBB */ - MESA_FORMAT_A8, /* AAAA AAAA */ - MESA_FORMAT_A16, /* AAAA AAAA AAAA AAAA */ - MESA_FORMAT_L8, /* LLLL LLLL */ - MESA_FORMAT_L16, /* LLLL LLLL LLLL LLLL */ - MESA_FORMAT_I8, /* IIII IIII */ - MESA_FORMAT_I16, /* IIII IIII IIII IIII */ + + /* Type A formats */ + MESA_FORMAT_A_UNORM8, /* uchar[i] = A */ + MESA_FORMAT_A_UNORM16, /* ushort[i] = A */ + MESA_FORMAT_L_UNORM8, /* uchar[i] = L */ + MESA_FORMAT_L_UNORM16, /* ushort[i] = L */ + MESA_FORMAT_I_UNORM8, /* uchar[i] = I */ + MESA_FORMAT_I_UNORM16, /* ushort[i] = I */ + + /* Type P formats */ MESA_FORMAT_YCBCR, /* YYYY YYYY UorV UorV */ MESA_FORMAT_YCBCR_REV, /* UorV UorV YYYY YYYY */ - MESA_FORMAT_R8, /* RRRR RRRR */ + + /* Type A format(s) */ + MESA_FORMAT_R_UNORM8, /* uchar[i] = R */ + + /* Type P formats */ MESA_FORMAT_GR88, /* GGGG GGGG RRRR RRRR */ MESA_FORMAT_RG88, /* RRRR RRRR GGGG GGGG */ - MESA_FORMAT_R16, /* RRRR RRRR RRRR RRRR */ + + /* Type A format(s) */ + MESA_FORMAT_R_UNORM16, /* ushort[i] = R */ + + /* Type P formats */ MESA_FORMAT_GR1616, /* GGGG GGGG GGGG GGGG RRRR RRRR RRRR RRRR */ MESA_FORMAT_RG1616, /* RRRR RRRR RRRR RRRR GGGG GGGG GGGG GGGG */ MESA_FORMAT_ARGB2101010, /* AARR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */ MESA_FORMAT_Z24_S8, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ SSSS SSSS */ MESA_FORMAT_S8_Z24, /* SSSS SSSS ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ - MESA_FORMAT_Z16, /* ZZZZ ZZZZ ZZZZ ZZZZ */ + + /* Type A format(s) */ + MESA_FORMAT_Z_UNORM16, /* ushort[i] = Z */ + + /* Type P formats */ MESA_FORMAT_X8_Z24, /* xxxx xxxx ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ MESA_FORMAT_Z24_X8, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ xxxx xxxx */ - MESA_FORMAT_Z32, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ - MESA_FORMAT_S8, /* SSSS SSSS */ + + /* Type A formats */ + MESA_FORMAT_Z_UNORM32, /* uint[i] = Z */ + MESA_FORMAT_S_UINT8, /* uchar[i] = S */ /*@}*/ /** * \name 8-bit/channel sRGB formats */ /*@{*/ - MESA_FORMAT_SRGB8, /* RRRR RRRR GGGG GGGG BBBB BBBB */ + /* Type A format(s) */ + MESA_FORMAT_BGR_SRGB8, /* uchar[i * 3] = B, [i * 3 + 1] = G, [i *3 + 2] = R */ + + /* Type P formats */ MESA_FORMAT_SRGBA8, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */ MESA_FORMAT_SARGB8, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */ - MESA_FORMAT_SL8, /* LLLL LLLL */ + + /* Type A format(s) */ + MESA_FORMAT_L_SRGB8, /* uchar[i] = L */ + + /* Type P formats */ MESA_FORMAT_SLA8, /* AAAA AAAA LLLL LLLL */ + + /* Type C formats */ MESA_FORMAT_SRGB_DXT1, MESA_FORMAT_SRGBA_DXT1, MESA_FORMAT_SRGBA_DXT3, @@ -133,6 +431,7 @@ typedef enum * \name Compressed texture formats. */ /*@{*/ + /* Type C formats */ MESA_FORMAT_RGB_FXT1, MESA_FORMAT_RGBA_FXT1, MESA_FORMAT_RGB_DXT1, @@ -145,7 +444,9 @@ typedef enum * \name Floating point texture formats. */ /*@{*/ - MESA_FORMAT_RGBA_FLOAT32, + + /* Type A formats */ + MESA_FORMAT_RGBA_FLOAT32, /* float[i * 4] = R, [i * 4 + 1] = G, [i * 4 + 2] = B, [i * 4 + 3] = A */ MESA_FORMAT_RGBA_FLOAT16, MESA_FORMAT_RGB_FLOAT32, MESA_FORMAT_RGB_FLOAT16, @@ -168,6 +469,8 @@ typedef enum * XXX Note: these are just stand-ins for some better hardware * formats TBD such as BGRA or ARGB. */ + + /* Type A formats */ MESA_FORMAT_ALPHA_UINT8, MESA_FORMAT_ALPHA_UINT16, MESA_FORMAT_ALPHA_UINT32, @@ -188,7 +491,6 @@ typedef enum MESA_FORMAT_LUMINANCE_INT8, MESA_FORMAT_LUMINANCE_INT16, MESA_FORMAT_LUMINANCE_INT32, - MESA_FORMAT_LUMINANCE_ALPHA_UINT8, MESA_FORMAT_LUMINANCE_ALPHA_UINT16, MESA_FORMAT_LUMINANCE_ALPHA_UINT32, @@ -204,6 +506,7 @@ typedef enum MESA_FORMAT_RG_INT16, MESA_FORMAT_RGB_INT16, MESA_FORMAT_RGBA_INT16, + MESA_FORMAT_R_INT32, MESA_FORMAT_RG_INT32, MESA_FORMAT_RGB_INT32, @@ -212,14 +515,17 @@ typedef enum /** * \name Non-normalized unsigned integer formats. */ + /* Type A format(s) */ MESA_FORMAT_R_UINT8, MESA_FORMAT_RG_UINT8, MESA_FORMAT_RGB_UINT8, MESA_FORMAT_RGBA_UINT8, + MESA_FORMAT_R_UINT16, MESA_FORMAT_RG_UINT16, MESA_FORMAT_RGB_UINT16, MESA_FORMAT_RGBA_UINT16, + MESA_FORMAT_R_UINT32, MESA_FORMAT_RG_UINT32, MESA_FORMAT_RGB_UINT32, @@ -232,19 +538,30 @@ typedef enum */ /*@{*/ MESA_FORMAT_DUDV8, /* DUDU DUDU DVDV DVDV */ + + /* Type A format(s) */ MESA_FORMAT_SIGNED_R8, /* RRRR RRRR */ + + /* Type P formats */ MESA_FORMAT_SIGNED_RG88_REV, /* GGGG GGGG RRRR RRRR */ MESA_FORMAT_SIGNED_RGBX8888, /* RRRR RRRR GGGG GGGG BBBB BBBB xxxx xxxx */ MESA_FORMAT_SIGNED_RGBA8888, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */ MESA_FORMAT_SIGNED_RGBA8888_REV,/*AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */ + + /* Type A format(s) */ MESA_FORMAT_SIGNED_R16, /* RRRR RRRR RRRR RRRR */ + + /* Type P format(s) */ MESA_FORMAT_SIGNED_GR1616, /* GGGG GGGG GGGG GGGG RRRR RRRR RRRR RRRR */ + + /* Type A format(s) */ MESA_FORMAT_SIGNED_RGB_16, /* ushort[0]=R, ushort[1]=G, ushort[2]=B */ MESA_FORMAT_SIGNED_RGBA_16, /* ... */ - MESA_FORMAT_RGBA_16, /* ... */ + MESA_FORMAT_RGBA_UNORM16, /* ... */ /*@}*/ /*@{*/ + /* Type C formats */ MESA_FORMAT_RED_RGTC1, MESA_FORMAT_SIGNED_RED_RGTC1, MESA_FORMAT_RG_RGTC2, @@ -270,19 +587,28 @@ typedef enum MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1, MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1, + /* Type A format(s) */ MESA_FORMAT_SIGNED_A8, /* AAAA AAAA */ MESA_FORMAT_SIGNED_L8, /* LLLL LLLL */ + + /* Type P format(s) */ MESA_FORMAT_SIGNED_AL88, /* AAAA AAAA LLLL LLLL */ + + /* Type A format(s) */ MESA_FORMAT_SIGNED_I8, /* IIII IIII */ MESA_FORMAT_SIGNED_A16, /* AAAA AAAA AAAA AAAA */ MESA_FORMAT_SIGNED_L16, /* LLLL LLLL LLLL LLLL */ MESA_FORMAT_SIGNED_AL1616, /* AAAA AAAA AAAA AAAA LLLL LLLL LLLL LLLL */ MESA_FORMAT_SIGNED_I16, /* IIII IIII IIII IIII */ + /* Type P format(s) */ MESA_FORMAT_RGB9_E5_FLOAT, MESA_FORMAT_R11_G11_B10_FLOAT, - MESA_FORMAT_Z32_FLOAT, + /* Type A format(s) */ + MESA_FORMAT_Z_FLOAT32, + + /* Type P formats */ MESA_FORMAT_Z32_FLOAT_X24S8, MESA_FORMAT_ARGB2101010_UINT, @@ -292,20 +618,27 @@ typedef enum MESA_FORMAT_XRGB1555_UNORM, /* xRRR RRGG GGGB BBBB */ MESA_FORMAT_XBGR8888_SNORM, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */ MESA_FORMAT_XBGR8888_SRGB, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */ - MESA_FORMAT_XBGR8888_UINT, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */ - MESA_FORMAT_XBGR8888_SINT, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */ + + /* Type A formats */ + MESA_FORMAT_RGBX_UINT8, /* uchar[i * 4] = R, [i * 4 + 1] = G, [i * 4 + 2] = B, [i * 4 + 3] = x */ + MESA_FORMAT_RGBX_SINT8, /* char[i * 4] = R, [i * 4 + 1] = G, [i * 4 + 2] = B, [i * 4 + 3] = x */ + + /* Type P format(s) */ MESA_FORMAT_XRGB2101010_UNORM, /* xxRR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */ - MESA_FORMAT_XBGR16161616_UNORM,/* ushort[3]=x, [2]=B, [1]=G, [0]=R */ - MESA_FORMAT_XBGR16161616_SNORM,/* ... */ - MESA_FORMAT_XBGR16161616_FLOAT,/* ... */ - MESA_FORMAT_XBGR16161616_UINT, /* ... */ - MESA_FORMAT_XBGR16161616_SINT, /* ... */ - MESA_FORMAT_XBGR32323232_FLOAT,/* float[3]=x, [2]=B, [1]=G, [0]=R */ - MESA_FORMAT_XBGR32323232_UINT, /* ... */ - MESA_FORMAT_XBGR32323232_SINT, /* ... */ - MESA_FORMAT_ABGR2101010, + /* Type A format(s) */ + MESA_FORMAT_RGBX_UNORM16, /* ushort[i * 4] = R, [i * 4 + 1] = G, [i * 4 + 2] = B, [i * 4 + 3] = x */ + MESA_FORMAT_RGBX_SNORM16, /* ... */ + MESA_FORMAT_RGBX_FLOAT16, /* ... */ + MESA_FORMAT_RGBX_UINT16, /* ... */ + MESA_FORMAT_RGBX_SINT16, /* ... */ + MESA_FORMAT_RGBX_FLOAT32, /* float[i * 4] = R, [i * 4 + 1] = G, [i * 4 + 2] = B, [i * 4 + 3] = x */ + MESA_FORMAT_RGBX_UINT32, /* ... */ + MESA_FORMAT_RGBX_SINT32, /* ... */ + + /* Type P formats */ + MESA_FORMAT_ABGR2101010, MESA_FORMAT_SIGNED_RG88, MESA_FORMAT_SIGNED_RG1616, diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c index 3468672d8eb..824607ae31a 100644 --- a/src/mesa/main/shaderimage.c +++ b/src/mesa/main/shaderimage.c @@ -140,7 +140,7 @@ get_image_format(GLenum format) return MESA_FORMAT_R_INT8; case GL_RGBA16: - return MESA_FORMAT_RGBA_16; + return MESA_FORMAT_RGBA_UNORM16; case GL_RGB10_A2: return MESA_FORMAT_ABGR2101010; @@ -155,10 +155,10 @@ get_image_format(GLenum format) return MESA_FORMAT_RG_8; case GL_R16: - return MESA_FORMAT_R16; + return MESA_FORMAT_R_UNORM16; case GL_R8: - return MESA_FORMAT_R8; + return MESA_FORMAT_R_UNORM8; case GL_RGBA16_SNORM: return MESA_FORMAT_SIGNED_RGBA_16; @@ -286,7 +286,7 @@ get_image_format_class(mesa_format format) case MESA_FORMAT_R_INT8: return IMAGE_FORMAT_CLASS_1X8; - case MESA_FORMAT_RGBA_16: + case MESA_FORMAT_RGBA_UNORM16: return IMAGE_FORMAT_CLASS_4X16; case MESA_FORMAT_ABGR2101010: @@ -301,10 +301,10 @@ get_image_format_class(mesa_format format) case MESA_FORMAT_RG_8: return IMAGE_FORMAT_CLASS_2X8; - case MESA_FORMAT_R16: + case MESA_FORMAT_R_UNORM16: return IMAGE_FORMAT_CLASS_1X16; - case MESA_FORMAT_R8: + case MESA_FORMAT_R_UNORM8: return IMAGE_FORMAT_CLASS_1X8; case MESA_FORMAT_SIGNED_RGBA_16: diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 93a6b6d742a..ab31d3ebc1a 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -102,8 +102,8 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, break; case GL_RGBA12: case GL_RGBA16: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UNORM16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UNORM16); RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_UNORM); RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM); break; @@ -116,7 +116,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, } /* fallthrough */ case GL_RGB8: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888); + RETURN_IF_SUPPORTED(MESA_FORMAT_BGR_UNORM8); RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8X8_UNORM); RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM); break; @@ -124,7 +124,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, RETURN_IF_SUPPORTED(MESA_FORMAT_RGB332); RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565); RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565_REV); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888); + RETURN_IF_SUPPORTED(MESA_FORMAT_BGR_UNORM8); RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8X8_UNORM); RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM); break; @@ -140,8 +140,8 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_RGB10: case GL_RGB12: case GL_RGB16: - RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_UNORM); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_UNORM16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UNORM16); RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8X8_UNORM); RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM); break; @@ -150,13 +150,13 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_ALPHA: case GL_ALPHA4: case GL_ALPHA8: - RETURN_IF_SUPPORTED(MESA_FORMAT_A8); + RETURN_IF_SUPPORTED(MESA_FORMAT_A_UNORM8); break; case GL_ALPHA12: case GL_ALPHA16: - RETURN_IF_SUPPORTED(MESA_FORMAT_A16); - RETURN_IF_SUPPORTED(MESA_FORMAT_A8); + RETURN_IF_SUPPORTED(MESA_FORMAT_A_UNORM16); + RETURN_IF_SUPPORTED(MESA_FORMAT_A_UNORM8); break; /* Luminance formats */ @@ -164,13 +164,13 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_LUMINANCE: case GL_LUMINANCE4: case GL_LUMINANCE8: - RETURN_IF_SUPPORTED(MESA_FORMAT_L8); + RETURN_IF_SUPPORTED(MESA_FORMAT_L_UNORM8); break; case GL_LUMINANCE12: case GL_LUMINANCE16: - RETURN_IF_SUPPORTED(MESA_FORMAT_L16); - RETURN_IF_SUPPORTED(MESA_FORMAT_L8); + RETURN_IF_SUPPORTED(MESA_FORMAT_L_UNORM16); + RETURN_IF_SUPPORTED(MESA_FORMAT_L_UNORM8); break; /* Luminance/Alpha formats */ @@ -196,39 +196,39 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_INTENSITY: case GL_INTENSITY4: case GL_INTENSITY8: - RETURN_IF_SUPPORTED(MESA_FORMAT_I8); + RETURN_IF_SUPPORTED(MESA_FORMAT_I_UNORM8); break; case GL_INTENSITY12: case GL_INTENSITY16: - RETURN_IF_SUPPORTED(MESA_FORMAT_I16); - RETURN_IF_SUPPORTED(MESA_FORMAT_I8); + RETURN_IF_SUPPORTED(MESA_FORMAT_I_UNORM16); + RETURN_IF_SUPPORTED(MESA_FORMAT_I_UNORM8); break; case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT32: - RETURN_IF_SUPPORTED(MESA_FORMAT_Z32); + RETURN_IF_SUPPORTED(MESA_FORMAT_Z_UNORM32); RETURN_IF_SUPPORTED(MESA_FORMAT_X8_Z24); RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24); break; case GL_DEPTH_COMPONENT16: - RETURN_IF_SUPPORTED(MESA_FORMAT_Z16); + RETURN_IF_SUPPORTED(MESA_FORMAT_Z_UNORM16); RETURN_IF_SUPPORTED(MESA_FORMAT_X8_Z24); RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24); break; case GL_COMPRESSED_ALPHA_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_A8); + RETURN_IF_SUPPORTED(MESA_FORMAT_A_UNORM8); break; case GL_COMPRESSED_LUMINANCE_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_L8); + RETURN_IF_SUPPORTED(MESA_FORMAT_L_UNORM8); break; case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); break; case GL_COMPRESSED_INTENSITY_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_I8); + RETURN_IF_SUPPORTED(MESA_FORMAT_I_UNORM8); break; case GL_COMPRESSED_RGB_ARB: /* We don't use texture compression for 1D and 1D array textures. @@ -243,7 +243,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_DXT1); RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FXT1); } - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888); + RETURN_IF_SUPPORTED(MESA_FORMAT_BGR_UNORM8); RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8X8_UNORM); RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM); break; @@ -392,14 +392,14 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, break; case GL_RGB16F_ARB: RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_FLOAT); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_FLOAT16); RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT32); RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); break; case GL_RGB32F_ARB: RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR32323232_FLOAT); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_FLOAT32); RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32); RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT16); RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16); @@ -430,8 +430,8 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, break; case GL_DEPTH_COMPONENT32F: - ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT]); - return MESA_FORMAT_Z32_FLOAT; + ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_Z_FLOAT32]); + return MESA_FORMAT_Z_FLOAT32; case GL_DEPTH32F_STENCIL8: ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT_X24S8]); return MESA_FORMAT_Z32_FLOAT_X24S8; @@ -491,7 +491,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, break; case GL_RGB16_SNORM: RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGB_16); - RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_SNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_SNORM16); /* FALLTHROUGH */ case GL_RGBA16_SNORM: RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16); @@ -522,7 +522,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_SRGB_EXT: case GL_SRGB8_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB8); + RETURN_IF_SUPPORTED(MESA_FORMAT_BGR_SRGB8); RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); break; case GL_SRGB_ALPHA_EXT: @@ -532,7 +532,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, break; case GL_SLUMINANCE_EXT: case GL_SLUMINANCE8_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_SL8); + RETURN_IF_SUPPORTED(MESA_FORMAT_L_SRGB8); RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); break; case GL_SLUMINANCE_ALPHA_EXT: @@ -541,7 +541,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); break; case GL_COMPRESSED_SLUMINANCE_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_SL8); + RETURN_IF_SUPPORTED(MESA_FORMAT_L_SRGB8); RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); break; case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: @@ -551,7 +551,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_COMPRESSED_SRGB_EXT: if (ctx->Mesa_DXTn) RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB_DXT1); - RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB8); + RETURN_IF_SUPPORTED(MESA_FORMAT_BGR_SRGB8); RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); break; case GL_COMPRESSED_SRGB_ALPHA_EXT: @@ -660,32 +660,32 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_RGB8UI_EXT: RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT8); - RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR8888_UINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_UINT8); RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8); break; case GL_RGB16UI_EXT: RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_UINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_UINT16); RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT16); break; case GL_RGB32UI_EXT: RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR32323232_UINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_UINT32); RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT32); break; case GL_RGB8I_EXT: RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_INT8); - RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR8888_SINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_SINT8); RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8); break; case GL_RGB16I_EXT: RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_INT16); - RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_SINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_SINT16); RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16); break; case GL_RGB32I_EXT: RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_INT32); - RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR32323232_SINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_SINT32); RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32); break; case GL_RGBA8UI_EXT: @@ -709,17 +709,17 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_R8: case GL_RED: - RETURN_IF_SUPPORTED(MESA_FORMAT_R8); + RETURN_IF_SUPPORTED(MESA_FORMAT_R_UNORM8); break; case GL_COMPRESSED_RED: if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) RETURN_IF_SUPPORTED(MESA_FORMAT_RED_RGTC1); - RETURN_IF_SUPPORTED(MESA_FORMAT_R8); + RETURN_IF_SUPPORTED(MESA_FORMAT_R_UNORM8); break; case GL_R16: - RETURN_IF_SUPPORTED(MESA_FORMAT_R16); + RETURN_IF_SUPPORTED(MESA_FORMAT_R_UNORM16); break; case GL_RG: diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 023aef4e6eb..03e44759ad0 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -4014,9 +4014,9 @@ get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat) if (ctx->API != API_OPENGL_CORE) { switch (internalFormat) { case GL_ALPHA8: - return MESA_FORMAT_A8; + return MESA_FORMAT_A_UNORM8; case GL_ALPHA16: - return MESA_FORMAT_A16; + return MESA_FORMAT_A_UNORM16; case GL_ALPHA16F_ARB: return MESA_FORMAT_ALPHA_FLOAT16; case GL_ALPHA32F_ARB: @@ -4034,9 +4034,9 @@ get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat) case GL_ALPHA32UI_EXT: return MESA_FORMAT_ALPHA_UINT32; case GL_LUMINANCE8: - return MESA_FORMAT_L8; + return MESA_FORMAT_L_UNORM8; case GL_LUMINANCE16: - return MESA_FORMAT_L16; + return MESA_FORMAT_L_UNORM16; case GL_LUMINANCE16F_ARB: return MESA_FORMAT_LUMINANCE_FLOAT16; case GL_LUMINANCE32F_ARB: @@ -4074,9 +4074,9 @@ get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat) case GL_LUMINANCE_ALPHA32UI_EXT: return MESA_FORMAT_LUMINANCE_ALPHA_UINT32; case GL_INTENSITY8: - return MESA_FORMAT_I8; + return MESA_FORMAT_I_UNORM8; case GL_INTENSITY16: - return MESA_FORMAT_I16; + return MESA_FORMAT_I_UNORM16; case GL_INTENSITY16F_ARB: return MESA_FORMAT_INTENSITY_FLOAT16; case GL_INTENSITY32F_ARB: @@ -4116,7 +4116,7 @@ get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat) case GL_RGBA8: return MESA_FORMAT_R8G8B8A8_UNORM; case GL_RGBA16: - return MESA_FORMAT_RGBA_16; + return MESA_FORMAT_RGBA_UNORM16; case GL_RGBA16F_ARB: return MESA_FORMAT_RGBA_FLOAT16; case GL_RGBA32F_ARB: @@ -4156,9 +4156,9 @@ get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat) return MESA_FORMAT_RG_UINT32; case GL_R8: - return MESA_FORMAT_R8; + return MESA_FORMAT_R_UNORM8; case GL_R16: - return MESA_FORMAT_R16; + return MESA_FORMAT_R_UNORM16; case GL_R16F: return MESA_FORMAT_R_FLOAT16; case GL_R32F: diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 863b63399a9..8f521147712 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -156,7 +156,7 @@ _mesa_initialize_texture_object( struct gl_context *ctx, obj->_Swizzle = SWIZZLE_NOOP; obj->Sampler.sRGBDecode = GL_DECODE_EXT; obj->BufferObjectFormat = GL_R8; - obj->_BufferObjectFormat = MESA_FORMAT_R8; + obj->_BufferObjectFormat = MESA_FORMAT_R_UNORM8; obj->ImageFormatCompatibilityType = GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE; } diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 258b66e829d..4c1d789eb76 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1012,11 +1012,11 @@ _mesa_texstore_z32(TEXSTORE_PARAMS) const GLuint depthScale = 0xffffffff; GLenum dstType; (void) dims; - ASSERT(dstFormat == MESA_FORMAT_Z32 || - dstFormat == MESA_FORMAT_Z32_FLOAT); + ASSERT(dstFormat == MESA_FORMAT_Z_UNORM32 || + dstFormat == MESA_FORMAT_Z_FLOAT32); ASSERT(_mesa_get_format_bytes(dstFormat) == sizeof(GLuint)); - if (dstFormat == MESA_FORMAT_Z32) + if (dstFormat == MESA_FORMAT_Z_UNORM32) dstType = GL_UNSIGNED_INT; else dstType = GL_FLOAT; @@ -1112,7 +1112,7 @@ _mesa_texstore_z16(TEXSTORE_PARAMS) { const GLuint depthScale = 0xffff; (void) dims; - ASSERT(dstFormat == MESA_FORMAT_Z16); + ASSERT(dstFormat == MESA_FORMAT_Z_UNORM16); ASSERT(_mesa_get_format_bytes(dstFormat) == sizeof(GLushort)); { @@ -1401,7 +1401,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgb888(TEXSTORE_PARAMS) { - ASSERT(dstFormat == MESA_FORMAT_RGB888); + ASSERT(dstFormat == MESA_FORMAT_BGR_UNORM8); ASSERT(_mesa_get_format_bytes(dstFormat) == 3); if (!ctx->_ImageTransferState && @@ -1463,7 +1463,7 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_bgr888(TEXSTORE_PARAMS) { - ASSERT(dstFormat == MESA_FORMAT_BGR888); + ASSERT(dstFormat == MESA_FORMAT_RGB_UNORM8); ASSERT(_mesa_get_format_bytes(dstFormat) == 3); if (!ctx->_ImageTransferState && @@ -1780,10 +1780,10 @@ _mesa_texstore_unorm16(TEXSTORE_PARAMS) { const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_R16 || - dstFormat == MESA_FORMAT_A16 || - dstFormat == MESA_FORMAT_L16 || - dstFormat == MESA_FORMAT_I16); + ASSERT(dstFormat == MESA_FORMAT_R_UNORM16 || + dstFormat == MESA_FORMAT_A_UNORM16 || + dstFormat == MESA_FORMAT_L_UNORM16 || + dstFormat == MESA_FORMAT_I_UNORM16); ASSERT(_mesa_get_format_bytes(dstFormat) == 2); { @@ -1822,8 +1822,8 @@ _mesa_texstore_unorm16(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgba_16(TEXSTORE_PARAMS) { - ASSERT(dstFormat == MESA_FORMAT_RGBA_16 || - dstFormat == MESA_FORMAT_XBGR16161616_UNORM); + ASSERT(dstFormat == MESA_FORMAT_RGBA_UNORM16 || + dstFormat == MESA_FORMAT_RGBX_UNORM16); ASSERT(_mesa_get_format_bytes(dstFormat) == 8); { @@ -1876,7 +1876,7 @@ _mesa_texstore_signed_rgba_16(TEXSTORE_PARAMS) ASSERT(dstFormat == MESA_FORMAT_SIGNED_RGB_16 || dstFormat == MESA_FORMAT_SIGNED_RGBA_16 || - dstFormat == MESA_FORMAT_XBGR16161616_SNORM); + dstFormat == MESA_FORMAT_RGBX_SNORM16); { /* general path */ @@ -1913,7 +1913,7 @@ _mesa_texstore_signed_rgba_16(TEXSTORE_PARAMS) dstRow += dstRowStride; src += 4 * srcWidth; } - else if (dstFormat == MESA_FORMAT_XBGR16161616_SNORM) { + else if (dstFormat == MESA_FORMAT_RGBX_SNORM16) { for (col = 0; col < srcWidth; col++) { GLuint c; @@ -1955,10 +1955,10 @@ _mesa_texstore_unorm8(TEXSTORE_PARAMS) { const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_A8 || - dstFormat == MESA_FORMAT_L8 || - dstFormat == MESA_FORMAT_I8 || - dstFormat == MESA_FORMAT_R8); + ASSERT(dstFormat == MESA_FORMAT_A_UNORM8 || + dstFormat == MESA_FORMAT_L_UNORM8 || + dstFormat == MESA_FORMAT_I_UNORM8 || + dstFormat == MESA_FORMAT_R_UNORM8); ASSERT(_mesa_get_format_bytes(dstFormat) == 1); if (!ctx->_ImageTransferState && @@ -1969,7 +1969,7 @@ _mesa_texstore_unorm8(TEXSTORE_PARAMS) /* dstmap - how to swizzle from RGBA to dst format: */ - if (dstFormat == MESA_FORMAT_A8) { + if (dstFormat == MESA_FORMAT_A_UNORM8) { dstmap[0] = 3; } else { @@ -2634,7 +2634,7 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_s8(TEXSTORE_PARAMS) { - ASSERT(dstFormat == MESA_FORMAT_S8); + ASSERT(dstFormat == MESA_FORMAT_S_UINT8); ASSERT(srcFormat == GL_STENCIL_INDEX); { @@ -2694,7 +2694,7 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) GLint components = _mesa_components_in_format(baseFormat); /* this forces alpha to 1 in _mesa_make_temp_float_image */ - if (dstFormat == MESA_FORMAT_XBGR32323232_FLOAT) { + if (dstFormat == MESA_FORMAT_RGBX_FLOAT32) { baseFormat = GL_RGBA; components = 4; } @@ -2707,7 +2707,7 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) dstFormat == MESA_FORMAT_INTENSITY_FLOAT32 || dstFormat == MESA_FORMAT_R_FLOAT32 || dstFormat == MESA_FORMAT_RG_FLOAT32 || - dstFormat == MESA_FORMAT_XBGR32323232_FLOAT); + dstFormat == MESA_FORMAT_RGBX_FLOAT32); ASSERT(baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB || baseInternalFormat == GL_ALPHA || @@ -2759,7 +2759,7 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) GLint components = _mesa_components_in_format(baseFormat); /* this forces alpha to 1 in _mesa_make_temp_float_image */ - if (dstFormat == MESA_FORMAT_XBGR16161616_FLOAT) { + if (dstFormat == MESA_FORMAT_RGBX_FLOAT16) { baseFormat = GL_RGBA; components = 4; } @@ -2772,7 +2772,7 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) dstFormat == MESA_FORMAT_INTENSITY_FLOAT16 || dstFormat == MESA_FORMAT_R_FLOAT16 || dstFormat == MESA_FORMAT_RG_FLOAT16 || - dstFormat == MESA_FORMAT_XBGR16161616_FLOAT); + dstFormat == MESA_FORMAT_RGBX_FLOAT16); ASSERT(baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB || baseInternalFormat == GL_ALPHA || @@ -2823,7 +2823,7 @@ _mesa_texstore_rgba_int8(TEXSTORE_PARAMS) GLint components = _mesa_components_in_format(baseFormat); /* this forces alpha to 1 in make_temp_uint_image */ - if (dstFormat == MESA_FORMAT_XBGR8888_SINT) { + if (dstFormat == MESA_FORMAT_RGBX_SINT8) { baseFormat = GL_RGBA; components = 4; } @@ -2836,7 +2836,7 @@ _mesa_texstore_rgba_int8(TEXSTORE_PARAMS) dstFormat == MESA_FORMAT_INTENSITY_INT8 || dstFormat == MESA_FORMAT_LUMINANCE_INT8 || dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_INT8 || - dstFormat == MESA_FORMAT_XBGR8888_SINT); + dstFormat == MESA_FORMAT_RGBX_SINT8); ASSERT(baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB || baseInternalFormat == GL_RG || @@ -2894,7 +2894,7 @@ _mesa_texstore_rgba_int16(TEXSTORE_PARAMS) GLint components = _mesa_components_in_format(baseFormat); /* this forces alpha to 1 in make_temp_uint_image */ - if (dstFormat == MESA_FORMAT_XBGR16161616_SINT) { + if (dstFormat == MESA_FORMAT_RGBX_SINT16) { baseFormat = GL_RGBA; components = 4; } @@ -2907,7 +2907,7 @@ _mesa_texstore_rgba_int16(TEXSTORE_PARAMS) dstFormat == MESA_FORMAT_LUMINANCE_INT16 || dstFormat == MESA_FORMAT_INTENSITY_INT16 || dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_INT16 || - dstFormat == MESA_FORMAT_XBGR16161616_SINT); + dstFormat == MESA_FORMAT_RGBX_SINT16); ASSERT(baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB || baseInternalFormat == GL_RG || @@ -2965,7 +2965,7 @@ _mesa_texstore_rgba_int32(TEXSTORE_PARAMS) GLint components = _mesa_components_in_format(baseFormat); /* this forces alpha to 1 in make_temp_uint_image */ - if (dstFormat == MESA_FORMAT_XBGR32323232_SINT) { + if (dstFormat == MESA_FORMAT_RGBX_SINT32) { baseFormat = GL_RGBA; components = 4; } @@ -2978,7 +2978,7 @@ _mesa_texstore_rgba_int32(TEXSTORE_PARAMS) dstFormat == MESA_FORMAT_INTENSITY_INT32 || dstFormat == MESA_FORMAT_LUMINANCE_INT32 || dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_INT32 || - dstFormat == MESA_FORMAT_XBGR32323232_SINT); + dstFormat == MESA_FORMAT_RGBX_SINT32); ASSERT(baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB || baseInternalFormat == GL_RG || @@ -3036,7 +3036,7 @@ _mesa_texstore_rgba_uint8(TEXSTORE_PARAMS) GLint components = _mesa_components_in_format(baseFormat); /* this forces alpha to 1 in make_temp_uint_image */ - if (dstFormat == MESA_FORMAT_XBGR8888_UINT) { + if (dstFormat == MESA_FORMAT_RGBX_UINT8) { baseFormat = GL_RGBA; components = 4; } @@ -3049,7 +3049,7 @@ _mesa_texstore_rgba_uint8(TEXSTORE_PARAMS) dstFormat == MESA_FORMAT_INTENSITY_UINT8 || dstFormat == MESA_FORMAT_LUMINANCE_UINT8 || dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_UINT8 || - dstFormat == MESA_FORMAT_XBGR8888_UINT); + dstFormat == MESA_FORMAT_RGBX_UINT8); ASSERT(baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB || baseInternalFormat == GL_RG || @@ -3104,7 +3104,7 @@ _mesa_texstore_rgba_uint16(TEXSTORE_PARAMS) GLint components = _mesa_components_in_format(baseFormat); /* this forces alpha to 1 in make_temp_uint_image */ - if (dstFormat == MESA_FORMAT_XBGR16161616_UINT) { + if (dstFormat == MESA_FORMAT_RGBX_UINT16) { baseFormat = GL_RGBA; components = 4; } @@ -3117,7 +3117,7 @@ _mesa_texstore_rgba_uint16(TEXSTORE_PARAMS) dstFormat == MESA_FORMAT_INTENSITY_UINT16 || dstFormat == MESA_FORMAT_LUMINANCE_UINT16 || dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_UINT16 || - dstFormat == MESA_FORMAT_XBGR16161616_UINT); + dstFormat == MESA_FORMAT_RGBX_UINT16); ASSERT(baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB || baseInternalFormat == GL_RG || @@ -3172,7 +3172,7 @@ _mesa_texstore_rgba_uint32(TEXSTORE_PARAMS) GLint components = _mesa_components_in_format(baseFormat); /* this forces alpha to 1 in make_temp_uint_image */ - if (dstFormat == MESA_FORMAT_XBGR32323232_UINT) { + if (dstFormat == MESA_FORMAT_RGBX_UINT32) { baseFormat = GL_RGBA; components = 4; } @@ -3185,7 +3185,7 @@ _mesa_texstore_rgba_uint32(TEXSTORE_PARAMS) dstFormat == MESA_FORMAT_INTENSITY_UINT32 || dstFormat == MESA_FORMAT_LUMINANCE_UINT32 || dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_UINT32 || - dstFormat == MESA_FORMAT_XBGR32323232_UINT); + dstFormat == MESA_FORMAT_RGBX_UINT32); ASSERT(baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB || baseInternalFormat == GL_RG || @@ -3238,10 +3238,10 @@ _mesa_texstore_srgb8(TEXSTORE_PARAMS) mesa_format newDstFormat; GLboolean k; - ASSERT(dstFormat == MESA_FORMAT_SRGB8); + ASSERT(dstFormat == MESA_FORMAT_BGR_SRGB8); /* reuse normal rgb texstore code */ - newDstFormat = MESA_FORMAT_RGB888; + newDstFormat = MESA_FORMAT_BGR_UNORM8; k = _mesa_texstore_rgb888(ctx, dims, baseInternalFormat, newDstFormat, @@ -3311,9 +3311,9 @@ _mesa_texstore_sl8(TEXSTORE_PARAMS) mesa_format newDstFormat; GLboolean k; - ASSERT(dstFormat == MESA_FORMAT_SL8); + ASSERT(dstFormat == MESA_FORMAT_L_SRGB8); - newDstFormat = MESA_FORMAT_L8; + newDstFormat = MESA_FORMAT_L_UNORM8; /* _mesa_textore_a8 handles luminance8 too */ k = _mesa_texstore_unorm8(ctx, dims, baseInternalFormat, @@ -3668,8 +3668,8 @@ _mesa_get_texstore_func(mesa_format format) table[MESA_FORMAT_R8G8B8X8_UNORM] = _mesa_texstore_rgba8888; table[MESA_FORMAT_B8G8R8X8_UNORM] = _mesa_texstore_argb8888; table[MESA_FORMAT_X8R8G8B8_UNORM] = _mesa_texstore_argb8888; - table[MESA_FORMAT_RGB888] = _mesa_texstore_rgb888; - table[MESA_FORMAT_BGR888] = _mesa_texstore_bgr888; + table[MESA_FORMAT_BGR_UNORM8] = _mesa_texstore_rgb888; + table[MESA_FORMAT_RGB_UNORM8] = _mesa_texstore_bgr888; table[MESA_FORMAT_RGB565] = _mesa_texstore_rgb565; table[MESA_FORMAT_RGB565_REV] = _mesa_texstore_rgb565; table[MESA_FORMAT_ARGB4444] = store_ubyte_texture; @@ -3683,32 +3683,32 @@ _mesa_get_texstore_func(mesa_format format) table[MESA_FORMAT_AL1616] = _mesa_texstore_unorm1616; table[MESA_FORMAT_AL1616_REV] = _mesa_texstore_unorm1616; table[MESA_FORMAT_RGB332] = store_ubyte_texture; - table[MESA_FORMAT_A8] = _mesa_texstore_unorm8; - table[MESA_FORMAT_A16] = _mesa_texstore_unorm16; - table[MESA_FORMAT_L8] = _mesa_texstore_unorm8; - table[MESA_FORMAT_L16] = _mesa_texstore_unorm16; - table[MESA_FORMAT_I8] = _mesa_texstore_unorm8; - table[MESA_FORMAT_I16] = _mesa_texstore_unorm16; + table[MESA_FORMAT_A_UNORM8] = _mesa_texstore_unorm8; + table[MESA_FORMAT_A_UNORM16] = _mesa_texstore_unorm16; + table[MESA_FORMAT_L_UNORM8] = _mesa_texstore_unorm8; + table[MESA_FORMAT_L_UNORM16] = _mesa_texstore_unorm16; + table[MESA_FORMAT_I_UNORM8] = _mesa_texstore_unorm8; + table[MESA_FORMAT_I_UNORM16] = _mesa_texstore_unorm16; table[MESA_FORMAT_YCBCR] = _mesa_texstore_ycbcr; table[MESA_FORMAT_YCBCR_REV] = _mesa_texstore_ycbcr; - table[MESA_FORMAT_R8] = _mesa_texstore_unorm8; + table[MESA_FORMAT_R_UNORM8] = _mesa_texstore_unorm8; table[MESA_FORMAT_GR88] = _mesa_texstore_unorm88; table[MESA_FORMAT_RG88] = _mesa_texstore_unorm88; - table[MESA_FORMAT_R16] = _mesa_texstore_unorm16; + table[MESA_FORMAT_R_UNORM16] = _mesa_texstore_unorm16; table[MESA_FORMAT_GR1616] = _mesa_texstore_unorm1616; table[MESA_FORMAT_RG1616] = _mesa_texstore_unorm1616; table[MESA_FORMAT_ARGB2101010] = _mesa_texstore_argb2101010; table[MESA_FORMAT_Z24_S8] = _mesa_texstore_z24_s8; table[MESA_FORMAT_S8_Z24] = _mesa_texstore_s8_z24; - table[MESA_FORMAT_Z16] = _mesa_texstore_z16; + table[MESA_FORMAT_Z_UNORM16] = _mesa_texstore_z16; table[MESA_FORMAT_X8_Z24] = _mesa_texstore_x8_z24; table[MESA_FORMAT_Z24_X8] = _mesa_texstore_z24_x8; - table[MESA_FORMAT_Z32] = _mesa_texstore_z32; - table[MESA_FORMAT_S8] = _mesa_texstore_s8; - table[MESA_FORMAT_SRGB8] = _mesa_texstore_srgb8; + table[MESA_FORMAT_Z_UNORM32] = _mesa_texstore_z32; + table[MESA_FORMAT_S_UINT8] = _mesa_texstore_s8; + table[MESA_FORMAT_BGR_SRGB8] = _mesa_texstore_srgb8; table[MESA_FORMAT_SRGBA8] = _mesa_texstore_srgba8; table[MESA_FORMAT_SARGB8] = _mesa_texstore_sargb8; - table[MESA_FORMAT_SL8] = _mesa_texstore_sl8; + table[MESA_FORMAT_L_SRGB8] = _mesa_texstore_sl8; table[MESA_FORMAT_SLA8] = _mesa_texstore_sla8; table[MESA_FORMAT_SRGB_DXT1] = _mesa_texstore_rgb_dxt1; table[MESA_FORMAT_SRGBA_DXT1] = _mesa_texstore_rgba_dxt1; @@ -3746,7 +3746,7 @@ _mesa_get_texstore_func(mesa_format format) table[MESA_FORMAT_SIGNED_GR1616] = _mesa_texstore_snorm1616; table[MESA_FORMAT_SIGNED_RGB_16] = _mesa_texstore_signed_rgba_16; table[MESA_FORMAT_SIGNED_RGBA_16] = _mesa_texstore_signed_rgba_16; - table[MESA_FORMAT_RGBA_16] = _mesa_texstore_rgba_16; + table[MESA_FORMAT_RGBA_UNORM16] = _mesa_texstore_rgba_16; table[MESA_FORMAT_RED_RGTC1] = _mesa_texstore_red_rgtc1; table[MESA_FORMAT_SIGNED_RED_RGTC1] = _mesa_texstore_signed_red_rgtc1; table[MESA_FORMAT_RG_RGTC2] = _mesa_texstore_rg_rgtc2; @@ -3778,7 +3778,7 @@ _mesa_get_texstore_func(mesa_format format) table[MESA_FORMAT_SIGNED_I16] = _mesa_texstore_snorm16; table[MESA_FORMAT_RGB9_E5_FLOAT] = _mesa_texstore_rgb9_e5; table[MESA_FORMAT_R11_G11_B10_FLOAT] = _mesa_texstore_r11_g11_b10f; - table[MESA_FORMAT_Z32_FLOAT] = _mesa_texstore_z32; + table[MESA_FORMAT_Z_FLOAT32] = _mesa_texstore_z32; table[MESA_FORMAT_Z32_FLOAT_X24S8] = _mesa_texstore_z32f_x24s8; table[MESA_FORMAT_ALPHA_UINT8] = _mesa_texstore_rgba_uint8; @@ -3842,17 +3842,17 @@ _mesa_get_texstore_func(mesa_format format) table[MESA_FORMAT_XRGB1555_UNORM] = store_ubyte_texture; table[MESA_FORMAT_XBGR8888_SNORM] = _mesa_texstore_signed_rgbx8888; table[MESA_FORMAT_XBGR8888_SRGB] = _mesa_texstore_srgba8; - table[MESA_FORMAT_XBGR8888_UINT] = _mesa_texstore_rgba_uint8; - table[MESA_FORMAT_XBGR8888_SINT] = _mesa_texstore_rgba_int8; + table[MESA_FORMAT_RGBX_UINT8] = _mesa_texstore_rgba_uint8; + table[MESA_FORMAT_RGBX_SINT8] = _mesa_texstore_rgba_int8; table[MESA_FORMAT_XRGB2101010_UNORM] = _mesa_texstore_argb2101010; - table[MESA_FORMAT_XBGR16161616_UNORM] = _mesa_texstore_rgba_16; - table[MESA_FORMAT_XBGR16161616_SNORM] = _mesa_texstore_signed_rgba_16; - table[MESA_FORMAT_XBGR16161616_FLOAT] = _mesa_texstore_rgba_float16; - table[MESA_FORMAT_XBGR16161616_UINT] = _mesa_texstore_rgba_uint16; - table[MESA_FORMAT_XBGR16161616_SINT] = _mesa_texstore_rgba_int16; - table[MESA_FORMAT_XBGR32323232_FLOAT] = _mesa_texstore_rgba_float32; - table[MESA_FORMAT_XBGR32323232_UINT] = _mesa_texstore_rgba_uint32; - table[MESA_FORMAT_XBGR32323232_SINT] = _mesa_texstore_rgba_int32; + table[MESA_FORMAT_RGBX_UNORM16] = _mesa_texstore_rgba_16; + table[MESA_FORMAT_RGBX_SNORM16] = _mesa_texstore_signed_rgba_16; + table[MESA_FORMAT_RGBX_FLOAT16] = _mesa_texstore_rgba_float16; + table[MESA_FORMAT_RGBX_UINT16] = _mesa_texstore_rgba_uint16; + table[MESA_FORMAT_RGBX_SINT16] = _mesa_texstore_rgba_int16; + table[MESA_FORMAT_RGBX_FLOAT32] = _mesa_texstore_rgba_float32; + table[MESA_FORMAT_RGBX_UINT32] = _mesa_texstore_rgba_uint32; + table[MESA_FORMAT_RGBX_SINT32] = _mesa_texstore_rgba_int32; table[MESA_FORMAT_ABGR2101010] = _mesa_texstore_abgr2101010; |