From eeed49f5f290793870c60b5b635b977a732a1eb4 Mon Sep 17 00:00:00 2001 From: Mark Mueller Date: Sun, 26 Jan 2014 15:12:56 -0800 Subject: [PATCH] mesa: Change many Type P MESA_FORMATs to meet naming spec Conversion of Type P formats as follows (w/related comment fixes): s/MESA_FORMAT_RGB565\b/MESA_FORMAT_B5G6R5_UNORM/g s/MESA_FORMAT_RGB565_REV\b/MESA_FORMAT_R5G6B5_UNORM/g s/MESA_FORMAT_ARGB4444\b/MESA_FORMAT_B4G4R4A4_UNORM/g s/MESA_FORMAT_ARGB4444_REV\b/MESA_FORMAT_A4R4G4B4_UNORM/g s/MESA_FORMAT_RGBA5551\b/MESA_FORMAT_A1B5G5R5_UNORM/g s/MESA_FORMAT_XBGR8888_SNORM\b/MESA_FORMAT_R8G8B8X8_SNORM/g s/MESA_FORMAT_XBGR8888_SRGB\b/MESA_FORMAT_R8G8B8X8_SRGB/g s/MESA_FORMAT_ARGB1555\b/MESA_FORMAT_B5G5R5A1_UNORM/g s/MESA_FORMAT_ARGB1555_REV\b/MESA_FORMAT_A1R5G5B5_UNORM/g s/MESA_FORMAT_AL44\b/MESA_FORMAT_L4A4_UNORM/g s/MESA_FORMAT_RGB332\b/MESA_FORMAT_B2G3R3_UNORM/g s/MESA_FORMAT_ARGB2101010\b/MESA_FORMAT_B10G10R10A2_UNORM/g s/MESA_FORMAT_Z24_S8\b/MESA_FORMAT_S8_UINT_Z24_UNORM/g s/MESA_FORMAT_S8_Z24\b/MESA_FORMAT_Z24_UNORM_S8_UINT/g s/MESA_FORMAT_X8_Z24\b/MESA_FORMAT_Z24_UNORM_X8_UINT/g s/MESA_FORMAT_Z24_X8\b/MESA_FORMAT_X8Z24_UNORM/g s/MESA_FORMAT_RGB9_E5_FLOAT\b/MESA_FORMAT_R9G9B9E5_FLOAT/g s/MESA_FORMAT_R11_G11_B10_FLOAT\b/MESA_FORMAT_R11G11B10_FLOAT/g s/MESA_FORMAT_Z32_FLOAT_X24S8\b/MESA_FORMAT_Z32_FLOAT_S8X24_UINT/g s/MESA_FORMAT_ABGR2101010_UINT\b/MESA_FORMAT_R10G10B10A2_UINT/g s/MESA_FORMAT_XRGB4444_UNORM\b/MESA_FORMAT_B4G4R4X4_UNORM/g s/MESA_FORMAT_XRGB1555_UNORM\b/MESA_FORMAT_B5G5R5X1_UNORM/g s/MESA_FORMAT_XRGB2101010_UNORM\b/MESA_FORMAT_B10G10R10X2_UNORM/g s/MESA_FORMAT_AL88\b/MESA_FORMAT_L8A8_UNORM/g s/MESA_FORMAT_AL88_REV\b/MESA_FORMAT_A8L8_UNORM/g s/MESA_FORMAT_AL1616\b/MESA_FORMAT_L16A16_UNORM/g s/MESA_FORMAT_AL1616_REV\b/MESA_FORMAT_A16L16_UNORM/g s/MESA_FORMAT_RG88\b/MESA_FORMAT_G8R8_UNORM/g s/MESA_FORMAT_GR88\b/MESA_FORMAT_R8G8_UNORM/g s/MESA_FORMAT_GR1616\b/MESA_FORMAT_R16G16_UNORM/g s/MESA_FORMAT_RG1616\b/MESA_FORMAT_G16R16_UNORM/g s/MESA_FORMAT_SRGBA8\b/MESA_FORMAT_A8B8G8R8_SRGB/g s/MESA_FORMAT_SARGB8\b/MESA_FORMAT_B8G8R8A8_SRGB/g s/MESA_FORMAT_SLA8\b/MESA_FORMAT_L8A8_SRGB/g Conflicts: src/mesa/drivers/dri/i965/brw_surface_formats.c src/mesa/main/format_pack.c src/mesa/main/format_unpack.c src/mesa/main/formats.c src/mesa/main/texformat.c src/mesa/main/texstore.c --- .../state_trackers/dri/common/dri_screen.c | 2 +- src/mesa/drivers/dri/common/dri_util.c | 20 +- src/mesa/drivers/dri/common/utils.c | 14 +- src/mesa/drivers/dri/i915/i830_texstate.c | 8 +- src/mesa/drivers/dri/i915/i830_vtbl.c | 14 +- src/mesa/drivers/dri/i915/i915_context.c | 14 +- src/mesa/drivers/dri/i915/i915_texstate.c | 14 +- src/mesa/drivers/dri/i915/i915_vtbl.c | 14 +- src/mesa/drivers/dri/i915/intel_blit.c | 6 +- src/mesa/drivers/dri/i915/intel_fbo.c | 2 +- .../drivers/dri/i915/intel_pixel_bitmap.c | 2 +- src/mesa/drivers/dri/i915/intel_screen.c | 12 +- src/mesa/drivers/dri/i915/intel_tex_image.c | 2 +- src/mesa/drivers/dri/i965/brw_blorp.cpp | 4 +- src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 6 +- src/mesa/drivers/dri/i965/brw_clear.c | 4 +- src/mesa/drivers/dri/i965/brw_context.c | 2 +- src/mesa/drivers/dri/i965/brw_misc_state.c | 10 +- .../drivers/dri/i965/brw_surface_formats.c | 94 +++--- src/mesa/drivers/dri/i965/intel_fbo.c | 2 +- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 16 +- src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 6 +- .../drivers/dri/i965/intel_pixel_bitmap.c | 2 +- src/mesa/drivers/dri/i965/intel_screen.c | 18 +- src/mesa/drivers/dri/i965/intel_tex_image.c | 2 +- src/mesa/drivers/dri/nouveau/nouveau_fbo.c | 8 +- src/mesa/drivers/dri/nouveau/nouveau_screen.c | 2 +- .../drivers/dri/nouveau/nouveau_texture.c | 4 +- src/mesa/drivers/dri/nouveau/nouveau_util.h | 6 +- src/mesa/drivers/dri/nouveau/nv04_state_fb.c | 2 +- src/mesa/drivers/dri/nouveau/nv04_state_tex.c | 6 +- src/mesa/drivers/dri/nouveau/nv04_surface.c | 96 +++--- src/mesa/drivers/dri/nouveau/nv10_state_fb.c | 4 +- src/mesa/drivers/dri/nouveau/nv10_state_tex.c | 10 +- src/mesa/drivers/dri/nouveau/nv20_state_fb.c | 6 +- src/mesa/drivers/dri/nouveau/nv20_state_tex.c | 12 +- src/mesa/drivers/dri/r200/r200_blit.c | 26 +- src/mesa/drivers/dri/r200/r200_state_init.c | 6 +- src/mesa/drivers/dri/r200/r200_texstate.c | 38 +-- src/mesa/drivers/dri/radeon/radeon_blit.c | 20 +- src/mesa/drivers/dri/radeon/radeon_fbo.c | 10 +- .../drivers/dri/radeon/radeon_pixel_read.c | 14 +- src/mesa/drivers/dri/radeon/radeon_screen.c | 12 +- .../drivers/dri/radeon/radeon_state_init.c | 6 +- src/mesa/drivers/dri/radeon/radeon_tex_copy.c | 4 +- src/mesa/drivers/dri/radeon/radeon_texstate.c | 22 +- src/mesa/drivers/dri/radeon/radeon_texture.c | 24 +- src/mesa/drivers/dri/swrast/swrast.c | 6 +- .../drivers/haiku/swrast/SoftwareRast.cpp | 4 +- src/mesa/drivers/osmesa/osmesa.c | 2 +- src/mesa/drivers/x11/xm_buffer.c | 2 +- src/mesa/main/debug.c | 4 +- src/mesa/main/fbobject.c | 6 +- src/mesa/main/format_pack.c | 267 ++++++++------- src/mesa/main/format_unpack.c | 138 ++++---- src/mesa/main/formats.c | 314 +++++++++--------- src/mesa/main/formats.h | 82 ++--- src/mesa/main/framebuffer.c | 4 +- src/mesa/main/readpix.c | 4 +- src/mesa/main/shaderimage.c | 20 +- src/mesa/main/texcompress_etc.c | 6 +- src/mesa/main/texformat.c | 102 +++--- src/mesa/main/teximage.c | 8 +- src/mesa/main/texparam.c | 2 +- src/mesa/main/texstore.c | 156 ++++----- src/mesa/state_tracker/st_format.c | 108 +++--- src/mesa/swrast/s_blit.c | 2 +- src/mesa/swrast/s_depth.c | 30 +- src/mesa/swrast/s_drawpix.c | 6 +- src/mesa/swrast/s_renderbuffer.c | 4 +- src/mesa/swrast/s_stencil.c | 4 +- src/mesa/swrast/s_texfetch.c | 72 ++-- src/mesa/swrast/s_texfetch_tmp.h | 48 +-- 73 files changed, 1014 insertions(+), 1015 deletions(-) diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c index 5907ed6ad7b..6b4c069e0e5 100644 --- a/src/gallium/state_trackers/dri/common/dri_screen.c +++ b/src/gallium/state_trackers/dri/common/dri_screen.c @@ -84,7 +84,7 @@ dri_fill_in_modes(struct dri_screen *screen) static const mesa_format mesa_formats[3] = { MESA_FORMAT_B8G8R8A8_UNORM, MESA_FORMAT_B8G8R8X8_UNORM, - MESA_FORMAT_RGB565, + MESA_FORMAT_B5G6R5_UNORM, }; static const enum pipe_format pipe_formats[3] = { PIPE_FORMAT_BGRA8888_UNORM, diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index ca5600bc855..83841def596 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -809,13 +809,13 @@ uint32_t driGLFormatToImageFormat(mesa_format format) { switch (format) { - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: return __DRI_IMAGE_FORMAT_RGB565; case MESA_FORMAT_B8G8R8X8_UNORM: return __DRI_IMAGE_FORMAT_XRGB8888; - case MESA_FORMAT_ARGB2101010: + case MESA_FORMAT_B10G10R10A2_UNORM: return __DRI_IMAGE_FORMAT_ARGB2101010; - case MESA_FORMAT_XRGB2101010_UNORM: + case MESA_FORMAT_B10G10R10X2_UNORM: return __DRI_IMAGE_FORMAT_XRGB2101010; case MESA_FORMAT_B8G8R8A8_UNORM: return __DRI_IMAGE_FORMAT_ARGB8888; @@ -825,11 +825,11 @@ driGLFormatToImageFormat(mesa_format format) return __DRI_IMAGE_FORMAT_XBGR8888; case MESA_FORMAT_R_UNORM8: return __DRI_IMAGE_FORMAT_R8; - case MESA_FORMAT_GR88: + case MESA_FORMAT_R8G8_UNORM: return __DRI_IMAGE_FORMAT_GR88; case MESA_FORMAT_NONE: return __DRI_IMAGE_FORMAT_NONE; - case MESA_FORMAT_SARGB8: + case MESA_FORMAT_B8G8R8A8_SRGB: return __DRI_IMAGE_FORMAT_SARGB8; default: return 0; @@ -841,13 +841,13 @@ driImageFormatToGLFormat(uint32_t image_format) { switch (image_format) { case __DRI_IMAGE_FORMAT_RGB565: - return MESA_FORMAT_RGB565; + return MESA_FORMAT_B5G6R5_UNORM; case __DRI_IMAGE_FORMAT_XRGB8888: return MESA_FORMAT_B8G8R8X8_UNORM; case __DRI_IMAGE_FORMAT_ARGB2101010: - return MESA_FORMAT_ARGB2101010; + return MESA_FORMAT_B10G10R10A2_UNORM; case __DRI_IMAGE_FORMAT_XRGB2101010: - return MESA_FORMAT_XRGB2101010_UNORM; + return MESA_FORMAT_B10G10R10X2_UNORM; case __DRI_IMAGE_FORMAT_ARGB8888: return MESA_FORMAT_B8G8R8A8_UNORM; case __DRI_IMAGE_FORMAT_ABGR8888: @@ -857,9 +857,9 @@ driImageFormatToGLFormat(uint32_t image_format) case __DRI_IMAGE_FORMAT_R8: return MESA_FORMAT_R_UNORM8; case __DRI_IMAGE_FORMAT_GR88: - return MESA_FORMAT_GR88; + return MESA_FORMAT_R8G8_UNORM; case __DRI_IMAGE_FORMAT_SARGB8: - return MESA_FORMAT_SARGB8; + return MESA_FORMAT_B8G8R8A8_SRGB; case __DRI_IMAGE_FORMAT_NONE: return MESA_FORMAT_NONE; default: diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index b18256e355d..1f29e0b080c 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -184,15 +184,15 @@ driCreateConfigs(mesa_format format, GLboolean enable_accum) { static const uint32_t masks_table[][4] = { - /* MESA_FORMAT_RGB565 */ + /* MESA_FORMAT_B5G6R5_UNORM */ { 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 }, /* MESA_FORMAT_B8G8R8X8_UNORM */ { 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 }, /* MESA_FORMAT_B8G8R8A8_UNORM */ { 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000 }, - /* MESA_FORMAT_XRGB2101010_UNORM */ + /* MESA_FORMAT_B10G10R10X2_UNORM */ { 0x3FF00000, 0x000FFC00, 0x000003FF, 0x00000000 }, - /* MESA_FORMAT_ARGB2101010 */ + /* MESA_FORMAT_B10G10R10A2_UNORM */ { 0x3FF00000, 0x000FFC00, 0x000003FF, 0xC0000000 }, }; @@ -209,20 +209,20 @@ driCreateConfigs(mesa_format format, bool is_srgb; switch (format) { - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: masks = masks_table[0]; break; case MESA_FORMAT_B8G8R8X8_UNORM: masks = masks_table[1]; break; case MESA_FORMAT_B8G8R8A8_UNORM: - case MESA_FORMAT_SARGB8: + case MESA_FORMAT_B8G8R8A8_SRGB: masks = masks_table[2]; break; - case MESA_FORMAT_XRGB2101010_UNORM: + case MESA_FORMAT_B10G10R10X2_UNORM: masks = masks_table[3]; break; - case MESA_FORMAT_ARGB2101010: + case MESA_FORMAT_B10G10R10A2_UNORM: masks = masks_table[4]; break; default: diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index 4e90761497f..7209655c167 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -49,13 +49,13 @@ translate_texture_format(GLuint mesa_format) return MAPSURF_8BIT | MT_8BIT_I8; case MESA_FORMAT_A_UNORM8: return MAPSURF_8BIT | MT_8BIT_I8; /* Kludge! */ - case MESA_FORMAT_AL88: + case MESA_FORMAT_L8A8_UNORM: return MAPSURF_16BIT | MT_16BIT_AY88; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: return MAPSURF_16BIT | MT_16BIT_RGB565; - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: return MAPSURF_16BIT | MT_16BIT_ARGB1555; - case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_B4G4R4A4_UNORM: return MAPSURF_16BIT | MT_16BIT_ARGB4444; case MESA_FORMAT_B8G8R8A8_UNORM: return MAPSURF_32BIT | MT_32BIT_ARGB8888; diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c index 49c29939c0d..0d3e3e233d4 100644 --- a/src/mesa/drivers/dri/i915/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915/i830_vtbl.c @@ -584,9 +584,9 @@ static uint32_t i830_render_target_format_for_mesa_format[MESA_FORMAT_COUNT] = { [MESA_FORMAT_B8G8R8A8_UNORM] = DV_PF_8888, [MESA_FORMAT_B8G8R8X8_UNORM] = DV_PF_8888, - [MESA_FORMAT_RGB565] = DV_PF_565, - [MESA_FORMAT_ARGB1555] = DV_PF_1555, - [MESA_FORMAT_ARGB4444] = DV_PF_4444, + [MESA_FORMAT_B5G6R5_UNORM] = DV_PF_565, + [MESA_FORMAT_B5G5R5A1_UNORM] = DV_PF_1555, + [MESA_FORMAT_B4G4R4A4_UNORM] = DV_PF_4444, }; static bool @@ -595,8 +595,8 @@ i830_render_target_supported(struct intel_context *intel, { mesa_format format = rb->Format; - if (format == MESA_FORMAT_S8_Z24 || - format == MESA_FORMAT_X8_Z24 || + if (format == MESA_FORMAT_Z24_UNORM_X8_UINT || + format == MESA_FORMAT_Z24_UNORM_S8_UINT || format == MESA_FORMAT_Z_UNORM16) { return true; } @@ -804,7 +804,7 @@ i830_update_draw_buffer(struct intel_context *intel) /* Check for stencil fallback. */ if (irbStencil && irbStencil->mt) { - assert(intel_rb_format(irbStencil) == MESA_FORMAT_S8_Z24); + assert(intel_rb_format(irbStencil) == MESA_FORMAT_Z24_UNORM_X8_UINT); FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, false); } else if (irbStencil && !irbStencil->mt) { FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, true); @@ -817,7 +817,7 @@ i830_update_draw_buffer(struct intel_context *intel) * we still need to set up the shared depth/stencil state so we can use it. */ if (depthRegion == NULL && irbStencil && irbStencil->mt - && intel_rb_format(irbStencil) == MESA_FORMAT_S8_Z24) { + && intel_rb_format(irbStencil) == MESA_FORMAT_Z24_UNORM_X8_UINT) { depthRegion = irbStencil->mt->region; } diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index bdb07294039..4cf6acc34c4 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -104,18 +104,18 @@ intel_init_texture_formats(struct gl_context *ctx) intel_screen->deviceID != PCI_CHIP_845_G) ctx->TextureFormatSupported[MESA_FORMAT_B8G8R8X8_UNORM] = true; if (intel->gen == 3) - ctx->TextureFormatSupported[MESA_FORMAT_SARGB8] = true; - ctx->TextureFormatSupported[MESA_FORMAT_ARGB4444] = true; - ctx->TextureFormatSupported[MESA_FORMAT_ARGB1555] = true; - ctx->TextureFormatSupported[MESA_FORMAT_RGB565] = true; + ctx->TextureFormatSupported[MESA_FORMAT_B8G8R8A8_SRGB] = true; + ctx->TextureFormatSupported[MESA_FORMAT_B4G4R4A4_UNORM] = true; + ctx->TextureFormatSupported[MESA_FORMAT_B5G5R5A1_UNORM] = true; + ctx->TextureFormatSupported[MESA_FORMAT_B5G6R5_UNORM] = true; ctx->TextureFormatSupported[MESA_FORMAT_L_UNORM8] = true; ctx->TextureFormatSupported[MESA_FORMAT_A_UNORM8] = true; ctx->TextureFormatSupported[MESA_FORMAT_I_UNORM8] = true; - ctx->TextureFormatSupported[MESA_FORMAT_AL88] = true; + ctx->TextureFormatSupported[MESA_FORMAT_L8A8_UNORM] = true; /* Depth and stencil */ - ctx->TextureFormatSupported[MESA_FORMAT_S8_Z24] = true; - ctx->TextureFormatSupported[MESA_FORMAT_X8_Z24] = true; + ctx->TextureFormatSupported[MESA_FORMAT_Z24_UNORM_X8_UINT] = true; + ctx->TextureFormatSupported[MESA_FORMAT_Z24_UNORM_S8_UINT] = true; /* * This was disabled in initial FBO enabling to avoid combinations diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index ffca3901ca3..4f4b693f0f0 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -48,15 +48,15 @@ translate_texture_format(mesa_format mesa_format, GLenum DepthMode) return MAPSURF_8BIT | MT_8BIT_I8; case MESA_FORMAT_A_UNORM8: return MAPSURF_8BIT | MT_8BIT_A8; - case MESA_FORMAT_AL88: + case MESA_FORMAT_L8A8_UNORM: return MAPSURF_16BIT | MT_16BIT_AY88; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: return MAPSURF_16BIT | MT_16BIT_RGB565; - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: return MAPSURF_16BIT | MT_16BIT_ARGB1555; - case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_B4G4R4A4_UNORM: return MAPSURF_16BIT | MT_16BIT_ARGB4444; - case MESA_FORMAT_SARGB8: + case MESA_FORMAT_B8G8R8A8_SRGB: case MESA_FORMAT_B8G8R8A8_UNORM: return MAPSURF_32BIT | MT_32BIT_ARGB8888; case MESA_FORMAT_B8G8R8X8_UNORM: @@ -88,8 +88,8 @@ translate_texture_format(mesa_format mesa_format, GLenum DepthMode) case MESA_FORMAT_RGBA_DXT5: case MESA_FORMAT_SRGBA_DXT5: return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5); - case MESA_FORMAT_S8_Z24: - case MESA_FORMAT_X8_Z24: + case MESA_FORMAT_Z24_UNORM_X8_UINT: + case MESA_FORMAT_Z24_UNORM_S8_UINT: if (DepthMode == GL_ALPHA) return (MAPSURF_32BIT | MT_32BIT_x8A24); else if (DepthMode == GL_INTENSITY) diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index e263da0d79a..0ab616c099f 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -551,9 +551,9 @@ static uint32_t i915_render_target_format_for_mesa_format[MESA_FORMAT_COUNT] = { [MESA_FORMAT_B8G8R8A8_UNORM] = DV_PF_8888, [MESA_FORMAT_B8G8R8X8_UNORM] = DV_PF_8888, - [MESA_FORMAT_RGB565] = DV_PF_565 | DITHER_FULL_ALWAYS, - [MESA_FORMAT_ARGB1555] = DV_PF_1555 | DITHER_FULL_ALWAYS, - [MESA_FORMAT_ARGB4444] = DV_PF_4444 | DITHER_FULL_ALWAYS, + [MESA_FORMAT_B5G6R5_UNORM] = DV_PF_565 | DITHER_FULL_ALWAYS, + [MESA_FORMAT_B5G5R5A1_UNORM] = DV_PF_1555 | DITHER_FULL_ALWAYS, + [MESA_FORMAT_B4G4R4A4_UNORM] = DV_PF_4444 | DITHER_FULL_ALWAYS, }; static bool @@ -562,8 +562,8 @@ i915_render_target_supported(struct intel_context *intel, { mesa_format format = rb->Format; - if (format == MESA_FORMAT_S8_Z24 || - format == MESA_FORMAT_X8_Z24 || + if (format == MESA_FORMAT_Z24_UNORM_X8_UINT || + format == MESA_FORMAT_Z24_UNORM_S8_UINT || format == MESA_FORMAT_Z_UNORM16) { return true; } @@ -777,7 +777,7 @@ i915_update_draw_buffer(struct intel_context *intel) /* Check for stencil fallback. */ if (irbStencil && irbStencil->mt) { - assert(intel_rb_format(irbStencil) == MESA_FORMAT_S8_Z24); + assert(intel_rb_format(irbStencil) == MESA_FORMAT_Z24_UNORM_X8_UINT); FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, false); } else if (irbStencil && !irbStencil->mt) { FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, true); @@ -790,7 +790,7 @@ i915_update_draw_buffer(struct intel_context *intel) * we still need to set up the shared depth/stencil state so we can use it. */ if (depthRegion == NULL && irbStencil && irbStencil->mt - && intel_rb_format(irbStencil) == MESA_FORMAT_S8_Z24) { + && intel_rb_format(irbStencil) == MESA_FORMAT_Z24_UNORM_X8_UINT) { depthRegion = irbStencil->mt->region; } diff --git a/src/mesa/drivers/dri/i915/intel_blit.c b/src/mesa/drivers/dri/i915/intel_blit.c index 5e9fc5ba625..d4e269dc841 100644 --- a/src/mesa/drivers/dri/i915/intel_blit.c +++ b/src/mesa/drivers/dri/i915/intel_blit.c @@ -455,14 +455,14 @@ intelClearWithBlit(struct gl_context *ctx, GLbitfield mask) clear_val = PACK_COLOR_8888(clear[3], clear[0], clear[1], clear[2]); break; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: clear_val = PACK_COLOR_565(clear[0], clear[1], clear[2]); break; - case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_B4G4R4A4_UNORM: clear_val = PACK_COLOR_4444(clear[3], clear[0], clear[1], clear[2]); break; - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: clear_val = PACK_COLOR_1555(clear[3], clear[0], clear[1], clear[2]); break; diff --git a/src/mesa/drivers/dri/i915/intel_fbo.c b/src/mesa/drivers/dri/i915/intel_fbo.c index 735f3460f6a..161a1d62216 100644 --- a/src/mesa/drivers/dri/i915/intel_fbo.c +++ b/src/mesa/drivers/dri/i915/intel_fbo.c @@ -194,7 +194,7 @@ intel_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer case GL_STENCIL_INDEX8_EXT: case GL_STENCIL_INDEX16_EXT: /* These aren't actual texture formats, so force them here. */ - rb->Format = MESA_FORMAT_S8_Z24; + rb->Format = MESA_FORMAT_Z24_UNORM_X8_UINT; break; } diff --git a/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c index 09ced23a8b3..f4a2293e6da 100644 --- a/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c @@ -232,7 +232,7 @@ do_blit_bitmap( struct gl_context *ctx, case MESA_FORMAT_B8G8R8X8_UNORM: color = PACK_COLOR_8888(ubcolor[3], ubcolor[0], ubcolor[1], ubcolor[2]); break; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: color = PACK_COLOR_565(ubcolor[0], ubcolor[1], ubcolor[2]); break; default: diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index 9b0262a4a79..f3c0fa32320 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -857,9 +857,9 @@ intelCreateBuffer(__DRIscreen * driScrnPriv, _mesa_initialize_window_framebuffer(fb, mesaVis); if (mesaVis->redBits == 5) - rgbFormat = MESA_FORMAT_RGB565; + rgbFormat = MESA_FORMAT_B5G6R5_UNORM; else if (mesaVis->sRGBCapable) - rgbFormat = MESA_FORMAT_SARGB8; + rgbFormat = MESA_FORMAT_B8G8R8A8_SRGB; else if (mesaVis->alphaBits == 0) rgbFormat = MESA_FORMAT_B8G8R8X8_UNORM; else @@ -886,7 +886,7 @@ intelCreateBuffer(__DRIscreen * driScrnPriv, * Use combined depth/stencil. Note that the renderbuffer is * attached to two attachment points. */ - rb = intel_create_private_renderbuffer(MESA_FORMAT_S8_Z24); + rb = intel_create_private_renderbuffer(MESA_FORMAT_Z24_UNORM_X8_UINT); _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base); _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &rb->Base.Base); } @@ -1043,7 +1043,7 @@ static __DRIconfig** intel_screen_make_configs(__DRIscreen *dri_screen) { static const mesa_format formats[] = { - MESA_FORMAT_RGB565, + MESA_FORMAT_B5G6R5_UNORM, MESA_FORMAT_B8G8R8A8_UNORM }; @@ -1069,7 +1069,7 @@ intel_screen_make_configs(__DRIscreen *dri_screen) depth_bits[0] = 0; stencil_bits[0] = 0; - if (formats[i] == MESA_FORMAT_RGB565) { + if (formats[i] == MESA_FORMAT_B5G6R5_UNORM) { depth_bits[1] = 16; stencil_bits[1] = 0; } else { @@ -1093,7 +1093,7 @@ intel_screen_make_configs(__DRIscreen *dri_screen) for (int i = 0; i < ARRAY_SIZE(formats); i++) { __DRIconfig **new_configs; - if (formats[i] == MESA_FORMAT_RGB565) { + if (formats[i] == MESA_FORMAT_B5G6R5_UNORM) { depth_bits[0] = 16; stencil_bits[0] = 0; } else { diff --git a/src/mesa/drivers/dri/i915/intel_tex_image.c b/src/mesa/drivers/dri/i915/intel_tex_image.c index 6aa11411439..57674b9b5cf 100644 --- a/src/mesa/drivers/dri/i915/intel_tex_image.c +++ b/src/mesa/drivers/dri/i915/intel_tex_image.c @@ -317,7 +317,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, } } else if (rb->mt->cpp == 2) { internalFormat = GL_RGB; - texFormat = MESA_FORMAT_RGB565; + texFormat = MESA_FORMAT_B5G6R5_UNORM; } _mesa_lock_texture(&intel->ctx, texObj); diff --git a/src/mesa/drivers/dri/i965/brw_blorp.cpp b/src/mesa/drivers/dri/i965/brw_blorp.cpp index e1b782dbba2..9fc410c215e 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp.cpp @@ -95,7 +95,7 @@ brw_blorp_surface_info::set(struct brw_context *brw, this->map_stencil_as_y_tiled = true; this->brw_surfaceformat = BRW_SURFACEFORMAT_R8_UNORM; break; - case MESA_FORMAT_X8_Z24: + case MESA_FORMAT_Z24_UNORM_S8_UINT: /* It would make sense to use BRW_SURFACEFORMAT_R24_UNORM_X8_TYPELESS * here, but unfortunately it isn't supported as a render target, which * would prevent us from blitting to 24-bit depth. @@ -328,7 +328,7 @@ brw_hiz_op_params::brw_hiz_op_params(struct intel_mipmap_tree *mt, switch (mt->format) { case MESA_FORMAT_Z_UNORM16: depth_format = BRW_DEPTHFORMAT_D16_UNORM; break; case MESA_FORMAT_Z_FLOAT32: depth_format = BRW_DEPTHFORMAT_D32_FLOAT; break; - case MESA_FORMAT_X8_Z24: depth_format = BRW_DEPTHFORMAT_D24_UNORM_X8_UINT; break; + case MESA_FORMAT_Z24_UNORM_S8_UINT: depth_format = BRW_DEPTHFORMAT_D24_UNORM_X8_UINT; break; default: assert(0); break; } } diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp index 55ff1e6bfb2..08cba13c9dd 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp @@ -219,7 +219,7 @@ formats_match(GLbitfield buffer_bit, struct intel_renderbuffer *src_irb, { /* Note: don't just check gl_renderbuffer::Format, because in some cases * multiple gl_formats resolve to the same native type in the miptree (for - * example MESA_FORMAT_X8_Z24 and MESA_FORMAT_S8_Z24), and we can blit + * example MESA_FORMAT_Z24_UNORM_S8_UINT and MESA_FORMAT_Z24_UNORM_X8_UINT), and we can blit * between those formats. */ mesa_format src_format = find_miptree(buffer_bit, src_irb)->format; @@ -368,8 +368,8 @@ brw_blorp_copytexsubimage(struct brw_context *brw, * we have to lie about the surface format. See the comments in * brw_blorp_surface_info::set(). */ - if ((src_mt->format == MESA_FORMAT_X8_Z24) != - (dst_mt->format == MESA_FORMAT_X8_Z24)) { + if ((src_mt->format == MESA_FORMAT_Z24_UNORM_S8_UINT) != + (dst_mt->format == MESA_FORMAT_Z24_UNORM_S8_UINT)) { return false; } diff --git a/src/mesa/drivers/dri/i965/brw_clear.c b/src/mesa/drivers/dri/i965/brw_clear.c index b463be86ac6..953e9bae14e 100644 --- a/src/mesa/drivers/dri/i965/brw_clear.c +++ b/src/mesa/drivers/dri/i965/brw_clear.c @@ -129,8 +129,8 @@ brw_fast_clear_depth(struct gl_context *ctx) uint32_t depth_clear_value; switch (mt->format) { - case MESA_FORMAT_Z32_FLOAT_X24S8: - case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: + case MESA_FORMAT_Z24_UNORM_X8_UINT: /* From the Sandy Bridge PRM, volume 2 part 1, page 314: * * "[DevSNB+]: Several cases exist where Depth Buffer Clear cannot be diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index b82f76f72cc..d46bdcd178d 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -891,7 +891,7 @@ intel_gles3_srgb_workaround(struct brw_context *brw, fb->Visual.sRGBCapable = false; for (int i = 0; i < BUFFER_COUNT; i++) { if (fb->Attachment[i].Renderbuffer && - fb->Attachment[i].Renderbuffer->Format == MESA_FORMAT_SARGB8) { + fb->Attachment[i].Renderbuffer->Format == MESA_FORMAT_B8G8R8A8_SRGB) { fb->Attachment[i].Renderbuffer->Format = MESA_FORMAT_B8G8R8A8_UNORM; } } diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index 438637447de..cb2447ff8fe 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -142,8 +142,8 @@ brw_depthbuffer_format(struct brw_context *brw) if (!drb && (srb = intel_get_renderbuffer(fb, BUFFER_STENCIL)) && !srb->mt->stencil_mt && - (intel_rb_format(srb) == MESA_FORMAT_S8_Z24 || - intel_rb_format(srb) == MESA_FORMAT_Z32_FLOAT_X24S8)) { + (intel_rb_format(srb) == MESA_FORMAT_Z24_UNORM_X8_UINT || + intel_rb_format(srb) == MESA_FORMAT_Z32_FLOAT_S8X24_UINT)) { drb = srb; } @@ -155,7 +155,7 @@ brw_depthbuffer_format(struct brw_context *brw) return BRW_DEPTHFORMAT_D16_UNORM; case MESA_FORMAT_Z_FLOAT32: return BRW_DEPTHFORMAT_D32_FLOAT; - case MESA_FORMAT_X8_Z24: + case MESA_FORMAT_Z24_UNORM_S8_UINT: if (brw->gen >= 6) { return BRW_DEPTHFORMAT_D24_UNORM_X8_UINT; } else { @@ -173,9 +173,9 @@ brw_depthbuffer_format(struct brw_context *brw) */ return BRW_DEPTHFORMAT_D24_UNORM_S8_UINT; } - case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_Z24_UNORM_X8_UINT: return BRW_DEPTHFORMAT_D24_UNORM_S8_UINT; - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: return BRW_DEPTHFORMAT_D32_FLOAT_S8X24_UINT; default: _mesa_problem(ctx, "Unexpected depth format %s\n", diff --git a/src/mesa/drivers/dri/i965/brw_surface_formats.c b/src/mesa/drivers/dri/i965/brw_surface_formats.c index 651c0f96217..e66a99fe57f 100644 --- a/src/mesa/drivers/dri/i965/brw_surface_formats.c +++ b/src/mesa/drivers/dri/i965/brw_surface_formats.c @@ -329,19 +329,19 @@ brw_format_for_mesa_format(mesa_format mesa_format) [MESA_FORMAT_X8R8G8B8_UNORM] = 0, [MESA_FORMAT_BGR_UNORM8] = 0, [MESA_FORMAT_RGB_UNORM8] = BRW_SURFACEFORMAT_R8G8B8_UNORM, - [MESA_FORMAT_RGB565] = BRW_SURFACEFORMAT_B5G6R5_UNORM, - [MESA_FORMAT_RGB565_REV] = 0, - [MESA_FORMAT_ARGB4444] = BRW_SURFACEFORMAT_B4G4R4A4_UNORM, - [MESA_FORMAT_ARGB4444_REV] = 0, - [MESA_FORMAT_RGBA5551] = 0, - [MESA_FORMAT_ARGB1555] = BRW_SURFACEFORMAT_B5G5R5A1_UNORM, - [MESA_FORMAT_ARGB1555_REV] = 0, - [MESA_FORMAT_AL44] = 0, - [MESA_FORMAT_AL88] = BRW_SURFACEFORMAT_L8A8_UNORM, - [MESA_FORMAT_AL88_REV] = 0, - [MESA_FORMAT_AL1616] = BRW_SURFACEFORMAT_L16A16_UNORM, - [MESA_FORMAT_AL1616_REV] = 0, - [MESA_FORMAT_RGB332] = 0, + [MESA_FORMAT_B5G6R5_UNORM] = BRW_SURFACEFORMAT_B5G6R5_UNORM, + [MESA_FORMAT_R5G6B5_UNORM] = 0, + [MESA_FORMAT_B4G4R4A4_UNORM] = BRW_SURFACEFORMAT_B4G4R4A4_UNORM, + [MESA_FORMAT_A4R4G4B4_UNORM] = 0, + [MESA_FORMAT_A1B5G5R5_UNORM] = 0, + [MESA_FORMAT_B5G5R5A1_UNORM] = BRW_SURFACEFORMAT_B5G5R5A1_UNORM, + [MESA_FORMAT_A1R5G5B5_UNORM] = 0, + [MESA_FORMAT_L4A4_UNORM] = 0, + [MESA_FORMAT_L8A8_UNORM] = BRW_SURFACEFORMAT_L8A8_UNORM, + [MESA_FORMAT_A8L8_UNORM] = 0, + [MESA_FORMAT_L16A16_UNORM] = BRW_SURFACEFORMAT_L16A16_UNORM, + [MESA_FORMAT_A16L16_UNORM] = 0, + [MESA_FORMAT_B2G3R3_UNORM] = 0, [MESA_FORMAT_A_UNORM8] = BRW_SURFACEFORMAT_A8_UNORM, [MESA_FORMAT_A_UNORM16] = BRW_SURFACEFORMAT_A16_UNORM, [MESA_FORMAT_L_UNORM8] = BRW_SURFACEFORMAT_L8_UNORM, @@ -351,25 +351,25 @@ brw_format_for_mesa_format(mesa_format mesa_format) [MESA_FORMAT_YCBCR_REV] = BRW_SURFACEFORMAT_YCRCB_NORMAL, [MESA_FORMAT_YCBCR] = BRW_SURFACEFORMAT_YCRCB_SWAPUVY, [MESA_FORMAT_R_UNORM8] = BRW_SURFACEFORMAT_R8_UNORM, - [MESA_FORMAT_GR88] = BRW_SURFACEFORMAT_R8G8_UNORM, - [MESA_FORMAT_RG88] = 0, + [MESA_FORMAT_R8G8_UNORM] = BRW_SURFACEFORMAT_R8G8_UNORM, + [MESA_FORMAT_G8R8_UNORM] = 0, [MESA_FORMAT_R_UNORM16] = BRW_SURFACEFORMAT_R16_UNORM, - [MESA_FORMAT_GR1616] = BRW_SURFACEFORMAT_R16G16_UNORM, - [MESA_FORMAT_RG1616] = 0, - [MESA_FORMAT_ARGB2101010] = BRW_SURFACEFORMAT_B10G10R10A2_UNORM, - [MESA_FORMAT_Z24_S8] = 0, - [MESA_FORMAT_S8_Z24] = 0, + [MESA_FORMAT_R16G16_UNORM] = BRW_SURFACEFORMAT_R16G16_UNORM, + [MESA_FORMAT_G16R16_UNORM] = 0, + [MESA_FORMAT_B10G10R10A2_UNORM] = BRW_SURFACEFORMAT_B10G10R10A2_UNORM, + [MESA_FORMAT_S8_UINT_Z24_UNORM] = 0, + [MESA_FORMAT_Z24_UNORM_X8_UINT] = 0, [MESA_FORMAT_Z_UNORM16] = 0, - [MESA_FORMAT_X8_Z24] = 0, - [MESA_FORMAT_Z24_X8] = 0, + [MESA_FORMAT_Z24_UNORM_S8_UINT] = 0, + [MESA_FORMAT_X8Z24_UNORM] = 0, [MESA_FORMAT_Z_UNORM32] = 0, [MESA_FORMAT_S_UINT8] = 0, [MESA_FORMAT_BGR_SRGB8] = 0, - [MESA_FORMAT_SRGBA8] = 0, - [MESA_FORMAT_SARGB8] = BRW_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB, + [MESA_FORMAT_A8B8G8R8_SRGB] = 0, + [MESA_FORMAT_B8G8R8A8_SRGB] = BRW_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB, [MESA_FORMAT_L_SRGB8] = BRW_SURFACEFORMAT_L8_UNORM_SRGB, - [MESA_FORMAT_SLA8] = BRW_SURFACEFORMAT_L8A8_UNORM_SRGB, + [MESA_FORMAT_L8A8_SRGB] = BRW_SURFACEFORMAT_L8A8_UNORM_SRGB, [MESA_FORMAT_SRGB_DXT1] = BRW_SURFACEFORMAT_DXT1_RGB_SRGB, [MESA_FORMAT_SRGBA_DXT1] = BRW_SURFACEFORMAT_BC1_UNORM_SRGB, [MESA_FORMAT_SRGBA_DXT3] = BRW_SURFACEFORMAT_BC2_UNORM_SRGB, @@ -496,22 +496,22 @@ brw_format_for_mesa_format(mesa_format mesa_format) [MESA_FORMAT_SIGNED_AL1616] = 0, [MESA_FORMAT_SIGNED_I16] = 0, - [MESA_FORMAT_RGB9_E5_FLOAT] = BRW_SURFACEFORMAT_R9G9B9E5_SHAREDEXP, - [MESA_FORMAT_R11_G11_B10_FLOAT] = BRW_SURFACEFORMAT_R11G11B10_FLOAT, + [MESA_FORMAT_R9G9B9E5_FLOAT] = BRW_SURFACEFORMAT_R9G9B9E5_SHAREDEXP, + [MESA_FORMAT_R11G11B10_FLOAT] = BRW_SURFACEFORMAT_R11G11B10_FLOAT, [MESA_FORMAT_Z_FLOAT32] = 0, - [MESA_FORMAT_Z32_FLOAT_X24S8] = 0, + [MESA_FORMAT_Z32_FLOAT_S8X24_UINT] = 0, - [MESA_FORMAT_ARGB2101010_UINT] = BRW_SURFACEFORMAT_B10G10R10A2_UINT, - [MESA_FORMAT_ABGR2101010_UINT] = BRW_SURFACEFORMAT_R10G10B10A2_UINT, + [MESA_FORMAT_B10G10R10A2_UINT] = BRW_SURFACEFORMAT_B10G10R10A2_UINT, + [MESA_FORMAT_R10G10B10A2_UINT] = BRW_SURFACEFORMAT_R10G10B10A2_UINT, - [MESA_FORMAT_XRGB4444_UNORM] = 0, - [MESA_FORMAT_XRGB1555_UNORM] = BRW_SURFACEFORMAT_B5G5R5X1_UNORM, - [MESA_FORMAT_XBGR8888_SNORM] = 0, - [MESA_FORMAT_XBGR8888_SRGB] = 0, + [MESA_FORMAT_B4G4R4X4_UNORM] = 0, + [MESA_FORMAT_B5G5R5X1_UNORM] = BRW_SURFACEFORMAT_B5G5R5X1_UNORM, + [MESA_FORMAT_R8G8B8X8_SNORM] = 0, + [MESA_FORMAT_R8G8B8X8_SRGB] = 0, [MESA_FORMAT_RGBX_UINT8] = 0, [MESA_FORMAT_RGBX_SINT8] = 0, - [MESA_FORMAT_XRGB2101010_UNORM] = BRW_SURFACEFORMAT_B10G10R10X2_UNORM, + [MESA_FORMAT_B10G10R10X2_UNORM] = BRW_SURFACEFORMAT_B10G10R10X2_UNORM, [MESA_FORMAT_RGBX_UNORM16] = BRW_SURFACEFORMAT_R16G16B16X16_UNORM, [MESA_FORMAT_RGBX_SNORM16] = 0, [MESA_FORMAT_RGBX_FLOAT16] = BRW_SURFACEFORMAT_R16G16B16X16_FLOAT, @@ -600,20 +600,20 @@ brw_init_surface_formats(struct brw_context *brw) /* We will check this table for FBO completeness, but the surface format * table above only covered color rendering. */ - brw->format_supported_as_render_target[MESA_FORMAT_S8_Z24] = true; - brw->format_supported_as_render_target[MESA_FORMAT_X8_Z24] = true; + brw->format_supported_as_render_target[MESA_FORMAT_Z24_UNORM_X8_UINT] = true; + brw->format_supported_as_render_target[MESA_FORMAT_Z24_UNORM_S8_UINT] = true; brw->format_supported_as_render_target[MESA_FORMAT_S_UINT8] = true; brw->format_supported_as_render_target[MESA_FORMAT_Z_UNORM16] = true; brw->format_supported_as_render_target[MESA_FORMAT_Z_FLOAT32] = true; - brw->format_supported_as_render_target[MESA_FORMAT_Z32_FLOAT_X24S8] = true; + brw->format_supported_as_render_target[MESA_FORMAT_Z32_FLOAT_S8X24_UINT] = true; /* We remap depth formats to a supported texturing format in * translate_tex_format(). */ - ctx->TextureFormatSupported[MESA_FORMAT_S8_Z24] = true; - ctx->TextureFormatSupported[MESA_FORMAT_X8_Z24] = true; + ctx->TextureFormatSupported[MESA_FORMAT_Z24_UNORM_X8_UINT] = true; + ctx->TextureFormatSupported[MESA_FORMAT_Z24_UNORM_S8_UINT] = true; ctx->TextureFormatSupported[MESA_FORMAT_Z_FLOAT32] = true; - ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT_X24S8] = true; + ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT_S8X24_UINT] = true; /* It appears that Z16 is slower than Z24 (on Intel Ivybridge and newer * hardware at least), so there's no real reason to prefer it unless you're @@ -697,14 +697,14 @@ translate_tex_format(struct brw_context *brw, case MESA_FORMAT_Z_UNORM16: return BRW_SURFACEFORMAT_R16_UNORM; - 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 BRW_SURFACEFORMAT_R24_UNORM_X8_TYPELESS; case MESA_FORMAT_Z_FLOAT32: return BRW_SURFACEFORMAT_R32_FLOAT; - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: return BRW_SURFACEFORMAT_R32_FLOAT_X8X24_TYPELESS; case MESA_FORMAT_RGBA_FLOAT32: @@ -739,9 +739,9 @@ brw_is_hiz_depth_format(struct brw_context *brw, mesa_format format) switch (format) { case MESA_FORMAT_Z_FLOAT32: - case MESA_FORMAT_Z32_FLOAT_X24S8: - case MESA_FORMAT_X8_Z24: - case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: + case MESA_FORMAT_Z24_UNORM_S8_UINT: + case MESA_FORMAT_Z24_UNORM_X8_UINT: case MESA_FORMAT_Z_UNORM16: return true; default: diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c b/src/mesa/drivers/dri/i965/intel_fbo.c index 5f6e1b3c391..d99f9a67f73 100644 --- a/src/mesa/drivers/dri/i965/intel_fbo.c +++ b/src/mesa/drivers/dri/i965/intel_fbo.c @@ -209,7 +209,7 @@ intel_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffer rb->Format = MESA_FORMAT_S_UINT8; } else { assert(!brw->must_use_separate_stencil); - rb->Format = MESA_FORMAT_S8_Z24; + rb->Format = MESA_FORMAT_Z24_UNORM_X8_UINT; } break; } diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 2a84391f732..47a0afbbd79 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -370,9 +370,9 @@ intel_miptree_create_layout(struct brw_context *brw, /* Fix up the Z miptree format for how we're splitting out separate * stencil. Gen7 expects there to be no stencil bits in its depth buffer. */ - if (mt->format == MESA_FORMAT_S8_Z24) { - mt->format = MESA_FORMAT_X8_Z24; - } else if (mt->format == MESA_FORMAT_Z32_FLOAT_X24S8) { + if (mt->format == MESA_FORMAT_Z24_UNORM_X8_UINT) { + mt->format = MESA_FORMAT_Z24_UNORM_S8_UINT; + } else if (mt->format == MESA_FORMAT_Z32_FLOAT_S8X24_UINT) { mt->format = MESA_FORMAT_Z_FLOAT32; mt->cpp = 4; } else { @@ -512,7 +512,7 @@ intel_miptree_create(struct brw_context *brw, case MESA_FORMAT_ETC2_SRGB8: case MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC: case MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1: - format = MESA_FORMAT_SARGB8; + format = MESA_FORMAT_B8G8R8A8_SRGB; break; case MESA_FORMAT_ETC2_RGBA8_EAC: case MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1: @@ -525,7 +525,7 @@ intel_miptree_create(struct brw_context *brw, format = MESA_FORMAT_SIGNED_R16; break; case MESA_FORMAT_ETC2_RG11_EAC: - format = MESA_FORMAT_GR1616; + format = MESA_FORMAT_R16G16_UNORM; break; case MESA_FORMAT_ETC2_SIGNED_RG11_EAC: format = MESA_FORMAT_SIGNED_GR1616; @@ -918,10 +918,10 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt, assert(target_to_target(image->TexObject->Target) == mt->target); mesa_format mt_format = mt->format; - if (mt->format == MESA_FORMAT_X8_Z24 && mt->stencil_mt) - mt_format = MESA_FORMAT_S8_Z24; + if (mt->format == MESA_FORMAT_Z24_UNORM_S8_UINT && mt->stencil_mt) + mt_format = MESA_FORMAT_Z24_UNORM_X8_UINT; if (mt->format == MESA_FORMAT_Z_FLOAT32 && mt->stencil_mt) - mt_format = MESA_FORMAT_Z32_FLOAT_X24S8; + mt_format = MESA_FORMAT_Z32_FLOAT_S8X24_UINT; if (mt->etc_format != MESA_FORMAT_NONE) mt_format = mt->etc_format; diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h index cb2eda60a54..775730c0a92 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h @@ -278,9 +278,9 @@ struct intel_mipmap_tree * However, for textures and renderbuffers with packed depth/stencil formats * on hardware where we want or need to use separate stencil, there will be * two miptrees for storing the data. If the depthstencil texture or rb is - * MESA_FORMAT_Z32_FLOAT_X24S8, then mt->format will be - * MESA_FORMAT_Z_FLOAT32, otherwise for MESA_FORMAT_S8_Z24 objects it will be - * MESA_FORMAT_X8_Z24. + * MESA_FORMAT_Z32_FLOAT_S8X24_UINT, then mt->format will be + * MESA_FORMAT_Z_FLOAT32, otherwise for MESA_FORMAT_Z24_UNORM_X8_UINT objects it will be + * MESA_FORMAT_Z24_UNORM_S8_UINT. * * For ETC1/ETC2 textures, this is one of the uncompressed mesa texture * formats if the hardware lacks support for ETC1/ETC2. See @ref wraps_etc. diff --git a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c index 34edc246cc3..a9674ca2db3 100644 --- a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c @@ -233,7 +233,7 @@ do_blit_bitmap( struct gl_context *ctx, case MESA_FORMAT_B8G8R8X8_UNORM: color = PACK_COLOR_8888(ubcolor[3], ubcolor[0], ubcolor[1], ubcolor[2]); break; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: color = PACK_COLOR_565(ubcolor[0], ubcolor[1], ubcolor[2]); break; default: diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 1b884cbcad4..7700a4ef0cf 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -976,13 +976,13 @@ intelCreateBuffer(__DRIscreen * driScrnPriv, _mesa_initialize_window_framebuffer(fb, mesaVis); if (mesaVis->redBits == 5) - rgbFormat = MESA_FORMAT_RGB565; + rgbFormat = MESA_FORMAT_B5G6R5_UNORM; else if (mesaVis->sRGBCapable) - rgbFormat = MESA_FORMAT_SARGB8; + rgbFormat = MESA_FORMAT_B8G8R8A8_SRGB; else if (mesaVis->alphaBits == 0) rgbFormat = MESA_FORMAT_B8G8R8X8_UNORM; else { - rgbFormat = MESA_FORMAT_SARGB8; + rgbFormat = MESA_FORMAT_B8G8R8A8_SRGB; fb->Visual.sRGBCapable = true; } @@ -1004,7 +1004,7 @@ intelCreateBuffer(__DRIscreen * driScrnPriv, assert(mesaVis->stencilBits == 8); if (screen->devinfo->has_hiz_and_separate_stencil) { - rb = intel_create_private_renderbuffer(MESA_FORMAT_X8_Z24, + rb = intel_create_private_renderbuffer(MESA_FORMAT_Z24_UNORM_S8_UINT, num_samples); _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base); rb = intel_create_private_renderbuffer(MESA_FORMAT_S_UINT8, @@ -1015,7 +1015,7 @@ intelCreateBuffer(__DRIscreen * driScrnPriv, * Use combined depth/stencil. Note that the renderbuffer is * attached to two attachment points. */ - rb = intel_create_private_renderbuffer(MESA_FORMAT_S8_Z24, + rb = intel_create_private_renderbuffer(MESA_FORMAT_Z24_UNORM_X8_UINT, num_samples); _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base); _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &rb->Base.Base); @@ -1125,7 +1125,7 @@ static __DRIconfig** intel_screen_make_configs(__DRIscreen *dri_screen) { static const mesa_format formats[] = { - MESA_FORMAT_RGB565, + MESA_FORMAT_B5G6R5_UNORM, MESA_FORMAT_B8G8R8A8_UNORM }; @@ -1154,7 +1154,7 @@ intel_screen_make_configs(__DRIscreen *dri_screen) depth_bits[0] = 0; stencil_bits[0] = 0; - if (formats[i] == MESA_FORMAT_RGB565) { + if (formats[i] == MESA_FORMAT_B5G6R5_UNORM) { depth_bits[1] = 16; stencil_bits[1] = 0; if (devinfo->gen >= 6) { @@ -1183,7 +1183,7 @@ intel_screen_make_configs(__DRIscreen *dri_screen) for (int i = 0; i < ARRAY_SIZE(formats); i++) { __DRIconfig **new_configs; - if (formats[i] == MESA_FORMAT_RGB565) { + if (formats[i] == MESA_FORMAT_B5G6R5_UNORM) { depth_bits[0] = 16; stencil_bits[0] = 0; } else { @@ -1223,7 +1223,7 @@ intel_screen_make_configs(__DRIscreen *dri_screen) depth_bits[0] = 0; stencil_bits[0] = 0; - if (formats[i] == MESA_FORMAT_RGB565) { + if (formats[i] == MESA_FORMAT_B5G6R5_UNORM) { depth_bits[1] = 16; stencil_bits[1] = 0; } else { diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c index 40095312f3f..02b3ba5a569 100644 --- a/src/mesa/drivers/dri/i965/intel_tex_image.c +++ b/src/mesa/drivers/dri/i965/intel_tex_image.c @@ -308,7 +308,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, } } else if (rb->mt->cpp == 2) { internalFormat = GL_RGB; - texFormat = MESA_FORMAT_RGB565; + texFormat = MESA_FORMAT_B5G6R5_UNORM; } _mesa_lock_texture(&brw->ctx, texObj); diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c index 5d1853374e1..ae50fe03677 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c @@ -55,7 +55,7 @@ set_renderbuffer_format(struct gl_renderbuffer *rb, GLenum internalFormat) break; case GL_RGB5: rb->_BaseFormat = GL_RGB; - rb->Format = MESA_FORMAT_RGB565; + rb->Format = MESA_FORMAT_B5G6R5_UNORM; s->cpp = 2; break; case GL_DEPTH_COMPONENT16: @@ -68,7 +68,7 @@ set_renderbuffer_format(struct gl_renderbuffer *rb, GLenum internalFormat) case GL_STENCIL_INDEX8_EXT: case GL_DEPTH24_STENCIL8_EXT: rb->_BaseFormat = GL_DEPTH_STENCIL; - rb->Format = MESA_FORMAT_Z24_S8; + rb->Format = MESA_FORMAT_S8_UINT_Z24_UNORM; s->cpp = 4; break; default: @@ -274,9 +274,9 @@ validate_format_bpp(mesa_format format) switch (format) { case MESA_FORMAT_B8G8R8X8_UNORM: case MESA_FORMAT_B8G8R8A8_UNORM: - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: return 32; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: case MESA_FORMAT_Z_UNORM16: return 16; default: diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c index 4ec4b675b31..a3810649234 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c @@ -53,7 +53,7 @@ nouveau_get_configs(void) const uint8_t msaa_samples[] = { 0 }; static const mesa_format formats[3] = { - MESA_FORMAT_RGB565, + MESA_FORMAT_B5G6R5_UNORM, MESA_FORMAT_B8G8R8A8_UNORM, MESA_FORMAT_B8G8R8X8_UNORM, }; diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c index 6882e506190..a8c0268bc98 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c @@ -177,7 +177,7 @@ nouveau_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_COMPRESSED_RGBA: return MESA_FORMAT_B8G8R8A8_UNORM; case GL_RGB5_A1: - return MESA_FORMAT_ARGB1555; + return MESA_FORMAT_B5G5R5A1_UNORM; case GL_RGB: case GL_RGB8: @@ -190,7 +190,7 @@ nouveau_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_R3_G3_B2: case GL_RGB4: case GL_RGB5: - return MESA_FORMAT_RGB565; + return MESA_FORMAT_B5G6R5_UNORM; case 2: case GL_LUMINANCE_ALPHA: diff --git a/src/mesa/drivers/dri/nouveau/nouveau_util.h b/src/mesa/drivers/dri/nouveau/nouveau_util.h index 547d1be35a7..0efaafadd52 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_util.h +++ b/src/mesa/drivers/dri/nouveau/nouveau_util.h @@ -46,7 +46,7 @@ pack_rgba_i(mesa_format f, uint8_t c[]) return PACK_COLOR_8888(c[RCOMP], c[GCOMP], c[BCOMP], c[ACOMP]); case MESA_FORMAT_R8G8B8A8_UNORM: return PACK_COLOR_8888(c[ACOMP], c[BCOMP], c[GCOMP], c[RCOMP]); - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: return PACK_COLOR_565(c[RCOMP], c[GCOMP], c[BCOMP]); default: assert(0); @@ -57,9 +57,9 @@ static inline unsigned pack_zs_i(mesa_format f, uint32_t z, uint8_t s) { switch (f) { - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: return (z & 0xffffff00) | (s & 0xff); - case MESA_FORMAT_Z24_X8: + case MESA_FORMAT_X8Z24_UNORM: return (z & 0xffffff00); case MESA_FORMAT_Z_UNORM16: return (z & 0xffff0000) >> 16; diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c index d3253bae88e..8b0857d281d 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c @@ -39,7 +39,7 @@ get_rt_format(mesa_format format) return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X8R8G8B8_X8R8G8B8; case MESA_FORMAT_B8G8R8A8_UNORM: return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_A8R8G8B8; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_R5G6B5; default: assert(0); diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c index c4a20fa575c..ff60b338648 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c @@ -42,11 +42,11 @@ get_tex_format(struct gl_texture_image *ti) case MESA_FORMAT_L_UNORM8: case MESA_FORMAT_I_UNORM8: return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_Y8; - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_A1R5G5B5; - case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_B4G4R4A4_UNORM: return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_A4R4G4B4; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_R5G6B5; case MESA_FORMAT_B8G8R8A8_UNORM: return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_A8R8G8B8; diff --git a/src/mesa/drivers/dri/nouveau/nv04_surface.c b/src/mesa/drivers/dri/nouveau/nv04_surface.c index 0d8cf3b59e3..f2fc83e0577 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_surface.c +++ b/src/mesa/drivers/dri/nouveau/nv04_surface.c @@ -40,18 +40,18 @@ swzsurf_format(mesa_format format) case MESA_FORMAT_A_UNORM8: case MESA_FORMAT_L_UNORM8: case MESA_FORMAT_I_UNORM8: - case MESA_FORMAT_RGB332: + case MESA_FORMAT_B2G3R3_UNORM: return NV04_SWIZZLED_SURFACE_FORMAT_COLOR_Y8; - case MESA_FORMAT_RGB565: - case MESA_FORMAT_RGB565_REV: - case MESA_FORMAT_ARGB4444: - case MESA_FORMAT_ARGB4444_REV: - case MESA_FORMAT_ARGB1555: - case MESA_FORMAT_RGBA5551: - case MESA_FORMAT_ARGB1555_REV: - case MESA_FORMAT_AL88: - case MESA_FORMAT_AL88_REV: + case MESA_FORMAT_B5G6R5_UNORM: + case MESA_FORMAT_R5G6B5_UNORM: + case MESA_FORMAT_B4G4R4A4_UNORM: + case MESA_FORMAT_A4R4G4B4_UNORM: + case MESA_FORMAT_B5G5R5A1_UNORM: + case MESA_FORMAT_A1B5G5R5_UNORM: + case MESA_FORMAT_A1R5G5B5_UNORM: + case MESA_FORMAT_L8A8_UNORM: + case MESA_FORMAT_A8L8_UNORM: case MESA_FORMAT_YCBCR: case MESA_FORMAT_YCBCR_REV: case MESA_FORMAT_Z_UNORM16: @@ -62,8 +62,8 @@ swzsurf_format(mesa_format format) case MESA_FORMAT_B8G8R8X8_UNORM: case MESA_FORMAT_B8G8R8A8_UNORM: case MESA_FORMAT_A8R8G8B8_UNORM: - case MESA_FORMAT_S8_Z24: - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_Z24_UNORM_X8_UINT: + case MESA_FORMAT_S8_UINT_Z24_UNORM: case MESA_FORMAT_Z_UNORM32: return NV04_SWIZZLED_SURFACE_FORMAT_COLOR_A8R8G8B8; @@ -79,18 +79,18 @@ surf2d_format(mesa_format format) case MESA_FORMAT_A_UNORM8: case MESA_FORMAT_L_UNORM8: case MESA_FORMAT_I_UNORM8: - case MESA_FORMAT_RGB332: + case MESA_FORMAT_B2G3R3_UNORM: return NV04_CONTEXT_SURFACES_2D_FORMAT_Y8; - case MESA_FORMAT_RGB565: - case MESA_FORMAT_RGB565_REV: - case MESA_FORMAT_ARGB4444: - case MESA_FORMAT_ARGB4444_REV: - case MESA_FORMAT_ARGB1555: - case MESA_FORMAT_RGBA5551: - case MESA_FORMAT_ARGB1555_REV: - case MESA_FORMAT_AL88: - case MESA_FORMAT_AL88_REV: + case MESA_FORMAT_B5G6R5_UNORM: + case MESA_FORMAT_R5G6B5_UNORM: + case MESA_FORMAT_B4G4R4A4_UNORM: + case MESA_FORMAT_A4R4G4B4_UNORM: + case MESA_FORMAT_B5G5R5A1_UNORM: + case MESA_FORMAT_A1B5G5R5_UNORM: + case MESA_FORMAT_A1R5G5B5_UNORM: + case MESA_FORMAT_L8A8_UNORM: + case MESA_FORMAT_A8L8_UNORM: case MESA_FORMAT_YCBCR: case MESA_FORMAT_YCBCR_REV: case MESA_FORMAT_Z_UNORM16: @@ -101,8 +101,8 @@ surf2d_format(mesa_format format) case MESA_FORMAT_B8G8R8X8_UNORM: case MESA_FORMAT_B8G8R8A8_UNORM: case MESA_FORMAT_A8R8G8B8_UNORM: - case MESA_FORMAT_S8_Z24: - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_Z24_UNORM_X8_UINT: + case MESA_FORMAT_S8_UINT_Z24_UNORM: case MESA_FORMAT_Z_UNORM32: return NV04_CONTEXT_SURFACES_2D_FORMAT_Y32; @@ -118,18 +118,18 @@ rect_format(mesa_format format) case MESA_FORMAT_A_UNORM8: case MESA_FORMAT_L_UNORM8: case MESA_FORMAT_I_UNORM8: - case MESA_FORMAT_RGB332: + case MESA_FORMAT_B2G3R3_UNORM: return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8; - case MESA_FORMAT_RGB565: - case MESA_FORMAT_RGB565_REV: - case MESA_FORMAT_ARGB4444: - case MESA_FORMAT_ARGB4444_REV: - case MESA_FORMAT_ARGB1555: - case MESA_FORMAT_RGBA5551: - case MESA_FORMAT_ARGB1555_REV: - case MESA_FORMAT_AL88: - case MESA_FORMAT_AL88_REV: + case MESA_FORMAT_B5G6R5_UNORM: + case MESA_FORMAT_R5G6B5_UNORM: + case MESA_FORMAT_B4G4R4A4_UNORM: + case MESA_FORMAT_A4R4G4B4_UNORM: + case MESA_FORMAT_B5G5R5A1_UNORM: + case MESA_FORMAT_A1B5G5R5_UNORM: + case MESA_FORMAT_A1R5G5B5_UNORM: + case MESA_FORMAT_L8A8_UNORM: + case MESA_FORMAT_A8L8_UNORM: case MESA_FORMAT_YCBCR: case MESA_FORMAT_YCBCR_REV: case MESA_FORMAT_Z_UNORM16: @@ -140,8 +140,8 @@ rect_format(mesa_format format) case MESA_FORMAT_B8G8R8X8_UNORM: case MESA_FORMAT_B8G8R8A8_UNORM: case MESA_FORMAT_A8R8G8B8_UNORM: - case MESA_FORMAT_S8_Z24: - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_Z24_UNORM_X8_UINT: + case MESA_FORMAT_S8_UINT_Z24_UNORM: case MESA_FORMAT_Z_UNORM32: return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8; @@ -157,18 +157,18 @@ sifm_format(mesa_format format) case MESA_FORMAT_A_UNORM8: case MESA_FORMAT_L_UNORM8: case MESA_FORMAT_I_UNORM8: - case MESA_FORMAT_RGB332: + case MESA_FORMAT_B2G3R3_UNORM: return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_AY8; - case MESA_FORMAT_RGB565: - case MESA_FORMAT_RGB565_REV: - case MESA_FORMAT_ARGB4444: - case MESA_FORMAT_ARGB4444_REV: - case MESA_FORMAT_ARGB1555: - case MESA_FORMAT_RGBA5551: - case MESA_FORMAT_ARGB1555_REV: - case MESA_FORMAT_AL88: - case MESA_FORMAT_AL88_REV: + case MESA_FORMAT_B5G6R5_UNORM: + case MESA_FORMAT_R5G6B5_UNORM: + case MESA_FORMAT_B4G4R4A4_UNORM: + case MESA_FORMAT_A4R4G4B4_UNORM: + case MESA_FORMAT_B5G5R5A1_UNORM: + case MESA_FORMAT_A1B5G5R5_UNORM: + case MESA_FORMAT_A1R5G5B5_UNORM: + case MESA_FORMAT_L8A8_UNORM: + case MESA_FORMAT_A8L8_UNORM: case MESA_FORMAT_YCBCR: case MESA_FORMAT_YCBCR_REV: case MESA_FORMAT_Z_UNORM16: @@ -179,8 +179,8 @@ sifm_format(mesa_format format) case MESA_FORMAT_B8G8R8X8_UNORM: case MESA_FORMAT_B8G8R8A8_UNORM: case MESA_FORMAT_A8R8G8B8_UNORM: - case MESA_FORMAT_S8_Z24: - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_Z24_UNORM_X8_UINT: + case MESA_FORMAT_S8_UINT_Z24_UNORM: case MESA_FORMAT_Z_UNORM32: return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A8R8G8B8; diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c index 4cd47abbd70..19769e5c47f 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c @@ -40,11 +40,11 @@ get_rt_format(mesa_format format) return NV10_3D_RT_FORMAT_COLOR_X8R8G8B8; case MESA_FORMAT_B8G8R8A8_UNORM: return NV10_3D_RT_FORMAT_COLOR_A8R8G8B8; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: return NV10_3D_RT_FORMAT_COLOR_R5G6B5; case MESA_FORMAT_Z_UNORM16: return NV10_3D_RT_FORMAT_DEPTH_Z16; - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: return NV10_3D_RT_FORMAT_DEPTH_Z24S8; default: assert(0); diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c index 316ee2abe6a..22c7a42ec1c 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c @@ -96,13 +96,13 @@ get_tex_format_pot(struct gl_texture_image *ti) case MESA_FORMAT_B8G8R8X8_UNORM: return NV10_3D_TEX_FORMAT_FORMAT_X8R8G8B8; - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: return NV10_3D_TEX_FORMAT_FORMAT_A1R5G5B5; - case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_B4G4R4A4_UNORM: return NV10_3D_TEX_FORMAT_FORMAT_A4R4G4B4; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: return NV10_3D_TEX_FORMAT_FORMAT_R5G6B5; case MESA_FORMAT_A_UNORM8: @@ -131,10 +131,10 @@ static uint32_t get_tex_format_rect(struct gl_texture_image *ti) { switch (ti->TexFormat) { - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: return NV10_3D_TEX_FORMAT_FORMAT_A1R5G5B5_RECT; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: return NV10_3D_TEX_FORMAT_FORMAT_R5G6B5_RECT; case MESA_FORMAT_B8G8R8A8_UNORM: diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c index 6b6cf3e3d65..6e3049e402e 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c @@ -40,11 +40,11 @@ get_rt_format(mesa_format format) return NV20_3D_RT_FORMAT_COLOR_X8R8G8B8; case MESA_FORMAT_B8G8R8A8_UNORM: return NV20_3D_RT_FORMAT_COLOR_A8R8G8B8; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: return NV20_3D_RT_FORMAT_COLOR_R5G6B5; case MESA_FORMAT_Z_UNORM16: return NV20_3D_RT_FORMAT_DEPTH_Z16; - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: return NV20_3D_RT_FORMAT_DEPTH_Z24S8; default: assert(0); @@ -117,7 +117,7 @@ nv20_emit_framebuffer(struct gl_context *ctx, int emit) if (context_chipset(ctx) >= 0x25) setup_hierz_buffer(ctx); } else { - rt_format |= get_rt_format(MESA_FORMAT_Z24_S8); + rt_format |= get_rt_format(MESA_FORMAT_S8_UINT_Z24_UNORM); zeta_pitch = rt_pitch; } diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c index 198e4f2a489..69984068604 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c @@ -90,16 +90,16 @@ get_tex_format_pot(struct gl_texture_image *ti) case MESA_FORMAT_B8G8R8A8_UNORM: return NV20_3D_TEX_FORMAT_FORMAT_A8R8G8B8; - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: return NV20_3D_TEX_FORMAT_FORMAT_A1R5G5B5; - case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_B4G4R4A4_UNORM: return NV20_3D_TEX_FORMAT_FORMAT_A4R4G4B4; case MESA_FORMAT_B8G8R8X8_UNORM: return NV20_3D_TEX_FORMAT_FORMAT_X8R8G8B8; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: return NV20_3D_TEX_FORMAT_FORMAT_R5G6B5; case MESA_FORMAT_A_UNORM8: @@ -131,16 +131,16 @@ get_tex_format_rect(struct gl_texture_image *ti) case MESA_FORMAT_B8G8R8A8_UNORM: return NV20_3D_TEX_FORMAT_FORMAT_A8R8G8B8_RECT; - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: return NV20_3D_TEX_FORMAT_FORMAT_A1R5G5B5_RECT; - case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_B4G4R4A4_UNORM: return NV20_3D_TEX_FORMAT_FORMAT_A4R4G4B4_RECT; case MESA_FORMAT_B8G8R8X8_UNORM: return NV20_3D_TEX_FORMAT_FORMAT_R8G8B8_RECT; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: return NV20_3D_TEX_FORMAT_FORMAT_R5G6B5_RECT; case MESA_FORMAT_L_UNORM8: diff --git a/src/mesa/drivers/dri/r200/r200_blit.c b/src/mesa/drivers/dri/r200/r200_blit.c index 62e38aabb49..a33f338990f 100644 --- a/src/mesa/drivers/dri/r200/r200_blit.c +++ b/src/mesa/drivers/dri/r200/r200_blit.c @@ -44,9 +44,9 @@ unsigned r200_check_blit(mesa_format mesa_format, uint32_t dst_pitch) switch (mesa_format) { case MESA_FORMAT_B8G8R8A8_UNORM: case MESA_FORMAT_B8G8R8X8_UNORM: - case MESA_FORMAT_RGB565: - case MESA_FORMAT_ARGB4444: - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G6R5_UNORM: + case MESA_FORMAT_B4G4R4A4_UNORM: + case MESA_FORMAT_B5G5R5A1_UNORM: case MESA_FORMAT_A_UNORM8: case MESA_FORMAT_L_UNORM8: case MESA_FORMAT_I_UNORM8: @@ -126,13 +126,13 @@ static void inline emit_tx_setup(struct r200_context *r200, case MESA_FORMAT_B8G8R8X8_UNORM: txformat |= R200_TXFORMAT_ARGB8888; break; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: txformat |= R200_TXFORMAT_RGB565; break; - case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_B4G4R4A4_UNORM: txformat |= R200_TXFORMAT_ARGB4444 | R200_TXFORMAT_ALPHA_IN_MAP; break; - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: txformat |= R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP; break; case MESA_FORMAT_A_UNORM8: @@ -142,7 +142,7 @@ static void inline emit_tx_setup(struct r200_context *r200, case MESA_FORMAT_L_UNORM8: txformat |= R200_TXFORMAT_I8; break; - case MESA_FORMAT_AL88: + case MESA_FORMAT_L8A8_UNORM: txformat |= R200_TXFORMAT_AI88 | R200_TXFORMAT_ALPHA_IN_MAP; break; default: @@ -157,9 +157,9 @@ static void inline emit_tx_setup(struct r200_context *r200, switch (dst_mesa_format) { case MESA_FORMAT_B8G8R8A8_UNORM: case MESA_FORMAT_B8G8R8X8_UNORM: - case MESA_FORMAT_RGB565: - case MESA_FORMAT_ARGB4444: - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G6R5_UNORM: + case MESA_FORMAT_B4G4R4A4_UNORM: + case MESA_FORMAT_B5G5R5A1_UNORM: case MESA_FORMAT_A_UNORM8: case MESA_FORMAT_L_UNORM8: case MESA_FORMAT_I_UNORM8: @@ -314,13 +314,13 @@ static inline void emit_cb_setup(struct r200_context *r200, case MESA_FORMAT_R8G8B8A8_UNORM: dst_format = RADEON_COLOR_FORMAT_ARGB8888; break; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: dst_format = RADEON_COLOR_FORMAT_RGB565; break; - case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_B4G4R4A4_UNORM: dst_format = RADEON_COLOR_FORMAT_ARGB4444; break; - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: dst_format = RADEON_COLOR_FORMAT_ARGB1555; break; case MESA_FORMAT_A_UNORM8: diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c b/src/mesa/drivers/dri/r200/r200_state_init.c index 79aa753dc94..eb93036691b 100644 --- a/src/mesa/drivers/dri/r200/r200_state_init.c +++ b/src/mesa/drivers/dri/r200/r200_state_init.c @@ -452,13 +452,13 @@ static void ctx_emit_cs(struct gl_context *ctx, struct radeon_state_atom *atom) if (rrb->cpp == 4) atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB8888; else switch (rrb->base.Base.Format) { - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_RGB565; break; - case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_B4G4R4A4_UNORM: atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB4444; break; - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB1555; break; default: diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c index 505c99959c7..5160c2ce2d1 100644 --- a/src/mesa/drivers/dri/r200/r200_texstate.c +++ b/src/mesa/drivers/dri/r200/r200_texstate.c @@ -74,14 +74,14 @@ static const struct tx_table tx_table_be[] = [ MESA_FORMAT_B8G8R8A8_UNORM ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, [ MESA_FORMAT_A8R8G8B8_UNORM ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, [ MESA_FORMAT_BGR_UNORM8 ] = { 0xffffffff, 0 }, - [ MESA_FORMAT_RGB565 ] = { R200_TXFORMAT_RGB565, 0 }, - [ MESA_FORMAT_RGB565_REV ] = { R200_TXFORMAT_RGB565, 0 }, - [ MESA_FORMAT_ARGB4444 ] = { R200_TXFORMAT_ARGB4444 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, - [ MESA_FORMAT_ARGB4444_REV ] = { R200_TXFORMAT_ARGB4444 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, - [ MESA_FORMAT_ARGB1555 ] = { R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, - [ MESA_FORMAT_ARGB1555_REV ] = { R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, - [ MESA_FORMAT_AL88 ] = { R200_TXFORMAT_AL88 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, - [ MESA_FORMAT_AL88_REV ] = { R200_TXFORMAT_AL88 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_B5G6R5_UNORM ] = { R200_TXFORMAT_RGB565, 0 }, + [ MESA_FORMAT_R5G6B5_UNORM ] = { R200_TXFORMAT_RGB565, 0 }, + [ MESA_FORMAT_B4G4R4A4_UNORM ] = { R200_TXFORMAT_ARGB4444 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_A4R4G4B4_UNORM ] = { R200_TXFORMAT_ARGB4444 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_B5G5R5A1_UNORM ] = { R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_A1R5G5B5_UNORM ] = { R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_L8A8_UNORM ] = { R200_TXFORMAT_AL88 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_A8L8_UNORM ] = { R200_TXFORMAT_AL88 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, [ MESA_FORMAT_A_UNORM8 ] = { R200_TXFORMAT_A8 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, [ MESA_FORMAT_L_UNORM8 ] = { R200_TXFORMAT_L8, 0 }, [ MESA_FORMAT_I_UNORM8 ] = { R200_TXFORMAT_I8 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, @@ -102,14 +102,14 @@ static const struct tx_table tx_table_le[] = [ MESA_FORMAT_B8G8R8A8_UNORM ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, [ MESA_FORMAT_A8R8G8B8_UNORM ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, [ MESA_FORMAT_BGR_UNORM8 ] = { R200_TXFORMAT_ARGB8888, 0 }, - [ MESA_FORMAT_RGB565 ] = { R200_TXFORMAT_RGB565, 0 }, - [ MESA_FORMAT_RGB565_REV ] = { R200_TXFORMAT_RGB565, 0 }, - [ MESA_FORMAT_ARGB4444 ] = { R200_TXFORMAT_ARGB4444 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, - [ MESA_FORMAT_ARGB4444_REV ] = { R200_TXFORMAT_ARGB4444 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, - [ MESA_FORMAT_ARGB1555 ] = { R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, - [ MESA_FORMAT_ARGB1555_REV ] = { R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, - [ MESA_FORMAT_AL88 ] = { R200_TXFORMAT_AL88 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, - [ MESA_FORMAT_AL88_REV ] = { R200_TXFORMAT_AL88 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_B5G6R5_UNORM ] = { R200_TXFORMAT_RGB565, 0 }, + [ MESA_FORMAT_R5G6B5_UNORM ] = { R200_TXFORMAT_RGB565, 0 }, + [ MESA_FORMAT_B4G4R4A4_UNORM ] = { R200_TXFORMAT_ARGB4444 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_A4R4G4B4_UNORM ] = { R200_TXFORMAT_ARGB4444 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_B5G5R5A1_UNORM ] = { R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_A1R5G5B5_UNORM ] = { R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_L8A8_UNORM ] = { R200_TXFORMAT_AL88 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_A8L8_UNORM ] = { R200_TXFORMAT_AL88 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, [ MESA_FORMAT_A_UNORM8 ] = { R200_TXFORMAT_A8 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, [ MESA_FORMAT_L_UNORM8 ] = { R200_TXFORMAT_L8, 0 }, [ MESA_FORMAT_I_UNORM8 ] = { R200_TXFORMAT_I8 | R200_TXFORMAT_ALPHA_IN_MAP, 0 }, @@ -784,9 +784,9 @@ void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_format t->pp_txfilter |= tx_table_le[MESA_FORMAT_BGR_UNORM8].filter; break; case 2: - texFormat = MESA_FORMAT_RGB565; - t->pp_txformat = tx_table_le[MESA_FORMAT_RGB565].format; - t->pp_txfilter |= tx_table_le[MESA_FORMAT_RGB565].filter; + texFormat = MESA_FORMAT_B5G6R5_UNORM; + t->pp_txformat = tx_table_le[MESA_FORMAT_B5G6R5_UNORM].format; + t->pp_txfilter |= tx_table_le[MESA_FORMAT_B5G6R5_UNORM].filter; break; } diff --git a/src/mesa/drivers/dri/radeon/radeon_blit.c b/src/mesa/drivers/dri/radeon/radeon_blit.c index a5b78550e6b..8c6a0865f14 100644 --- a/src/mesa/drivers/dri/radeon/radeon_blit.c +++ b/src/mesa/drivers/dri/radeon/radeon_blit.c @@ -44,9 +44,9 @@ unsigned r100_check_blit(mesa_format mesa_format, uint32_t dst_pitch) switch (mesa_format) { case MESA_FORMAT_B8G8R8A8_UNORM: case MESA_FORMAT_B8G8R8X8_UNORM: - case MESA_FORMAT_RGB565: - case MESA_FORMAT_ARGB4444: - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G6R5_UNORM: + case MESA_FORMAT_B4G4R4A4_UNORM: + case MESA_FORMAT_B5G5R5A1_UNORM: case MESA_FORMAT_A_UNORM8: case MESA_FORMAT_L_UNORM8: case MESA_FORMAT_I_UNORM8: @@ -117,13 +117,13 @@ static void inline emit_tx_setup(struct r100_context *r100, case MESA_FORMAT_B8G8R8X8_UNORM: txformat |= RADEON_TXFORMAT_ARGB8888; break; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: txformat |= RADEON_TXFORMAT_RGB565; break; - case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_B4G4R4A4_UNORM: txformat |= RADEON_TXFORMAT_ARGB4444 | RADEON_TXFORMAT_ALPHA_IN_MAP; break; - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: txformat |= RADEON_TXFORMAT_ARGB1555 | RADEON_TXFORMAT_ALPHA_IN_MAP; break; case MESA_FORMAT_A_UNORM8: @@ -133,7 +133,7 @@ static void inline emit_tx_setup(struct r100_context *r100, case MESA_FORMAT_L_UNORM8: txformat |= RADEON_TXFORMAT_I8; break; - case MESA_FORMAT_AL88: + case MESA_FORMAT_L8A8_UNORM: txformat |= RADEON_TXFORMAT_AI88 | RADEON_TXFORMAT_ALPHA_IN_MAP; break; default: @@ -190,13 +190,13 @@ static inline void emit_cb_setup(struct r100_context *r100, case MESA_FORMAT_B8G8R8X8_UNORM: dst_format = RADEON_COLOR_FORMAT_ARGB8888; break; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: dst_format = RADEON_COLOR_FORMAT_RGB565; break; - case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_B4G4R4A4_UNORM: dst_format = RADEON_COLOR_FORMAT_ARGB4444; break; - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: dst_format = RADEON_COLOR_FORMAT_ARGB1555; break; case MESA_FORMAT_A_UNORM8: diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index f2496e68098..3d1bef3ac6d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -310,7 +310,7 @@ radeon_map_renderbuffer(struct gl_context *ctx, } if ((rmesa->radeonScreen->chip_flags & RADEON_CHIPSET_DEPTH_ALWAYS_TILED) && !rrb->has_surface) { - if (rb->Format == MESA_FORMAT_S8_Z24 || rb->Format == MESA_FORMAT_X8_Z24) { + if (rb->Format == MESA_FORMAT_Z24_UNORM_X8_UINT || rb->Format == MESA_FORMAT_Z24_UNORM_S8_UINT) { radeon_map_renderbuffer_s8z24(ctx, rb, x, y, w, h, mode, out_map, out_stride); return; @@ -419,7 +419,7 @@ radeon_unmap_renderbuffer(struct gl_context *ctx, GLboolean ok; if ((rmesa->radeonScreen->chip_flags & RADEON_CHIPSET_DEPTH_ALWAYS_TILED) && !rrb->has_surface) { - if (rb->Format == MESA_FORMAT_S8_Z24 || rb->Format == MESA_FORMAT_X8_Z24) { + if (rb->Format == MESA_FORMAT_Z24_UNORM_X8_UINT || rb->Format == MESA_FORMAT_Z24_UNORM_S8_UINT) { radeon_unmap_renderbuffer_s8z24(ctx, rb); return; } @@ -507,7 +507,7 @@ radeon_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffe case GL_STENCIL_INDEX8_EXT: case GL_STENCIL_INDEX16_EXT: /* alloc a depth+stencil buffer */ - rb->Format = MESA_FORMAT_S8_Z24; + rb->Format = MESA_FORMAT_Z24_UNORM_X8_UINT; cpp = 4; break; case GL_DEPTH_COMPONENT16: @@ -517,12 +517,12 @@ radeon_alloc_renderbuffer_storage(struct gl_context * ctx, struct gl_renderbuffe case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT32: - rb->Format = MESA_FORMAT_X8_Z24; + rb->Format = MESA_FORMAT_Z24_UNORM_S8_UINT; cpp = 4; break; case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - rb->Format = MESA_FORMAT_S8_Z24; + rb->Format = MESA_FORMAT_Z24_UNORM_X8_UINT; cpp = 4; break; default: diff --git a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c index ee0f7782793..6998444fb66 100644 --- a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c +++ b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c @@ -45,9 +45,9 @@ static mesa_format gl_format_and_type_to_mesa_format(GLenum format, GLenum type) case GL_RGB: switch (type) { case GL_UNSIGNED_SHORT_5_6_5: - return MESA_FORMAT_RGB565; + return MESA_FORMAT_B5G6R5_UNORM; case GL_UNSIGNED_SHORT_5_6_5_REV: - return MESA_FORMAT_RGB565_REV; + return MESA_FORMAT_R5G6B5_UNORM; } break; case GL_RGBA: @@ -55,7 +55,7 @@ static mesa_format gl_format_and_type_to_mesa_format(GLenum format, GLenum type) case GL_FLOAT: return MESA_FORMAT_RGBA_FLOAT32; case GL_UNSIGNED_SHORT_5_5_5_1: - return MESA_FORMAT_RGBA5551; + return MESA_FORMAT_A1B5G5R5_UNORM; case GL_UNSIGNED_INT_8_8_8_8: return MESA_FORMAT_A8B8G8R8_UNORM; case GL_UNSIGNED_BYTE: @@ -66,13 +66,13 @@ static mesa_format gl_format_and_type_to_mesa_format(GLenum format, GLenum type) case GL_BGRA: switch (type) { case GL_UNSIGNED_SHORT_4_4_4_4: - return MESA_FORMAT_ARGB4444_REV; + return MESA_FORMAT_A4R4G4B4_UNORM; case GL_UNSIGNED_SHORT_4_4_4_4_REV: - return MESA_FORMAT_ARGB4444; + return MESA_FORMAT_B4G4R4A4_UNORM; case GL_UNSIGNED_SHORT_5_5_5_1: - return MESA_FORMAT_ARGB1555_REV; + return MESA_FORMAT_A1R5G5B5_UNORM; case GL_UNSIGNED_SHORT_1_5_5_5_REV: - return MESA_FORMAT_ARGB1555; + return MESA_FORMAT_B5G5R5A1_UNORM; case GL_UNSIGNED_INT_8_8_8_8: return MESA_FORMAT_A8R8G8B8_UNORM; case GL_UNSIGNED_BYTE: diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 2c3186ec433..eb5df2ce16f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -214,7 +214,7 @@ radeon_create_image_from_name(__DRIscreen *screen, switch (format) { case __DRI_IMAGE_FORMAT_RGB565: - image->format = MESA_FORMAT_RGB565; + image->format = MESA_FORMAT_B5G6R5_UNORM; image->internal_format = GL_RGB; image->data_type = GL_UNSIGNED_BYTE; break; @@ -314,7 +314,7 @@ radeon_create_image(__DRIscreen *screen, switch (format) { case __DRI_IMAGE_FORMAT_RGB565: - image->format = MESA_FORMAT_RGB565; + image->format = MESA_FORMAT_B5G6R5_UNORM; image->internal_format = GL_RGB; image->data_type = GL_UNSIGNED_BYTE; break; @@ -611,7 +611,7 @@ radeonCreateBuffer( __DRIscreen *driScrnPriv, _mesa_initialize_window_framebuffer(&rfb->base, mesaVis); if (mesaVis->redBits == 5) - rgbFormat = _mesa_little_endian() ? MESA_FORMAT_RGB565 : MESA_FORMAT_RGB565_REV; + rgbFormat = _mesa_little_endian() ? MESA_FORMAT_B5G6R5_UNORM : MESA_FORMAT_R5G6B5_UNORM; else if (mesaVis->alphaBits == 0) rgbFormat = _mesa_little_endian() ? MESA_FORMAT_B8G8R8X8_UNORM : MESA_FORMAT_X8R8G8B8_UNORM; else @@ -632,14 +632,14 @@ radeonCreateBuffer( __DRIscreen *driScrnPriv, if (mesaVis->depthBits == 24) { if (mesaVis->stencilBits == 8) { struct radeon_renderbuffer *depthStencilRb = - radeon_create_renderbuffer(MESA_FORMAT_S8_Z24, driDrawPriv); + radeon_create_renderbuffer(MESA_FORMAT_Z24_UNORM_X8_UINT, driDrawPriv); _mesa_add_renderbuffer(&rfb->base, BUFFER_DEPTH, &depthStencilRb->base.Base); _mesa_add_renderbuffer(&rfb->base, BUFFER_STENCIL, &depthStencilRb->base.Base); depthStencilRb->has_surface = screen->depthHasSurface; } else { /* depth renderbuffer */ struct radeon_renderbuffer *depth = - radeon_create_renderbuffer(MESA_FORMAT_X8_Z24, driDrawPriv); + radeon_create_renderbuffer(MESA_FORMAT_Z24_UNORM_S8_UINT, driDrawPriv); _mesa_add_renderbuffer(&rfb->base, BUFFER_DEPTH, &depth->base.Base); depth->has_surface = screen->depthHasSurface; } @@ -709,7 +709,7 @@ static const __DRIconfig **radeonInitScreen2(__DRIscreen *psp) { static const mesa_format formats[3] = { - MESA_FORMAT_RGB565, + MESA_FORMAT_B5G6R5_UNORM, MESA_FORMAT_B8G8R8X8_UNORM, MESA_FORMAT_B8G8R8A8_UNORM }; diff --git a/src/mesa/drivers/dri/radeon/radeon_state_init.c b/src/mesa/drivers/dri/radeon/radeon_state_init.c index ee8880027d4..2dd19184905 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state_init.c +++ b/src/mesa/drivers/dri/radeon/radeon_state_init.c @@ -335,13 +335,13 @@ static void ctx_emit_cs(struct gl_context *ctx, struct radeon_state_atom *atom) if (rrb->cpp == 4) atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB8888; else switch (rrb->base.Base.Format) { - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_RGB565; break; - case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_B4G4R4A4_UNORM: atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB4444; break; - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB1555; break; default: diff --git a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c index f8430cb95c0..e52730411c4 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c @@ -108,8 +108,8 @@ do_copy_texsubimage(struct gl_context *ctx, switch (dst_bpp) { case 2: - src_mesaformat = MESA_FORMAT_RGB565; - dst_mesaformat = MESA_FORMAT_RGB565; + src_mesaformat = MESA_FORMAT_B5G6R5_UNORM; + dst_mesaformat = MESA_FORMAT_B5G6R5_UNORM; break; case 4: src_mesaformat = MESA_FORMAT_B8G8R8A8_UNORM; diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index e79d8dfae17..66daccf0895 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -79,14 +79,14 @@ static const struct tx_table tx_table[] = [ MESA_FORMAT_B8G8R8A8_UNORM ] = { RADEON_TXFORMAT_ARGB8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }, [ MESA_FORMAT_A8R8G8B8_UNORM ] = { RADEON_TXFORMAT_ARGB8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }, [ MESA_FORMAT_BGR_UNORM8 ] = { RADEON_TXFORMAT_ARGB8888, 0 }, - [ MESA_FORMAT_RGB565 ] = { RADEON_TXFORMAT_RGB565, 0 }, - [ MESA_FORMAT_RGB565_REV ] = { RADEON_TXFORMAT_RGB565, 0 }, - [ MESA_FORMAT_ARGB4444 ] = { RADEON_TXFORMAT_ARGB4444 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }, - [ MESA_FORMAT_ARGB4444_REV ] = { RADEON_TXFORMAT_ARGB4444 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }, - [ MESA_FORMAT_ARGB1555 ] = { RADEON_TXFORMAT_ARGB1555 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }, - [ MESA_FORMAT_ARGB1555_REV ] = { RADEON_TXFORMAT_ARGB1555 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }, - [ MESA_FORMAT_AL88 ] = { RADEON_TXFORMAT_AL88 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }, - [ MESA_FORMAT_AL88_REV ] = { RADEON_TXFORMAT_AL88 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_B5G6R5_UNORM ] = { RADEON_TXFORMAT_RGB565, 0 }, + [ MESA_FORMAT_R5G6B5_UNORM ] = { RADEON_TXFORMAT_RGB565, 0 }, + [ MESA_FORMAT_B4G4R4A4_UNORM ] = { RADEON_TXFORMAT_ARGB4444 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_A4R4G4B4_UNORM ] = { RADEON_TXFORMAT_ARGB4444 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_B5G5R5A1_UNORM ] = { RADEON_TXFORMAT_ARGB1555 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_A1R5G5B5_UNORM ] = { RADEON_TXFORMAT_ARGB1555 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_L8A8_UNORM ] = { RADEON_TXFORMAT_AL88 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }, + [ MESA_FORMAT_A8L8_UNORM ] = { RADEON_TXFORMAT_AL88 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }, [ MESA_FORMAT_A_UNORM8 ] = { RADEON_TXFORMAT_A8 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }, [ MESA_FORMAT_L_UNORM8 ] = { RADEON_TXFORMAT_L8, 0 }, [ MESA_FORMAT_I_UNORM8 ] = { RADEON_TXFORMAT_I8 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 }, @@ -659,9 +659,9 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_form t->pp_txfilter |= tx_table[MESA_FORMAT_BGR_UNORM8].filter; break; case 2: - texFormat = MESA_FORMAT_RGB565; - t->pp_txformat = tx_table[MESA_FORMAT_RGB565].format; - t->pp_txfilter |= tx_table[MESA_FORMAT_RGB565].filter; + texFormat = MESA_FORMAT_B5G6R5_UNORM; + t->pp_txformat = tx_table[MESA_FORMAT_B5G6R5_UNORM].format; + t->pp_txfilter |= tx_table[MESA_FORMAT_B5G6R5_UNORM].filter; break; } diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 40b17bb8269..8c717205052 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -433,7 +433,7 @@ mesa_format radeonChooseTextureFormat(struct gl_context * ctx, case GL_DEPTH_COMPONENT32: case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - return MESA_FORMAT_S8_Z24; + return MESA_FORMAT_Z24_UNORM_X8_UINT; /* EXT_texture_sRGB */ case GL_SRGB: @@ -442,7 +442,7 @@ mesa_format radeonChooseTextureFormat(struct gl_context * ctx, case GL_SRGB8_ALPHA8: case GL_COMPRESSED_SRGB: case GL_COMPRESSED_SRGB_ALPHA: - return MESA_FORMAT_SARGB8; + return MESA_FORMAT_B8G8R8A8_SRGB; case GL_SLUMINANCE: case GL_SLUMINANCE8: @@ -452,7 +452,7 @@ mesa_format radeonChooseTextureFormat(struct gl_context * ctx, case GL_SLUMINANCE_ALPHA: case GL_SLUMINANCE8_ALPHA8: case GL_COMPRESSED_SLUMINANCE_ALPHA: - return MESA_FORMAT_SLA8; + return MESA_FORMAT_L8A8_SRGB; case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: return MESA_FORMAT_SRGB_DXT1; @@ -513,7 +513,7 @@ unsigned radeonIsFormatRenderable(mesa_format mesa_format) switch (mesa_format) { case MESA_FORMAT_Z_UNORM16: - case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_Z24_UNORM_X8_UINT: return 1; default: return 0; @@ -594,18 +594,18 @@ radeonInitTextureFormats(void) if (_mesa_little_endian()) { _radeon_texformat_rgba8888 = MESA_FORMAT_A8B8G8R8_UNORM; _radeon_texformat_argb8888 = MESA_FORMAT_B8G8R8A8_UNORM; - _radeon_texformat_rgb565 = MESA_FORMAT_RGB565; - _radeon_texformat_argb4444 = MESA_FORMAT_ARGB4444; - _radeon_texformat_argb1555 = MESA_FORMAT_ARGB1555; - _radeon_texformat_al88 = MESA_FORMAT_AL88; + _radeon_texformat_rgb565 = MESA_FORMAT_B5G6R5_UNORM; + _radeon_texformat_argb4444 = MESA_FORMAT_B4G4R4A4_UNORM; + _radeon_texformat_argb1555 = MESA_FORMAT_B5G5R5A1_UNORM; + _radeon_texformat_al88 = MESA_FORMAT_L8A8_UNORM; } else { _radeon_texformat_rgba8888 = MESA_FORMAT_R8G8B8A8_UNORM; _radeon_texformat_argb8888 = MESA_FORMAT_A8R8G8B8_UNORM; - _radeon_texformat_rgb565 = MESA_FORMAT_RGB565_REV; - _radeon_texformat_argb4444 = MESA_FORMAT_ARGB4444_REV; - _radeon_texformat_argb1555 = MESA_FORMAT_ARGB1555_REV; - _radeon_texformat_al88 = MESA_FORMAT_AL88_REV; + _radeon_texformat_rgb565 = MESA_FORMAT_R5G6B5_UNORM; + _radeon_texformat_argb4444 = MESA_FORMAT_A4R4G4B4_UNORM; + _radeon_texformat_argb1555 = MESA_FORMAT_A1R5G5B5_UNORM; + _radeon_texformat_al88 = MESA_FORMAT_A8L8_UNORM; } } diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 47f07ae9fe7..48b07bd1169 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -166,7 +166,7 @@ swrastFillInModes(__DRIscreen *psp, switch (pixel_bits) { case 16: - format = MESA_FORMAT_RGB565; + format = MESA_FORMAT_B5G6R5_UNORM; break; case 24: format = MESA_FORMAT_B8G8R8X8_UNORM; @@ -357,13 +357,13 @@ swrast_new_renderbuffer(const struct gl_config *visual, __DRIdrawable *dPriv, xrb->bpp = 32; break; case PF_R5G6B5: - rb->Format = MESA_FORMAT_RGB565; + rb->Format = MESA_FORMAT_B5G6R5_UNORM; rb->InternalFormat = GL_RGB; rb->_BaseFormat = GL_RGB; xrb->bpp = 16; break; case PF_R3G3B2: - rb->Format = MESA_FORMAT_RGB332; + rb->Format = MESA_FORMAT_B2G3R3_UNORM; rb->InternalFormat = GL_RGB; rb->_BaseFormat = GL_RGB; xrb->bpp = 8; diff --git a/src/mesa/drivers/haiku/swrast/SoftwareRast.cpp b/src/mesa/drivers/haiku/swrast/SoftwareRast.cpp index a4afbdca0c6..813ad1ff27d 100644 --- a/src/mesa/drivers/haiku/swrast/SoftwareRast.cpp +++ b/src/mesa/drivers/haiku/swrast/SoftwareRast.cpp @@ -605,11 +605,11 @@ MesaSoftwareRast::_SetupRenderBuffer(struct gl_renderbuffer* rb, break; case B_RGB16: rb->_BaseFormat = GL_RGB; - rb->Format = MESA_FORMAT_RGB565; + rb->Format = MESA_FORMAT_B5G6R5_UNORM; break; case B_RGB15: rb->_BaseFormat = GL_RGB; - rb->Format = MESA_FORMAT_ARGB1555; + rb->Format = MESA_FORMAT_B5G5R5A1_UNORM; break; default: fprintf(stderr, "Unsupported screen color space %s\n", diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index cd137bec533..347913dd678 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -520,7 +520,7 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb, } else if (osmesa->format == OSMESA_RGB_565) { ASSERT(osmesa->DataType == GL_UNSIGNED_BYTE); - rb->Format = MESA_FORMAT_RGB565; + rb->Format = MESA_FORMAT_B5G6R5_UNORM; } else { _mesa_problem(ctx, "bad pixel format in osmesa renderbuffer_storage"); diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c index b9beb48526d..f6e14270a47 100644 --- a/src/mesa/drivers/x11/xm_buffer.c +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -352,7 +352,7 @@ xmesa_new_renderbuffer(struct gl_context *ctx, GLuint name, xrb->Base.Base.Format = MESA_FORMAT_R8G8B8A8_UNORM; break; case PF_5R6G5B: - xrb->Base.Base.Format = MESA_FORMAT_RGB565; + xrb->Base.Base.Format = MESA_FORMAT_B5G6R5_UNORM; break; default: _mesa_warning(ctx, "Bad pixel format in xmesa_new_renderbuffer"); diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 3a483e46d1f..a5b40b4b560 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -620,8 +620,8 @@ _mesa_print_texture(struct gl_context *ctx, struct gl_texture_image *img) case MESA_FORMAT_I_UNORM8: c = 1; break; - case MESA_FORMAT_AL88: - case MESA_FORMAT_AL88_REV: + case MESA_FORMAT_L8A8_UNORM: + case MESA_FORMAT_A8L8_UNORM: c = 2; break; case MESA_FORMAT_BGR_UNORM8: diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 90ea870ca84..f63ed8cd3db 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -538,7 +538,7 @@ _mesa_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb) default: switch (rb->Format) { /* XXX This list is likely incomplete. */ - case MESA_FORMAT_RGB9_E5_FLOAT: + case MESA_FORMAT_R9G9B9E5_FLOAT: fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED; return; default:; @@ -668,7 +668,7 @@ is_format_color_renderable(const struct gl_context *ctx, mesa_format format, GLe break; } - if (format == MESA_FORMAT_ARGB2101010 && internalFormat != GL_RGB10_A2) { + if (format == MESA_FORMAT_B10G10R10A2_UNORM && internalFormat != GL_RGB10_A2) { return GL_FALSE; } @@ -2903,7 +2903,7 @@ _mesa_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, /* special cases */ *params = GL_INDEX; } - else if (format == MESA_FORMAT_Z32_FLOAT_X24S8) { + else if (format == MESA_FORMAT_Z32_FLOAT_S8X24_UINT) { /* depends on the attachment parameter */ if (attachment == GL_STENCIL_ATTACHMENT) { *params = GL_INDEX; 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; diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c index 33dc07d80c2..d40fb55802e 100644 --- a/src/mesa/main/format_unpack.c +++ b/src/mesa/main/format_unpack.c @@ -30,7 +30,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; @@ -2329,19 +2329,19 @@ get_unpack_rgba_function(mesa_format format) table[MESA_FORMAT_X8R8G8B8_UNORM] = unpack_XRGB8888_REV; 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; - table[MESA_FORMAT_ARGB4444_REV] = unpack_ARGB4444_REV; - table[MESA_FORMAT_RGBA5551] = unpack_RGBA5551; - table[MESA_FORMAT_ARGB1555] = unpack_ARGB1555; - table[MESA_FORMAT_ARGB1555_REV] = unpack_ARGB1555_REV; - table[MESA_FORMAT_AL44] = unpack_AL44; - table[MESA_FORMAT_AL88] = unpack_AL88; - table[MESA_FORMAT_AL88_REV] = unpack_AL88_REV; - table[MESA_FORMAT_AL1616] = unpack_AL1616; - table[MESA_FORMAT_AL1616_REV] = unpack_AL1616_REV; - table[MESA_FORMAT_RGB332] = unpack_RGB332; + table[MESA_FORMAT_B5G6R5_UNORM] = unpack_RGB565; + table[MESA_FORMAT_R5G6B5_UNORM] = unpack_RGB565_REV; + table[MESA_FORMAT_B4G4R4A4_UNORM] = unpack_ARGB4444; + table[MESA_FORMAT_A4R4G4B4_UNORM] = unpack_ARGB4444_REV; + table[MESA_FORMAT_A1B5G5R5_UNORM] = unpack_RGBA5551; + table[MESA_FORMAT_B5G5R5A1_UNORM] = unpack_ARGB1555; + table[MESA_FORMAT_A1R5G5B5_UNORM] = unpack_ARGB1555_REV; + table[MESA_FORMAT_L4A4_UNORM] = unpack_AL44; + table[MESA_FORMAT_L8A8_UNORM] = unpack_AL88; + table[MESA_FORMAT_A8L8_UNORM] = unpack_AL88_REV; + table[MESA_FORMAT_L16A16_UNORM] = unpack_AL1616; + table[MESA_FORMAT_A16L16_UNORM] = unpack_AL1616_REV; + table[MESA_FORMAT_B2G3R3_UNORM] = unpack_RGB332; table[MESA_FORMAT_A_UNORM8] = unpack_A8; table[MESA_FORMAT_A_UNORM16] = unpack_A16; table[MESA_FORMAT_L_UNORM8] = unpack_L8; @@ -2351,26 +2351,26 @@ get_unpack_rgba_function(mesa_format format) table[MESA_FORMAT_YCBCR] = unpack_YCBCR; table[MESA_FORMAT_YCBCR_REV] = unpack_YCBCR_REV; table[MESA_FORMAT_R_UNORM8] = unpack_R8; - table[MESA_FORMAT_GR88] = unpack_GR88; - table[MESA_FORMAT_RG88] = unpack_RG88; + table[MESA_FORMAT_R8G8_UNORM] = unpack_GR88; + table[MESA_FORMAT_G8R8_UNORM] = unpack_RG88; 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; - table[MESA_FORMAT_ARGB2101010_UINT] = unpack_ARGB2101010_UINT; - 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_R16G16_UNORM] = unpack_GR1616; + table[MESA_FORMAT_G16R16_UNORM] = unpack_RG1616; + table[MESA_FORMAT_B10G10R10A2_UNORM] = unpack_ARGB2101010; + table[MESA_FORMAT_B10G10R10A2_UINT] = unpack_ARGB2101010_UINT; + table[MESA_FORMAT_R10G10B10A2_UINT] = unpack_ABGR2101010_UINT; + table[MESA_FORMAT_S8_UINT_Z24_UNORM] = unpack_Z24_S8; + table[MESA_FORMAT_Z24_UNORM_X8_UINT] = unpack_S8_Z24; 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_Z24_UNORM_S8_UINT] = unpack_X8_Z24; + table[MESA_FORMAT_X8Z24_UNORM] = unpack_Z24_X8; 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_A8B8G8R8_SRGB] = unpack_SRGBA8; + table[MESA_FORMAT_B8G8R8A8_SRGB] = unpack_SARGB8; table[MESA_FORMAT_L_SRGB8] = unpack_SL8; - table[MESA_FORMAT_SLA8] = unpack_SLA8; + table[MESA_FORMAT_L8A8_SRGB] = unpack_SLA8; table[MESA_FORMAT_SRGB_DXT1] = unpack_SRGB_DXT1; table[MESA_FORMAT_SRGBA_DXT1] = unpack_SRGBA_DXT1; table[MESA_FORMAT_SRGBA_DXT3] = unpack_SRGBA_DXT3; @@ -2497,19 +2497,19 @@ get_unpack_rgba_function(mesa_format format) table[MESA_FORMAT_SIGNED_AL1616] = unpack_SIGNED_AL1616; table[MESA_FORMAT_SIGNED_I16] = unpack_SIGNED_I16; - 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_R9G9B9E5_FLOAT] = unpack_RGB9_E5_FLOAT; + table[MESA_FORMAT_R11G11B10_FLOAT] = unpack_R11_G11_B10_FLOAT; table[MESA_FORMAT_Z_FLOAT32] = unpack_Z32_FLOAT; - table[MESA_FORMAT_Z32_FLOAT_X24S8] = unpack_Z32_FLOAT_X24S8; + table[MESA_FORMAT_Z32_FLOAT_S8X24_UINT] = 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_B4G4R4X4_UNORM] = unpack_XRGB4444_UNORM; + table[MESA_FORMAT_B5G5R5X1_UNORM] = unpack_XRGB1555_UNORM; + table[MESA_FORMAT_R8G8B8X8_SNORM] = unpack_XBGR8888_SNORM; + table[MESA_FORMAT_R8G8B8X8_SRGB] = unpack_XBGR8888_SRGB; 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_B10G10R10X2_UNORM] = unpack_XRGB2101010_UNORM; table[MESA_FORMAT_RGBX_UNORM16] = unpack_XBGR16161616_UNORM; table[MESA_FORMAT_RGBX_SNORM16] = unpack_XBGR16161616_SNORM; table[MESA_FORMAT_RGBX_FLOAT16] = unpack_XBGR16161616_FLOAT; @@ -2519,7 +2519,7 @@ get_unpack_rgba_function(mesa_format format) table[MESA_FORMAT_RGBX_UINT32] = unpack_XBGR32323232_UINT; table[MESA_FORMAT_RGBX_SINT32] = unpack_XBGR32323232_SINT; - table[MESA_FORMAT_ABGR2101010] = unpack_ABGR2101010; + table[MESA_FORMAT_R10G10B10A2_UNORM] = unpack_ABGR2101010; table[MESA_FORMAT_SIGNED_RG88] = unpack_SIGNED_RG88; table[MESA_FORMAT_SIGNED_RG1616] = unpack_SIGNED_RG1616; @@ -2947,37 +2947,37 @@ _mesa_unpack_ubyte_rgba_row(mesa_format format, GLuint n, case MESA_FORMAT_RGB_UNORM8: unpack_ubyte_BGR888(src, dst, n); break; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: unpack_ubyte_RGB565(src, dst, n); break; - case MESA_FORMAT_RGB565_REV: + case MESA_FORMAT_R5G6B5_UNORM: unpack_ubyte_RGB565_REV(src, dst, n); break; - case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_B4G4R4A4_UNORM: unpack_ubyte_ARGB4444(src, dst, n); break; - case MESA_FORMAT_ARGB4444_REV: + case MESA_FORMAT_A4R4G4B4_UNORM: unpack_ubyte_ARGB4444_REV(src, dst, n); break; - case MESA_FORMAT_RGBA5551: + case MESA_FORMAT_A1B5G5R5_UNORM: unpack_ubyte_RGBA5551(src, dst, n); break; - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: unpack_ubyte_ARGB1555(src, dst, n); break; - case MESA_FORMAT_ARGB1555_REV: + case MESA_FORMAT_A1R5G5B5_UNORM: unpack_ubyte_ARGB1555_REV(src, dst, n); break; - case MESA_FORMAT_AL44: + case MESA_FORMAT_L4A4_UNORM: unpack_ubyte_AL44(src, dst, n); break; - case MESA_FORMAT_AL88: + case MESA_FORMAT_L8A8_UNORM: unpack_ubyte_AL88(src, dst, n); break; - case MESA_FORMAT_AL88_REV: + case MESA_FORMAT_A8L8_UNORM: unpack_ubyte_AL88_REV(src, dst, n); break; - case MESA_FORMAT_RGB332: + case MESA_FORMAT_B2G3R3_UNORM: unpack_ubyte_RGB332(src, dst, n); break; case MESA_FORMAT_A_UNORM8: @@ -2992,10 +2992,10 @@ _mesa_unpack_ubyte_rgba_row(mesa_format format, GLuint n, case MESA_FORMAT_R_UNORM8: unpack_ubyte_R8(src, dst, n); break; - case MESA_FORMAT_GR88: + case MESA_FORMAT_R8G8_UNORM: unpack_ubyte_GR88(src, dst, n); break; - case MESA_FORMAT_RG88: + case MESA_FORMAT_G8R8_UNORM: unpack_ubyte_RG88(src, dst, n); break; default: @@ -3806,15 +3806,15 @@ _mesa_unpack_uint_rgba_row(mesa_format format, GLuint n, unpack_int_rgba_INTENSITY_INT8(src, dst, n); break; - case MESA_FORMAT_ARGB2101010_UINT: + case MESA_FORMAT_B10G10R10A2_UINT: unpack_int_rgba_ARGB2101010_UINT(src, dst, n); break; - case MESA_FORMAT_ABGR2101010_UINT: + case MESA_FORMAT_R10G10B10A2_UINT: unpack_int_rgba_ABGR2101010_UINT(src, dst, n); break; - case MESA_FORMAT_ARGB2101010: + case MESA_FORMAT_B10G10R10A2_UNORM: unpack_int_rgba_ARGB2101010(src, dst, n); break; @@ -3839,7 +3839,7 @@ _mesa_unpack_uint_rgba_row(mesa_format format, GLuint n, unpack_int_rgba_XBGR32323232_UINT(src, dst, n); break; - case MESA_FORMAT_ABGR2101010: + case MESA_FORMAT_R10G10B10A2_UNORM: unpack_int_rgba_ABGR2101010(src, dst, n); break; @@ -3970,12 +3970,12 @@ _mesa_unpack_float_z_row(mesa_format format, GLuint n, unpack_float_z_func unpack; switch (format) { - case MESA_FORMAT_Z24_S8: - case MESA_FORMAT_Z24_X8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: + case MESA_FORMAT_X8Z24_UNORM: unpack = unpack_float_z_Z24_X8; 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: unpack = unpack_float_z_X8_Z24; break; case MESA_FORMAT_Z_UNORM16: @@ -3987,7 +3987,7 @@ _mesa_unpack_float_z_row(mesa_format format, GLuint n, case MESA_FORMAT_Z_FLOAT32: unpack = unpack_float_z_Z32F; break; - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: unpack = unpack_float_z_Z32X24S8; break; default: @@ -4075,12 +4075,12 @@ _mesa_unpack_uint_z_row(mesa_format format, GLuint n, const GLubyte *srcPtr = (GLubyte *) src; switch (format) { - case MESA_FORMAT_Z24_S8: - case MESA_FORMAT_Z24_X8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: + case MESA_FORMAT_X8Z24_UNORM: unpack = unpack_uint_z_Z24_X8; 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: unpack = unpack_uint_z_X8_Z24; break; case MESA_FORMAT_Z_UNORM16: @@ -4092,7 +4092,7 @@ _mesa_unpack_uint_z_row(mesa_format format, GLuint n, case MESA_FORMAT_Z_FLOAT32: unpack = unpack_uint_z_Z32_FLOAT; break; - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: unpack = unpack_uint_z_Z32_FLOAT_X24S8; break; default: @@ -4149,13 +4149,13 @@ _mesa_unpack_ubyte_stencil_row(mesa_format format, GLuint n, case MESA_FORMAT_S_UINT8: unpack_ubyte_s_S8(src, dst, n); break; - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: unpack_ubyte_s_Z24_S8(src, dst, n); break; - case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_Z24_UNORM_X8_UINT: unpack_ubyte_s_S8_Z24(src, dst, n); break; - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: unpack_ubyte_s_Z32_FLOAT_X24S8(src, dst, n); break; default: @@ -4187,10 +4187,10 @@ _mesa_unpack_uint_24_8_depth_stencil_row(mesa_format format, GLuint n, const void *src, GLuint *dst) { switch (format) { - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: unpack_uint_24_8_depth_stencil_Z24_S8(src, dst, n); break; - case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_Z24_UNORM_X8_UINT: unpack_uint_24_8_depth_stencil_S8_Z24(src, dst, n); break; default: diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 99d1e189d8d..1ca2aa3b080 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -178,8 +178,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 3 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_RGB565, /* Name */ - "MESA_FORMAT_RGB565", /* StrName */ + MESA_FORMAT_B5G6R5_UNORM, /* Name */ + "MESA_FORMAT_B5G6R5_UNORM", /* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 5, 6, 5, 0, /* Red/Green/Blue/AlphaBits */ @@ -187,8 +187,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_RGB565_REV, /* Name */ - "MESA_FORMAT_RGB565_REV", /* StrName */ + MESA_FORMAT_R5G6B5_UNORM, /* Name */ + "MESA_FORMAT_R5G6B5_UNORM", /* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 5, 6, 5, 0, /* Red/Green/Blue/AlphaBits */ @@ -196,8 +196,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_ARGB4444, /* Name */ - "MESA_FORMAT_ARGB4444", /* StrName */ + MESA_FORMAT_B4G4R4A4_UNORM, /* Name */ + "MESA_FORMAT_B4G4R4A4_UNORM", /* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */ @@ -205,8 +205,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_ARGB4444_REV, /* Name */ - "MESA_FORMAT_ARGB4444_REV", /* StrName */ + MESA_FORMAT_A4R4G4B4_UNORM, /* Name */ + "MESA_FORMAT_A4R4G4B4_UNORM", /* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */ @@ -214,8 +214,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_RGBA5551, /* Name */ - "MESA_FORMAT_RGBA5551", /* StrName */ + MESA_FORMAT_A1B5G5R5_UNORM, /* Name */ + "MESA_FORMAT_A1B5G5R5_UNORM", /* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */ @@ -223,8 +223,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_ARGB1555, /* Name */ - "MESA_FORMAT_ARGB1555", /* StrName */ + MESA_FORMAT_B5G5R5A1_UNORM, /* Name */ + "MESA_FORMAT_B5G5R5A1_UNORM", /* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */ @@ -232,8 +232,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_ARGB1555_REV, /* Name */ - "MESA_FORMAT_ARGB1555_REV", /* StrName */ + MESA_FORMAT_A1R5G5B5_UNORM, /* Name */ + "MESA_FORMAT_A1R5G5B5_UNORM", /* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */ @@ -241,8 +241,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_AL44, /* Name */ - "MESA_FORMAT_AL44", /* StrName */ + MESA_FORMAT_L4A4_UNORM, /* Name */ + "MESA_FORMAT_L4A4_UNORM", /* StrName */ GL_LUMINANCE_ALPHA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 4, /* Red/Green/Blue/AlphaBits */ @@ -250,8 +250,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_AL88, /* Name */ - "MESA_FORMAT_AL88", /* StrName */ + MESA_FORMAT_L8A8_UNORM, /* Name */ + "MESA_FORMAT_L8A8_UNORM", /* StrName */ GL_LUMINANCE_ALPHA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 8, /* Red/Green/Blue/AlphaBits */ @@ -259,8 +259,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_AL88_REV, /* Name */ - "MESA_FORMAT_AL88_REV", /* StrName */ + MESA_FORMAT_A8L8_UNORM, /* Name */ + "MESA_FORMAT_A8L8_UNORM", /* StrName */ GL_LUMINANCE_ALPHA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 8, /* Red/Green/Blue/AlphaBits */ @@ -268,8 +268,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_AL1616, /* Name */ - "MESA_FORMAT_AL1616", /* StrName */ + MESA_FORMAT_L16A16_UNORM, /* Name */ + "MESA_FORMAT_L16A16_UNORM", /* StrName */ GL_LUMINANCE_ALPHA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 16, /* Red/Green/Blue/AlphaBits */ @@ -277,8 +277,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_AL1616_REV, /* Name */ - "MESA_FORMAT_AL1616_REV", /* StrName */ + MESA_FORMAT_A16L16_UNORM, /* Name */ + "MESA_FORMAT_A16L16_UNORM", /* StrName */ GL_LUMINANCE_ALPHA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 16, /* Red/Green/Blue/AlphaBits */ @@ -286,8 +286,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_RGB332, /* Name */ - "MESA_FORMAT_RGB332", /* StrName */ + MESA_FORMAT_B2G3R3_UNORM, /* Name */ + "MESA_FORMAT_B2G3R3_UNORM", /* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 3, 3, 2, 0, /* Red/Green/Blue/AlphaBits */ @@ -376,8 +376,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 }, { - MESA_FORMAT_GR88, - "MESA_FORMAT_GR88", + MESA_FORMAT_R8G8_UNORM, + "MESA_FORMAT_R8G8_UNORM", GL_RG, GL_UNSIGNED_NORMALIZED, 8, 8, 0, 0, @@ -385,8 +385,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 }, { - MESA_FORMAT_RG88, - "MESA_FORMAT_RG88", + MESA_FORMAT_G8R8_UNORM, + "MESA_FORMAT_G8R8_UNORM", GL_RG, GL_UNSIGNED_NORMALIZED, 8, 8, 0, 0, @@ -403,8 +403,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 }, { - MESA_FORMAT_GR1616, - "MESA_FORMAT_GR1616", + MESA_FORMAT_R16G16_UNORM, + "MESA_FORMAT_R16G16_UNORM", GL_RG, GL_UNSIGNED_NORMALIZED, 16, 16, 0, 0, @@ -412,8 +412,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_RG1616, - "MESA_FORMAT_RG1616", + MESA_FORMAT_G16R16_UNORM, + "MESA_FORMAT_G16R16_UNORM", GL_RG, GL_UNSIGNED_NORMALIZED, 16, 16, 0, 0, @@ -421,8 +421,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_ARGB2101010, - "MESA_FORMAT_ARGB2101010", + MESA_FORMAT_B10G10R10A2_UNORM, + "MESA_FORMAT_B10G10R10A2_UNORM", GL_RGBA, GL_UNSIGNED_NORMALIZED, 10, 10, 10, 2, @@ -430,8 +430,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_Z24_S8, /* Name */ - "MESA_FORMAT_Z24_S8", /* StrName */ + MESA_FORMAT_S8_UINT_Z24_UNORM, /* Name */ + "MESA_FORMAT_S8_UINT_Z24_UNORM", /* StrName */ GL_DEPTH_STENCIL, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -439,8 +439,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_S8_Z24, /* Name */ - "MESA_FORMAT_S8_Z24", /* StrName */ + MESA_FORMAT_Z24_UNORM_X8_UINT, /* Name */ + "MESA_FORMAT_Z24_UNORM_X8_UINT", /* StrName */ GL_DEPTH_STENCIL, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -457,8 +457,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_X8_Z24, /* Name */ - "MESA_FORMAT_X8_Z24", /* StrName */ + MESA_FORMAT_Z24_UNORM_S8_UINT, /* Name */ + "MESA_FORMAT_Z24_UNORM_S8_UINT", /* StrName */ GL_DEPTH_COMPONENT, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -466,8 +466,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_Z24_X8, /* Name */ - "MESA_FORMAT_Z24_X8", /* StrName */ + MESA_FORMAT_X8Z24_UNORM, /* Name */ + "MESA_FORMAT_X8Z24_UNORM", /* StrName */ GL_DEPTH_COMPONENT, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -502,8 +502,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 3 }, { - MESA_FORMAT_SRGBA8, - "MESA_FORMAT_SRGBA8", + MESA_FORMAT_A8B8G8R8_SRGB, + "MESA_FORMAT_A8B8G8R8_SRGB", GL_RGBA, GL_UNSIGNED_NORMALIZED, 8, 8, 8, 8, @@ -511,8 +511,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_SARGB8, - "MESA_FORMAT_SARGB8", + MESA_FORMAT_B8G8R8A8_SRGB, + "MESA_FORMAT_B8G8R8A8_SRGB", GL_RGBA, GL_UNSIGNED_NORMALIZED, 8, 8, 8, 8, @@ -529,8 +529,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 }, { - MESA_FORMAT_SLA8, - "MESA_FORMAT_SLA8", + MESA_FORMAT_L8A8_SRGB, + "MESA_FORMAT_L8A8_SRGB", GL_LUMINANCE_ALPHA, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 8, @@ -1571,7 +1571,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 }, { - MESA_FORMAT_RGB9_E5_FLOAT, + MESA_FORMAT_R9G9B9E5_FLOAT, "MESA_FORMAT_RGB9_E5", GL_RGB, GL_FLOAT, @@ -1580,8 +1580,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_R11_G11_B10_FLOAT, - "MESA_FORMAT_R11_G11_B10_FLOAT", + MESA_FORMAT_R11G11B10_FLOAT, + "MESA_FORMAT_R11G11B10_FLOAT", GL_RGB, GL_FLOAT, 11, 11, 10, 0, @@ -1599,8 +1599,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_Z32_FLOAT_X24S8, /* Name */ - "MESA_FORMAT_Z32_FLOAT_X24S8", /* StrName */ + MESA_FORMAT_Z32_FLOAT_S8X24_UINT, /* Name */ + "MESA_FORMAT_Z32_FLOAT_S8X24_UINT", /* StrName */ GL_DEPTH_STENCIL, /* BaseFormat */ /* DataType here is used to answer GL_TEXTURE_DEPTH_TYPE queries, and is * never used for stencil because stencil is always GL_UNSIGNED_INT. @@ -1611,8 +1611,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 8 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_ARGB2101010_UINT, - "MESA_FORMAT_ARGB2101010_UINT", + MESA_FORMAT_B10G10R10A2_UINT, + "MESA_FORMAT_B10G10R10A2_UINT", GL_RGBA, GL_UNSIGNED_INT, 10, 10, 10, 2, @@ -1620,8 +1620,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_ABGR2101010_UINT, - "MESA_FORMAT_ABGR2101010_UINT", + MESA_FORMAT_R10G10B10A2_UINT, + "MESA_FORMAT_R10G10B10A2_UINT", GL_RGBA, GL_UNSIGNED_INT, 10, 10, 10, 2, @@ -1629,8 +1629,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_XRGB4444_UNORM, - "MESA_FORMAT_XRGB4444_UNORM", + MESA_FORMAT_B4G4R4X4_UNORM, + "MESA_FORMAT_B4G4R4X4_UNORM", GL_RGB, GL_UNSIGNED_NORMALIZED, 4, 4, 4, 0, @@ -1638,8 +1638,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 }, { - MESA_FORMAT_XRGB1555_UNORM, - "MESA_FORMAT_XRGB1555_UNORM", + MESA_FORMAT_B5G5R5X1_UNORM, + "MESA_FORMAT_B5G5R5X1_UNORM", GL_RGB, GL_UNSIGNED_NORMALIZED, 5, 5, 5, 0, @@ -1647,8 +1647,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 }, { - MESA_FORMAT_XBGR8888_SNORM, - "MESA_FORMAT_XBGR8888_SNORM", + MESA_FORMAT_R8G8B8X8_SNORM, + "MESA_FORMAT_R8G8B8X8_SNORM", GL_RGB, GL_SIGNED_NORMALIZED, 8, 8, 8, 0, @@ -1656,8 +1656,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_XBGR8888_SRGB, - "MESA_FORMAT_XBGR8888_SRGB", + MESA_FORMAT_R8G8B8X8_SRGB, + "MESA_FORMAT_R8G8B8X8_SRGB", GL_RGB, GL_UNSIGNED_NORMALIZED, 8, 8, 8, 0, @@ -1683,8 +1683,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_XRGB2101010_UNORM, - "MESA_FORMAT_XRGB2101010_UNORM", + MESA_FORMAT_B10G10R10X2_UNORM, + "MESA_FORMAT_B10G10R10X2_UNORM", GL_RGB, GL_UNSIGNED_NORMALIZED, 10, 10, 10, 0, @@ -1764,8 +1764,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 16 }, { - MESA_FORMAT_ABGR2101010, - "MESA_FORMAT_ABGR2101010", + MESA_FORMAT_R10G10B10A2_UNORM, + "MESA_FORMAT_R10G10B10A2_UNORM", GL_RGBA, GL_UNSIGNED_NORMALIZED, 10, 10, 10, 2, @@ -1999,8 +1999,8 @@ _mesa_is_format_unsigned(mesa_format format) GLboolean _mesa_is_format_signed(mesa_format format) { - if (format == MESA_FORMAT_R11_G11_B10_FLOAT || - format == MESA_FORMAT_RGB9_E5_FLOAT) { + if (format == MESA_FORMAT_R11G11B10_FLOAT || + format == MESA_FORMAT_R9G9B9E5_FLOAT) { /* these packed float formats only store unsigned values */ return GL_FALSE; } @@ -2023,15 +2023,15 @@ _mesa_get_format_color_encoding(mesa_format format) /* XXX this info should be encoded in gl_format_info */ switch (format) { case MESA_FORMAT_BGR_SRGB8: - case MESA_FORMAT_SRGBA8: - case MESA_FORMAT_SARGB8: + case MESA_FORMAT_A8B8G8R8_SRGB: + case MESA_FORMAT_B8G8R8A8_SRGB: case MESA_FORMAT_L_SRGB8: - case MESA_FORMAT_SLA8: + case MESA_FORMAT_L8A8_SRGB: case MESA_FORMAT_SRGB_DXT1: case MESA_FORMAT_SRGBA_DXT1: case MESA_FORMAT_SRGBA_DXT3: case MESA_FORMAT_SRGBA_DXT5: - case MESA_FORMAT_XBGR8888_SRGB: + case MESA_FORMAT_R8G8B8X8_SRGB: case MESA_FORMAT_ETC2_SRGB8: case MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC: case MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1: @@ -2053,17 +2053,17 @@ _mesa_get_srgb_format_linear(mesa_format format) case MESA_FORMAT_BGR_SRGB8: format = MESA_FORMAT_BGR_UNORM8; break; - case MESA_FORMAT_SRGBA8: + case MESA_FORMAT_A8B8G8R8_SRGB: format = MESA_FORMAT_A8B8G8R8_UNORM; break; - case MESA_FORMAT_SARGB8: + case MESA_FORMAT_B8G8R8A8_SRGB: format = MESA_FORMAT_B8G8R8A8_UNORM; break; case MESA_FORMAT_L_SRGB8: format = MESA_FORMAT_L_UNORM8; break; - case MESA_FORMAT_SLA8: - format = MESA_FORMAT_AL88; + case MESA_FORMAT_L8A8_SRGB: + format = MESA_FORMAT_L8A8_UNORM; break; case MESA_FORMAT_SRGB_DXT1: format = MESA_FORMAT_RGB_DXT1; @@ -2077,7 +2077,7 @@ _mesa_get_srgb_format_linear(mesa_format format) case MESA_FORMAT_SRGBA_DXT5: format = MESA_FORMAT_RGBA_DXT5; break; - case MESA_FORMAT_XBGR8888_SRGB: + case MESA_FORMAT_R8G8B8X8_SRGB: format = MESA_FORMAT_R8G8B8X8_UNORM; break; case MESA_FORMAT_ETC2_SRGB8: @@ -2125,7 +2125,7 @@ _mesa_get_uncompressed_format(mesa_format format) case MESA_FORMAT_SIGNED_RED_RGTC1: return MESA_FORMAT_SIGNED_R8; case MESA_FORMAT_RG_RGTC2: - return MESA_FORMAT_GR88; + return MESA_FORMAT_R8G8_UNORM; case MESA_FORMAT_SIGNED_RG_RGTC2: return MESA_FORMAT_SIGNED_RG88_REV; case MESA_FORMAT_L_LATC1: @@ -2133,7 +2133,7 @@ _mesa_get_uncompressed_format(mesa_format format) case MESA_FORMAT_SIGNED_L_LATC1: return MESA_FORMAT_SIGNED_L8; case MESA_FORMAT_LA_LATC2: - return MESA_FORMAT_AL88; + return MESA_FORMAT_L8A8_UNORM; case MESA_FORMAT_SIGNED_LA_LATC2: return MESA_FORMAT_SIGNED_AL88; case MESA_FORMAT_ETC1_RGB8: @@ -2150,7 +2150,7 @@ _mesa_get_uncompressed_format(mesa_format format) return MESA_FORMAT_R_UNORM16; case MESA_FORMAT_ETC2_RG11_EAC: case MESA_FORMAT_ETC2_SIGNED_RG11_EAC: - return MESA_FORMAT_GR1616; + return MESA_FORMAT_R16G16_UNORM; default: #ifdef DEBUG assert(!_mesa_is_format_compressed(format)); @@ -2388,53 +2388,53 @@ _mesa_format_to_type_and_comps(mesa_format format, *datatype = GL_UNSIGNED_BYTE; *comps = 3; return; - case MESA_FORMAT_RGB565: - case MESA_FORMAT_RGB565_REV: + case MESA_FORMAT_B5G6R5_UNORM: + case MESA_FORMAT_R5G6B5_UNORM: *datatype = GL_UNSIGNED_SHORT_5_6_5; *comps = 3; return; - case MESA_FORMAT_ARGB4444: - case MESA_FORMAT_ARGB4444_REV: - case MESA_FORMAT_XRGB4444_UNORM: + case MESA_FORMAT_B4G4R4A4_UNORM: + case MESA_FORMAT_A4R4G4B4_UNORM: + case MESA_FORMAT_B4G4R4X4_UNORM: *datatype = GL_UNSIGNED_SHORT_4_4_4_4; *comps = 4; return; - case MESA_FORMAT_ARGB1555: - case MESA_FORMAT_ARGB1555_REV: - case MESA_FORMAT_XRGB1555_UNORM: + case MESA_FORMAT_B5G5R5A1_UNORM: + case MESA_FORMAT_A1R5G5B5_UNORM: + case MESA_FORMAT_B5G5R5X1_UNORM: *datatype = GL_UNSIGNED_SHORT_1_5_5_5_REV; *comps = 4; return; - case MESA_FORMAT_ARGB2101010: + case MESA_FORMAT_B10G10R10A2_UNORM: *datatype = GL_UNSIGNED_INT_2_10_10_10_REV; *comps = 4; return; - case MESA_FORMAT_RGBA5551: + case MESA_FORMAT_A1B5G5R5_UNORM: *datatype = GL_UNSIGNED_SHORT_5_5_5_1; *comps = 4; return; - case MESA_FORMAT_AL44: + case MESA_FORMAT_L4A4_UNORM: *datatype = MESA_UNSIGNED_BYTE_4_4; *comps = 2; return; - case MESA_FORMAT_AL88: - case MESA_FORMAT_AL88_REV: - case MESA_FORMAT_GR88: - case MESA_FORMAT_RG88: + case MESA_FORMAT_L8A8_UNORM: + case MESA_FORMAT_A8L8_UNORM: + case MESA_FORMAT_R8G8_UNORM: + case MESA_FORMAT_G8R8_UNORM: *datatype = GL_UNSIGNED_BYTE; *comps = 2; return; - case MESA_FORMAT_AL1616: - case MESA_FORMAT_AL1616_REV: - case MESA_FORMAT_GR1616: - case MESA_FORMAT_RG1616: + case MESA_FORMAT_L16A16_UNORM: + case MESA_FORMAT_A16L16_UNORM: + case MESA_FORMAT_R16G16_UNORM: + case MESA_FORMAT_G16R16_UNORM: *datatype = GL_UNSIGNED_SHORT; *comps = 2; return; @@ -2447,7 +2447,7 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 1; return; - case MESA_FORMAT_RGB332: + case MESA_FORMAT_B2G3R3_UNORM: *datatype = GL_UNSIGNED_BYTE_3_3_2; *comps = 3; return; @@ -2467,12 +2467,12 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 2; return; - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: *datatype = GL_UNSIGNED_INT_24_8_MESA; *comps = 2; return; - case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_Z24_UNORM_X8_UINT: *datatype = GL_UNSIGNED_INT_8_24_REV_MESA; *comps = 2; return; @@ -2482,12 +2482,12 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 1; return; - case MESA_FORMAT_X8_Z24: + case MESA_FORMAT_Z24_UNORM_S8_UINT: *datatype = GL_UNSIGNED_INT; *comps = 1; return; - case MESA_FORMAT_Z24_X8: + case MESA_FORMAT_X8Z24_UNORM: *datatype = GL_UNSIGNED_INT; *comps = 1; return; @@ -2502,7 +2502,7 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 1; return; - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: *datatype = GL_FLOAT_32_UNSIGNED_INT_24_8_REV; *comps = 1; return; @@ -2561,8 +2561,8 @@ _mesa_format_to_type_and_comps(mesa_format format, *datatype = GL_UNSIGNED_BYTE; *comps = 3; return; - case MESA_FORMAT_SRGBA8: - case MESA_FORMAT_SARGB8: + case MESA_FORMAT_A8B8G8R8_SRGB: + case MESA_FORMAT_B8G8R8A8_SRGB: *datatype = GL_UNSIGNED_BYTE; *comps = 4; return; @@ -2570,7 +2570,7 @@ _mesa_format_to_type_and_comps(mesa_format format, *datatype = GL_UNSIGNED_BYTE; *comps = 1; return; - case MESA_FORMAT_SLA8: + case MESA_FORMAT_L8A8_SRGB: *datatype = GL_UNSIGNED_BYTE; *comps = 2; return; @@ -2815,35 +2815,35 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 4; return; - case MESA_FORMAT_RGB9_E5_FLOAT: + case MESA_FORMAT_R9G9B9E5_FLOAT: *datatype = GL_UNSIGNED_INT_5_9_9_9_REV; *comps = 3; return; - case MESA_FORMAT_R11_G11_B10_FLOAT: + case MESA_FORMAT_R11G11B10_FLOAT: *datatype = GL_UNSIGNED_INT_10F_11F_11F_REV; *comps = 3; return; - case MESA_FORMAT_ARGB2101010_UINT: - case MESA_FORMAT_ABGR2101010_UINT: + case MESA_FORMAT_B10G10R10A2_UINT: + case MESA_FORMAT_R10G10B10A2_UINT: *datatype = GL_UNSIGNED_INT_2_10_10_10_REV; *comps = 4; return; - case MESA_FORMAT_XBGR8888_SRGB: + case MESA_FORMAT_R8G8B8X8_SRGB: case MESA_FORMAT_RGBX_UINT8: *datatype = GL_UNSIGNED_BYTE; *comps = 4; return; - case MESA_FORMAT_XBGR8888_SNORM: + case MESA_FORMAT_R8G8B8X8_SNORM: case MESA_FORMAT_RGBX_SINT8: *datatype = GL_BYTE; *comps = 4; return; - case MESA_FORMAT_XRGB2101010_UNORM: + case MESA_FORMAT_B10G10R10X2_UNORM: *datatype = GL_UNSIGNED_INT_2_10_10_10_REV; *comps = 4; return; @@ -2880,7 +2880,7 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 4; return; - case MESA_FORMAT_ABGR2101010: + case MESA_FORMAT_R10G10B10A2_UNORM: *datatype = GL_UNSIGNED_INT_2_10_10_10_REV; *comps = 4; return; @@ -2943,7 +2943,7 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, return GL_FALSE; case MESA_FORMAT_A8B8G8R8_UNORM: - case MESA_FORMAT_SRGBA8: + case MESA_FORMAT_A8B8G8R8_SRGB: if (format == GL_RGBA && type == GL_UNSIGNED_INT_8_8_8_8 && !swapBytes) return GL_TRUE; @@ -2991,7 +2991,7 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, return GL_FALSE; case MESA_FORMAT_B8G8R8A8_UNORM: - case MESA_FORMAT_SARGB8: + case MESA_FORMAT_B8G8R8A8_SRGB: if (format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV && !swapBytes) return GL_TRUE; @@ -3032,48 +3032,48 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, case MESA_FORMAT_RGB_UNORM8: return format == GL_RGB && type == GL_UNSIGNED_BYTE && littleEndian; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: return format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 && !swapBytes; - case MESA_FORMAT_RGB565_REV: + case MESA_FORMAT_R5G6B5_UNORM: /* Some of the 16-bit MESA_FORMATs that would seem to correspond to * GL_UNSIGNED_SHORT_* are byte-swapped instead of channel-reversed, * according to formats.h, so they can't be matched. */ return GL_FALSE; - case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_B4G4R4A4_UNORM: return format == GL_BGRA && type == GL_UNSIGNED_SHORT_4_4_4_4_REV && !swapBytes; - case MESA_FORMAT_ARGB4444_REV: + case MESA_FORMAT_A4R4G4B4_UNORM: return GL_FALSE; - case MESA_FORMAT_RGBA5551: + case MESA_FORMAT_A1B5G5R5_UNORM: return format == GL_RGBA && type == GL_UNSIGNED_SHORT_5_5_5_1 && !swapBytes; - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: return format == GL_BGRA && type == GL_UNSIGNED_SHORT_1_5_5_5_REV && !swapBytes; - case MESA_FORMAT_ARGB1555_REV: + case MESA_FORMAT_A1R5G5B5_UNORM: return GL_FALSE; - case MESA_FORMAT_AL44: + case MESA_FORMAT_L4A4_UNORM: return GL_FALSE; - case MESA_FORMAT_AL88: - case MESA_FORMAT_SLA8: + case MESA_FORMAT_L8A8_UNORM: + case MESA_FORMAT_L8A8_SRGB: return format == GL_LUMINANCE_ALPHA && type == GL_UNSIGNED_BYTE && littleEndian; - case MESA_FORMAT_AL88_REV: + case MESA_FORMAT_A8L8_UNORM: return GL_FALSE; - case MESA_FORMAT_AL1616: + case MESA_FORMAT_L16A16_UNORM: return format == GL_LUMINANCE_ALPHA && type == GL_UNSIGNED_SHORT && littleEndian && !swapBytes; - case MESA_FORMAT_AL1616_REV: + case MESA_FORMAT_A16L16_UNORM: return GL_FALSE; - case MESA_FORMAT_RGB332: + case MESA_FORMAT_B2G3R3_UNORM: return format == GL_RGB && type == GL_UNSIGNED_BYTE_3_3_2; case MESA_FORMAT_A_UNORM8: @@ -3101,36 +3101,36 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, case MESA_FORMAT_R_UNORM8: return format == GL_RED && type == GL_UNSIGNED_BYTE; - case MESA_FORMAT_GR88: + case MESA_FORMAT_R8G8_UNORM: return format == GL_RG && type == GL_UNSIGNED_BYTE && littleEndian; - case MESA_FORMAT_RG88: + case MESA_FORMAT_G8R8_UNORM: return GL_FALSE; case MESA_FORMAT_R_UNORM16: return format == GL_RED && type == GL_UNSIGNED_SHORT && !swapBytes; - case MESA_FORMAT_GR1616: + case MESA_FORMAT_R16G16_UNORM: return format == GL_RG && type == GL_UNSIGNED_SHORT && littleEndian && !swapBytes; - case MESA_FORMAT_RG1616: + case MESA_FORMAT_G16R16_UNORM: return GL_FALSE; - case MESA_FORMAT_ARGB2101010: + case MESA_FORMAT_B10G10R10A2_UNORM: return format == GL_BGRA && type == GL_UNSIGNED_INT_2_10_10_10_REV && !swapBytes; - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: return format == GL_DEPTH_STENCIL && type == GL_UNSIGNED_INT_24_8 && !swapBytes; - case MESA_FORMAT_Z24_X8: - case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_X8Z24_UNORM: + case MESA_FORMAT_Z24_UNORM_X8_UINT: return GL_FALSE; case MESA_FORMAT_Z_UNORM16: return format == GL_DEPTH_COMPONENT && type == GL_UNSIGNED_SHORT && !swapBytes; - case MESA_FORMAT_X8_Z24: + case MESA_FORMAT_Z24_UNORM_S8_UINT: return GL_FALSE; case MESA_FORMAT_Z_UNORM32: @@ -3395,38 +3395,38 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, return format == GL_INTENSITY && type == GL_SHORT && littleEndian && !swapBytes; - case MESA_FORMAT_ARGB2101010_UINT: + case MESA_FORMAT_B10G10R10A2_UINT: return (format == GL_BGRA_INTEGER_EXT && type == GL_UNSIGNED_INT_2_10_10_10_REV && !swapBytes); - case MESA_FORMAT_ABGR2101010_UINT: + case MESA_FORMAT_R10G10B10A2_UINT: return (format == GL_RGBA_INTEGER_EXT && type == GL_UNSIGNED_INT_2_10_10_10_REV && !swapBytes); - case MESA_FORMAT_RGB9_E5_FLOAT: + case MESA_FORMAT_R9G9B9E5_FLOAT: return format == GL_RGB && type == GL_UNSIGNED_INT_5_9_9_9_REV && !swapBytes; - case MESA_FORMAT_R11_G11_B10_FLOAT: + case MESA_FORMAT_R11G11B10_FLOAT: return format == GL_RGB && type == GL_UNSIGNED_INT_10F_11F_11F_REV && !swapBytes; case MESA_FORMAT_Z_FLOAT32: return format == GL_DEPTH_COMPONENT && type == GL_FLOAT && !swapBytes; - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: return format == GL_DEPTH_STENCIL && type == GL_FLOAT_32_UNSIGNED_INT_24_8_REV && !swapBytes; - case MESA_FORMAT_XRGB4444_UNORM: - case MESA_FORMAT_XRGB1555_UNORM: - case MESA_FORMAT_XBGR8888_SNORM: - case MESA_FORMAT_XBGR8888_SRGB: + case MESA_FORMAT_B4G4R4X4_UNORM: + case MESA_FORMAT_B5G5R5X1_UNORM: + case MESA_FORMAT_R8G8B8X8_SNORM: + case MESA_FORMAT_R8G8B8X8_SRGB: case MESA_FORMAT_RGBX_UINT8: case MESA_FORMAT_RGBX_SINT8: - case MESA_FORMAT_XRGB2101010_UNORM: + case MESA_FORMAT_B10G10R10X2_UNORM: case MESA_FORMAT_RGBX_UNORM16: case MESA_FORMAT_RGBX_SNORM16: case MESA_FORMAT_RGBX_FLOAT16: @@ -3437,7 +3437,7 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, case MESA_FORMAT_RGBX_SINT32: return GL_FALSE; - case MESA_FORMAT_ABGR2101010: + case MESA_FORMAT_R10G10B10A2_UNORM: return format == GL_RGBA && type == GL_UNSIGNED_INT_2_10_10_10_REV && !swapBytes; diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 1e3fb8d43f5..f81e29cfa87 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -348,19 +348,19 @@ typedef enum 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 */ - MESA_FORMAT_ARGB4444_REV, /* GGGG BBBB AAAA RRRR */ - MESA_FORMAT_RGBA5551, /* RRRR RGGG GGBB BBBA */ - MESA_FORMAT_ARGB1555, /* ARRR RRGG GGGB BBBB */ - MESA_FORMAT_ARGB1555_REV, /* GGGB BBBB ARRR RRGG */ - MESA_FORMAT_AL44, /* AAAA LLLL */ - MESA_FORMAT_AL88, /* AAAA AAAA LLLL LLLL */ - MESA_FORMAT_AL88_REV, /* LLLL LLLL AAAA AAAA */ - 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_B5G6R5_UNORM, /* BBBB BGGG GGGR RRRR */ + MESA_FORMAT_R5G6B5_UNORM, /* RRRR RGGG GGGB BBBB */ + MESA_FORMAT_B4G4R4A4_UNORM, /* BBBB GGGG RRRR AAAA */ + MESA_FORMAT_A4R4G4B4_UNORM, /* AAAA RRRR GGGG BBBB */ + MESA_FORMAT_A1B5G5R5_UNORM, /* ABBB BBGG GGGR RRRR */ + MESA_FORMAT_B5G5R5A1_UNORM, /* BBBB BGGG GGRR RRRA */ + MESA_FORMAT_A1R5G5B5_UNORM, /* ARRR RRGG GGGB BBBB */ + MESA_FORMAT_L4A4_UNORM, /* LLLL AAAA */ + MESA_FORMAT_L8A8_UNORM, /* LLLL LLLL AAAA AAAA */ + MESA_FORMAT_A8L8_UNORM, /* AAAA AAAA LLLL LLLL */ + MESA_FORMAT_L16A16_UNORM, /* LLLL LLLL LLLL LLLL AAAA AAAA AAAA AAAA */ + MESA_FORMAT_A16L16_UNORM, /* AAAA AAAA AAAA AAAA LLLL LLLL LLLL LLLL */ + MESA_FORMAT_B2G3R3_UNORM, /* BBGG GRRR */ /* Type A formats */ MESA_FORMAT_A_UNORM8, /* uchar[i] = A */ @@ -371,32 +371,32 @@ typedef enum 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_YCBCR, /* YYYY YYYY UorV UorV */ + MESA_FORMAT_YCBCR_REV, /* UorV UorV YYYY YYYY */ /* 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_R8G8_UNORM, /* RRRR RRRR GGGG GGGG */ + MESA_FORMAT_G8R8_UNORM, /* GGGG GGGG 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_R16G16_UNORM, /* RRRR RRRR RRRR RRRR GGGG GGGG GGGG GGGG */ + MESA_FORMAT_G16R16_UNORM, /* GGGG GGGG GGGG GGGG RRRR RRRR RRRR RRRR */ + MESA_FORMAT_B10G10R10A2_UNORM,/* BBBB BBBB BBGG GGGG GGGG RRRR RRRR RRAA */ + MESA_FORMAT_S8_UINT_Z24_UNORM,/* SSSS SSSS ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ + MESA_FORMAT_Z24_UNORM_X8_UINT,/* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ xxxx xxxx */ /* 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_Z24_UNORM_S8_UINT,/* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ SSSS SSSS */ + MESA_FORMAT_X8Z24_UNORM, /* xxxx xxxx ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ /* Type A formats */ MESA_FORMAT_Z_UNORM32, /* uint[i] = Z */ @@ -411,14 +411,14 @@ typedef enum 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_A8B8G8R8_SRGB, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR*/ + MESA_FORMAT_B8G8R8A8_SRGB, /* BBBB BBBB GGGG GGGG RRRR RRRR AAAA AAAA */ /* Type A format(s) */ MESA_FORMAT_L_SRGB8, /* uchar[i] = L */ /* Type P formats */ - MESA_FORMAT_SLA8, /* AAAA AAAA LLLL LLLL */ + MESA_FORMAT_L8A8_SRGB, /* LLLL LLLL AAAA AAAA */ /* Type C formats */ MESA_FORMAT_SRGB_DXT1, @@ -531,8 +531,8 @@ typedef enum MESA_FORMAT_RGB_UINT32, MESA_FORMAT_RGBA_UINT32, - /* msb <------ TEXEL BITS -----------> lsb */ - /* ---- ---- ---- ---- ---- ---- ---- ---- */ + /* msb <------ TEXEL BITS -----------> lsb */ + /* ---- ---- ---- ---- ---- ---- ---- ---- */ /** * \name Signed fixed point texture formats. */ @@ -602,31 +602,31 @@ typedef enum 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_R9G9B9E5_FLOAT, + MESA_FORMAT_R11G11B10_FLOAT, /* Type A format(s) */ MESA_FORMAT_Z_FLOAT32, /* Type P formats */ - MESA_FORMAT_Z32_FLOAT_X24S8, + MESA_FORMAT_Z32_FLOAT_S8X24_UINT, - MESA_FORMAT_ARGB2101010_UINT, - MESA_FORMAT_ABGR2101010_UINT, + MESA_FORMAT_B10G10R10A2_UINT, + MESA_FORMAT_R10G10B10A2_UINT, - MESA_FORMAT_XRGB4444_UNORM, /* xxxx RRRR GGGG BBBB */ - 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_B4G4R4X4_UNORM, /* BBBB GGGG RRRR xxxx */ + MESA_FORMAT_B5G5R5X1_UNORM, /* BBBB BGGG GGRR RRRx */ + MESA_FORMAT_R8G8B8X8_SNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB xxxx xxxx */ + MESA_FORMAT_R8G8B8X8_SRGB, /* RRRR RRRR GGGG GGGG BBBB BBBB xxxx xxxx */ /* 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_B10G10R10X2_UNORM,/* xxRR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */ - /* Type A format(s) */ + /* Type A formats */ 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, /* ... */ @@ -638,7 +638,7 @@ typedef enum MESA_FORMAT_RGBX_SINT32, /* ... */ /* Type P formats */ - MESA_FORMAT_ABGR2101010, + MESA_FORMAT_R10G10B10A2_UNORM, MESA_FORMAT_SIGNED_RG88, MESA_FORMAT_SIGNED_RG1616, diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index b5fc4ee0d8a..54eeda2b2ae 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -842,7 +842,7 @@ _mesa_get_color_read_format(struct gl_context *ctx) if (format == MESA_FORMAT_B8G8R8A8_UNORM) return GL_BGRA; - else if (format == MESA_FORMAT_RGB565) + else if (format == MESA_FORMAT_B5G6R5_UNORM) return GL_BGR; switch (data_type) { @@ -875,7 +875,7 @@ _mesa_get_color_read_type(struct gl_context *ctx) const GLenum format = ctx->ReadBuffer->_ColorReadBuffer->Format; const GLenum data_type = _mesa_get_format_datatype(format); - if (format == MESA_FORMAT_RGB565) + if (format == MESA_FORMAT_B5G6R5_UNORM) return GL_UNSIGNED_SHORT_5_6_5_REV; switch (data_type) { diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index fcf849b9808..e16346896ba 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -594,8 +594,8 @@ fast_read_depth_stencil_pixels(struct gl_context *ctx, if (rb != stencilRb) return GL_FALSE; - if (rb->Format != MESA_FORMAT_Z24_S8 && - rb->Format != MESA_FORMAT_S8_Z24) + if (rb->Format != MESA_FORMAT_S8_UINT_Z24_UNORM && + rb->Format != MESA_FORMAT_Z24_UNORM_X8_UINT) return GL_FALSE; ctx->Driver.MapRenderbuffer(ctx, rb, x, y, width, height, GL_MAP_READ_BIT, diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c index 824607ae31a..05362325213 100644 --- a/src/mesa/main/shaderimage.c +++ b/src/mesa/main/shaderimage.c @@ -43,15 +43,15 @@ */ #ifdef MESA_BIG_ENDIAN # define MESA_FORMAT_RGBA_8 MESA_FORMAT_A8B8G8R8_UNORM -# define MESA_FORMAT_RG_16 MESA_FORMAT_RG1616 -# define MESA_FORMAT_RG_8 MESA_FORMAT_RG88 +# define MESA_FORMAT_RG_16 MESA_FORMAT_G16R16_UNORM +# define MESA_FORMAT_RG_8 MESA_FORMAT_G8R8_UNORM # define MESA_FORMAT_SIGNED_RGBA_8 MESA_FORMAT_SIGNED_RGBA8888 # define MESA_FORMAT_SIGNED_RG_16 MESA_FORMAT_SIGNED_RG1616 # define MESA_FORMAT_SIGNED_RG_8 MESA_FORMAT_SIGNED_RG88 #else # define MESA_FORMAT_RGBA_8 MESA_FORMAT_R8G8B8A8_UNORM -# define MESA_FORMAT_RG_16 MESA_FORMAT_GR1616 -# define MESA_FORMAT_RG_8 MESA_FORMAT_GR88 +# define MESA_FORMAT_RG_16 MESA_FORMAT_R16G16_UNORM +# define MESA_FORMAT_RG_8 MESA_FORMAT_R8G8_UNORM # define MESA_FORMAT_SIGNED_RGBA_8 MESA_FORMAT_SIGNED_RGBA8888_REV # define MESA_FORMAT_SIGNED_RG_16 MESA_FORMAT_SIGNED_GR1616 # define MESA_FORMAT_SIGNED_RG_8 MESA_FORMAT_SIGNED_RG88_REV @@ -74,7 +74,7 @@ get_image_format(GLenum format) return MESA_FORMAT_RG_FLOAT16; case GL_R11F_G11F_B10F: - return MESA_FORMAT_R11_G11_B10_FLOAT; + return MESA_FORMAT_R11G11B10_FLOAT; case GL_R32F: return MESA_FORMAT_R_FLOAT32; @@ -89,7 +89,7 @@ get_image_format(GLenum format) return MESA_FORMAT_RGBA_UINT16; case GL_RGB10_A2UI: - return MESA_FORMAT_ABGR2101010_UINT; + return MESA_FORMAT_R10G10B10A2_UINT; case GL_RGBA8UI: return MESA_FORMAT_RGBA_UINT8; @@ -143,7 +143,7 @@ get_image_format(GLenum format) return MESA_FORMAT_RGBA_UNORM16; case GL_RGB10_A2: - return MESA_FORMAT_ABGR2101010; + return MESA_FORMAT_R10G10B10A2_UNORM; case GL_RGBA8: return MESA_FORMAT_RGBA_8; @@ -220,7 +220,7 @@ get_image_format_class(mesa_format format) case MESA_FORMAT_RG_FLOAT16: return IMAGE_FORMAT_CLASS_2X16; - case MESA_FORMAT_R11_G11_B10_FLOAT: + case MESA_FORMAT_R11G11B10_FLOAT: return IMAGE_FORMAT_CLASS_10_11_11; case MESA_FORMAT_R_FLOAT32: @@ -235,7 +235,7 @@ get_image_format_class(mesa_format format) case MESA_FORMAT_RGBA_UINT16: return IMAGE_FORMAT_CLASS_4X16; - case MESA_FORMAT_ABGR2101010_UINT: + case MESA_FORMAT_R10G10B10A2_UINT: return IMAGE_FORMAT_CLASS_2_10_10_10; case MESA_FORMAT_RGBA_UINT8: @@ -289,7 +289,7 @@ get_image_format_class(mesa_format format) case MESA_FORMAT_RGBA_UNORM16: return IMAGE_FORMAT_CLASS_4X16; - case MESA_FORMAT_ABGR2101010: + case MESA_FORMAT_R10G10B10A2_UNORM: return IMAGE_FORMAT_CLASS_2_10_10_10; case MESA_FORMAT_RGBA_8: diff --git a/src/mesa/main/texcompress_etc.c b/src/mesa/main/texcompress_etc.c index 75bb9f7ffa8..e3862be45e6 100644 --- a/src/mesa/main/texcompress_etc.c +++ b/src/mesa/main/texcompress_etc.c @@ -726,7 +726,7 @@ etc2_unpack_srgb8(uint8_t *dst_row, for (i = 0; i < bw; i++) { etc2_rgb8_fetch_texel(&block, i, j, dst, false /* punchthrough_alpha */); - /* Convert to MESA_FORMAT_SARGB8 */ + /* Convert to MESA_FORMAT_B8G8R8A8_SRGB */ tmp = dst[0]; dst[0] = dst[2]; dst[2] = tmp; @@ -806,7 +806,7 @@ etc2_unpack_srgb8_alpha8(uint8_t *dst_row, for (i = 0; i < bw; i++) { etc2_rgba8_fetch_texel(&block, i, j, dst); - /* Convert to MESA_FORMAT_SARGB8 */ + /* Convert to MESA_FORMAT_B8G8R8A8_SRGB */ tmp = dst[0]; dst[0] = dst[2]; dst[2] = tmp; @@ -1047,7 +1047,7 @@ etc2_unpack_srgb8_punchthrough_alpha1(uint8_t *dst_row, for (i = 0; i < bw; i++) { etc2_rgb8_fetch_texel(&block, i, j, dst, true /* punchthrough_alpha */); - /* Convert to MESA_FORMAT_SARGB8 */ + /* Convert to MESA_FORMAT_B8G8R8A8_SRGB */ tmp = dst[0]; dst[0] = dst[2]; dst[2] = tmp; diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index ab31d3ebc1a..7137c5fc9c5 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -70,11 +70,11 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case 4: case GL_RGBA: if (type == GL_UNSIGNED_SHORT_4_4_4_4_REV) { - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444); + RETURN_IF_SUPPORTED(MESA_FORMAT_B4G4R4A4_UNORM); } else if (type == GL_UNSIGNED_SHORT_1_5_5_5_REV) { - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB1555); + RETURN_IF_SUPPORTED(MESA_FORMAT_B5G5R5A1_UNORM); } else if (type == GL_UNSIGNED_INT_2_10_10_10_REV) { - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010); + RETURN_IF_SUPPORTED(MESA_FORMAT_B10G10R10A2_UNORM); } RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_UNORM); RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM); @@ -85,19 +85,19 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM); break; case GL_RGB5_A1: - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB1555); + RETURN_IF_SUPPORTED(MESA_FORMAT_B5G5R5A1_UNORM); break; case GL_RGBA2: - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444_REV); /* just to test another format*/ - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444); + RETURN_IF_SUPPORTED(MESA_FORMAT_A4R4G4B4_UNORM); /* just to test another format*/ + RETURN_IF_SUPPORTED(MESA_FORMAT_B4G4R4A4_UNORM); break; case GL_RGBA4: - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444); + RETURN_IF_SUPPORTED(MESA_FORMAT_B4G4R4A4_UNORM); break; /* deep RGBA formats */ case GL_RGB10_A2: - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010); + RETURN_IF_SUPPORTED(MESA_FORMAT_B10G10R10A2_UNORM); RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM); break; case GL_RGBA12: @@ -112,7 +112,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case 3: case GL_RGB: if (type == GL_UNSIGNED_INT_2_10_10_10_REV) { - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010); + RETURN_IF_SUPPORTED(MESA_FORMAT_B10G10R10A2_UNORM); } /* fallthrough */ case GL_RGB8: @@ -121,19 +121,19 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM); break; case GL_R3_G3_B2: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB332); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565); - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565_REV); + RETURN_IF_SUPPORTED(MESA_FORMAT_B2G3R3_UNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_B5G6R5_UNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_R5G6B5_UNORM); RETURN_IF_SUPPORTED(MESA_FORMAT_BGR_UNORM8); RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8X8_UNORM); RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM); break; case GL_RGB4: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565_REV); /* just to test another format */ - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565); + RETURN_IF_SUPPORTED(MESA_FORMAT_R5G6B5_UNORM); /* just to test another format */ + RETURN_IF_SUPPORTED(MESA_FORMAT_B5G6R5_UNORM); break; case GL_RGB5: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565); + RETURN_IF_SUPPORTED(MESA_FORMAT_B5G6R5_UNORM); break; /* deep RGB formats */ @@ -175,22 +175,22 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, /* Luminance/Alpha formats */ case GL_LUMINANCE4_ALPHA4: - RETURN_IF_SUPPORTED(MESA_FORMAT_AL44); - RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); + RETURN_IF_SUPPORTED(MESA_FORMAT_L4A4_UNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_L8A8_UNORM); break; case 2: case GL_LUMINANCE_ALPHA: case GL_LUMINANCE6_ALPHA2: case GL_LUMINANCE8_ALPHA8: - RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); + RETURN_IF_SUPPORTED(MESA_FORMAT_L8A8_UNORM); break; case GL_LUMINANCE12_ALPHA4: case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: - RETURN_IF_SUPPORTED(MESA_FORMAT_AL1616); - RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); + RETURN_IF_SUPPORTED(MESA_FORMAT_L16A16_UNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_L8A8_UNORM); break; case GL_INTENSITY: @@ -209,13 +209,13 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT32: RETURN_IF_SUPPORTED(MESA_FORMAT_Z_UNORM32); - RETURN_IF_SUPPORTED(MESA_FORMAT_X8_Z24); - RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24); + RETURN_IF_SUPPORTED(MESA_FORMAT_Z24_UNORM_S8_UINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_Z24_UNORM_X8_UINT); break; case GL_DEPTH_COMPONENT16: RETURN_IF_SUPPORTED(MESA_FORMAT_Z_UNORM16); - RETURN_IF_SUPPORTED(MESA_FORMAT_X8_Z24); - RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24); + RETURN_IF_SUPPORTED(MESA_FORMAT_Z24_UNORM_S8_UINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_Z24_UNORM_X8_UINT); break; case GL_COMPRESSED_ALPHA_ARB: @@ -225,7 +225,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, RETURN_IF_SUPPORTED(MESA_FORMAT_L_UNORM8); break; case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: - RETURN_IF_SUPPORTED(MESA_FORMAT_AL88); + RETURN_IF_SUPPORTED(MESA_FORMAT_L8A8_UNORM); break; case GL_COMPRESSED_INTENSITY_ARB: RETURN_IF_SUPPORTED(MESA_FORMAT_I_UNORM8); @@ -259,7 +259,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, break; case GL_RGB565: - RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565); + RETURN_IF_SUPPORTED(MESA_FORMAT_B5G6R5_UNORM); break; case GL_YCBCR_MESA: @@ -415,26 +415,26 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_RGB9_E5: /* GL_EXT_texture_shared_exponent -- just one format to support */ - ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_RGB9_E5_FLOAT]); - return MESA_FORMAT_RGB9_E5_FLOAT; + ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_R9G9B9E5_FLOAT]); + return MESA_FORMAT_R9G9B9E5_FLOAT; case GL_R11F_G11F_B10F: /* GL_EXT_texture_packed_float -- just one format to support */ - ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_R11_G11_B10_FLOAT]); - return MESA_FORMAT_R11_G11_B10_FLOAT; + ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_R11G11B10_FLOAT]); + return MESA_FORMAT_R11G11B10_FLOAT; case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_Z24_S8); - RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24); + RETURN_IF_SUPPORTED(MESA_FORMAT_S8_UINT_Z24_UNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_Z24_UNORM_X8_UINT); break; case GL_DEPTH_COMPONENT32F: 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; + ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT_S8X24_UINT]); + return MESA_FORMAT_Z32_FLOAT_S8X24_UINT; case GL_DUDV_ATI: case GL_DU8DV8_ATI: @@ -523,42 +523,42 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_SRGB_EXT: case GL_SRGB8_EXT: RETURN_IF_SUPPORTED(MESA_FORMAT_BGR_SRGB8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_SRGB); break; case GL_SRGB_ALPHA_EXT: case GL_SRGB8_ALPHA8_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_SRGB); + RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_SRGB); break; case GL_SLUMINANCE_EXT: case GL_SLUMINANCE8_EXT: RETURN_IF_SUPPORTED(MESA_FORMAT_L_SRGB8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_SRGB); break; case GL_SLUMINANCE_ALPHA_EXT: case GL_SLUMINANCE8_ALPHA8_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_SLA8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + RETURN_IF_SUPPORTED(MESA_FORMAT_L8A8_SRGB); + RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_SRGB); break; case GL_COMPRESSED_SLUMINANCE_EXT: RETURN_IF_SUPPORTED(MESA_FORMAT_L_SRGB8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_SRGB); break; case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: - RETURN_IF_SUPPORTED(MESA_FORMAT_SLA8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + RETURN_IF_SUPPORTED(MESA_FORMAT_L8A8_SRGB); + RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_SRGB); break; case GL_COMPRESSED_SRGB_EXT: if (ctx->Mesa_DXTn) RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB_DXT1); RETURN_IF_SUPPORTED(MESA_FORMAT_BGR_SRGB8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_SRGB); break; case GL_COMPRESSED_SRGB_ALPHA_EXT: if (ctx->Mesa_DXTn) RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT3); /* Not srgba_dxt1, see spec */ - RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8); + RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_SRGB); + RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_SRGB); break; case GL_ALPHA8UI_EXT: @@ -724,17 +724,17 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_RG: case GL_RG8: - RETURN_IF_SUPPORTED(MESA_FORMAT_GR88); + RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8_UNORM); break; case GL_COMPRESSED_RG: if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) RETURN_IF_SUPPORTED(MESA_FORMAT_RG_RGTC2); - RETURN_IF_SUPPORTED(MESA_FORMAT_GR88); + RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8_UNORM); break; case GL_RG16: - RETURN_IF_SUPPORTED(MESA_FORMAT_GR1616); + RETURN_IF_SUPPORTED(MESA_FORMAT_R16G16_UNORM); break; case GL_R16F: @@ -804,8 +804,8 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, break; case GL_RGB10_A2UI: - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010_UINT); - RETURN_IF_SUPPORTED(MESA_FORMAT_ABGR2101010_UINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_B10G10R10A2_UINT); + RETURN_IF_SUPPORTED(MESA_FORMAT_R10G10B10A2_UINT); break; case GL_BGRA: diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 03e44759ad0..0bcbb3297cb 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -4054,9 +4054,9 @@ get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat) case GL_LUMINANCE32UI_EXT: return MESA_FORMAT_LUMINANCE_UINT32; case GL_LUMINANCE8_ALPHA8: - return MESA_FORMAT_AL88; + return MESA_FORMAT_L8A8_UNORM; case GL_LUMINANCE16_ALPHA16: - return MESA_FORMAT_AL1616; + return MESA_FORMAT_L16A16_UNORM; case GL_LUMINANCE_ALPHA16F_ARB: return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16; case GL_LUMINANCE_ALPHA32F_ARB: @@ -4135,9 +4135,9 @@ get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat) return MESA_FORMAT_RGBA_UINT32; case GL_RG8: - return MESA_FORMAT_GR88; + return MESA_FORMAT_R8G8_UNORM; case GL_RG16: - return MESA_FORMAT_GR1616; + return MESA_FORMAT_R16G16_UNORM; case GL_RG16F: return MESA_FORMAT_RG_FLOAT16; case GL_RG32F: diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 8145a657d37..e915ddd76fc 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -1169,7 +1169,7 @@ get_tex_level_parameter_image(struct gl_context *ctx, if (ctx->Version < 30 && !ctx->Extensions.EXT_texture_shared_exponent) goto invalid_pname; - *params = texFormat == MESA_FORMAT_RGB9_E5_FLOAT ? 5 : 0; + *params = texFormat == MESA_FORMAT_R9G9B9E5_FLOAT ? 5 : 0; break; /* GL_ARB_texture_compression */ diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 4c1d789eb76..bcfaf8dc1ea 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1049,7 +1049,7 @@ _mesa_texstore_x8_z24(TEXSTORE_PARAMS) const GLuint depthScale = 0xffffff; (void) dims; - ASSERT(dstFormat == MESA_FORMAT_X8_Z24); + ASSERT(dstFormat == MESA_FORMAT_Z24_UNORM_S8_UINT); { /* general path */ @@ -1079,7 +1079,7 @@ _mesa_texstore_z24_x8(TEXSTORE_PARAMS) const GLuint depthScale = 0xffffff; (void) dims; - ASSERT(dstFormat == MESA_FORMAT_Z24_X8); + ASSERT(dstFormat == MESA_FORMAT_X8Z24_UNORM); { /* general path */ @@ -1141,8 +1141,8 @@ _mesa_texstore_z16(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgb565(TEXSTORE_PARAMS) { - ASSERT(dstFormat == MESA_FORMAT_RGB565 || - dstFormat == MESA_FORMAT_RGB565_REV); + ASSERT(dstFormat == MESA_FORMAT_B5G6R5_UNORM || + dstFormat == MESA_FORMAT_R5G6B5_UNORM); ASSERT(_mesa_get_format_bytes(dstFormat) == 2); if (!ctx->_ImageTransferState && @@ -1163,7 +1163,7 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS) const GLubyte *srcUB = (const GLubyte *) src; GLushort *dstUS = (GLushort *) dst; /* check for byteswapped format */ - if (dstFormat == MESA_FORMAT_RGB565) { + if (dstFormat == MESA_FORMAT_B5G6R5_UNORM) { for (col = 0; col < srcWidth; col++) { dstUS[col] = PACK_COLOR_565( srcUB[0], srcUB[1], srcUB[2] ); srcUB += 3; @@ -1525,8 +1525,8 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_argb2101010(TEXSTORE_PARAMS) { - ASSERT(dstFormat == MESA_FORMAT_ARGB2101010 || - dstFormat == MESA_FORMAT_XRGB2101010_UNORM); + ASSERT(dstFormat == MESA_FORMAT_B10G10R10A2_UNORM || + dstFormat == MESA_FORMAT_B10G10R10X2_UNORM); ASSERT(_mesa_get_format_bytes(dstFormat) == 4); { @@ -1579,7 +1579,7 @@ _mesa_texstore_unorm44(TEXSTORE_PARAMS) { const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_AL44); + ASSERT(dstFormat == MESA_FORMAT_L4A4_UNORM); ASSERT(_mesa_get_format_bytes(dstFormat) == 1); { @@ -1622,10 +1622,10 @@ _mesa_texstore_unorm88(TEXSTORE_PARAMS) const GLboolean littleEndian = _mesa_little_endian(); const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_AL88 || - dstFormat == MESA_FORMAT_AL88_REV || - dstFormat == MESA_FORMAT_GR88 || - dstFormat == MESA_FORMAT_RG88); + ASSERT(dstFormat == MESA_FORMAT_L8A8_UNORM || + dstFormat == MESA_FORMAT_A8L8_UNORM || + dstFormat == MESA_FORMAT_R8G8_UNORM || + dstFormat == MESA_FORMAT_G8R8_UNORM); ASSERT(_mesa_get_format_bytes(dstFormat) == 2); if (!ctx->_ImageTransferState && @@ -1637,9 +1637,9 @@ _mesa_texstore_unorm88(TEXSTORE_PARAMS) /* dstmap - how to swizzle from RGBA to dst format: */ - if (dstFormat == MESA_FORMAT_AL88 || dstFormat == MESA_FORMAT_AL88_REV) { - if ((littleEndian && dstFormat == MESA_FORMAT_AL88) || - (!littleEndian && dstFormat == MESA_FORMAT_AL88_REV)) { + if (dstFormat == MESA_FORMAT_L8A8_UNORM || dstFormat == MESA_FORMAT_A8L8_UNORM) { + if ((littleEndian && dstFormat == MESA_FORMAT_L8A8_UNORM) || + (!littleEndian && dstFormat == MESA_FORMAT_A8L8_UNORM)) { dstmap[0] = 0; dstmap[1] = 3; } @@ -1649,8 +1649,8 @@ _mesa_texstore_unorm88(TEXSTORE_PARAMS) } } else { - if ((littleEndian && dstFormat == MESA_FORMAT_GR88) || - (!littleEndian && dstFormat == MESA_FORMAT_RG88)) { + if ((littleEndian && dstFormat == MESA_FORMAT_R8G8_UNORM) || + (!littleEndian && dstFormat == MESA_FORMAT_G8R8_UNORM)) { dstmap[0] = 0; dstmap[1] = 1; } @@ -1687,8 +1687,8 @@ _mesa_texstore_unorm88(TEXSTORE_PARAMS) GLubyte *dstRow = dstSlices[img]; for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; - if (dstFormat == MESA_FORMAT_AL88 || - dstFormat == MESA_FORMAT_GR88) { + if (dstFormat == MESA_FORMAT_L8A8_UNORM || + dstFormat == MESA_FORMAT_R8G8_UNORM) { for (col = 0; col < srcWidth; col++) { /* src[0] is luminance (or R), src[1] is alpha (or G) */ dstUS[col] = PACK_COLOR_88( src[1], @@ -1721,10 +1721,10 @@ _mesa_texstore_unorm1616(TEXSTORE_PARAMS) { const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_AL1616 || - dstFormat == MESA_FORMAT_AL1616_REV || - dstFormat == MESA_FORMAT_GR1616 || - dstFormat == MESA_FORMAT_RG1616); + ASSERT(dstFormat == MESA_FORMAT_L16A16_UNORM || + dstFormat == MESA_FORMAT_A16L16_UNORM || + dstFormat == MESA_FORMAT_R16G16_UNORM || + dstFormat == MESA_FORMAT_G16R16_UNORM); ASSERT(_mesa_get_format_bytes(dstFormat) == 4); { @@ -1744,8 +1744,8 @@ _mesa_texstore_unorm1616(TEXSTORE_PARAMS) GLubyte *dstRow = dstSlices[img]; for (row = 0; row < srcHeight; row++) { GLuint *dstUI = (GLuint *) dstRow; - if (dstFormat == MESA_FORMAT_AL1616 || - dstFormat == MESA_FORMAT_GR1616) { + if (dstFormat == MESA_FORMAT_L16A16_UNORM || + dstFormat == MESA_FORMAT_R16G16_UNORM) { for (col = 0; col < srcWidth; col++) { GLushort l, a; @@ -2346,7 +2346,7 @@ _mesa_texstore_snorm1616(TEXSTORE_PARAMS) /** * Store a texture in MESA_FORMAT_SIGNED_RGBX8888 or - * MESA_FORMAT_XBGR8888_SNORM. + * MESA_FORMAT_R8G8B8X8_SNORM. */ static GLboolean _mesa_texstore_signed_rgbx8888(TEXSTORE_PARAMS) @@ -2354,7 +2354,7 @@ _mesa_texstore_signed_rgbx8888(TEXSTORE_PARAMS) const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_SIGNED_RGBX8888 || - dstFormat == MESA_FORMAT_XBGR8888_SNORM); + dstFormat == MESA_FORMAT_R8G8B8X8_SNORM); ASSERT(_mesa_get_format_bytes(dstFormat) == 4); { @@ -2474,7 +2474,7 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS) = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); GLint img, row; - ASSERT(dstFormat == MESA_FORMAT_Z24_S8); + ASSERT(dstFormat == MESA_FORMAT_S8_UINT_Z24_UNORM); ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT || srcFormat == GL_DEPTH_COMPONENT || srcFormat == GL_STENCIL_INDEX); @@ -2558,7 +2558,7 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS) GLuint *depth; GLubyte *stencil; - ASSERT(dstFormat == MESA_FORMAT_S8_Z24); + ASSERT(dstFormat == MESA_FORMAT_Z24_UNORM_X8_UINT); ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT || srcFormat == GL_DEPTH_COMPONENT || srcFormat == GL_STENCIL_INDEX); @@ -3259,14 +3259,14 @@ _mesa_texstore_srgba8(TEXSTORE_PARAMS) mesa_format newDstFormat; GLboolean k; - ASSERT(dstFormat == MESA_FORMAT_SRGBA8 || - dstFormat == MESA_FORMAT_XBGR8888_SRGB); + ASSERT(dstFormat == MESA_FORMAT_A8B8G8R8_SRGB || + dstFormat == MESA_FORMAT_R8G8B8X8_SRGB); /* reuse normal rgba texstore code */ - if (dstFormat == MESA_FORMAT_SRGBA8) { + if (dstFormat == MESA_FORMAT_A8B8G8R8_SRGB) { newDstFormat = MESA_FORMAT_A8B8G8R8_UNORM; } - else if (dstFormat == MESA_FORMAT_XBGR8888_SRGB) { + else if (dstFormat == MESA_FORMAT_R8G8B8X8_SRGB) { newDstFormat = MESA_FORMAT_R8G8B8X8_UNORM; } else { @@ -3290,7 +3290,7 @@ _mesa_texstore_sargb8(TEXSTORE_PARAMS) mesa_format newDstFormat; GLboolean k; - ASSERT(dstFormat == MESA_FORMAT_SARGB8); + ASSERT(dstFormat == MESA_FORMAT_B8G8R8A8_SRGB); /* reuse normal rgba texstore code */ newDstFormat = MESA_FORMAT_B8G8R8A8_UNORM; @@ -3332,10 +3332,10 @@ _mesa_texstore_sla8(TEXSTORE_PARAMS) mesa_format newDstFormat; GLboolean k; - ASSERT(dstFormat == MESA_FORMAT_SLA8); + ASSERT(dstFormat == MESA_FORMAT_L8A8_SRGB); /* reuse normal luminance/alpha texstore code */ - newDstFormat = MESA_FORMAT_AL88; + newDstFormat = MESA_FORMAT_L8A8_UNORM; k = _mesa_texstore_unorm88(ctx, dims, baseInternalFormat, newDstFormat, @@ -3351,7 +3351,7 @@ _mesa_texstore_rgb9_e5(TEXSTORE_PARAMS) { const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_RGB9_E5_FLOAT); + ASSERT(dstFormat == MESA_FORMAT_R9G9B9E5_FLOAT); ASSERT(baseInternalFormat == GL_RGB); { @@ -3389,7 +3389,7 @@ _mesa_texstore_r11_g11_b10f(TEXSTORE_PARAMS) { const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_R11_G11_B10_FLOAT); + ASSERT(dstFormat == MESA_FORMAT_R11G11B10_FLOAT); ASSERT(baseInternalFormat == GL_RGB); { @@ -3426,7 +3426,7 @@ _mesa_texstore_r11_g11_b10f(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS) { - ASSERT(dstFormat == MESA_FORMAT_Z32_FLOAT_X24S8); + ASSERT(dstFormat == MESA_FORMAT_Z32_FLOAT_S8X24_UINT); ASSERT(srcFormat == GL_DEPTH_STENCIL || srcFormat == GL_DEPTH_COMPONENT || srcFormat == GL_STENCIL_INDEX); @@ -3479,7 +3479,7 @@ _mesa_texstore_argb2101010_uint(TEXSTORE_PARAMS) { const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_ARGB2101010_UINT); + ASSERT(dstFormat == MESA_FORMAT_B10G10R10A2_UINT); ASSERT(_mesa_get_format_bytes(dstFormat) == 4); { @@ -3535,7 +3535,7 @@ _mesa_texstore_abgr2101010_uint(TEXSTORE_PARAMS) { const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_ABGR2101010_UINT); + ASSERT(dstFormat == MESA_FORMAT_R10G10B10A2_UINT); ASSERT(_mesa_get_format_bytes(dstFormat) == 4); { @@ -3591,7 +3591,7 @@ _mesa_texstore_abgr2101010(TEXSTORE_PARAMS) { const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_ABGR2101010); + ASSERT(dstFormat == MESA_FORMAT_R10G10B10A2_UNORM); ASSERT(_mesa_get_format_bytes(dstFormat) == 4); { @@ -3670,19 +3670,19 @@ _mesa_get_texstore_func(mesa_format format) table[MESA_FORMAT_X8R8G8B8_UNORM] = _mesa_texstore_argb8888; 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; - table[MESA_FORMAT_ARGB4444_REV] = store_ubyte_texture; - table[MESA_FORMAT_RGBA5551] = store_ubyte_texture; - table[MESA_FORMAT_ARGB1555] = store_ubyte_texture; - table[MESA_FORMAT_ARGB1555_REV] = store_ubyte_texture; - table[MESA_FORMAT_AL44] = _mesa_texstore_unorm44; - table[MESA_FORMAT_AL88] = _mesa_texstore_unorm88; - table[MESA_FORMAT_AL88_REV] = _mesa_texstore_unorm88; - 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_B5G6R5_UNORM] = _mesa_texstore_rgb565; + table[MESA_FORMAT_R5G6B5_UNORM] = _mesa_texstore_rgb565; + table[MESA_FORMAT_B4G4R4A4_UNORM] = store_ubyte_texture; + table[MESA_FORMAT_A4R4G4B4_UNORM] = store_ubyte_texture; + table[MESA_FORMAT_A1B5G5R5_UNORM] = store_ubyte_texture; + table[MESA_FORMAT_B5G5R5A1_UNORM] = store_ubyte_texture; + table[MESA_FORMAT_A1R5G5B5_UNORM] = store_ubyte_texture; + table[MESA_FORMAT_L4A4_UNORM] = _mesa_texstore_unorm44; + table[MESA_FORMAT_L8A8_UNORM] = _mesa_texstore_unorm88; + table[MESA_FORMAT_A8L8_UNORM] = _mesa_texstore_unorm88; + table[MESA_FORMAT_L16A16_UNORM] = _mesa_texstore_unorm1616; + table[MESA_FORMAT_A16L16_UNORM] = _mesa_texstore_unorm1616; + table[MESA_FORMAT_B2G3R3_UNORM] = store_ubyte_texture; table[MESA_FORMAT_A_UNORM8] = _mesa_texstore_unorm8; table[MESA_FORMAT_A_UNORM16] = _mesa_texstore_unorm16; table[MESA_FORMAT_L_UNORM8] = _mesa_texstore_unorm8; @@ -3692,24 +3692,24 @@ _mesa_get_texstore_func(mesa_format format) table[MESA_FORMAT_YCBCR] = _mesa_texstore_ycbcr; table[MESA_FORMAT_YCBCR_REV] = _mesa_texstore_ycbcr; 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_R8G8_UNORM] = _mesa_texstore_unorm88; + table[MESA_FORMAT_G8R8_UNORM] = _mesa_texstore_unorm88; 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_R16G16_UNORM] = _mesa_texstore_unorm1616; + table[MESA_FORMAT_G16R16_UNORM] = _mesa_texstore_unorm1616; + table[MESA_FORMAT_B10G10R10A2_UNORM] = _mesa_texstore_argb2101010; + table[MESA_FORMAT_S8_UINT_Z24_UNORM] = _mesa_texstore_z24_s8; + table[MESA_FORMAT_Z24_UNORM_X8_UINT] = _mesa_texstore_s8_z24; 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_Z24_UNORM_S8_UINT] = _mesa_texstore_x8_z24; + table[MESA_FORMAT_X8Z24_UNORM] = _mesa_texstore_z24_x8; 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_A8B8G8R8_SRGB] = _mesa_texstore_srgba8; + table[MESA_FORMAT_B8G8R8A8_SRGB] = _mesa_texstore_sargb8; table[MESA_FORMAT_L_SRGB8] = _mesa_texstore_sl8; - table[MESA_FORMAT_SLA8] = _mesa_texstore_sla8; + table[MESA_FORMAT_L8A8_SRGB] = _mesa_texstore_sla8; table[MESA_FORMAT_SRGB_DXT1] = _mesa_texstore_rgb_dxt1; table[MESA_FORMAT_SRGBA_DXT1] = _mesa_texstore_rgba_dxt1; table[MESA_FORMAT_SRGBA_DXT3] = _mesa_texstore_rgba_dxt3; @@ -3776,10 +3776,10 @@ _mesa_get_texstore_func(mesa_format format) table[MESA_FORMAT_SIGNED_L16] = _mesa_texstore_snorm16; table[MESA_FORMAT_SIGNED_AL1616] = _mesa_texstore_snorm1616; 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_R9G9B9E5_FLOAT] = _mesa_texstore_rgb9_e5; + table[MESA_FORMAT_R11G11B10_FLOAT] = _mesa_texstore_r11_g11_b10f; table[MESA_FORMAT_Z_FLOAT32] = _mesa_texstore_z32; - table[MESA_FORMAT_Z32_FLOAT_X24S8] = _mesa_texstore_z32f_x24s8; + table[MESA_FORMAT_Z32_FLOAT_S8X24_UINT] = _mesa_texstore_z32f_x24s8; table[MESA_FORMAT_ALPHA_UINT8] = _mesa_texstore_rgba_uint8; table[MESA_FORMAT_ALPHA_UINT16] = _mesa_texstore_rgba_uint16; @@ -3835,16 +3835,16 @@ _mesa_get_texstore_func(mesa_format format) table[MESA_FORMAT_RGB_UINT32] = _mesa_texstore_rgba_uint32; table[MESA_FORMAT_RGBA_UINT32] = _mesa_texstore_rgba_uint32; - table[MESA_FORMAT_ARGB2101010_UINT] = _mesa_texstore_argb2101010_uint; - table[MESA_FORMAT_ABGR2101010_UINT] = _mesa_texstore_abgr2101010_uint; + table[MESA_FORMAT_B10G10R10A2_UINT] = _mesa_texstore_argb2101010_uint; + table[MESA_FORMAT_R10G10B10A2_UINT] = _mesa_texstore_abgr2101010_uint; - table[MESA_FORMAT_XRGB4444_UNORM] = store_ubyte_texture; - 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_B4G4R4X4_UNORM] = store_ubyte_texture; + table[MESA_FORMAT_B5G5R5X1_UNORM] = store_ubyte_texture; + table[MESA_FORMAT_R8G8B8X8_SNORM] = _mesa_texstore_signed_rgbx8888; + table[MESA_FORMAT_R8G8B8X8_SRGB] = _mesa_texstore_srgba8; 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_B10G10R10X2_UNORM] = _mesa_texstore_argb2101010; 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; @@ -3854,7 +3854,7 @@ _mesa_get_texstore_func(mesa_format format) 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; + table[MESA_FORMAT_R10G10B10A2_UNORM] = _mesa_texstore_abgr2101010; table[MESA_FORMAT_SIGNED_RG88] = _mesa_texstore_snorm88; table[MESA_FORMAT_SIGNED_RG1616] = _mesa_texstore_snorm1616; diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 021fdb462de..a4fafbee0db 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -73,21 +73,21 @@ st_mesa_format_to_pipe_format(mesa_format mesaFormat) return PIPE_FORMAT_BGRX8888_UNORM; case MESA_FORMAT_X8R8G8B8_UNORM: return PIPE_FORMAT_XRGB8888_UNORM; - case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_B5G5R5A1_UNORM: return PIPE_FORMAT_B5G5R5A1_UNORM; - case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_B4G4R4A4_UNORM: return PIPE_FORMAT_B4G4R4A4_UNORM; - case MESA_FORMAT_RGB565: + case MESA_FORMAT_B5G6R5_UNORM: return PIPE_FORMAT_B5G6R5_UNORM; - case MESA_FORMAT_RGB332: + case MESA_FORMAT_B2G3R3_UNORM: return PIPE_FORMAT_B2G3R3_UNORM; - case MESA_FORMAT_ARGB2101010: + case MESA_FORMAT_B10G10R10A2_UNORM: return PIPE_FORMAT_B10G10R10A2_UNORM; - case MESA_FORMAT_AL44: + case MESA_FORMAT_L4A4_UNORM: return PIPE_FORMAT_L4A4_UNORM; - case MESA_FORMAT_AL88: + case MESA_FORMAT_L8A8_UNORM: return PIPE_FORMAT_L8A8_UNORM; - case MESA_FORMAT_AL1616: + case MESA_FORMAT_L16A16_UNORM: return PIPE_FORMAT_L16A16_UNORM; case MESA_FORMAT_A_UNORM8: return PIPE_FORMAT_A8_UNORM; @@ -105,19 +105,19 @@ st_mesa_format_to_pipe_format(mesa_format mesaFormat) return PIPE_FORMAT_Z16_UNORM; case MESA_FORMAT_Z_UNORM32: return PIPE_FORMAT_Z32_UNORM; - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: return PIPE_FORMAT_S8_UINT_Z24_UNORM; - case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_Z24_UNORM_X8_UINT: return PIPE_FORMAT_Z24_UNORM_S8_UINT; - case MESA_FORMAT_Z24_X8: + case MESA_FORMAT_X8Z24_UNORM: return PIPE_FORMAT_X8Z24_UNORM; - case MESA_FORMAT_X8_Z24: + case MESA_FORMAT_Z24_UNORM_S8_UINT: return PIPE_FORMAT_Z24X8_UNORM; case MESA_FORMAT_S_UINT8: return PIPE_FORMAT_S8_UINT; case MESA_FORMAT_Z_FLOAT32: return PIPE_FORMAT_Z32_FLOAT; - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: return PIPE_FORMAT_Z32_FLOAT_S8X24_UINT; case MESA_FORMAT_YCBCR: return PIPE_FORMAT_UYVY; @@ -137,15 +137,15 @@ st_mesa_format_to_pipe_format(mesa_format mesaFormat) return PIPE_FORMAT_DXT3_SRGBA; case MESA_FORMAT_SRGBA_DXT5: return PIPE_FORMAT_DXT5_SRGBA; - case MESA_FORMAT_SLA8: + case MESA_FORMAT_L8A8_SRGB: return PIPE_FORMAT_L8A8_SRGB; case MESA_FORMAT_L_SRGB8: return PIPE_FORMAT_L8_SRGB; case MESA_FORMAT_BGR_SRGB8: return PIPE_FORMAT_R8G8B8_SRGB; - case MESA_FORMAT_SRGBA8: + case MESA_FORMAT_A8B8G8R8_SRGB: return PIPE_FORMAT_A8B8G8R8_SRGB; - case MESA_FORMAT_SARGB8: + case MESA_FORMAT_B8G8R8A8_SRGB: return PIPE_FORMAT_B8G8R8A8_SRGB; case MESA_FORMAT_RGBA_FLOAT32: return PIPE_FORMAT_R32G32B32A32_FLOAT; @@ -184,9 +184,9 @@ st_mesa_format_to_pipe_format(mesa_format mesaFormat) return PIPE_FORMAT_R8_UNORM; case MESA_FORMAT_R_UNORM16: return PIPE_FORMAT_R16_UNORM; - case MESA_FORMAT_GR88: + case MESA_FORMAT_R8G8_UNORM: return PIPE_FORMAT_R8G8_UNORM; - case MESA_FORMAT_GR1616: + case MESA_FORMAT_R16G16_UNORM: return PIPE_FORMAT_R16G16_UNORM; case MESA_FORMAT_RGBA_UNORM16: return PIPE_FORMAT_R16G16B16A16_UNORM; @@ -353,28 +353,28 @@ st_mesa_format_to_pipe_format(mesa_format mesaFormat) case MESA_FORMAT_SIGNED_I16: return PIPE_FORMAT_I16_SNORM; - case MESA_FORMAT_RGB9_E5_FLOAT: + case MESA_FORMAT_R9G9B9E5_FLOAT: return PIPE_FORMAT_R9G9B9E5_FLOAT; - case MESA_FORMAT_R11_G11_B10_FLOAT: + case MESA_FORMAT_R11G11B10_FLOAT: return PIPE_FORMAT_R11G11B10_FLOAT; - case MESA_FORMAT_ARGB2101010_UINT: + case MESA_FORMAT_B10G10R10A2_UINT: return PIPE_FORMAT_B10G10R10A2_UINT; - case MESA_FORMAT_ABGR2101010_UINT: + case MESA_FORMAT_R10G10B10A2_UINT: return PIPE_FORMAT_R10G10B10A2_UINT; - case MESA_FORMAT_XRGB4444_UNORM: + case MESA_FORMAT_B4G4R4X4_UNORM: return PIPE_FORMAT_B4G4R4X4_UNORM; - case MESA_FORMAT_XRGB1555_UNORM: + case MESA_FORMAT_B5G5R5X1_UNORM: return PIPE_FORMAT_B5G5R5X1_UNORM; - case MESA_FORMAT_XBGR8888_SNORM: + case MESA_FORMAT_R8G8B8X8_SNORM: return PIPE_FORMAT_R8G8B8X8_SNORM; - case MESA_FORMAT_XBGR8888_SRGB: + case MESA_FORMAT_R8G8B8X8_SRGB: return PIPE_FORMAT_R8G8B8X8_SRGB; case MESA_FORMAT_RGBX_UINT8: return PIPE_FORMAT_R8G8B8X8_UINT; case MESA_FORMAT_RGBX_SINT8: return PIPE_FORMAT_R8G8B8X8_SINT; - case MESA_FORMAT_XRGB2101010_UNORM: + case MESA_FORMAT_B10G10R10X2_UNORM: return PIPE_FORMAT_B10G10R10X2_UNORM; case MESA_FORMAT_RGBX_UNORM16: return PIPE_FORMAT_R16G16B16X16_UNORM; @@ -423,21 +423,21 @@ st_pipe_format_to_mesa_format(enum pipe_format format) case PIPE_FORMAT_XRGB8888_UNORM: return MESA_FORMAT_X8R8G8B8_UNORM; case PIPE_FORMAT_B5G5R5A1_UNORM: - return MESA_FORMAT_ARGB1555; + return MESA_FORMAT_B5G5R5A1_UNORM; case PIPE_FORMAT_B4G4R4A4_UNORM: - return MESA_FORMAT_ARGB4444; + return MESA_FORMAT_B4G4R4A4_UNORM; case PIPE_FORMAT_B5G6R5_UNORM: - return MESA_FORMAT_RGB565; + return MESA_FORMAT_B5G6R5_UNORM; case PIPE_FORMAT_B2G3R3_UNORM: - return MESA_FORMAT_RGB332; + return MESA_FORMAT_B2G3R3_UNORM; case PIPE_FORMAT_B10G10R10A2_UNORM: - return MESA_FORMAT_ARGB2101010; + return MESA_FORMAT_B10G10R10A2_UNORM; case PIPE_FORMAT_L4A4_UNORM: - return MESA_FORMAT_AL44; + return MESA_FORMAT_L4A4_UNORM; case PIPE_FORMAT_L8A8_UNORM: - return MESA_FORMAT_AL88; + return MESA_FORMAT_L8A8_UNORM; case PIPE_FORMAT_L16A16_UNORM: - return MESA_FORMAT_AL1616; + return MESA_FORMAT_L16A16_UNORM; case PIPE_FORMAT_A8_UNORM: return MESA_FORMAT_A_UNORM8; case PIPE_FORMAT_A16_UNORM: @@ -461,17 +461,17 @@ st_pipe_format_to_mesa_format(enum pipe_format format) case PIPE_FORMAT_Z32_UNORM: return MESA_FORMAT_Z_UNORM32; case PIPE_FORMAT_S8_UINT_Z24_UNORM: - return MESA_FORMAT_Z24_S8; + return MESA_FORMAT_S8_UINT_Z24_UNORM; case PIPE_FORMAT_X8Z24_UNORM: - return MESA_FORMAT_Z24_X8; + return MESA_FORMAT_X8Z24_UNORM; case PIPE_FORMAT_Z24X8_UNORM: - return MESA_FORMAT_X8_Z24; + return MESA_FORMAT_Z24_UNORM_S8_UINT; case PIPE_FORMAT_Z24_UNORM_S8_UINT: - return MESA_FORMAT_S8_Z24; + return MESA_FORMAT_Z24_UNORM_X8_UINT; case PIPE_FORMAT_Z32_FLOAT: return MESA_FORMAT_Z_FLOAT32; case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT: - return MESA_FORMAT_Z32_FLOAT_X24S8; + return MESA_FORMAT_Z32_FLOAT_S8X24_UINT; case PIPE_FORMAT_UYVY: return MESA_FORMAT_YCBCR; @@ -495,15 +495,15 @@ st_pipe_format_to_mesa_format(enum pipe_format format) case PIPE_FORMAT_DXT5_SRGBA: return MESA_FORMAT_SRGBA_DXT5; case PIPE_FORMAT_L8A8_SRGB: - return MESA_FORMAT_SLA8; + return MESA_FORMAT_L8A8_SRGB; case PIPE_FORMAT_L8_SRGB: return MESA_FORMAT_L_SRGB8; case PIPE_FORMAT_R8G8B8_SRGB: return MESA_FORMAT_BGR_SRGB8; case PIPE_FORMAT_A8B8G8R8_SRGB: - return MESA_FORMAT_SRGBA8; + return MESA_FORMAT_A8B8G8R8_SRGB; case PIPE_FORMAT_B8G8R8A8_SRGB: - return MESA_FORMAT_SARGB8; + return MESA_FORMAT_B8G8R8A8_SRGB; case PIPE_FORMAT_R32G32B32A32_FLOAT: return MESA_FORMAT_RGBA_FLOAT32; case PIPE_FORMAT_R16G16B16A16_FLOAT: @@ -542,9 +542,9 @@ st_pipe_format_to_mesa_format(enum pipe_format format) case PIPE_FORMAT_R16_UNORM: return MESA_FORMAT_R_UNORM16; case PIPE_FORMAT_R8G8_UNORM: - return MESA_FORMAT_GR88; + return MESA_FORMAT_R8G8_UNORM; case PIPE_FORMAT_R16G16_UNORM: - return MESA_FORMAT_GR1616; + return MESA_FORMAT_R16G16_UNORM; case PIPE_FORMAT_A8_UINT: return MESA_FORMAT_ALPHA_UINT8; @@ -708,29 +708,29 @@ st_pipe_format_to_mesa_format(enum pipe_format format) return MESA_FORMAT_SIGNED_I16; case PIPE_FORMAT_R9G9B9E5_FLOAT: - return MESA_FORMAT_RGB9_E5_FLOAT; + return MESA_FORMAT_R9G9B9E5_FLOAT; case PIPE_FORMAT_R11G11B10_FLOAT: - return MESA_FORMAT_R11_G11_B10_FLOAT; + return MESA_FORMAT_R11G11B10_FLOAT; case PIPE_FORMAT_B10G10R10A2_UINT: - return MESA_FORMAT_ARGB2101010_UINT; + return MESA_FORMAT_B10G10R10A2_UINT; case PIPE_FORMAT_R10G10B10A2_UINT: - return MESA_FORMAT_ABGR2101010_UINT; + return MESA_FORMAT_R10G10B10A2_UINT; case PIPE_FORMAT_B4G4R4X4_UNORM: - return MESA_FORMAT_XRGB4444_UNORM; + return MESA_FORMAT_B4G4R4X4_UNORM; case PIPE_FORMAT_B5G5R5X1_UNORM: - return MESA_FORMAT_XRGB1555_UNORM; + return MESA_FORMAT_B5G5R5X1_UNORM; case PIPE_FORMAT_R8G8B8X8_SNORM: - return MESA_FORMAT_XBGR8888_SNORM; + return MESA_FORMAT_R8G8B8X8_SNORM; case PIPE_FORMAT_R8G8B8X8_SRGB: - return MESA_FORMAT_XBGR8888_SRGB; + return MESA_FORMAT_R8G8B8X8_SRGB; case PIPE_FORMAT_R8G8B8X8_UINT: return MESA_FORMAT_RGBX_UINT8; case PIPE_FORMAT_R8G8B8X8_SINT: return MESA_FORMAT_RGBX_SINT8; case PIPE_FORMAT_B10G10R10X2_UNORM: - return MESA_FORMAT_XRGB2101010_UNORM; + return MESA_FORMAT_B10G10R10X2_UNORM; case PIPE_FORMAT_R16G16B16X16_UNORM: return MESA_FORMAT_RGBX_UNORM16; case PIPE_FORMAT_R16G16B16X16_SNORM: diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c index aadcd959109..1ba188c5f7a 100644 --- a/src/mesa/swrast/s_blit.c +++ b/src/mesa/swrast/s_blit.c @@ -167,7 +167,7 @@ blit_nearest(struct gl_context *ctx, * masking for things like DEPTH copies of Z24S8. */ if (readRb->Format == MESA_FORMAT_Z_FLOAT32 || - readRb->Format == MESA_FORMAT_Z32_FLOAT_X24S8) { + readRb->Format == MESA_FORMAT_Z32_FLOAT_S8X24_UINT) { mode = UNPACK_Z_FLOAT; } else { mode = UNPACK_Z_INT; diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index b00b949abb2..93aaffc5746 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -552,10 +552,10 @@ _swrast_clear_depth_buffer(struct gl_context *ctx) height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin; mapMode = GL_MAP_WRITE_BIT; - if (rb->Format == MESA_FORMAT_S8_Z24 || - rb->Format == MESA_FORMAT_X8_Z24 || - rb->Format == MESA_FORMAT_Z24_S8 || - rb->Format == MESA_FORMAT_Z24_X8) { + if (rb->Format == MESA_FORMAT_Z24_UNORM_X8_UINT || + rb->Format == MESA_FORMAT_Z24_UNORM_S8_UINT || + rb->Format == MESA_FORMAT_S8_UINT_Z24_UNORM || + rb->Format == MESA_FORMAT_X8Z24_UNORM) { mapMode |= GL_MAP_READ_BIT; } @@ -602,17 +602,17 @@ _swrast_clear_depth_buffer(struct gl_context *ctx) } } break; - case MESA_FORMAT_S8_Z24: - case MESA_FORMAT_X8_Z24: - case MESA_FORMAT_Z24_S8: - case MESA_FORMAT_Z24_X8: + case MESA_FORMAT_Z24_UNORM_X8_UINT: + case MESA_FORMAT_Z24_UNORM_S8_UINT: + case MESA_FORMAT_S8_UINT_Z24_UNORM: + case MESA_FORMAT_X8Z24_UNORM: { GLfloat clear = (GLfloat) ctx->Depth.Clear; GLuint clearVal = 0; GLuint mask; - if (rb->Format == MESA_FORMAT_S8_Z24 || - rb->Format == MESA_FORMAT_X8_Z24) + if (rb->Format == MESA_FORMAT_Z24_UNORM_X8_UINT || + rb->Format == MESA_FORMAT_Z24_UNORM_S8_UINT) mask = 0xff000000; else mask = 0xff; @@ -628,7 +628,7 @@ _swrast_clear_depth_buffer(struct gl_context *ctx) } break; - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: /* XXX untested */ { GLfloat clearVal = (GLfloat) ctx->Depth.Clear; @@ -692,15 +692,15 @@ _swrast_clear_depth_stencil_buffer(struct gl_context *ctx) } switch (rb->Format) { - case MESA_FORMAT_S8_Z24: - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_Z24_UNORM_X8_UINT: + case MESA_FORMAT_S8_UINT_Z24_UNORM: { GLfloat zClear = (GLfloat) ctx->Depth.Clear; GLuint clear = 0, mask; _mesa_pack_float_z_row(rb->Format, 1, &zClear, &clear); - if (rb->Format == MESA_FORMAT_S8_Z24) { + if (rb->Format == MESA_FORMAT_Z24_UNORM_X8_UINT) { mask = ((~writeMask) & 0xff) << 24; clear |= (ctx->Stencil.Clear & writeMask & 0xff) << 24; } @@ -725,7 +725,7 @@ _swrast_clear_depth_stencil_buffer(struct gl_context *ctx) } } break; - case MESA_FORMAT_Z32_FLOAT_X24S8: + case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: /* XXX untested */ { const GLfloat zClear = (GLfloat) ctx->Depth.Clear; diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index ce15f02e35b..ed4487f3ea4 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -500,7 +500,7 @@ draw_rgba_pixels( struct gl_context *ctx, GLint x, GLint y, /** - * Draw depth+stencil values into a MESA_FORAMT_Z24_S8 or MESA_FORMAT_S8_Z24 + * Draw depth+stencil values into a MESA_FORAMT_Z24_S8 or MESA_FORMAT_Z24_UNORM_X8_UINT * renderbuffer. No masking, zooming, scaling, etc. */ static void @@ -572,8 +572,8 @@ draw_depth_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, ASSERT(stencilRb); if (depthRb == stencilRb && - (depthRb->Format == MESA_FORMAT_Z24_S8 || - depthRb->Format == MESA_FORMAT_S8_Z24) && + (depthRb->Format == MESA_FORMAT_S8_UINT_Z24_UNORM || + depthRb->Format == MESA_FORMAT_Z24_UNORM_X8_UINT) && type == GL_UNSIGNED_INT_24_8 && !scaleOrBias && !zoom && diff --git a/src/mesa/swrast/s_renderbuffer.c b/src/mesa/swrast/s_renderbuffer.c index 8638ea4a9d2..d008f5ca51d 100644 --- a/src/mesa/swrast/s_renderbuffer.c +++ b/src/mesa/swrast/s_renderbuffer.c @@ -102,14 +102,14 @@ soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb, rb->Format = MESA_FORMAT_Z_UNORM16; break; case GL_DEPTH_COMPONENT24: - rb->Format = MESA_FORMAT_X8_Z24; + rb->Format = MESA_FORMAT_Z24_UNORM_S8_UINT; break; case GL_DEPTH_COMPONENT32: rb->Format = MESA_FORMAT_Z_UNORM32; break; case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - rb->Format = MESA_FORMAT_Z24_S8; + rb->Format = MESA_FORMAT_S8_UINT_Z24_UNORM; break; default: /* unsupported format */ diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c index 8b30469ad32..e7c35ff693a 100644 --- a/src/mesa/swrast/s_stencil.c +++ b/src/mesa/swrast/s_stencil.c @@ -614,7 +614,7 @@ _swrast_clear_stencil_buffer(struct gl_context *ctx) } } break; - case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_Z24_UNORM_X8_UINT: { GLuint clear = (ctx->Stencil.Clear & writeMask & 0xff) << 24; GLuint mask = (((~writeMask) & 0xff) << 24) | 0xffffff; @@ -627,7 +627,7 @@ _swrast_clear_stencil_buffer(struct gl_context *ctx) } } break; - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_UINT_Z24_UNORM: { GLuint clear = ctx->Stencil.Clear & writeMask & 0xff; GLuint mask = 0xffffff00 | ((~writeMask) & 0xff); diff --git a/src/mesa/swrast/s_texfetch.c b/src/mesa/swrast/s_texfetch.c index c481f6bdcab..cbc3dfe132e 100644 --- a/src/mesa/swrast/s_texfetch.c +++ b/src/mesa/swrast/s_texfetch.c @@ -209,79 +209,79 @@ texfetch_funcs[] = fetch_texel_3d_f_bgr888 }, { - MESA_FORMAT_RGB565, + MESA_FORMAT_B5G6R5_UNORM, fetch_texel_1d_f_rgb565, fetch_texel_2d_f_rgb565, fetch_texel_3d_f_rgb565 }, { - MESA_FORMAT_RGB565_REV, + MESA_FORMAT_R5G6B5_UNORM, fetch_texel_1d_f_rgb565_rev, fetch_texel_2d_f_rgb565_rev, fetch_texel_3d_f_rgb565_rev }, { - MESA_FORMAT_ARGB4444, + MESA_FORMAT_B4G4R4A4_UNORM, fetch_texel_1d_f_argb4444, fetch_texel_2d_f_argb4444, fetch_texel_3d_f_argb4444 }, { - MESA_FORMAT_ARGB4444_REV, + MESA_FORMAT_A4R4G4B4_UNORM, fetch_texel_1d_f_argb4444_rev, fetch_texel_2d_f_argb4444_rev, fetch_texel_3d_f_argb4444_rev }, { - MESA_FORMAT_RGBA5551, + MESA_FORMAT_A1B5G5R5_UNORM, fetch_texel_1d_f_rgba5551, fetch_texel_2d_f_rgba5551, fetch_texel_3d_f_rgba5551 }, { - MESA_FORMAT_ARGB1555, + MESA_FORMAT_B5G5R5A1_UNORM, fetch_texel_1d_f_argb1555, fetch_texel_2d_f_argb1555, fetch_texel_3d_f_argb1555 }, { - MESA_FORMAT_ARGB1555_REV, + MESA_FORMAT_A1R5G5B5_UNORM, fetch_texel_1d_f_argb1555_rev, fetch_texel_2d_f_argb1555_rev, fetch_texel_3d_f_argb1555_rev }, { - MESA_FORMAT_AL44, + MESA_FORMAT_L4A4_UNORM, fetch_texel_1d_f_al44, fetch_texel_2d_f_al44, fetch_texel_3d_f_al44 }, { - MESA_FORMAT_AL88, + MESA_FORMAT_L8A8_UNORM, fetch_texel_1d_f_al88, fetch_texel_2d_f_al88, fetch_texel_3d_f_al88 }, { - MESA_FORMAT_AL88_REV, + MESA_FORMAT_A8L8_UNORM, fetch_texel_1d_f_al88_rev, fetch_texel_2d_f_al88_rev, fetch_texel_3d_f_al88_rev }, { - MESA_FORMAT_AL1616, + MESA_FORMAT_L16A16_UNORM, fetch_texel_1d_f_al1616, fetch_texel_2d_f_al1616, fetch_texel_3d_f_al1616 }, { - MESA_FORMAT_AL1616_REV, + MESA_FORMAT_A16L16_UNORM, fetch_texel_1d_f_al1616_rev, fetch_texel_2d_f_al1616_rev, fetch_texel_3d_f_al1616_rev }, { - MESA_FORMAT_RGB332, + MESA_FORMAT_B2G3R3_UNORM, fetch_texel_1d_f_rgb332, fetch_texel_2d_f_rgb332, fetch_texel_3d_f_rgb332 @@ -341,13 +341,13 @@ texfetch_funcs[] = fetch_texel_3d_f_r8 }, { - MESA_FORMAT_GR88, + MESA_FORMAT_R8G8_UNORM, fetch_texel_1d_f_gr88, fetch_texel_2d_f_gr88, fetch_texel_3d_f_gr88 }, { - MESA_FORMAT_RG88, + MESA_FORMAT_G8R8_UNORM, fetch_texel_1d_f_rg88, fetch_texel_2d_f_rg88, fetch_texel_3d_f_rg88 @@ -359,31 +359,31 @@ texfetch_funcs[] = fetch_texel_3d_f_r16 }, { - MESA_FORMAT_GR1616, + MESA_FORMAT_R16G16_UNORM, fetch_texel_1d_f_rg1616, fetch_texel_2d_f_rg1616, fetch_texel_3d_f_rg1616 }, { - MESA_FORMAT_RG1616, + MESA_FORMAT_G16R16_UNORM, fetch_texel_1d_f_rg1616_rev, fetch_texel_2d_f_rg1616_rev, fetch_texel_3d_f_rg1616_rev }, { - MESA_FORMAT_ARGB2101010, + MESA_FORMAT_B10G10R10A2_UNORM, fetch_texel_1d_f_argb2101010, fetch_texel_2d_f_argb2101010, fetch_texel_3d_f_argb2101010 }, { - MESA_FORMAT_Z24_S8, + MESA_FORMAT_S8_UINT_Z24_UNORM, fetch_texel_1d_f_z24_s8, fetch_texel_2d_f_z24_s8, fetch_texel_3d_f_z24_s8 }, { - MESA_FORMAT_S8_Z24, + MESA_FORMAT_Z24_UNORM_X8_UINT, fetch_texel_1d_f_s8_z24, fetch_texel_2d_f_s8_z24, fetch_texel_3d_f_s8_z24 @@ -395,13 +395,13 @@ texfetch_funcs[] = fetch_texel_3d_f_z16 }, { - MESA_FORMAT_X8_Z24, + MESA_FORMAT_Z24_UNORM_S8_UINT, fetch_texel_1d_f_s8_z24, fetch_texel_2d_f_s8_z24, fetch_texel_3d_f_s8_z24 }, { - MESA_FORMAT_Z24_X8, + MESA_FORMAT_X8Z24_UNORM, fetch_texel_1d_f_z24_s8, fetch_texel_2d_f_z24_s8, fetch_texel_3d_f_z24_s8 @@ -425,13 +425,13 @@ texfetch_funcs[] = fetch_texel_3d_srgb8 }, { - MESA_FORMAT_SRGBA8, + MESA_FORMAT_A8B8G8R8_SRGB, fetch_texel_1d_srgba8, fetch_texel_2d_srgba8, fetch_texel_3d_srgba8 }, { - MESA_FORMAT_SARGB8, + MESA_FORMAT_B8G8R8A8_SRGB, fetch_texel_1d_sargb8, fetch_texel_2d_sargb8, fetch_texel_3d_sargb8 @@ -443,7 +443,7 @@ texfetch_funcs[] = fetch_texel_3d_sl8 }, { - MESA_FORMAT_SLA8, + MESA_FORMAT_L8A8_SRGB, fetch_texel_1d_sla8, fetch_texel_2d_sla8, fetch_texel_3d_sla8 @@ -1161,13 +1161,13 @@ texfetch_funcs[] = fetch_texel_3d_signed_i16 }, { - MESA_FORMAT_RGB9_E5_FLOAT, + MESA_FORMAT_R9G9B9E5_FLOAT, fetch_texel_1d_rgb9_e5, fetch_texel_2d_rgb9_e5, fetch_texel_3d_rgb9_e5 }, { - MESA_FORMAT_R11_G11_B10_FLOAT, + MESA_FORMAT_R11G11B10_FLOAT, fetch_texel_1d_r11_g11_b10f, fetch_texel_2d_r11_g11_b10f, fetch_texel_3d_r11_g11_b10f @@ -1179,43 +1179,43 @@ texfetch_funcs[] = fetch_texel_3d_f_r_f32 }, { - MESA_FORMAT_Z32_FLOAT_X24S8, + MESA_FORMAT_Z32_FLOAT_S8X24_UINT, fetch_texel_1d_z32f_x24s8, fetch_texel_2d_z32f_x24s8, fetch_texel_3d_z32f_x24s8 }, { - MESA_FORMAT_ARGB2101010_UINT, + MESA_FORMAT_B10G10R10A2_UINT, NULL, NULL, NULL }, { - MESA_FORMAT_ABGR2101010_UINT, + MESA_FORMAT_R10G10B10A2_UINT, NULL, NULL, NULL }, { - MESA_FORMAT_XRGB4444_UNORM, + MESA_FORMAT_B4G4R4X4_UNORM, NULL, NULL, NULL }, { - MESA_FORMAT_XRGB1555_UNORM, + MESA_FORMAT_B5G5R5X1_UNORM, NULL, NULL, NULL }, { - MESA_FORMAT_XBGR8888_SNORM, + MESA_FORMAT_R8G8B8X8_SNORM, NULL, NULL, NULL }, { - MESA_FORMAT_XBGR8888_SRGB, + MESA_FORMAT_R8G8B8X8_SRGB, NULL, NULL, NULL @@ -1233,7 +1233,7 @@ texfetch_funcs[] = NULL }, { - MESA_FORMAT_XRGB2101010_UNORM, + MESA_FORMAT_B10G10R10X2_UNORM, NULL, NULL, NULL @@ -1287,7 +1287,7 @@ texfetch_funcs[] = NULL }, { - MESA_FORMAT_ABGR2101010, + MESA_FORMAT_R10G10B10A2_UNORM, NULL, NULL, NULL diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h index 30fe1b8df09..1ac94e65f67 100644 --- a/src/mesa/swrast/s_texfetch_tmp.h +++ b/src/mesa/swrast/s_texfetch_tmp.h @@ -553,7 +553,7 @@ static void FETCH(f_bgr888)( const struct swrast_texture_image *texImage, /* use color expansion like (g << 2) | (g >> 4) (does somewhat random rounding) instead of slow (g << 2) * 255 / 252 (always rounds down) */ -/* MESA_FORMAT_RGB565 ********************************************************/ +/* MESA_FORMAT_B5G6R5_UNORM ********************************************************/ /* Fetch texel from 1D, 2D or 3D rgb565 texture, return 4 GLchans */ static void FETCH(f_rgb565)( const struct swrast_texture_image *texImage, @@ -570,7 +570,7 @@ static void FETCH(f_rgb565)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_RGB565_REV ****************************************************/ +/* MESA_FORMAT_R5G6B5_UNORM ****************************************************/ /* Fetch texel from 1D, 2D or 3D rgb565_rev texture, return 4 GLchans */ static void FETCH(f_rgb565_rev)( const struct swrast_texture_image *texImage, @@ -587,7 +587,7 @@ static void FETCH(f_rgb565_rev)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_ARGB4444 ******************************************************/ +/* MESA_FORMAT_B4G4R4A4_UNORM ******************************************************/ /* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */ static void FETCH(f_argb4444)( const struct swrast_texture_image *texImage, @@ -604,7 +604,7 @@ static void FETCH(f_argb4444)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_ARGB4444_REV **************************************************/ +/* MESA_FORMAT_A4R4G4B4_UNORM **************************************************/ /* Fetch texel from 1D, 2D or 3D argb4444_rev texture, return 4 GLchans */ static void FETCH(f_argb4444_rev)( const struct swrast_texture_image *texImage, @@ -619,7 +619,7 @@ static void FETCH(f_argb4444_rev)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_RGBA5551 ******************************************************/ +/* MESA_FORMAT_A1B5G5R5_UNORM ******************************************************/ /* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ static void FETCH(f_rgba5551)( const struct swrast_texture_image *texImage, @@ -635,7 +635,7 @@ static void FETCH(f_rgba5551)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_ARGB1555 ******************************************************/ +/* MESA_FORMAT_B5G5R5A1_UNORM ******************************************************/ /* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ static void FETCH(f_argb1555)( const struct swrast_texture_image *texImage, @@ -652,7 +652,7 @@ static void FETCH(f_argb1555)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_ARGB1555_REV **************************************************/ +/* MESA_FORMAT_A1R5G5B5_UNORM **************************************************/ /* Fetch texel from 1D, 2D or 3D argb1555_rev texture, return 4 GLchans */ static void FETCH(f_argb1555_rev)( const struct swrast_texture_image *texImage, @@ -669,7 +669,7 @@ static void FETCH(f_argb1555_rev)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_ARGB2101010 ***************************************************/ +/* MESA_FORMAT_B10G10R10A2_UNORM ***************************************************/ /* Fetch texel from 1D, 2D or 3D argb2101010 texture, return 4 GLchans */ static void FETCH(f_argb2101010)( const struct swrast_texture_image *texImage, @@ -686,7 +686,7 @@ static void FETCH(f_argb2101010)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_GR88 **********************************************************/ +/* MESA_FORMAT_R8G8_UNORM **********************************************************/ /* Fetch texel from 1D, 2D or 3D rg88 texture, return 4 GLchans */ static void FETCH(f_gr88)( const struct swrast_texture_image *texImage, @@ -702,7 +702,7 @@ static void FETCH(f_gr88)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_RG88 ******************************************************/ +/* MESA_FORMAT_G8R8_UNORM ******************************************************/ /* Fetch texel from 1D, 2D or 3D rg88_rev texture, return 4 GLchans */ static void FETCH(f_rg88)( const struct swrast_texture_image *texImage, @@ -718,7 +718,7 @@ static void FETCH(f_rg88)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_AL44 **********************************************************/ +/* MESA_FORMAT_L4A4_UNORM **********************************************************/ /* Fetch texel from 1D, 2D or 3D al44 texture, return 4 GLchans */ static void FETCH(f_al44)( const struct swrast_texture_image *texImage, @@ -734,7 +734,7 @@ static void FETCH(f_al44)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_AL88 **********************************************************/ +/* MESA_FORMAT_L8A8_UNORM **********************************************************/ /* Fetch texel from 1D, 2D or 3D al88 texture, return 4 GLchans */ static void FETCH(f_al88)( const struct swrast_texture_image *texImage, @@ -782,7 +782,7 @@ static void FETCH(f_r16)(const struct swrast_texture_image *texImage, -/* MESA_FORMAT_AL88_REV ******************************************************/ +/* MESA_FORMAT_A8L8_UNORM ******************************************************/ /* Fetch texel from 1D, 2D or 3D al88_rev texture, return 4 GLchans */ static void FETCH(f_al88_rev)( const struct swrast_texture_image *texImage, @@ -798,7 +798,7 @@ static void FETCH(f_al88_rev)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_GR1616 ********************************************************/ +/* MESA_FORMAT_R16G16_UNORM ********************************************************/ /* Fetch texel from 1D, 2D or 3D rg1616 texture, return 4 GLchans */ static void FETCH(f_rg1616)( const struct swrast_texture_image *texImage, @@ -814,7 +814,7 @@ static void FETCH(f_rg1616)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_RG1616 ****************************************************/ +/* MESA_FORMAT_G16R16_UNORM ****************************************************/ /* Fetch texel from 1D, 2D or 3D rg1616_rev texture, return 4 GLchans */ static void FETCH(f_rg1616_rev)( const struct swrast_texture_image *texImage, @@ -830,7 +830,7 @@ static void FETCH(f_rg1616_rev)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_AL1616 ********************************************************/ +/* MESA_FORMAT_L16A16_UNORM ********************************************************/ /* Fetch texel from 1D, 2D or 3D al1616 texture, return 4 GLchans */ static void FETCH(f_al1616)( const struct swrast_texture_image *texImage, @@ -846,7 +846,7 @@ static void FETCH(f_al1616)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_AL1616_REV ****************************************************/ +/* MESA_FORMAT_A16L16_UNORM ****************************************************/ /* Fetch texel from 1D, 2D or 3D al1616_rev texture, return 4 GLchans */ static void FETCH(f_al1616_rev)( const struct swrast_texture_image *texImage, @@ -862,7 +862,7 @@ static void FETCH(f_al1616_rev)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_RGB332 ********************************************************/ +/* MESA_FORMAT_B2G3R3_UNORM ********************************************************/ /* Fetch texel from 1D, 2D or 3D rgb332 texture, return 4 GLchans */ static void FETCH(f_rgb332)( const struct swrast_texture_image *texImage, @@ -1538,8 +1538,8 @@ static void FETCH(f_z24_s8)( const struct swrast_texture_image *texImage, const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); const GLdouble scale = 1.0 / (GLdouble) 0xffffff; texel[0] = (GLfloat) (((*src) >> 8) * scale); - ASSERT(texImage->Base.TexFormat == MESA_FORMAT_Z24_S8 || - texImage->Base.TexFormat == MESA_FORMAT_Z24_X8); + ASSERT(texImage->Base.TexFormat == MESA_FORMAT_S8_UINT_Z24_UNORM || + texImage->Base.TexFormat == MESA_FORMAT_X8Z24_UNORM); ASSERT(texel[0] >= 0.0F); ASSERT(texel[0] <= 1.0F); } @@ -1556,8 +1556,8 @@ static void FETCH(f_s8_z24)( const struct swrast_texture_image *texImage, const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); const GLdouble scale = 1.0 / (GLdouble) 0xffffff; texel[0] = (GLfloat) (((*src) & 0x00ffffff) * scale); - ASSERT(texImage->Base.TexFormat == MESA_FORMAT_S8_Z24 || - texImage->Base.TexFormat == MESA_FORMAT_X8_Z24); + ASSERT(texImage->Base.TexFormat == MESA_FORMAT_Z24_UNORM_X8_UINT || + texImage->Base.TexFormat == MESA_FORMAT_Z24_UNORM_S8_UINT); ASSERT(texel[0] >= 0.0F); ASSERT(texel[0] <= 1.0F); } @@ -1578,7 +1578,7 @@ static void FETCH(rgb9_e5)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_R11_G11_B10_FLOAT *********************************************/ +/* MESA_FORMAT_R11G11B10_FLOAT *********************************************/ static void FETCH(r11_g11_b10f)( const struct swrast_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) @@ -1591,7 +1591,7 @@ static void FETCH(r11_g11_b10f)( const struct swrast_texture_image *texImage, -/* MESA_FORMAT_Z32_FLOAT_X24S8 ***********************************************/ +/* MESA_FORMAT_Z32_FLOAT_S8X24_UINT ***********************************************/ static void FETCH(z32f_x24s8)(const struct swrast_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel) -- 2.30.2