[Mesa-dev] [V3 PATCH 2/8] mesa: Change 4 color component ubyte formats
Mark Mueller
markkmueller at gmail.com
Fri Jan 17 03:45:28 PST 2014
Change all 4 color component unsigned byte formats to meet spec:
s/MESA_FORMAT_RGBA8888\b/MESA_FORMAT_ABGR_UNORM8/g
s/MESA_FORMAT_RGBA8888_REV\b/MESA_FORMAT_RGBA_UNORM8/g
s/MESA_FORMAT_ARGB8888\b/MESA_FORMAT_BGRA_UNORM8/g
s/MESA_FORMAT_ARGB8888_REV\b/MESA_FORMAT_ARGB_UNORM8/g
s/MESA_FORMAT_RGBX8888\b/MESA_FORMAT_XBGR_UNORM8/g
s/MESA_FORMAT_RGBX8888_REV\b/MESA_FORMAT_RGBX_UNORM8/g
s/MESA_FORMAT_XRGB8888\b/MESA_FORMAT_BGRX_UNORM8/g
s/MESA_FORMAT_XRGB8888_REV\b/MESA_FORMAT_XRGB_UNORM8/g
Signed-off-by: Mark Mueller <MarkKMueller at gmail.com>
---
src/gallium/state_trackers/dri/common/dri_screen.c | 4 +-
src/mesa/drivers/dri/common/dri_util.c | 16 ++---
src/mesa/drivers/dri/common/utils.c | 8 +--
src/mesa/drivers/dri/i915/i830_texstate.c | 4 +-
src/mesa/drivers/dri/i915/i830_vtbl.c | 4 +-
src/mesa/drivers/dri/i915/i915_context.c | 4 +-
src/mesa/drivers/dri/i915/i915_texstate.c | 6 +-
src/mesa/drivers/dri/i915/i915_vtbl.c | 4 +-
src/mesa/drivers/dri/i915/intel_blit.c | 16 ++---
src/mesa/drivers/dri/i915/intel_fbo.c | 2 +-
src/mesa/drivers/dri/i915/intel_pixel_bitmap.c | 4 +-
src/mesa/drivers/dri/i915/intel_screen.c | 10 +--
src/mesa/drivers/dri/i915/intel_tex_image.c | 4 +-
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 8 +--
src/mesa/drivers/dri/i965/brw_context.c | 2 +-
src/mesa/drivers/dri/i965/brw_surface_formats.c | 16 ++---
src/mesa/drivers/dri/i965/intel_blit.c | 12 ++--
src/mesa/drivers/dri/i965/intel_fbo.c | 2 +-
src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 8 +--
src/mesa/drivers/dri/i965/intel_pixel_bitmap.c | 4 +-
src/mesa/drivers/dri/i965/intel_screen.c | 8 +--
src/mesa/drivers/dri/i965/intel_tex_image.c | 4 +-
src/mesa/drivers/dri/i965/intel_tex_subimage.c | 4 +-
src/mesa/drivers/dri/nouveau/nouveau_fbo.c | 8 +--
src/mesa/drivers/dri/nouveau/nouveau_screen.c | 4 +-
src/mesa/drivers/dri/nouveau/nouveau_texture.c | 10 +--
src/mesa/drivers/dri/nouveau/nouveau_util.h | 12 ++--
src/mesa/drivers/dri/nouveau/nv04_context.c | 2 +-
src/mesa/drivers/dri/nouveau/nv04_state_fb.c | 4 +-
src/mesa/drivers/dri/nouveau/nv04_state_frag.c | 2 +-
src/mesa/drivers/dri/nouveau/nv04_state_raster.c | 2 +-
src/mesa/drivers/dri/nouveau/nv04_state_tex.c | 4 +-
src/mesa/drivers/dri/nouveau/nv04_surface.c | 40 +++++------
src/mesa/drivers/dri/nouveau/nv10_state_fb.c | 4 +-
src/mesa/drivers/dri/nouveau/nv10_state_frag.c | 4 +-
src/mesa/drivers/dri/nouveau/nv10_state_tex.c | 8 +--
src/mesa/drivers/dri/nouveau/nv10_state_tnl.c | 2 +-
src/mesa/drivers/dri/nouveau/nv20_state_fb.c | 4 +-
src/mesa/drivers/dri/nouveau/nv20_state_tex.c | 8 +--
src/mesa/drivers/dri/nouveau/nv20_state_tnl.c | 2 +-
src/mesa/drivers/dri/r200/r200_blit.c | 32 ++++-----
src/mesa/drivers/dri/r200/r200_texstate.c | 22 +++---
src/mesa/drivers/dri/radeon/radeon_blit.c | 14 ++--
src/mesa/drivers/dri/radeon/radeon_pixel_read.c | 8 +--
src/mesa/drivers/dri/radeon/radeon_screen.c | 16 ++---
src/mesa/drivers/dri/radeon/radeon_tex_copy.c | 4 +-
src/mesa/drivers/dri/radeon/radeon_texstate.c | 14 ++--
src/mesa/drivers/dri/radeon/radeon_texture.c | 12 ++--
src/mesa/drivers/dri/swrast/swrast.c | 14 ++--
src/mesa/drivers/haiku/swrast/SoftwareRast.cpp | 4 +-
src/mesa/drivers/osmesa/osmesa.c | 12 ++--
src/mesa/drivers/x11/xm_buffer.c | 8 +--
src/mesa/main/debug.c | 4 +-
src/mesa/main/format_pack.c | 76 ++++++++++----------
src/mesa/main/format_unpack.c | 36 +++++-----
src/mesa/main/formats.c | 80 +++++++++++-----------
src/mesa/main/formats.h | 22 +++---
src/mesa/main/framebuffer.c | 2 +-
src/mesa/main/readpix.c | 4 +-
src/mesa/main/shaderimage.c | 4 +-
src/mesa/main/texformat.c | 36 +++++-----
src/mesa/main/teximage.c | 2 +-
src/mesa/main/texstore.c | 72 +++++++++----------
src/mesa/state_tracker/st_format.c | 32 ++++-----
src/mesa/swrast/s_drawpix.c | 8 +--
src/mesa/swrast/s_renderbuffer.c | 4 +-
src/mesa/swrast/s_texfetch.c | 16 ++---
src/mesa/swrast/s_texfetch_tmp.h | 12 ++--
src/mesa/swrast/s_texfilter.c | 8 +--
src/mesa/swrast/s_triangle.c | 16 ++---
70 files changed, 435 insertions(+), 433 deletions(-)
diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c
index c13b2ed..08f5d07 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.c
+++ b/src/gallium/state_trackers/dri/common/dri_screen.c
@@ -82,8 +82,8 @@ static const __DRIconfig **
dri_fill_in_modes(struct dri_screen *screen)
{
static const mesa_format mesa_formats[3] = {
- MESA_FORMAT_ARGB8888,
- MESA_FORMAT_XRGB8888,
+ MESA_FORMAT_BGRA_UNORM8,
+ MESA_FORMAT_BGRX_UNORM8,
MESA_FORMAT_RGB565,
};
static const enum pipe_format pipe_formats[3] = {
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index e8c0d91..9025a00 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -811,17 +811,17 @@ driGLFormatToImageFormat(mesa_format format)
switch (format) {
case MESA_FORMAT_RGB565:
return __DRI_IMAGE_FORMAT_RGB565;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
return __DRI_IMAGE_FORMAT_XRGB8888;
case MESA_FORMAT_ARGB2101010:
return __DRI_IMAGE_FORMAT_ARGB2101010;
case MESA_FORMAT_XRGB2101010_UNORM:
return __DRI_IMAGE_FORMAT_XRGB2101010;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
return __DRI_IMAGE_FORMAT_ARGB8888;
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_RGBA_UNORM8:
return __DRI_IMAGE_FORMAT_ABGR8888;
- case MESA_FORMAT_RGBX8888_REV:
+ case MESA_FORMAT_RGBX_UNORM8:
return __DRI_IMAGE_FORMAT_XBGR8888;
case MESA_FORMAT_R8:
return __DRI_IMAGE_FORMAT_R8;
@@ -843,17 +843,17 @@ driImageFormatToGLFormat(uint32_t image_format)
case __DRI_IMAGE_FORMAT_RGB565:
return MESA_FORMAT_RGB565;
case __DRI_IMAGE_FORMAT_XRGB8888:
- return MESA_FORMAT_XRGB8888;
+ return MESA_FORMAT_BGRX_UNORM8;
case __DRI_IMAGE_FORMAT_ARGB2101010:
return MESA_FORMAT_ARGB2101010;
case __DRI_IMAGE_FORMAT_XRGB2101010:
return MESA_FORMAT_XRGB2101010_UNORM;
case __DRI_IMAGE_FORMAT_ARGB8888:
- return MESA_FORMAT_ARGB8888;
+ return MESA_FORMAT_BGRA_UNORM8;
case __DRI_IMAGE_FORMAT_ABGR8888:
- return MESA_FORMAT_RGBA8888_REV;
+ return MESA_FORMAT_RGBA_UNORM8;
case __DRI_IMAGE_FORMAT_XBGR8888:
- return MESA_FORMAT_RGBX8888_REV;
+ return MESA_FORMAT_RGBX_UNORM8;
case __DRI_IMAGE_FORMAT_R8:
return MESA_FORMAT_R8;
case __DRI_IMAGE_FORMAT_GR88:
diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index 06981c2..f4aa3cf 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -186,9 +186,9 @@ driCreateConfigs(mesa_format format,
static const uint32_t masks_table[][4] = {
/* MESA_FORMAT_RGB565 */
{ 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 },
- /* MESA_FORMAT_XRGB8888 */
+ /* MESA_FORMAT_BGRX_UNORM8 */
{ 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 },
- /* MESA_FORMAT_ARGB8888 */
+ /* MESA_FORMAT_BGRA_UNORM8 */
{ 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000 },
/* MESA_FORMAT_XRGB2101010_UNORM */
{ 0x3FF00000, 0x000FFC00, 0x000003FF, 0x00000000 },
@@ -212,10 +212,10 @@ driCreateConfigs(mesa_format format,
case MESA_FORMAT_RGB565:
masks = masks_table[0];
break;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
masks = masks_table[1];
break;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
case MESA_FORMAT_SARGB8:
masks = masks_table[2];
break;
diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c
index f186fac..39fe60d 100644
--- a/src/mesa/drivers/dri/i915/i830_texstate.c
+++ b/src/mesa/drivers/dri/i915/i830_texstate.c
@@ -57,9 +57,9 @@ translate_texture_format(GLuint mesa_format)
return MAPSURF_16BIT | MT_16BIT_ARGB1555;
case MESA_FORMAT_ARGB4444:
return MAPSURF_16BIT | MT_16BIT_ARGB4444;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
return MAPSURF_32BIT | MT_32BIT_ARGB8888;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
return MAPSURF_32BIT | MT_32BIT_XRGB8888;
case MESA_FORMAT_YCBCR_REV:
return (MAPSURF_422 | MT_422_YCRCB_NORMAL);
diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c
index 553cc3e..0a18e8a 100644
--- a/src/mesa/drivers/dri/i915/i830_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i830_vtbl.c
@@ -582,8 +582,8 @@ i830_destroy_context(struct intel_context *intel)
static uint32_t i830_render_target_format_for_mesa_format[MESA_FORMAT_COUNT] =
{
- [MESA_FORMAT_ARGB8888] = DV_PF_8888,
- [MESA_FORMAT_XRGB8888] = DV_PF_8888,
+ [MESA_FORMAT_BGRA_UNORM8] = DV_PF_8888,
+ [MESA_FORMAT_BGRX_UNORM8] = DV_PF_8888,
[MESA_FORMAT_RGB565] = DV_PF_565,
[MESA_FORMAT_ARGB1555] = DV_PF_1555,
[MESA_FORMAT_ARGB4444] = DV_PF_4444,
diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c
index c30eed9..60ceb6d 100644
--- a/src/mesa/drivers/dri/i915/i915_context.c
+++ b/src/mesa/drivers/dri/i915/i915_context.c
@@ -99,10 +99,10 @@ intel_init_texture_formats(struct gl_context *ctx)
struct intel_context *intel = intel_context(ctx);
struct intel_screen *intel_screen = intel->intelScreen;
- ctx->TextureFormatSupported[MESA_FORMAT_ARGB8888] = true;
+ ctx->TextureFormatSupported[MESA_FORMAT_BGRA_UNORM8] = true;
if (intel_screen->deviceID != PCI_CHIP_I830_M &&
intel_screen->deviceID != PCI_CHIP_845_G)
- ctx->TextureFormatSupported[MESA_FORMAT_XRGB8888] = true;
+ ctx->TextureFormatSupported[MESA_FORMAT_BGRX_UNORM8] = true;
if (intel->gen == 3)
ctx->TextureFormatSupported[MESA_FORMAT_SARGB8] = true;
ctx->TextureFormatSupported[MESA_FORMAT_ARGB4444] = true;
diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c
index 594fa55..9e2a36a 100644
--- a/src/mesa/drivers/dri/i915/i915_texstate.c
+++ b/src/mesa/drivers/dri/i915/i915_texstate.c
@@ -57,11 +57,11 @@ translate_texture_format(mesa_format mesa_format, GLenum DepthMode)
case MESA_FORMAT_ARGB4444:
return MAPSURF_16BIT | MT_16BIT_ARGB4444;
case MESA_FORMAT_SARGB8:
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
return MAPSURF_32BIT | MT_32BIT_ARGB8888;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
return MAPSURF_32BIT | MT_32BIT_XRGB8888;
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_RGBA_UNORM8:
return MAPSURF_32BIT | MT_32BIT_ABGR8888;
case MESA_FORMAT_YCBCR_REV:
return (MAPSURF_422 | MT_422_YCRCB_NORMAL);
diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c
index 382c221..a54e4e2 100644
--- a/src/mesa/drivers/dri/i915/i915_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i915_vtbl.c
@@ -549,8 +549,8 @@ i915_set_buf_info_for_region(uint32_t *state, struct intel_region *region,
static uint32_t i915_render_target_format_for_mesa_format[MESA_FORMAT_COUNT] =
{
- [MESA_FORMAT_ARGB8888] = DV_PF_8888,
- [MESA_FORMAT_XRGB8888] = DV_PF_8888,
+ [MESA_FORMAT_BGRA_UNORM8] = DV_PF_8888,
+ [MESA_FORMAT_BGRX_UNORM8] = 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,
diff --git a/src/mesa/drivers/dri/i915/intel_blit.c b/src/mesa/drivers/dri/i915/intel_blit.c
index 6680ccd..6d4e569 100644
--- a/src/mesa/drivers/dri/i915/intel_blit.c
+++ b/src/mesa/drivers/dri/i915/intel_blit.c
@@ -129,10 +129,10 @@ intel_miptree_blit(struct intel_context *intel,
* channel to 1.0 at the end.
*/
if (src_format != dst_format &&
- ((src_format != MESA_FORMAT_ARGB8888 &&
- src_format != MESA_FORMAT_XRGB8888) ||
- (dst_format != MESA_FORMAT_ARGB8888 &&
- dst_format != MESA_FORMAT_XRGB8888))) {
+ ((src_format != MESA_FORMAT_BGRA_UNORM8 &&
+ src_format != MESA_FORMAT_BGRX_UNORM8) ||
+ (dst_format != MESA_FORMAT_BGRA_UNORM8 &&
+ dst_format != MESA_FORMAT_BGRX_UNORM8))) {
perf_debug("%s: Can't use hardware blitter from %s to %s, "
"falling back.\n", __FUNCTION__,
_mesa_get_format_name(src_format),
@@ -201,8 +201,8 @@ intel_miptree_blit(struct intel_context *intel,
return false;
}
- if (src_mt->format == MESA_FORMAT_XRGB8888 &&
- dst_mt->format == MESA_FORMAT_ARGB8888) {
+ if (src_mt->format == MESA_FORMAT_BGRX_UNORM8 &&
+ dst_mt->format == MESA_FORMAT_BGRA_UNORM8) {
intel_miptree_set_alpha_to_one(intel, dst_mt,
dst_x, dst_y,
width, height);
@@ -450,8 +450,8 @@ intelClearWithBlit(struct gl_context *ctx, GLbitfield mask)
_mesa_unclamped_float_rgba_to_ubyte(clear, color);
switch (intel_rb_format(irb)) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
+ case MESA_FORMAT_BGRX_UNORM8:
clear_val = PACK_COLOR_8888(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 250c11d..3872449 100644
--- a/src/mesa/drivers/dri/i915/intel_fbo.c
+++ b/src/mesa/drivers/dri/i915/intel_fbo.c
@@ -238,7 +238,7 @@ intel_image_target_renderbuffer_storage(struct gl_context *ctx,
/* __DRIimage is opaque to the core so it has to be checked here */
switch (image->format) {
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_RGBA_UNORM8:
_mesa_error(&intel->ctx, GL_INVALID_OPERATION,
"glEGLImageTargetRenderbufferStorage(unsupported image format");
return;
diff --git a/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c
index c82253a..96003f2 100644
--- a/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c
+++ b/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c
@@ -228,8 +228,8 @@ do_blit_bitmap( struct gl_context *ctx,
UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[3], tmpColor[3]);
switch (irb->mt->format) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
+ case MESA_FORMAT_BGRX_UNORM8:
color = PACK_COLOR_8888(ubcolor[3], ubcolor[0], ubcolor[1], ubcolor[2]);
break;
case MESA_FORMAT_RGB565:
diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c
index aff58ad..72a35ca 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -124,8 +124,8 @@ aub_dump_bmp(struct gl_context *ctx)
enum aub_dump_bmp_format format;
switch (irb->Base.Base.Format) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
+ case MESA_FORMAT_BGRX_UNORM8:
format = AUB_DUMP_BMP_FORMAT_ARGB_8888;
break;
default:
@@ -861,9 +861,9 @@ intelCreateBuffer(__DRIscreen * driScrnPriv,
else if (mesaVis->sRGBCapable)
rgbFormat = MESA_FORMAT_SARGB8;
else if (mesaVis->alphaBits == 0)
- rgbFormat = MESA_FORMAT_XRGB8888;
+ rgbFormat = MESA_FORMAT_BGRX_UNORM8;
else
- rgbFormat = MESA_FORMAT_ARGB8888;
+ rgbFormat = MESA_FORMAT_BGRA_UNORM8;
/* setup the hardware-based renderbuffers */
rb = intel_create_renderbuffer(rgbFormat);
@@ -1044,7 +1044,7 @@ intel_screen_make_configs(__DRIscreen *dri_screen)
{
static const mesa_format formats[] = {
MESA_FORMAT_RGB565,
- MESA_FORMAT_ARGB8888
+ MESA_FORMAT_BGRA_UNORM8
};
/* GLX_SWAP_COPY_OML is not supported due to page flipping. */
diff --git a/src/mesa/drivers/dri/i915/intel_tex_image.c b/src/mesa/drivers/dri/i915/intel_tex_image.c
index fc23a5e..a70bc5d 100644
--- a/src/mesa/drivers/dri/i915/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i915/intel_tex_image.c
@@ -309,11 +309,11 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
if (rb->mt->cpp == 4) {
if (texture_format == __DRI_TEXTURE_FORMAT_RGB) {
internalFormat = GL_RGB;
- texFormat = MESA_FORMAT_XRGB8888;
+ texFormat = MESA_FORMAT_BGRX_UNORM8;
}
else {
internalFormat = GL_RGBA;
- texFormat = MESA_FORMAT_ARGB8888;
+ texFormat = MESA_FORMAT_BGRA_UNORM8;
}
} else if (rb->mt->cpp == 2) {
internalFormat = GL_RGB;
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 0cc7f62..6f8a023 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -209,10 +209,10 @@ color_formats_match(mesa_format src_format, mesa_format dst_format)
* (overriding alpha to 1.0 via blending).
*/
return linear_src_format == linear_dst_format ||
- (linear_src_format == MESA_FORMAT_XRGB8888 &&
- linear_dst_format == MESA_FORMAT_ARGB8888) ||
- (linear_src_format == MESA_FORMAT_ARGB8888 &&
- linear_dst_format == MESA_FORMAT_XRGB8888);
+ (linear_src_format == MESA_FORMAT_BGRX_UNORM8 &&
+ linear_dst_format == MESA_FORMAT_BGRA_UNORM8) ||
+ (linear_src_format == MESA_FORMAT_BGRA_UNORM8 &&
+ linear_dst_format == MESA_FORMAT_BGRX_UNORM8);
}
static bool
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 6821029..c3c8a84 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -877,7 +877,7 @@ intel_gles3_srgb_workaround(struct brw_context *brw,
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_ARGB8888;
+ fb->Attachment[i].Renderbuffer->Format = MESA_FORMAT_BGRA_UNORM8;
}
}
}
diff --git a/src/mesa/drivers/dri/i965/brw_surface_formats.c b/src/mesa/drivers/dri/i965/brw_surface_formats.c
index ebbd335..605f095 100644
--- a/src/mesa/drivers/dri/i965/brw_surface_formats.c
+++ b/src/mesa/drivers/dri/i965/brw_surface_formats.c
@@ -319,14 +319,14 @@ brw_format_for_mesa_format(mesa_format mesa_format)
*/
static const uint32_t table[MESA_FORMAT_COUNT] =
{
- [MESA_FORMAT_RGBA8888] = 0,
- [MESA_FORMAT_RGBA8888_REV] = BRW_SURFACEFORMAT_R8G8B8A8_UNORM,
- [MESA_FORMAT_ARGB8888] = BRW_SURFACEFORMAT_B8G8R8A8_UNORM,
- [MESA_FORMAT_ARGB8888_REV] = 0,
- [MESA_FORMAT_RGBX8888] = 0,
- [MESA_FORMAT_RGBX8888_REV] = BRW_SURFACEFORMAT_R8G8B8X8_UNORM,
- [MESA_FORMAT_XRGB8888] = BRW_SURFACEFORMAT_B8G8R8X8_UNORM,
- [MESA_FORMAT_XRGB8888_REV] = 0,
+ [MESA_FORMAT_ABGR_UNORM8] = 0,
+ [MESA_FORMAT_RGBA_UNORM8] = BRW_SURFACEFORMAT_R8G8B8A8_UNORM,
+ [MESA_FORMAT_BGRA_UNORM8] = BRW_SURFACEFORMAT_B8G8R8A8_UNORM,
+ [MESA_FORMAT_ARGB_UNORM8] = 0,
+ [MESA_FORMAT_XBGR_UNORM8] = 0,
+ [MESA_FORMAT_RGBX_UNORM8] = BRW_SURFACEFORMAT_R8G8B8X8_UNORM,
+ [MESA_FORMAT_BGRX_UNORM8] = BRW_SURFACEFORMAT_B8G8R8X8_UNORM,
+ [MESA_FORMAT_XRGB_UNORM8] = 0,
[MESA_FORMAT_RGB888] = 0,
[MESA_FORMAT_BGR888] = BRW_SURFACEFORMAT_R8G8B8_UNORM,
[MESA_FORMAT_RGB565] = BRW_SURFACEFORMAT_B5G6R5_UNORM,
diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c
index 6ea35ae..e5dd408 100644
--- a/src/mesa/drivers/dri/i965/intel_blit.c
+++ b/src/mesa/drivers/dri/i965/intel_blit.c
@@ -171,10 +171,10 @@ intel_miptree_blit(struct brw_context *brw,
* channel to 1.0 at the end.
*/
if (src_format != dst_format &&
- ((src_format != MESA_FORMAT_ARGB8888 &&
- src_format != MESA_FORMAT_XRGB8888) ||
- (dst_format != MESA_FORMAT_ARGB8888 &&
- dst_format != MESA_FORMAT_XRGB8888))) {
+ ((src_format != MESA_FORMAT_BGRA_UNORM8 &&
+ src_format != MESA_FORMAT_BGRX_UNORM8) ||
+ (dst_format != MESA_FORMAT_BGRA_UNORM8 &&
+ dst_format != MESA_FORMAT_BGRX_UNORM8))) {
perf_debug("%s: Can't use hardware blitter from %s to %s, "
"falling back.\n", __FUNCTION__,
_mesa_get_format_name(src_format),
@@ -271,8 +271,8 @@ intel_miptree_blit(struct brw_context *brw,
return false;
}
- if (src_mt->format == MESA_FORMAT_XRGB8888 &&
- dst_mt->format == MESA_FORMAT_ARGB8888) {
+ if (src_mt->format == MESA_FORMAT_BGRX_UNORM8 &&
+ dst_mt->format == MESA_FORMAT_BGRA_UNORM8) {
intel_miptree_set_alpha_to_one(brw, dst_mt,
dst_x, dst_y,
width, height);
diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c b/src/mesa/drivers/dri/i965/intel_fbo.c
index e6cc90c..d748ba2 100644
--- a/src/mesa/drivers/dri/i965/intel_fbo.c
+++ b/src/mesa/drivers/dri/i965/intel_fbo.c
@@ -269,7 +269,7 @@ intel_image_target_renderbuffer_storage(struct gl_context *ctx,
/* __DRIimage is opaque to the core so it has to be checked here */
switch (image->format) {
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_RGBA_UNORM8:
_mesa_error(ctx, GL_INVALID_OPERATION,
"glEGLImageTargetRenderbufferStorage(unsupported image format");
return;
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index b29aefe..4e98510 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -504,10 +504,10 @@ intel_miptree_create(struct brw_context *brw,
if (brw->gen < 8 && !brw->is_baytrail) {
switch (format) {
case MESA_FORMAT_ETC1_RGB8:
- format = MESA_FORMAT_RGBX8888_REV;
+ format = MESA_FORMAT_RGBX_UNORM8;
break;
case MESA_FORMAT_ETC2_RGB8:
- format = MESA_FORMAT_RGBX8888_REV;
+ format = MESA_FORMAT_RGBX_UNORM8;
break;
case MESA_FORMAT_ETC2_SRGB8:
case MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC:
@@ -516,7 +516,7 @@ intel_miptree_create(struct brw_context *brw,
break;
case MESA_FORMAT_ETC2_RGBA8_EAC:
case MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1:
- format = MESA_FORMAT_RGBA8888_REV;
+ format = MESA_FORMAT_RGBA_UNORM8;
break;
case MESA_FORMAT_ETC2_R11_EAC:
format = MESA_FORMAT_R16;
@@ -2004,7 +2004,7 @@ intel_miptree_map_etc(struct brw_context *brw,
{
assert(mt->etc_format != MESA_FORMAT_NONE);
if (mt->etc_format == MESA_FORMAT_ETC1_RGB8) {
- assert(mt->format == MESA_FORMAT_RGBX8888_REV);
+ assert(mt->format == MESA_FORMAT_RGBX_UNORM8);
}
assert(map->mode & GL_MAP_WRITE_BIT);
diff --git a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
index 6858c7d..7d6a12c 100644
--- a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
+++ b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
@@ -229,8 +229,8 @@ do_blit_bitmap( struct gl_context *ctx,
UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[3], tmpColor[3]);
switch (_mesa_get_render_format(ctx, intel_rb_format(irb))) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
+ case MESA_FORMAT_BGRX_UNORM8:
color = PACK_COLOR_8888(ubcolor[3], ubcolor[0], ubcolor[1], ubcolor[2]);
break;
case MESA_FORMAT_RGB565:
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 9fcd690..9641120 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -135,8 +135,8 @@ aub_dump_bmp(struct gl_context *ctx)
enum aub_dump_bmp_format format;
switch (irb->Base.Base.Format) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
+ case MESA_FORMAT_BGRX_UNORM8:
format = AUB_DUMP_BMP_FORMAT_ARGB_8888;
break;
default:
@@ -980,7 +980,7 @@ intelCreateBuffer(__DRIscreen * driScrnPriv,
else if (mesaVis->sRGBCapable)
rgbFormat = MESA_FORMAT_SARGB8;
else if (mesaVis->alphaBits == 0)
- rgbFormat = MESA_FORMAT_XRGB8888;
+ rgbFormat = MESA_FORMAT_BGRX_UNORM8;
else {
rgbFormat = MESA_FORMAT_SARGB8;
fb->Visual.sRGBCapable = true;
@@ -1126,7 +1126,7 @@ intel_screen_make_configs(__DRIscreen *dri_screen)
{
static const mesa_format formats[] = {
MESA_FORMAT_RGB565,
- MESA_FORMAT_ARGB8888
+ MESA_FORMAT_BGRA_UNORM8
};
/* GLX_SWAP_COPY_OML is not supported due to page flipping. */
diff --git a/src/mesa/drivers/dri/i965/intel_tex_image.c b/src/mesa/drivers/dri/i965/intel_tex_image.c
index b774efe..ca7df05 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_image.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_image.c
@@ -300,11 +300,11 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
if (rb->mt->cpp == 4) {
if (texture_format == __DRI_TEXTURE_FORMAT_RGB) {
internalFormat = GL_RGB;
- texFormat = MESA_FORMAT_XRGB8888;
+ texFormat = MESA_FORMAT_BGRX_UNORM8;
}
else {
internalFormat = GL_RGBA;
- texFormat = MESA_FORMAT_ARGB8888;
+ texFormat = MESA_FORMAT_BGRA_UNORM8;
}
} else if (rb->mt->cpp == 2) {
internalFormat = GL_RGB;
diff --git a/src/mesa/drivers/dri/i965/intel_tex_subimage.c b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
index ef6a5e5..50a5b4d 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
@@ -576,8 +576,8 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
(texImage->TexFormat == MESA_FORMAT_A8 && format == GL_ALPHA)) {
cpp = 1;
mem_copy = memcpy;
- } else if ((texImage->TexFormat == MESA_FORMAT_ARGB8888) ||
- (texImage->TexFormat == MESA_FORMAT_XRGB8888)) {
+ } else if ((texImage->TexFormat == MESA_FORMAT_BGRA_UNORM8) ||
+ (texImage->TexFormat == MESA_FORMAT_BGRX_UNORM8)) {
cpp = 4;
if (format == GL_BGRA) {
mem_copy = memcpy;
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
index 43651bf..69819ab 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_fbo.c
@@ -44,13 +44,13 @@ set_renderbuffer_format(struct gl_renderbuffer *rb, GLenum internalFormat)
case GL_RGB:
case GL_RGB8:
rb->_BaseFormat = GL_RGB;
- rb->Format = MESA_FORMAT_XRGB8888;
+ rb->Format = MESA_FORMAT_BGRX_UNORM8;
s->cpp = 4;
break;
case GL_RGBA:
case GL_RGBA8:
rb->_BaseFormat = GL_RGBA;
- rb->Format = MESA_FORMAT_ARGB8888;
+ rb->Format = MESA_FORMAT_BGRA_UNORM8;
s->cpp = 4;
break;
case GL_RGB5:
@@ -272,8 +272,8 @@ static int
validate_format_bpp(mesa_format format)
{
switch (format) {
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
+ case MESA_FORMAT_BGRA_UNORM8:
case MESA_FORMAT_Z24_S8:
return 32;
case MESA_FORMAT_RGB565:
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
index 7117f51..262913e 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_screen.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
@@ -54,8 +54,8 @@ nouveau_get_configs(void)
static const mesa_format formats[3] = {
MESA_FORMAT_RGB565,
- MESA_FORMAT_ARGB8888,
- MESA_FORMAT_XRGB8888,
+ MESA_FORMAT_BGRA_UNORM8,
+ MESA_FORMAT_BGRX_UNORM8,
};
const GLenum back_buffer_modes[] = {
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
index dfa6d12..317ab86 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
@@ -175,7 +175,7 @@ nouveau_choose_tex_format(struct gl_context *ctx, GLenum target,
case GL_RGBA16:
case GL_RGB10_A2:
case GL_COMPRESSED_RGBA:
- return MESA_FORMAT_ARGB8888;
+ return MESA_FORMAT_BGRA_UNORM8;
case GL_RGB5_A1:
return MESA_FORMAT_ARGB1555;
@@ -185,7 +185,7 @@ nouveau_choose_tex_format(struct gl_context *ctx, GLenum target,
case GL_RGB12:
case GL_RGB16:
case GL_COMPRESSED_RGB:
- return MESA_FORMAT_XRGB8888;
+ return MESA_FORMAT_BGRX_UNORM8;
case 3:
case GL_R3_G3_B2:
case GL_RGB4:
@@ -201,7 +201,7 @@ nouveau_choose_tex_format(struct gl_context *ctx, GLenum target,
case GL_LUMINANCE16_ALPHA16:
case GL_LUMINANCE8_ALPHA8:
case GL_COMPRESSED_LUMINANCE_ALPHA:
- return MESA_FORMAT_ARGB8888;
+ return MESA_FORMAT_BGRA_UNORM8;
case 1:
case GL_LUMINANCE:
@@ -589,9 +589,9 @@ get_texbuffer_format(struct gl_renderbuffer *rb, GLint format)
if (s->cpp < 4)
return s->format;
else if (format == __DRI_TEXTURE_FORMAT_RGBA)
- return MESA_FORMAT_ARGB8888;
+ return MESA_FORMAT_BGRA_UNORM8;
else
- return MESA_FORMAT_XRGB8888;
+ return MESA_FORMAT_BGRX_UNORM8;
}
void
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_util.h b/src/mesa/drivers/dri/nouveau/nouveau_util.h
index 8d0c269..7546e52 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_util.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_util.h
@@ -34,17 +34,17 @@ static inline unsigned
pack_rgba_i(mesa_format f, uint8_t c[])
{
switch (f) {
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
return PACK_COLOR_8888(c[ACOMP], c[RCOMP], c[GCOMP], c[BCOMP]);
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_ARGB_UNORM8:
return PACK_COLOR_8888(c[BCOMP], c[GCOMP], c[RCOMP], c[ACOMP]);
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
return PACK_COLOR_8888(0, c[RCOMP], c[GCOMP], c[BCOMP]);
- case MESA_FORMAT_XRGB8888_REV:
+ case MESA_FORMAT_XRGB_UNORM8:
return PACK_COLOR_8888(c[BCOMP], c[GCOMP], c[RCOMP], 0);
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_ABGR_UNORM8:
return PACK_COLOR_8888(c[RCOMP], c[GCOMP], c[BCOMP], c[ACOMP]);
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_RGBA_UNORM8:
return PACK_COLOR_8888(c[ACOMP], c[BCOMP], c[GCOMP], c[RCOMP]);
case MESA_FORMAT_RGB565:
return PACK_COLOR_565(c[RCOMP], c[GCOMP], c[BCOMP]);
diff --git a/src/mesa/drivers/dri/nouveau/nv04_context.c b/src/mesa/drivers/dri/nouveau/nv04_context.c
index 6cd191e..dc62208 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_context.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_context.c
@@ -114,7 +114,7 @@ init_dummy_texture(struct gl_context *ctx)
nouveau_surface_alloc(ctx, s, SWIZZLED,
NOUVEAU_BO_MAP | NOUVEAU_BO_VRAM,
- MESA_FORMAT_ARGB8888, 1, 1);
+ MESA_FORMAT_BGRA_UNORM8, 1, 1);
nouveau_bo_map(s->bo, NOUVEAU_BO_WR, context_client(ctx));
*(uint32_t *)s->bo->map = 0xffffffff;
diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c
index fcf9fdf..b4fb1ff 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_state_fb.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_state_fb.c
@@ -35,9 +35,9 @@ static inline unsigned
get_rt_format(mesa_format format)
{
switch (format) {
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X8R8G8B8_X8R8G8B8;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_A8R8G8B8;
case MESA_FORMAT_RGB565:
return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_R5G6B5;
diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_frag.c b/src/mesa/drivers/dri/nouveau/nv04_state_frag.c
index d0245da..c854907 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_state_frag.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_state_frag.c
@@ -294,6 +294,6 @@ nv04_emit_tex_env(struct gl_context *ctx, int emit)
/* update calculated multitex state */
nv04->alpha[i] = rc_a.hw;
nv04->color[i] = rc_c.hw;
- nv04->factor = pack_rgba_f(MESA_FORMAT_ARGB8888,
+ nv04->factor = pack_rgba_f(MESA_FORMAT_BGRA_UNORM8,
ctx->Texture.Unit[0].EnvColor);
}
diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c
index ed21e54..2b8a8e8 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_state_raster.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_state_raster.c
@@ -222,6 +222,6 @@ nv04_emit_blend(struct gl_context *ctx, int emit)
/* Fog. */
if (ctx->Fog.Enabled) {
nv04->blend |= NV04_TEXTURED_TRIANGLE_BLEND_FOG_ENABLE;
- nv04->fog = pack_rgba_f(MESA_FORMAT_ARGB8888, ctx->Fog.Color);
+ nv04->fog = pack_rgba_f(MESA_FORMAT_BGRA_UNORM8, ctx->Fog.Color);
}
}
diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c
index e4d695a..aa7f38a 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c
@@ -48,9 +48,9 @@ get_tex_format(struct gl_texture_image *ti)
return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_A4R4G4B4;
case MESA_FORMAT_RGB565:
return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_R5G6B5;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_A8R8G8B8;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_X8R8G8B8;
default:
assert(0);
diff --git a/src/mesa/drivers/dri/nouveau/nv04_surface.c b/src/mesa/drivers/dri/nouveau/nv04_surface.c
index 153cc9b..28df9b7 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_surface.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_surface.c
@@ -57,11 +57,11 @@ swzsurf_format(mesa_format format)
case MESA_FORMAT_Z16:
return NV04_SWIZZLED_SURFACE_FORMAT_COLOR_R5G6B5;
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_RGBA8888_REV:
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_ABGR_UNORM8:
+ case MESA_FORMAT_RGBA_UNORM8:
+ case MESA_FORMAT_BGRX_UNORM8:
+ case MESA_FORMAT_BGRA_UNORM8:
+ case MESA_FORMAT_ARGB_UNORM8:
case MESA_FORMAT_S8_Z24:
case MESA_FORMAT_Z24_S8:
case MESA_FORMAT_Z32:
@@ -96,11 +96,11 @@ surf2d_format(mesa_format format)
case MESA_FORMAT_Z16:
return NV04_CONTEXT_SURFACES_2D_FORMAT_R5G6B5;
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_RGBA8888_REV:
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_ABGR_UNORM8:
+ case MESA_FORMAT_RGBA_UNORM8:
+ case MESA_FORMAT_BGRX_UNORM8:
+ case MESA_FORMAT_BGRA_UNORM8:
+ case MESA_FORMAT_ARGB_UNORM8:
case MESA_FORMAT_S8_Z24:
case MESA_FORMAT_Z24_S8:
case MESA_FORMAT_Z32:
@@ -135,11 +135,11 @@ rect_format(mesa_format format)
case MESA_FORMAT_Z16:
return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A16R5G6B5;
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_RGBA8888_REV:
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_ABGR_UNORM8:
+ case MESA_FORMAT_RGBA_UNORM8:
+ case MESA_FORMAT_BGRX_UNORM8:
+ case MESA_FORMAT_BGRA_UNORM8:
+ case MESA_FORMAT_ARGB_UNORM8:
case MESA_FORMAT_S8_Z24:
case MESA_FORMAT_Z24_S8:
case MESA_FORMAT_Z32:
@@ -174,11 +174,11 @@ sifm_format(mesa_format format)
case MESA_FORMAT_Z16:
return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_R5G6B5;
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_RGBA8888_REV:
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_ABGR_UNORM8:
+ case MESA_FORMAT_RGBA_UNORM8:
+ case MESA_FORMAT_BGRX_UNORM8:
+ case MESA_FORMAT_BGRA_UNORM8:
+ case MESA_FORMAT_ARGB_UNORM8:
case MESA_FORMAT_S8_Z24:
case MESA_FORMAT_Z24_S8:
case MESA_FORMAT_Z32:
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
index 93410bc..7611759 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
@@ -36,9 +36,9 @@ static inline unsigned
get_rt_format(mesa_format format)
{
switch (format) {
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
return NV10_3D_RT_FORMAT_COLOR_X8R8G8B8;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
return NV10_3D_RT_FORMAT_COLOR_A8R8G8B8;
case MESA_FORMAT_RGB565:
return NV10_3D_RT_FORMAT_COLOR_R5G6B5;
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_frag.c b/src/mesa/drivers/dri/nouveau/nv10_state_frag.c
index b6ccf45..7f85808 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_frag.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_frag.c
@@ -185,7 +185,7 @@ get_input_arg(struct combiner_state *rc, int arg, int flags)
get_input_mapping(rc, operand,
flags ^ INVERT);
- } else if (format == MESA_FORMAT_XRGB8888) {
+ } else if (format == MESA_FORMAT_BGRX_UNORM8) {
/* Sometimes emulated using ARGB8888. */
if (!is_color_operand(operand))
return RC_IN_SOURCE(ZERO) |
@@ -319,7 +319,7 @@ nv10_get_general_combiner(struct gl_context *ctx, int i,
rc_a.in = rc_a.out = rc_c.in = rc_c.out = 0;
}
- *k = pack_rgba_f(MESA_FORMAT_ARGB8888,
+ *k = pack_rgba_f(MESA_FORMAT_BGRA_UNORM8,
ctx->Texture.Unit[i].EnvColor);
*a_in = rc_a.in;
*a_out = rc_a.out;
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
index 3b76d66..3530191 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
@@ -90,10 +90,10 @@ static uint32_t
get_tex_format_pot(struct gl_texture_image *ti)
{
switch (ti->TexFormat) {
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
return NV10_3D_TEX_FORMAT_FORMAT_A8R8G8B8;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
return NV10_3D_TEX_FORMAT_FORMAT_X8R8G8B8;
case MESA_FORMAT_ARGB1555:
@@ -137,8 +137,8 @@ get_tex_format_rect(struct gl_texture_image *ti)
case MESA_FORMAT_RGB565:
return NV10_3D_TEX_FORMAT_FORMAT_R5G6B5_RECT;
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
+ case MESA_FORMAT_BGRX_UNORM8:
return NV10_3D_TEX_FORMAT_FORMAT_A8R8G8B8_RECT;
case MESA_FORMAT_A8:
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c b/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c
index 06155fe..7861e4d 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c
@@ -144,7 +144,7 @@ nv10_emit_fog(struct gl_context *ctx, int emit)
PUSH_DATA (push, get_fog_mode(f->Mode));
PUSH_DATA (push, get_fog_source(source, f->FogDistanceMode));
PUSH_DATAb(push, f->Enabled);
- PUSH_DATA (push, pack_rgba_f(MESA_FORMAT_RGBA8888_REV, f->Color));
+ PUSH_DATA (push, pack_rgba_f(MESA_FORMAT_RGBA_UNORM8, f->Color));
BEGIN_NV04(push, NV10_3D(FOG_COEFF(0)), 3);
PUSH_DATAp(push, k, 3);
diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c
index 1c1f862..5cd0b28 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c
@@ -36,9 +36,9 @@ static inline unsigned
get_rt_format(mesa_format format)
{
switch (format) {
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
return NV20_3D_RT_FORMAT_COLOR_X8R8G8B8;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
return NV20_3D_RT_FORMAT_COLOR_A8R8G8B8;
case MESA_FORMAT_RGB565:
return NV20_3D_RT_FORMAT_COLOR_R5G6B5;
diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
index ffbc2df..1bc8e19 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
@@ -87,7 +87,7 @@ static uint32_t
get_tex_format_pot(struct gl_texture_image *ti)
{
switch (ti->TexFormat) {
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
return NV20_3D_TEX_FORMAT_FORMAT_A8R8G8B8;
case MESA_FORMAT_ARGB1555:
@@ -96,7 +96,7 @@ get_tex_format_pot(struct gl_texture_image *ti)
case MESA_FORMAT_ARGB4444:
return NV20_3D_TEX_FORMAT_FORMAT_A4R4G4B4;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
return NV20_3D_TEX_FORMAT_FORMAT_X8R8G8B8;
case MESA_FORMAT_RGB565:
@@ -128,7 +128,7 @@ static uint32_t
get_tex_format_rect(struct gl_texture_image *ti)
{
switch (ti->TexFormat) {
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
return NV20_3D_TEX_FORMAT_FORMAT_A8R8G8B8_RECT;
case MESA_FORMAT_ARGB1555:
@@ -137,7 +137,7 @@ get_tex_format_rect(struct gl_texture_image *ti)
case MESA_FORMAT_ARGB4444:
return NV20_3D_TEX_FORMAT_FORMAT_A4R4G4B4_RECT;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
return NV20_3D_TEX_FORMAT_FORMAT_R8G8B8_RECT;
case MESA_FORMAT_RGB565:
diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c b/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c
index 1d3d83d..1e3dc03 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c
@@ -166,7 +166,7 @@ nv20_emit_fog(struct gl_context *ctx, int emit)
get_fog_mode_signed(f->Mode)));
PUSH_DATA (push, get_fog_source(source, f->FogDistanceMode));
PUSH_DATAb(push, f->Enabled);
- PUSH_DATA (push, pack_rgba_f(MESA_FORMAT_RGBA8888_REV, f->Color));
+ PUSH_DATA (push, pack_rgba_f(MESA_FORMAT_RGBA_UNORM8, f->Color));
BEGIN_NV04(push, NV20_3D(FOG_COEFF(0)), 3);
PUSH_DATAp(push, k, 3);
diff --git a/src/mesa/drivers/dri/r200/r200_blit.c b/src/mesa/drivers/dri/r200/r200_blit.c
index 73aeec8..12e69c3 100644
--- a/src/mesa/drivers/dri/r200/r200_blit.c
+++ b/src/mesa/drivers/dri/r200/r200_blit.c
@@ -42,8 +42,8 @@ unsigned r200_check_blit(mesa_format mesa_format, uint32_t dst_pitch)
{
/* XXX others? BE/LE? */
switch (mesa_format) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
+ case MESA_FORMAT_BGRX_UNORM8:
case MESA_FORMAT_RGB565:
case MESA_FORMAT_ARGB4444:
case MESA_FORMAT_ARGB1555:
@@ -51,8 +51,8 @@ unsigned r200_check_blit(mesa_format mesa_format, uint32_t dst_pitch)
case MESA_FORMAT_L8:
case MESA_FORMAT_I8:
/* swizzled */
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_ABGR_UNORM8:
+ case MESA_FORMAT_RGBA_UNORM8:
break;
default:
return 0;
@@ -114,16 +114,16 @@ static void inline emit_tx_setup(struct r200_context *r200,
/* XXX others? BE/LE? */
switch (src_mesa_format) {
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
txformat |= R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_ABGR_UNORM8:
txformat |= R200_TXFORMAT_RGBA8888 | R200_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_RGBA_UNORM8:
txformat |= R200_TXFORMAT_ABGR8888 | R200_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
txformat |= R200_TXFORMAT_ARGB8888;
break;
case MESA_FORMAT_RGB565:
@@ -155,8 +155,8 @@ static void inline emit_tx_setup(struct r200_context *r200,
offset |= R200_TXO_MICRO_TILE;
switch (dst_mesa_format) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
+ case MESA_FORMAT_BGRX_UNORM8:
case MESA_FORMAT_RGB565:
case MESA_FORMAT_ARGB4444:
case MESA_FORMAT_ARGB1555:
@@ -182,7 +182,7 @@ static void inline emit_tx_setup(struct r200_context *r200,
R200_TXA_OUTPUT_REG_R0));
END_BATCH();
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_ABGR_UNORM8:
BEGIN_BATCH(10);
OUT_BATCH_REGVAL(RADEON_PP_CNTL, (RADEON_TEX_0_ENABLE |
RADEON_TEX_BLEND_0_ENABLE));
@@ -202,7 +202,7 @@ static void inline emit_tx_setup(struct r200_context *r200,
R200_TXA_OUTPUT_REG_R0));
END_BATCH();
break;
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_RGBA_UNORM8:
BEGIN_BATCH(34);
OUT_BATCH_REGVAL(RADEON_PP_CNTL, (RADEON_TEX_0_ENABLE |
RADEON_TEX_BLEND_0_ENABLE |
@@ -308,10 +308,10 @@ static inline void emit_cb_setup(struct r200_context *r200,
/* XXX others? BE/LE? */
switch (mesa_format) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_BGRA_UNORM8:
+ case MESA_FORMAT_BGRX_UNORM8:
+ case MESA_FORMAT_ABGR_UNORM8:
+ case MESA_FORMAT_RGBA_UNORM8:
dst_format = RADEON_COLOR_FORMAT_ARGB8888;
break;
case MESA_FORMAT_RGB565:
diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c
index 6ba538e..70f90b5 100644
--- a/src/mesa/drivers/dri/r200/r200_texstate.c
+++ b/src/mesa/drivers/dri/r200/r200_texstate.c
@@ -69,10 +69,10 @@ struct tx_table {
static const struct tx_table tx_table_be[] =
{
- [ MESA_FORMAT_RGBA8888 ] = { R200_TXFORMAT_ABGR8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_RGBA8888_REV ] = { R200_TXFORMAT_RGBA8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_ARGB8888 ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_ARGB8888_REV ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_ABGR_UNORM8 ] = { R200_TXFORMAT_ABGR8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_RGBA_UNORM8 ] = { R200_TXFORMAT_RGBA8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_BGRA_UNORM8 ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_ARGB_UNORM8 ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_RGB888 ] = { 0xffffffff, 0 },
[ MESA_FORMAT_RGB565 ] = { R200_TXFORMAT_RGB565, 0 },
[ MESA_FORMAT_RGB565_REV ] = { R200_TXFORMAT_RGB565, 0 },
@@ -97,10 +97,10 @@ static const struct tx_table tx_table_be[] =
static const struct tx_table tx_table_le[] =
{
- [ MESA_FORMAT_RGBA8888 ] = { R200_TXFORMAT_RGBA8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_RGBA8888_REV ] = { R200_TXFORMAT_ABGR8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_ARGB8888 ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_ARGB8888_REV ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_ABGR_UNORM8 ] = { R200_TXFORMAT_RGBA8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_RGBA_UNORM8 ] = { R200_TXFORMAT_ABGR8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_BGRA_UNORM8 ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_ARGB_UNORM8 ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_RGB888 ] = { R200_TXFORMAT_ARGB8888, 0 },
[ MESA_FORMAT_RGB565 ] = { R200_TXFORMAT_RGB565, 0 },
[ MESA_FORMAT_RGB565_REV ] = { R200_TXFORMAT_RGB565, 0 },
@@ -772,10 +772,10 @@ void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_format
t->pp_txformat = tx_table_le[MESA_FORMAT_RGB888].format;
}
else {
- texFormat = MESA_FORMAT_ARGB8888;
- t->pp_txformat = tx_table_le[MESA_FORMAT_ARGB8888].format;
+ texFormat = MESA_FORMAT_BGRA_UNORM8;
+ t->pp_txformat = tx_table_le[MESA_FORMAT_BGRA_UNORM8].format;
}
- t->pp_txfilter |= tx_table_le[MESA_FORMAT_ARGB8888].filter;
+ t->pp_txfilter |= tx_table_le[MESA_FORMAT_BGRA_UNORM8].filter;
break;
case 3:
default:
diff --git a/src/mesa/drivers/dri/radeon/radeon_blit.c b/src/mesa/drivers/dri/radeon/radeon_blit.c
index db10886..56afc70 100644
--- a/src/mesa/drivers/dri/radeon/radeon_blit.c
+++ b/src/mesa/drivers/dri/radeon/radeon_blit.c
@@ -42,8 +42,8 @@ unsigned r100_check_blit(mesa_format mesa_format, uint32_t dst_pitch)
{
/* XXX others? BE/LE? */
switch (mesa_format) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
+ case MESA_FORMAT_BGRX_UNORM8:
case MESA_FORMAT_RGB565:
case MESA_FORMAT_ARGB4444:
case MESA_FORMAT_ARGB1555:
@@ -108,13 +108,13 @@ static void inline emit_tx_setup(struct r100_context *r100,
/* XXX others? BE/LE? */
switch (mesa_format) {
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
txformat |= RADEON_TXFORMAT_ARGB8888 | RADEON_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_ABGR_UNORM8:
txformat |= RADEON_TXFORMAT_RGBA8888 | RADEON_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
txformat |= RADEON_TXFORMAT_ARGB8888;
break;
case MESA_FORMAT_RGB565:
@@ -186,8 +186,8 @@ static inline void emit_cb_setup(struct r100_context *r100,
/* XXX others? BE/LE? */
switch (mesa_format) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
+ case MESA_FORMAT_BGRX_UNORM8:
dst_format = RADEON_COLOR_FORMAT_ARGB8888;
break;
case MESA_FORMAT_RGB565:
diff --git a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
index e9bfc0d..6981653 100644
--- a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
+++ b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
@@ -57,10 +57,10 @@ static mesa_format gl_format_and_type_to_mesa_format(GLenum format, GLenum type)
case GL_UNSIGNED_SHORT_5_5_5_1:
return MESA_FORMAT_RGBA5551;
case GL_UNSIGNED_INT_8_8_8_8:
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_ABGR_UNORM8;
case GL_UNSIGNED_BYTE:
case GL_UNSIGNED_INT_8_8_8_8_REV:
- return MESA_FORMAT_RGBA8888_REV;
+ return MESA_FORMAT_RGBA_UNORM8;
}
break;
case GL_BGRA:
@@ -74,10 +74,10 @@ static mesa_format gl_format_and_type_to_mesa_format(GLenum format, GLenum type)
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
return MESA_FORMAT_ARGB1555;
case GL_UNSIGNED_INT_8_8_8_8:
- return MESA_FORMAT_ARGB8888_REV;
+ return MESA_FORMAT_ARGB_UNORM8;
case GL_UNSIGNED_BYTE:
case GL_UNSIGNED_INT_8_8_8_8_REV:
- return MESA_FORMAT_ARGB8888;
+ return MESA_FORMAT_BGRA_UNORM8;
}
break;
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index d90bafa..8463a8e 100644
--- a/src/mesa/drivers/dri/radeon/radeon_screen.c
+++ b/src/mesa/drivers/dri/radeon/radeon_screen.c
@@ -219,12 +219,12 @@ radeon_create_image_from_name(__DRIscreen *screen,
image->data_type = GL_UNSIGNED_BYTE;
break;
case __DRI_IMAGE_FORMAT_XRGB8888:
- image->format = MESA_FORMAT_XRGB8888;
+ image->format = MESA_FORMAT_BGRX_UNORM8;
image->internal_format = GL_RGB;
image->data_type = GL_UNSIGNED_BYTE;
break;
case __DRI_IMAGE_FORMAT_ARGB8888:
- image->format = MESA_FORMAT_ARGB8888;
+ image->format = MESA_FORMAT_BGRA_UNORM8;
image->internal_format = GL_RGBA;
image->data_type = GL_UNSIGNED_BYTE;
break;
@@ -319,12 +319,12 @@ radeon_create_image(__DRIscreen *screen,
image->data_type = GL_UNSIGNED_BYTE;
break;
case __DRI_IMAGE_FORMAT_XRGB8888:
- image->format = MESA_FORMAT_XRGB8888;
+ image->format = MESA_FORMAT_BGRX_UNORM8;
image->internal_format = GL_RGB;
image->data_type = GL_UNSIGNED_BYTE;
break;
case __DRI_IMAGE_FORMAT_ARGB8888:
- image->format = MESA_FORMAT_ARGB8888;
+ image->format = MESA_FORMAT_BGRA_UNORM8;
image->internal_format = GL_RGBA;
image->data_type = GL_UNSIGNED_BYTE;
break;
@@ -613,9 +613,9 @@ radeonCreateBuffer( __DRIscreen *driScrnPriv,
if (mesaVis->redBits == 5)
rgbFormat = _mesa_little_endian() ? MESA_FORMAT_RGB565 : MESA_FORMAT_RGB565_REV;
else if (mesaVis->alphaBits == 0)
- rgbFormat = _mesa_little_endian() ? MESA_FORMAT_XRGB8888 : MESA_FORMAT_XRGB8888_REV;
+ rgbFormat = _mesa_little_endian() ? MESA_FORMAT_BGRX_UNORM8 : MESA_FORMAT_XRGB_UNORM8;
else
- rgbFormat = _mesa_little_endian() ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB8888_REV;
+ rgbFormat = _mesa_little_endian() ? MESA_FORMAT_BGRA_UNORM8 : MESA_FORMAT_ARGB_UNORM8;
/* front color renderbuffer */
rfb->color_rb[0] = radeon_create_renderbuffer(rgbFormat, driDrawPriv);
@@ -710,8 +710,8 @@ __DRIconfig **radeonInitScreen2(__DRIscreen *psp)
{
static const mesa_format formats[3] = {
MESA_FORMAT_RGB565,
- MESA_FORMAT_XRGB8888,
- MESA_FORMAT_ARGB8888
+ MESA_FORMAT_BGRX_UNORM8,
+ MESA_FORMAT_BGRA_UNORM8
};
/* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
* support pageflipping at all.
diff --git a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c
index fc72384..bc63103 100644
--- a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c
+++ b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c
@@ -112,8 +112,8 @@ do_copy_texsubimage(struct gl_context *ctx,
dst_mesaformat = MESA_FORMAT_RGB565;
break;
case 4:
- src_mesaformat = MESA_FORMAT_ARGB8888;
- dst_mesaformat = MESA_FORMAT_ARGB8888;
+ src_mesaformat = MESA_FORMAT_BGRA_UNORM8;
+ dst_mesaformat = MESA_FORMAT_BGRA_UNORM8;
break;
case 1:
src_mesaformat = MESA_FORMAT_A8;
diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c
index 5550a5a..2723f88 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texstate.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c
@@ -74,10 +74,10 @@ struct tx_table {
static const struct tx_table tx_table[] =
{
[ MESA_FORMAT_NONE ] = { 0xffffffff, 0 },
- [ MESA_FORMAT_RGBA8888 ] = { RADEON_TXFORMAT_RGBA8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_RGBA8888_REV ] = { RADEON_TXFORMAT_RGBA8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_ARGB8888 ] = { RADEON_TXFORMAT_ARGB8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_ARGB8888_REV ] = { RADEON_TXFORMAT_ARGB8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_ABGR_UNORM8 ] = { RADEON_TXFORMAT_RGBA8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_RGBA_UNORM8 ] = { RADEON_TXFORMAT_RGBA8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_BGRA_UNORM8 ] = { RADEON_TXFORMAT_ARGB8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_ARGB_UNORM8 ] = { RADEON_TXFORMAT_ARGB8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_RGB888 ] = { RADEON_TXFORMAT_ARGB8888, 0 },
[ MESA_FORMAT_RGB565 ] = { RADEON_TXFORMAT_RGB565, 0 },
[ MESA_FORMAT_RGB565_REV ] = { RADEON_TXFORMAT_RGB565, 0 },
@@ -647,10 +647,10 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_form
texFormat = MESA_FORMAT_RGB888;
}
else {
- t->pp_txformat = tx_table[MESA_FORMAT_ARGB8888].format;
- texFormat = MESA_FORMAT_ARGB8888;
+ t->pp_txformat = tx_table[MESA_FORMAT_BGRA_UNORM8].format;
+ texFormat = MESA_FORMAT_BGRA_UNORM8;
}
- t->pp_txfilter |= tx_table[MESA_FORMAT_ARGB8888].filter;
+ t->pp_txfilter |= tx_table[MESA_FORMAT_BGRA_UNORM8].filter;
break;
case 3:
default:
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index 8455b82..9eaa62f 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -231,12 +231,12 @@ static mesa_format radeonChoose8888TexFormat(radeonContextPtr rmesa,
(srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && !littleEndian) ||
(srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
(srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && littleEndian)) {
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_ABGR_UNORM8;
} else if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
(srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && littleEndian) ||
(srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8) ||
(srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && !littleEndian)) {
- return MESA_FORMAT_RGBA8888_REV;
+ return MESA_FORMAT_RGBA_UNORM8;
} else
return _radeon_texformat_argb8888;
#endif
@@ -592,16 +592,16 @@ static void
radeonInitTextureFormats(void)
{
if (_mesa_little_endian()) {
- _radeon_texformat_rgba8888 = MESA_FORMAT_RGBA8888;
- _radeon_texformat_argb8888 = MESA_FORMAT_ARGB8888;
+ _radeon_texformat_rgba8888 = MESA_FORMAT_ABGR_UNORM8;
+ _radeon_texformat_argb8888 = MESA_FORMAT_BGRA_UNORM8;
_radeon_texformat_rgb565 = MESA_FORMAT_RGB565;
_radeon_texformat_argb4444 = MESA_FORMAT_ARGB4444;
_radeon_texformat_argb1555 = MESA_FORMAT_ARGB1555;
_radeon_texformat_al88 = MESA_FORMAT_AL88;
}
else {
- _radeon_texformat_rgba8888 = MESA_FORMAT_RGBA8888_REV;
- _radeon_texformat_argb8888 = MESA_FORMAT_ARGB8888_REV;
+ _radeon_texformat_rgba8888 = MESA_FORMAT_RGBA_UNORM8;
+ _radeon_texformat_argb8888 = MESA_FORMAT_ARGB_UNORM8;
_radeon_texformat_rgb565 = MESA_FORMAT_RGB565_REV;
_radeon_texformat_argb4444 = MESA_FORMAT_ARGB4444_REV;
_radeon_texformat_argb1555 = MESA_FORMAT_ARGB1555_REV;
diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
index ddb810f..f069d19 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -92,9 +92,9 @@ static void swrastSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
sPriv->swrast_loader->getDrawableInfo(dPriv, &x, &y, &w, &h, dPriv->loaderPrivate);
if (texture_format == __DRI_TEXTURE_FORMAT_RGB)
- texFormat = MESA_FORMAT_XRGB8888;
+ texFormat = MESA_FORMAT_BGRX_UNORM8;
else
- texFormat = MESA_FORMAT_ARGB8888;
+ texFormat = MESA_FORMAT_BGRA_UNORM8;
_mesa_init_teximage_fields(&dri_ctx->Base, texImage,
w, h, 1, 0, internalFormat, texFormat);
@@ -169,10 +169,10 @@ swrastFillInModes(__DRIscreen *psp,
format = MESA_FORMAT_RGB565;
break;
case 24:
- format = MESA_FORMAT_XRGB8888;
+ format = MESA_FORMAT_BGRX_UNORM8;
break;
case 32:
- format = MESA_FORMAT_ARGB8888;
+ format = MESA_FORMAT_BGRA_UNORM8;
break;
default:
fprintf(stderr, "[%s:%u] bad depth %d\n", __func__, __LINE__,
@@ -345,13 +345,13 @@ swrast_new_renderbuffer(const struct gl_config *visual, __DRIdrawable *dPriv,
switch (pixel_format) {
case PF_A8R8G8B8:
- rb->Format = MESA_FORMAT_ARGB8888;
+ rb->Format = MESA_FORMAT_BGRA_UNORM8;
rb->InternalFormat = GL_RGBA;
rb->_BaseFormat = GL_RGBA;
xrb->bpp = 32;
break;
case PF_X8R8G8B8:
- rb->Format = MESA_FORMAT_ARGB8888; /* XXX */
+ rb->Format = MESA_FORMAT_BGRA_UNORM8; /* XXX */
rb->InternalFormat = GL_RGB;
rb->_BaseFormat = GL_RGB;
xrb->bpp = 32;
@@ -634,7 +634,7 @@ static mesa_format swrastChooseTextureFormat(struct gl_context * ctx,
GLenum type)
{
if (internalFormat == GL_RGB)
- return MESA_FORMAT_XRGB8888;
+ return MESA_FORMAT_BGRX_UNORM8;
return _mesa_choose_tex_format(ctx, target, internalFormat, format, type);
}
diff --git a/src/mesa/drivers/haiku/swrast/SoftwareRast.cpp b/src/mesa/drivers/haiku/swrast/SoftwareRast.cpp
index df697e4..1c9f3f5 100644
--- a/src/mesa/drivers/haiku/swrast/SoftwareRast.cpp
+++ b/src/mesa/drivers/haiku/swrast/SoftwareRast.cpp
@@ -593,11 +593,11 @@ MesaSoftwareRast::_SetupRenderBuffer(struct gl_renderbuffer* rb,
switch (colorSpace) {
case B_RGBA32:
rb->_BaseFormat = GL_RGBA;
- rb->Format = MESA_FORMAT_ARGB8888;
+ rb->Format = MESA_FORMAT_BGRA_UNORM8;
break;
case B_RGB32:
rb->_BaseFormat = GL_RGB;
- rb->Format = MESA_FORMAT_XRGB8888;
+ rb->Format = MESA_FORMAT_BGRX_UNORM8;
break;
case B_RGB24:
rb->_BaseFormat = GL_RGB;
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index e168fec..4fdb24b 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -449,9 +449,9 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
if (osmesa->format == OSMESA_RGBA) {
if (osmesa->DataType == GL_UNSIGNED_BYTE) {
if (_mesa_little_endian())
- rb->Format = MESA_FORMAT_RGBA8888_REV;
+ rb->Format = MESA_FORMAT_RGBA_UNORM8;
else
- rb->Format = MESA_FORMAT_RGBA8888;
+ rb->Format = MESA_FORMAT_ABGR_UNORM8;
}
else if (osmesa->DataType == GL_UNSIGNED_SHORT) {
rb->Format = MESA_FORMAT_RGBA_16;
@@ -463,9 +463,9 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
else if (osmesa->format == OSMESA_BGRA) {
if (osmesa->DataType == GL_UNSIGNED_BYTE) {
if (_mesa_little_endian())
- rb->Format = MESA_FORMAT_ARGB8888;
+ rb->Format = MESA_FORMAT_BGRA_UNORM8;
else
- rb->Format = MESA_FORMAT_ARGB8888_REV;
+ rb->Format = MESA_FORMAT_ARGB_UNORM8;
}
else if (osmesa->DataType == GL_UNSIGNED_SHORT) {
_mesa_warning(ctx, "Unsupported OSMesa format BGRA/GLushort");
@@ -479,9 +479,9 @@ osmesa_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
else if (osmesa->format == OSMESA_ARGB) {
if (osmesa->DataType == GL_UNSIGNED_BYTE) {
if (_mesa_little_endian())
- rb->Format = MESA_FORMAT_ARGB8888_REV;
+ rb->Format = MESA_FORMAT_ARGB_UNORM8;
else
- rb->Format = MESA_FORMAT_ARGB8888;
+ rb->Format = MESA_FORMAT_BGRA_UNORM8;
}
else if (osmesa->DataType == GL_UNSIGNED_SHORT) {
_mesa_warning(ctx, "Unsupported OSMesa format ARGB/GLushort");
diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c
index 3af5be4..d6d3a15 100644
--- a/src/mesa/drivers/x11/xm_buffer.c
+++ b/src/mesa/drivers/x11/xm_buffer.c
@@ -343,20 +343,20 @@ xmesa_new_renderbuffer(struct gl_context *ctx, GLuint name,
/* This will really only happen for pixmaps. We'll access the
* pixmap via a temporary XImage which will be 32bpp.
*/
- xrb->Base.Base.Format = MESA_FORMAT_XRGB8888;
+ xrb->Base.Base.Format = MESA_FORMAT_BGRX_UNORM8;
break;
case PF_8A8R8G8B:
- xrb->Base.Base.Format = MESA_FORMAT_ARGB8888;
+ xrb->Base.Base.Format = MESA_FORMAT_BGRA_UNORM8;
break;
case PF_8A8B8G8R:
- xrb->Base.Base.Format = MESA_FORMAT_RGBA8888_REV;
+ xrb->Base.Base.Format = MESA_FORMAT_RGBA_UNORM8;
break;
case PF_5R6G5B:
xrb->Base.Base.Format = MESA_FORMAT_RGB565;
break;
default:
_mesa_warning(ctx, "Bad pixel format in xmesa_new_renderbuffer");
- xrb->Base.Base.Format = MESA_FORMAT_ARGB8888;
+ xrb->Base.Base.Format = MESA_FORMAT_BGRA_UNORM8;
break;
}
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index 99b2147..1092f37 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -628,8 +628,8 @@ _mesa_print_texture(struct gl_context *ctx, struct gl_texture_image *img)
case MESA_FORMAT_BGR888:
c = 3;
break;
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_ABGR_UNORM8:
+ case MESA_FORMAT_BGRA_UNORM8:
c = 4;
break;
default:
diff --git a/src/mesa/main/format_pack.c b/src/mesa/main/format_pack.c
index bb78482..6ed6a1a 100644
--- a/src/mesa/main/format_pack.c
+++ b/src/mesa/main/format_pack.c
@@ -92,7 +92,7 @@ linear_ubyte_to_srgb_ubyte(GLubyte cl)
/*
- * MESA_FORMAT_RGBA8888
+ * MESA_FORMAT_ABGR_UNORM8
*/
static void
@@ -136,7 +136,7 @@ pack_row_float_RGBA8888(GLuint n, const GLfloat src[][4], void *dst)
/*
- * MESA_FORMAT_RGBA8888_REV
+ * MESA_FORMAT_RGBA_UNORM8
*/
static void
@@ -179,7 +179,7 @@ pack_row_float_RGBA8888_REV(GLuint n, const GLfloat src[][4], void *dst)
/*
- * MESA_FORMAT_ARGB8888
+ * MESA_FORMAT_BGRA_UNORM8
*/
static void
@@ -222,7 +222,7 @@ pack_row_float_ARGB8888(GLuint n, const GLfloat src[][4], void *dst)
/*
- * MESA_FORMAT_ARGB8888_REV
+ * MESA_FORMAT_ARGB_UNORM8
*/
static void
@@ -265,7 +265,7 @@ pack_row_float_ARGB8888_REV(GLuint n, const GLfloat src[][4], void *dst)
/*
- * MESA_FORMAT_XRGB8888
+ * MESA_FORMAT_BGRX_UNORM8
*/
static void
@@ -307,7 +307,7 @@ pack_row_float_XRGB8888(GLuint n, const GLfloat src[][4], void *dst)
/*
- * MESA_FORMAT_XRGB8888_REV
+ * MESA_FORMAT_XRGB_UNORM8
*/
static void
@@ -1889,14 +1889,14 @@ _mesa_get_pack_ubyte_rgba_function(mesa_format format)
table[MESA_FORMAT_NONE] = NULL;
- table[MESA_FORMAT_RGBA8888] = pack_ubyte_RGBA8888;
- table[MESA_FORMAT_RGBA8888_REV] = pack_ubyte_RGBA8888_REV;
- table[MESA_FORMAT_ARGB8888] = pack_ubyte_ARGB8888;
- table[MESA_FORMAT_ARGB8888_REV] = pack_ubyte_ARGB8888_REV;
- table[MESA_FORMAT_RGBX8888] = pack_ubyte_RGBA8888; /* reused */
- table[MESA_FORMAT_RGBX8888_REV] = pack_ubyte_RGBA8888_REV; /* reused */
- table[MESA_FORMAT_XRGB8888] = pack_ubyte_XRGB8888;
- table[MESA_FORMAT_XRGB8888_REV] = pack_ubyte_XRGB8888_REV;
+ table[MESA_FORMAT_ABGR_UNORM8] = pack_ubyte_RGBA8888;
+ table[MESA_FORMAT_RGBA_UNORM8] = pack_ubyte_RGBA8888_REV;
+ table[MESA_FORMAT_BGRA_UNORM8] = pack_ubyte_ARGB8888;
+ table[MESA_FORMAT_ARGB_UNORM8] = pack_ubyte_ARGB8888_REV;
+ table[MESA_FORMAT_XBGR_UNORM8] = pack_ubyte_RGBA8888; /* reused */
+ table[MESA_FORMAT_RGBX_UNORM8] = pack_ubyte_RGBA8888_REV; /* reused */
+ table[MESA_FORMAT_BGRX_UNORM8] = pack_ubyte_XRGB8888;
+ table[MESA_FORMAT_XRGB_UNORM8] = pack_ubyte_XRGB8888_REV;
table[MESA_FORMAT_RGB888] = pack_ubyte_RGB888;
table[MESA_FORMAT_BGR888] = pack_ubyte_BGR888;
table[MESA_FORMAT_RGB565] = pack_ubyte_RGB565;
@@ -2052,14 +2052,14 @@ _mesa_get_pack_float_rgba_function(mesa_format format)
table[MESA_FORMAT_NONE] = NULL;
- table[MESA_FORMAT_RGBA8888] = pack_float_RGBA8888;
- table[MESA_FORMAT_RGBA8888_REV] = pack_float_RGBA8888_REV;
- table[MESA_FORMAT_ARGB8888] = pack_float_ARGB8888;
- table[MESA_FORMAT_ARGB8888_REV] = pack_float_ARGB8888_REV;
- table[MESA_FORMAT_RGBX8888] = pack_float_RGBA8888; /* reused */
- table[MESA_FORMAT_RGBX8888_REV] = pack_float_RGBA8888_REV; /* reused */
- table[MESA_FORMAT_XRGB8888] = pack_float_XRGB8888;
- table[MESA_FORMAT_XRGB8888_REV] = pack_float_XRGB8888_REV;
+ table[MESA_FORMAT_ABGR_UNORM8] = pack_float_RGBA8888;
+ table[MESA_FORMAT_RGBA_UNORM8] = pack_float_RGBA8888_REV;
+ table[MESA_FORMAT_BGRA_UNORM8] = pack_float_ARGB8888;
+ table[MESA_FORMAT_ARGB_UNORM8] = pack_float_ARGB8888_REV;
+ table[MESA_FORMAT_XBGR_UNORM8] = pack_float_RGBA8888; /* reused */
+ table[MESA_FORMAT_RGBX_UNORM8] = pack_float_RGBA8888_REV; /* reused */
+ table[MESA_FORMAT_BGRX_UNORM8] = pack_float_XRGB8888;
+ table[MESA_FORMAT_XRGB_UNORM8] = pack_float_XRGB8888_REV;
table[MESA_FORMAT_RGB888] = pack_float_RGB888;
table[MESA_FORMAT_BGR888] = pack_float_BGR888;
table[MESA_FORMAT_RGB565] = pack_float_RGB565;
@@ -2213,14 +2213,14 @@ get_pack_float_rgba_row_function(mesa_format format)
*/
memset(table, 0, sizeof(table));
- table[MESA_FORMAT_RGBA8888] = pack_row_float_RGBA8888;
- table[MESA_FORMAT_RGBA8888_REV] = pack_row_float_RGBA8888_REV;
- table[MESA_FORMAT_ARGB8888] = pack_row_float_ARGB8888;
- table[MESA_FORMAT_ARGB8888_REV] = pack_row_float_ARGB8888_REV;
- table[MESA_FORMAT_RGBX8888] = pack_row_float_RGBA8888; /* reused */
- table[MESA_FORMAT_RGBX8888_REV] = pack_row_float_RGBA8888_REV; /* reused */
- table[MESA_FORMAT_XRGB8888] = pack_row_float_XRGB8888;
- table[MESA_FORMAT_XRGB8888_REV] = pack_row_float_XRGB8888_REV;
+ table[MESA_FORMAT_ABGR_UNORM8] = pack_row_float_RGBA8888;
+ table[MESA_FORMAT_RGBA_UNORM8] = pack_row_float_RGBA8888_REV;
+ table[MESA_FORMAT_BGRA_UNORM8] = pack_row_float_ARGB8888;
+ table[MESA_FORMAT_ARGB_UNORM8] = pack_row_float_ARGB8888_REV;
+ table[MESA_FORMAT_XBGR_UNORM8] = pack_row_float_RGBA8888; /* reused */
+ table[MESA_FORMAT_RGBX_UNORM8] = pack_row_float_RGBA8888_REV; /* reused */
+ table[MESA_FORMAT_BGRX_UNORM8] = pack_row_float_XRGB8888;
+ table[MESA_FORMAT_XRGB_UNORM8] = pack_row_float_XRGB8888_REV;
table[MESA_FORMAT_RGB888] = pack_row_float_RGB888;
table[MESA_FORMAT_BGR888] = pack_row_float_BGR888;
table[MESA_FORMAT_RGB565] = pack_row_float_RGB565;
@@ -2246,14 +2246,14 @@ get_pack_ubyte_rgba_row_function(mesa_format format)
*/
memset(table, 0, sizeof(table));
- table[MESA_FORMAT_RGBA8888] = pack_row_ubyte_RGBA8888;
- table[MESA_FORMAT_RGBA8888_REV] = pack_row_ubyte_RGBA8888_REV;
- table[MESA_FORMAT_ARGB8888] = pack_row_ubyte_ARGB8888;
- table[MESA_FORMAT_ARGB8888_REV] = pack_row_ubyte_ARGB8888_REV;
- table[MESA_FORMAT_RGBX8888] = pack_row_ubyte_RGBA8888; /* reused */
- table[MESA_FORMAT_RGBX8888_REV] = pack_row_ubyte_RGBA8888_REV; /* reused */
- table[MESA_FORMAT_XRGB8888] = pack_row_ubyte_XRGB8888;
- table[MESA_FORMAT_XRGB8888_REV] = pack_row_ubyte_XRGB8888_REV;
+ table[MESA_FORMAT_ABGR_UNORM8] = pack_row_ubyte_RGBA8888;
+ table[MESA_FORMAT_RGBA_UNORM8] = pack_row_ubyte_RGBA8888_REV;
+ table[MESA_FORMAT_BGRA_UNORM8] = pack_row_ubyte_ARGB8888;
+ table[MESA_FORMAT_ARGB_UNORM8] = pack_row_ubyte_ARGB8888_REV;
+ table[MESA_FORMAT_XBGR_UNORM8] = pack_row_ubyte_RGBA8888; /* reused */
+ table[MESA_FORMAT_RGBX_UNORM8] = pack_row_ubyte_RGBA8888_REV; /* reused */
+ table[MESA_FORMAT_BGRX_UNORM8] = pack_row_ubyte_XRGB8888;
+ table[MESA_FORMAT_XRGB_UNORM8] = pack_row_ubyte_XRGB8888_REV;
table[MESA_FORMAT_RGB888] = pack_row_ubyte_RGB888;
table[MESA_FORMAT_BGR888] = pack_row_ubyte_BGR888;
table[MESA_FORMAT_RGB565] = pack_row_ubyte_RGB565;
diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c
index 96c7110..0529bbc 100644
--- a/src/mesa/main/format_unpack.c
+++ b/src/mesa/main/format_unpack.c
@@ -2319,14 +2319,14 @@ get_unpack_rgba_function(mesa_format format)
if (!initialized) {
table[MESA_FORMAT_NONE] = NULL;
- table[MESA_FORMAT_RGBA8888] = unpack_RGBA8888;
- table[MESA_FORMAT_RGBA8888_REV] = unpack_RGBA8888_REV;
- table[MESA_FORMAT_ARGB8888] = unpack_ARGB8888;
- table[MESA_FORMAT_ARGB8888_REV] = unpack_ARGB8888_REV;
- table[MESA_FORMAT_RGBX8888] = unpack_RGBX8888;
- table[MESA_FORMAT_RGBX8888_REV] = unpack_RGBX8888_REV;
- table[MESA_FORMAT_XRGB8888] = unpack_XRGB8888;
- table[MESA_FORMAT_XRGB8888_REV] = unpack_XRGB8888_REV;
+ table[MESA_FORMAT_ABGR_UNORM8] = unpack_RGBA8888;
+ table[MESA_FORMAT_RGBA_UNORM8] = unpack_RGBA8888_REV;
+ table[MESA_FORMAT_BGRA_UNORM8] = unpack_ARGB8888;
+ table[MESA_FORMAT_ARGB_UNORM8] = unpack_ARGB8888_REV;
+ table[MESA_FORMAT_XBGR_UNORM8] = unpack_RGBX8888;
+ table[MESA_FORMAT_RGBX_UNORM8] = unpack_RGBX8888_REV;
+ table[MESA_FORMAT_BGRX_UNORM8] = unpack_XRGB8888;
+ table[MESA_FORMAT_XRGB_UNORM8] = unpack_XRGB8888_REV;
table[MESA_FORMAT_RGB888] = unpack_RGB888;
table[MESA_FORMAT_BGR888] = unpack_BGR888;
table[MESA_FORMAT_RGB565] = unpack_RGB565;
@@ -2917,28 +2917,28 @@ _mesa_unpack_ubyte_rgba_row(mesa_format format, GLuint n,
const void *src, GLubyte dst[][4])
{
switch (format) {
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_ABGR_UNORM8:
unpack_ubyte_RGBA8888(src, dst, n);
break;
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_RGBA_UNORM8:
unpack_ubyte_RGBA8888_REV(src, dst, n);
break;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
unpack_ubyte_ARGB8888(src, dst, n);
break;
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_ARGB_UNORM8:
unpack_ubyte_ARGB8888_REV(src, dst, n);
break;
- case MESA_FORMAT_RGBX8888:
+ case MESA_FORMAT_XBGR_UNORM8:
unpack_ubyte_RGBX8888(src, dst, n);
break;
- case MESA_FORMAT_RGBX8888_REV:
+ case MESA_FORMAT_RGBX_UNORM8:
unpack_ubyte_RGBX8888_REV(src, dst, n);
break;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
unpack_ubyte_XRGB8888(src, dst, n);
break;
- case MESA_FORMAT_XRGB8888_REV:
+ case MESA_FORMAT_XRGB_UNORM8:
unpack_ubyte_XRGB8888_REV(src, dst, n);
break;
case MESA_FORMAT_RGB888:
@@ -3666,11 +3666,11 @@ _mesa_unpack_uint_rgba_row(mesa_format format, GLuint n,
unpack_int_rgba_RGBA_INT8(src, dst, n);
break;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
unpack_int_rgba_ARGB8888(src, dst, n);
break;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
unpack_int_rgba_XRGB8888(src, dst, n);
break;
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 575d716..be72dd5 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -88,8 +88,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
0, 0, 0 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_RGBA8888, /* Name */
- "MESA_FORMAT_RGBA8888", /* StrName */
+ MESA_FORMAT_ABGR_UNORM8, /* Name */
+ "MESA_FORMAT_ABGR_UNORM8", /* StrName */
GL_RGBA, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */
@@ -97,8 +97,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_RGBA8888_REV, /* Name */
- "MESA_FORMAT_RGBA8888_REV", /* StrName */
+ MESA_FORMAT_RGBA_UNORM8, /* Name */
+ "MESA_FORMAT_RGBA_UNORM8", /* StrName */
GL_RGBA, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */
@@ -106,8 +106,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_ARGB8888, /* Name */
- "MESA_FORMAT_ARGB8888", /* StrName */
+ MESA_FORMAT_BGRA_UNORM8, /* Name */
+ "MESA_FORMAT_BGRA_UNORM8", /* StrName */
GL_RGBA, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */
@@ -115,8 +115,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_ARGB8888_REV, /* Name */
- "MESA_FORMAT_ARGB8888_REV", /* StrName */
+ MESA_FORMAT_ARGB_UNORM8, /* Name */
+ "MESA_FORMAT_ARGB_UNORM8", /* StrName */
GL_RGBA, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */
@@ -124,8 +124,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_RGBX8888, /* Name */
- "MESA_FORMAT_RGBX8888", /* StrName */
+ MESA_FORMAT_XBGR_UNORM8, /* Name */
+ "MESA_FORMAT_XBGR_UNORM8", /* StrName */
GL_RGB, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */
@@ -133,8 +133,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_RGBX8888_REV, /* Name */
- "MESA_FORMAT_RGBX8888_REV", /* StrName */
+ MESA_FORMAT_RGBX_UNORM8, /* Name */
+ "MESA_FORMAT_RGBX_UNORM8", /* StrName */
GL_RGB, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */
@@ -142,8 +142,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_XRGB8888, /* Name */
- "MESA_FORMAT_XRGB8888", /* StrName */
+ MESA_FORMAT_BGRX_UNORM8, /* Name */
+ "MESA_FORMAT_BGRX_UNORM8", /* StrName */
GL_RGB, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */
@@ -151,8 +151,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_XRGB8888_REV, /* Name */
- "MESA_FORMAT_XRGB8888_REV", /* StrName */
+ MESA_FORMAT_XRGB_UNORM8, /* Name */
+ "MESA_FORMAT_XRGB_UNORM8", /* StrName */
GL_RGB, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */
@@ -2051,10 +2051,10 @@ _mesa_get_srgb_format_linear(mesa_format format)
format = MESA_FORMAT_RGB888;
break;
case MESA_FORMAT_SRGBA8:
- format = MESA_FORMAT_RGBA8888;
+ format = MESA_FORMAT_ABGR_UNORM8;
break;
case MESA_FORMAT_SARGB8:
- format = MESA_FORMAT_ARGB8888;
+ format = MESA_FORMAT_BGRA_UNORM8;
break;
case MESA_FORMAT_SL8:
format = MESA_FORMAT_L8;
@@ -2075,7 +2075,7 @@ _mesa_get_srgb_format_linear(mesa_format format)
format = MESA_FORMAT_RGBA_DXT5;
break;
case MESA_FORMAT_XBGR8888_SRGB:
- format = MESA_FORMAT_RGBX8888_REV;
+ format = MESA_FORMAT_RGBX_UNORM8;
break;
default:
break;
@@ -2095,19 +2095,19 @@ _mesa_get_uncompressed_format(mesa_format format)
case MESA_FORMAT_RGB_FXT1:
return MESA_FORMAT_RGB888;
case MESA_FORMAT_RGBA_FXT1:
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_ABGR_UNORM8;
case MESA_FORMAT_RGB_DXT1:
case MESA_FORMAT_SRGB_DXT1:
return MESA_FORMAT_RGB888;
case MESA_FORMAT_RGBA_DXT1:
case MESA_FORMAT_SRGBA_DXT1:
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_ABGR_UNORM8;
case MESA_FORMAT_RGBA_DXT3:
case MESA_FORMAT_SRGBA_DXT3:
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_ABGR_UNORM8;
case MESA_FORMAT_RGBA_DXT5:
case MESA_FORMAT_SRGBA_DXT5:
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_ABGR_UNORM8;
case MESA_FORMAT_RED_RGTC1:
return MESA_FORMAT_R8;
case MESA_FORMAT_SIGNED_RED_RGTC1:
@@ -2132,7 +2132,7 @@ _mesa_get_uncompressed_format(mesa_format format)
case MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC:
case MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1:
case MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1:
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_ABGR_UNORM8;
case MESA_FORMAT_ETC2_R11_EAC:
case MESA_FORMAT_ETC2_SIGNED_R11_EAC:
return MESA_FORMAT_R16;
@@ -2360,14 +2360,14 @@ _mesa_format_to_type_and_comps(mesa_format format,
GLenum *datatype, GLuint *comps)
{
switch (format) {
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_RGBA8888_REV:
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_ARGB8888_REV:
- case MESA_FORMAT_RGBX8888:
- case MESA_FORMAT_RGBX8888_REV:
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_XRGB8888_REV:
+ case MESA_FORMAT_ABGR_UNORM8:
+ case MESA_FORMAT_RGBA_UNORM8:
+ case MESA_FORMAT_BGRA_UNORM8:
+ case MESA_FORMAT_ARGB_UNORM8:
+ case MESA_FORMAT_XBGR_UNORM8:
+ case MESA_FORMAT_RGBX_UNORM8:
+ case MESA_FORMAT_BGRX_UNORM8:
+ case MESA_FORMAT_XRGB_UNORM8:
*datatype = GL_UNSIGNED_BYTE;
*comps = 4;
return;
@@ -2930,7 +2930,7 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format,
case MESA_FORMAT_COUNT:
return GL_FALSE;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_ABGR_UNORM8:
case MESA_FORMAT_SRGBA8:
if (format == GL_RGBA && type == GL_UNSIGNED_INT_8_8_8_8 && !swapBytes)
return GL_TRUE;
@@ -2954,7 +2954,7 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format,
return GL_FALSE;
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_RGBA_UNORM8:
if (format == GL_RGBA && type == GL_UNSIGNED_INT_8_8_8_8_REV &&
!swapBytes)
return GL_TRUE;
@@ -2978,7 +2978,7 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format,
return GL_FALSE;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
case MESA_FORMAT_SARGB8:
if (format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV &&
!swapBytes)
@@ -2992,7 +2992,7 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format,
return GL_FALSE;
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_ARGB_UNORM8:
if (format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8 && !swapBytes)
return GL_TRUE;
@@ -3005,12 +3005,12 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format,
return GL_FALSE;
- case MESA_FORMAT_RGBX8888:
- case MESA_FORMAT_RGBX8888_REV:
+ case MESA_FORMAT_XBGR_UNORM8:
+ case MESA_FORMAT_RGBX_UNORM8:
return GL_FALSE;
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_XRGB8888_REV:
+ case MESA_FORMAT_BGRX_UNORM8:
+ case MESA_FORMAT_XRGB_UNORM8:
return GL_FALSE;
case MESA_FORMAT_RGB888:
diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h
index 68f15be..d0a4bce 100644
--- a/src/mesa/main/formats.h
+++ b/src/mesa/main/formats.h
@@ -65,16 +65,18 @@ typedef enum
* \name Basic hardware formats
*/
/*@{*/
- /* msb <------ TEXEL BITS -----------> lsb */
- /* ---- ---- ---- ---- ---- ---- ---- ---- */
- MESA_FORMAT_RGBA8888, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */
- MESA_FORMAT_RGBA8888_REV, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */
- MESA_FORMAT_ARGB8888, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */
- MESA_FORMAT_ARGB8888_REV, /* BBBB BBBB GGGG GGGG RRRR RRRR AAAA AAAA */
- MESA_FORMAT_RGBX8888, /* RRRR RRRR GGGG GGGG BBBB BBBB XXXX XXXX */
- MESA_FORMAT_RGBX8888_REV, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */
- MESA_FORMAT_XRGB8888, /* xxxx xxxx RRRR RRRR GGGG GGGG BBBB BBBB */
- MESA_FORMAT_XRGB8888_REV, /* BBBB BBBB GGGG GGGG RRRR RRRR xxxx xxxx */
+ MESA_FORMAT_ABGR_UNORM8, /* uchar[i * 4 + 0] = A, uchar[i * 4 + 1] = B,
+ * uchar[i * 4 + 2] = G, uchar[i * 4 + 3] = R
+ */
+ MESA_FORMAT_RGBA_UNORM8, /* uchar[i * 4 + 0] = R, uchar[i * 4 + 1] = G,
+ * uchar[i * 4 + 2] = B, uchar[i * 4 + 3] = A
+ */
+ MESA_FORMAT_BGRA_UNORM8,
+ MESA_FORMAT_ARGB_UNORM8,
+ MESA_FORMAT_XBGR_UNORM8,
+ MESA_FORMAT_RGBX_UNORM8,
+ MESA_FORMAT_BGRX_UNORM8,
+ MESA_FORMAT_XRGB_UNORM8,
MESA_FORMAT_RGB888, /* RRRR RRRR GGGG GGGG BBBB BBBB */
MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */
MESA_FORMAT_RGB565, /* RRRR RGGG GGGB BBBB */
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index 21cbe1f..0291a83 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -812,7 +812,7 @@ _mesa_get_color_read_format(struct gl_context *ctx)
const GLenum format = ctx->ReadBuffer->_ColorReadBuffer->Format;
const GLenum data_type = _mesa_get_format_datatype(format);
- if (format == MESA_FORMAT_ARGB8888)
+ if (format == MESA_FORMAT_BGRA_UNORM8)
return GL_BGRA;
else if (format == MESA_FORMAT_RGB565)
return GL_BGR;
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index 63cf020..6721d47 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -424,13 +424,13 @@ read_rgba_pixels_swizzle(struct gl_context *ctx,
GLboolean swizzle_rb = GL_FALSE, copy_xrgb = GL_FALSE;
/* XXX we could check for other swizzle/special cases here as needed */
- if (rb->Format == MESA_FORMAT_RGBA8888_REV &&
+ if (rb->Format == MESA_FORMAT_RGBA_UNORM8 &&
format == GL_BGRA &&
type == GL_UNSIGNED_INT_8_8_8_8_REV &&
!ctx->Pack.SwapBytes) {
swizzle_rb = GL_TRUE;
}
- else if (rb->Format == MESA_FORMAT_XRGB8888 &&
+ else if (rb->Format == MESA_FORMAT_BGRX_UNORM8 &&
format == GL_BGRA &&
type == GL_UNSIGNED_INT_8_8_8_8_REV &&
!ctx->Pack.SwapBytes) {
diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c
index cfb5ad4..69399f4 100644
--- a/src/mesa/main/shaderimage.c
+++ b/src/mesa/main/shaderimage.c
@@ -42,14 +42,14 @@
* results.
*/
#ifdef MESA_BIG_ENDIAN
-# define MESA_FORMAT_RGBA_8 MESA_FORMAT_RGBA8888
+# define MESA_FORMAT_RGBA_8 MESA_FORMAT_ABGR_UNORM8
# define MESA_FORMAT_RG_16 MESA_FORMAT_RG1616
# define MESA_FORMAT_RG_8 MESA_FORMAT_RG88
# 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_RGBA8888_REV
+# define MESA_FORMAT_RGBA_8 MESA_FORMAT_RGBA_UNORM8
# define MESA_FORMAT_RG_16 MESA_FORMAT_GR1616
# define MESA_FORMAT_RG_8 MESA_FORMAT_GR88
# define MESA_FORMAT_SIGNED_RGBA_8 MESA_FORMAT_SIGNED_RGBA8888_REV
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index 0a993ed..b6532da 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -76,13 +76,13 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
} else if (type == GL_UNSIGNED_INT_2_10_10_10_REV) {
RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010);
}
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_ABGR_UNORM8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA_UNORM8);
break;
case GL_RGBA8:
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_ABGR_UNORM8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA_UNORM8);
break;
case GL_RGB5_A1:
RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB1555);
@@ -98,14 +98,14 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
/* deep RGBA formats */
case GL_RGB10_A2:
RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA_UNORM8);
break;
case GL_RGBA12:
case GL_RGBA16:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16);
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_ABGR_UNORM8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA_UNORM8);
break;
/* shallow RGB formats */
@@ -117,16 +117,16 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
/* fallthrough */
case GL_RGB8:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRX_UNORM8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA_UNORM8);
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_RGB888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRX_UNORM8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA_UNORM8);
break;
case GL_RGB4:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565_REV); /* just to test another format */
@@ -142,8 +142,8 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
case GL_RGB16:
RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_UNORM);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRX_UNORM8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA_UNORM8);
break;
/* Alpha formats */
@@ -244,8 +244,8 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FXT1);
}
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRX_UNORM8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA_UNORM8);
break;
case GL_COMPRESSED_RGBA_ARB:
/* We don't use texture compression for 1D and 1D array textures. */
@@ -254,8 +254,8 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_DXT3); /* Not rgba_dxt1, see spec */
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FXT1);
}
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_ABGR_UNORM8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA_UNORM8);
break;
case GL_RGB565:
@@ -809,7 +809,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
break;
case GL_BGRA:
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA_UNORM8);
break;
}
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 887ce73..9ee299e 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -4068,7 +4068,7 @@ get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat)
switch (internalFormat) {
case GL_RGBA8:
- return MESA_FORMAT_RGBA8888_REV;
+ return MESA_FORMAT_RGBA_UNORM8;
case GL_RGBA16:
return MESA_FORMAT_RGBA_16;
case GL_RGBA16F_ARB:
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 42f86b7..825f80a 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -1190,17 +1190,17 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS)
/**
- * Store a texture in MESA_FORMAT_RGBA8888 or MESA_FORMAT_RGBA8888_REV.
+ * Store a texture in MESA_FORMAT_ABGR_UNORM8 or MESA_FORMAT_RGBA_UNORM8.
*/
static GLboolean
_mesa_texstore_rgba8888(TEXSTORE_PARAMS)
{
const GLboolean littleEndian = _mesa_little_endian();
- ASSERT(dstFormat == MESA_FORMAT_RGBA8888 ||
- dstFormat == MESA_FORMAT_RGBA8888_REV ||
- dstFormat == MESA_FORMAT_RGBX8888 ||
- dstFormat == MESA_FORMAT_RGBX8888_REV);
+ ASSERT(dstFormat == MESA_FORMAT_ABGR_UNORM8 ||
+ dstFormat == MESA_FORMAT_RGBA_UNORM8 ||
+ dstFormat == MESA_FORMAT_XBGR_UNORM8 ||
+ dstFormat == MESA_FORMAT_RGBX_UNORM8);
ASSERT(_mesa_get_format_bytes(dstFormat) == 4);
if (!ctx->_ImageTransferState &&
@@ -1214,10 +1214,10 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS)
/* dstmap - how to swizzle from RGBA to dst format:
*/
- if ((littleEndian && (dstFormat == MESA_FORMAT_RGBA8888 ||
- dstFormat == MESA_FORMAT_RGBX8888)) ||
- (!littleEndian && (dstFormat == MESA_FORMAT_RGBA8888_REV ||
- dstFormat == MESA_FORMAT_RGBX8888_REV))) {
+ if ((littleEndian && (dstFormat == MESA_FORMAT_ABGR_UNORM8 ||
+ dstFormat == MESA_FORMAT_XBGR_UNORM8)) ||
+ (!littleEndian && (dstFormat == MESA_FORMAT_RGBA_UNORM8 ||
+ dstFormat == MESA_FORMAT_RGBX_UNORM8))) {
dstmap[3] = 0;
dstmap[2] = 1;
dstmap[1] = 2;
@@ -1254,16 +1254,16 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
{
const GLboolean littleEndian = _mesa_little_endian();
- ASSERT(dstFormat == MESA_FORMAT_ARGB8888 ||
- dstFormat == MESA_FORMAT_ARGB8888_REV ||
- dstFormat == MESA_FORMAT_XRGB8888 ||
- dstFormat == MESA_FORMAT_XRGB8888_REV );
+ ASSERT(dstFormat == MESA_FORMAT_BGRA_UNORM8 ||
+ dstFormat == MESA_FORMAT_ARGB_UNORM8 ||
+ dstFormat == MESA_FORMAT_BGRX_UNORM8 ||
+ dstFormat == MESA_FORMAT_XRGB_UNORM8 );
ASSERT(_mesa_get_format_bytes(dstFormat) == 4);
if (!ctx->_ImageTransferState &&
!srcPacking->SwapBytes &&
- (dstFormat == MESA_FORMAT_ARGB8888 ||
- dstFormat == MESA_FORMAT_XRGB8888) &&
+ (dstFormat == MESA_FORMAT_BGRA_UNORM8 ||
+ dstFormat == MESA_FORMAT_BGRX_UNORM8) &&
srcFormat == GL_RGB &&
(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB) &&
@@ -1290,7 +1290,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
}
else if (!ctx->_ImageTransferState &&
!srcPacking->SwapBytes &&
- dstFormat == MESA_FORMAT_ARGB8888 &&
+ dstFormat == MESA_FORMAT_BGRA_UNORM8 &&
srcFormat == GL_LUMINANCE_ALPHA &&
baseInternalFormat == GL_RGBA &&
srcType == GL_UNSIGNED_BYTE) {
@@ -1316,7 +1316,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
}
else if (!ctx->_ImageTransferState &&
!srcPacking->SwapBytes &&
- dstFormat == MESA_FORMAT_ARGB8888 &&
+ dstFormat == MESA_FORMAT_BGRA_UNORM8 &&
srcFormat == GL_RGBA &&
baseInternalFormat == GL_RGBA &&
srcType == GL_UNSIGNED_BYTE) {
@@ -1358,20 +1358,20 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
/* dstmap - how to swizzle from RGBA to dst format:
*/
- if ((littleEndian && dstFormat == MESA_FORMAT_ARGB8888) ||
- (littleEndian && dstFormat == MESA_FORMAT_XRGB8888) ||
- (!littleEndian && dstFormat == MESA_FORMAT_ARGB8888_REV) ||
- (!littleEndian && dstFormat == MESA_FORMAT_XRGB8888_REV)) {
+ if ((littleEndian && dstFormat == MESA_FORMAT_BGRA_UNORM8) ||
+ (littleEndian && dstFormat == MESA_FORMAT_BGRX_UNORM8) ||
+ (!littleEndian && dstFormat == MESA_FORMAT_ARGB_UNORM8) ||
+ (!littleEndian && dstFormat == MESA_FORMAT_XRGB_UNORM8)) {
dstmap[3] = 3; /* alpha */
dstmap[2] = 0; /* red */
dstmap[1] = 1; /* green */
dstmap[0] = 2; /* blue */
}
else {
- assert((littleEndian && dstFormat == MESA_FORMAT_ARGB8888_REV) ||
- (!littleEndian && dstFormat == MESA_FORMAT_ARGB8888) ||
- (littleEndian && dstFormat == MESA_FORMAT_XRGB8888_REV) ||
- (!littleEndian && dstFormat == MESA_FORMAT_XRGB8888));
+ assert((littleEndian && dstFormat == MESA_FORMAT_ARGB_UNORM8) ||
+ (!littleEndian && dstFormat == MESA_FORMAT_BGRA_UNORM8) ||
+ (littleEndian && dstFormat == MESA_FORMAT_XRGB_UNORM8) ||
+ (!littleEndian && dstFormat == MESA_FORMAT_BGRX_UNORM8));
dstmap[3] = 2;
dstmap[2] = 1;
dstmap[1] = 0;
@@ -3264,10 +3264,10 @@ _mesa_texstore_srgba8(TEXSTORE_PARAMS)
/* reuse normal rgba texstore code */
if (dstFormat == MESA_FORMAT_SRGBA8) {
- newDstFormat = MESA_FORMAT_RGBA8888;
+ newDstFormat = MESA_FORMAT_ABGR_UNORM8;
}
else if (dstFormat == MESA_FORMAT_XBGR8888_SRGB) {
- newDstFormat = MESA_FORMAT_RGBX8888_REV;
+ newDstFormat = MESA_FORMAT_RGBX_UNORM8;
}
else {
ASSERT(0);
@@ -3293,7 +3293,7 @@ _mesa_texstore_sargb8(TEXSTORE_PARAMS)
ASSERT(dstFormat == MESA_FORMAT_SARGB8);
/* reuse normal rgba texstore code */
- newDstFormat = MESA_FORMAT_ARGB8888;
+ newDstFormat = MESA_FORMAT_BGRA_UNORM8;
k = _mesa_texstore_argb8888(ctx, dims, baseInternalFormat,
newDstFormat,
@@ -3660,14 +3660,14 @@ _mesa_get_texstore_func(mesa_format format)
if (!initialized) {
table[MESA_FORMAT_NONE] = _mesa_texstore_null;
- table[MESA_FORMAT_RGBA8888] = _mesa_texstore_rgba8888;
- table[MESA_FORMAT_RGBA8888_REV] = _mesa_texstore_rgba8888;
- table[MESA_FORMAT_ARGB8888] = _mesa_texstore_argb8888;
- table[MESA_FORMAT_ARGB8888_REV] = _mesa_texstore_argb8888;
- table[MESA_FORMAT_RGBX8888] = _mesa_texstore_rgba8888;
- table[MESA_FORMAT_RGBX8888_REV] = _mesa_texstore_rgba8888;
- table[MESA_FORMAT_XRGB8888] = _mesa_texstore_argb8888;
- table[MESA_FORMAT_XRGB8888_REV] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_ABGR_UNORM8] = _mesa_texstore_rgba8888;
+ table[MESA_FORMAT_RGBA_UNORM8] = _mesa_texstore_rgba8888;
+ table[MESA_FORMAT_BGRA_UNORM8] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_ARGB_UNORM8] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_XBGR_UNORM8] = _mesa_texstore_rgba8888;
+ table[MESA_FORMAT_RGBX_UNORM8] = _mesa_texstore_rgba8888;
+ table[MESA_FORMAT_BGRX_UNORM8] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_XRGB_UNORM8] = _mesa_texstore_argb8888;
table[MESA_FORMAT_RGB888] = _mesa_texstore_rgb888;
table[MESA_FORMAT_BGR888] = _mesa_texstore_bgr888;
table[MESA_FORMAT_RGB565] = _mesa_texstore_rgb565;
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 1cd01c7..21a0262 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -57,21 +57,21 @@ enum pipe_format
st_mesa_format_to_pipe_format(mesa_format mesaFormat)
{
switch (mesaFormat) {
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_ABGR_UNORM8:
return PIPE_FORMAT_ABGR8888_UNORM;
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_RGBA_UNORM8:
return PIPE_FORMAT_RGBA8888_UNORM;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_BGRA_UNORM8:
return PIPE_FORMAT_BGRA8888_UNORM;
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_ARGB_UNORM8:
return PIPE_FORMAT_ARGB8888_UNORM;
- case MESA_FORMAT_RGBX8888:
+ case MESA_FORMAT_XBGR_UNORM8:
return PIPE_FORMAT_XBGR8888_UNORM;
- case MESA_FORMAT_RGBX8888_REV:
+ case MESA_FORMAT_RGBX_UNORM8:
return PIPE_FORMAT_RGBX8888_UNORM;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_BGRX_UNORM8:
return PIPE_FORMAT_BGRX8888_UNORM;
- case MESA_FORMAT_XRGB8888_REV:
+ case MESA_FORMAT_XRGB_UNORM8:
return PIPE_FORMAT_XRGB8888_UNORM;
case MESA_FORMAT_ARGB1555:
return PIPE_FORMAT_B5G5R5A1_UNORM;
@@ -405,21 +405,21 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
{
switch (format) {
case PIPE_FORMAT_ABGR8888_UNORM:
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_ABGR_UNORM8;
case PIPE_FORMAT_RGBA8888_UNORM:
- return MESA_FORMAT_RGBA8888_REV;
+ return MESA_FORMAT_RGBA_UNORM8;
case PIPE_FORMAT_BGRA8888_UNORM:
- return MESA_FORMAT_ARGB8888;
+ return MESA_FORMAT_BGRA_UNORM8;
case PIPE_FORMAT_ARGB8888_UNORM:
- return MESA_FORMAT_ARGB8888_REV;
+ return MESA_FORMAT_ARGB_UNORM8;
case PIPE_FORMAT_XBGR8888_UNORM:
- return MESA_FORMAT_RGBX8888;
+ return MESA_FORMAT_XBGR_UNORM8;
case PIPE_FORMAT_RGBX8888_UNORM:
- return MESA_FORMAT_RGBX8888_REV;
+ return MESA_FORMAT_RGBX_UNORM8;
case PIPE_FORMAT_BGRX8888_UNORM:
- return MESA_FORMAT_XRGB8888;
+ return MESA_FORMAT_BGRX_UNORM8;
case PIPE_FORMAT_XRGB8888_UNORM:
- return MESA_FORMAT_XRGB8888_REV;
+ return MESA_FORMAT_XRGB_UNORM8;
case PIPE_FORMAT_B5G5R5A1_UNORM:
return MESA_FORMAT_ARGB1555;
case PIPE_FORMAT_B4G4R4A4_UNORM:
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index 1786de1..d17009a 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -223,8 +223,8 @@ fast_draw_rgba_pixels(struct gl_context *ctx, GLint x, GLint y,
if (format == GL_RGB &&
type == GL_UNSIGNED_BYTE &&
- (rb->Format == MESA_FORMAT_XRGB8888 ||
- rb->Format == MESA_FORMAT_ARGB8888)) {
+ (rb->Format == MESA_FORMAT_BGRX_UNORM8 ||
+ rb->Format == MESA_FORMAT_BGRA_UNORM8)) {
fast_draw_rgb_ubyte_pixels(ctx, rb, x, y, width, height,
&unpack, pixels);
return GL_TRUE;
@@ -232,8 +232,8 @@ fast_draw_rgba_pixels(struct gl_context *ctx, GLint x, GLint y,
if (format == GL_RGBA &&
type == GL_UNSIGNED_BYTE &&
- (rb->Format == MESA_FORMAT_XRGB8888 ||
- rb->Format == MESA_FORMAT_ARGB8888)) {
+ (rb->Format == MESA_FORMAT_BGRX_UNORM8 ||
+ rb->Format == MESA_FORMAT_BGRA_UNORM8)) {
fast_draw_rgba_ubyte_pixels(ctx, rb, x, y, width, height,
&unpack, pixels);
return GL_TRUE;
diff --git a/src/mesa/swrast/s_renderbuffer.c b/src/mesa/swrast/s_renderbuffer.c
index e3f33de..7b9fda3 100644
--- a/src/mesa/swrast/s_renderbuffer.c
+++ b/src/mesa/swrast/s_renderbuffer.c
@@ -81,9 +81,9 @@ soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb,
case GL_RGBA12:
#endif
if (_mesa_little_endian())
- rb->Format = MESA_FORMAT_RGBA8888_REV;
+ rb->Format = MESA_FORMAT_RGBA_UNORM8;
else
- rb->Format = MESA_FORMAT_RGBA8888;
+ rb->Format = MESA_FORMAT_ABGR_UNORM8;
break;
case GL_RGBA16:
case GL_RGBA16_SNORM:
diff --git a/src/mesa/swrast/s_texfetch.c b/src/mesa/swrast/s_texfetch.c
index 7f9d386..8a64ac3 100644
--- a/src/mesa/swrast/s_texfetch.c
+++ b/src/mesa/swrast/s_texfetch.c
@@ -149,49 +149,49 @@ texfetch_funcs[] =
},
{
- MESA_FORMAT_RGBA8888,
+ MESA_FORMAT_ABGR_UNORM8,
fetch_texel_1d_f_rgba8888,
fetch_texel_2d_f_rgba8888,
fetch_texel_3d_f_rgba8888
},
{
- MESA_FORMAT_RGBA8888_REV,
+ MESA_FORMAT_RGBA_UNORM8,
fetch_texel_1d_f_rgba8888_rev,
fetch_texel_2d_f_rgba8888_rev,
fetch_texel_3d_f_rgba8888_rev
},
{
- MESA_FORMAT_ARGB8888,
+ MESA_FORMAT_BGRA_UNORM8,
fetch_texel_1d_f_argb8888,
fetch_texel_2d_f_argb8888,
fetch_texel_3d_f_argb8888
},
{
- MESA_FORMAT_ARGB8888_REV,
+ MESA_FORMAT_ARGB_UNORM8,
fetch_texel_1d_f_argb8888_rev,
fetch_texel_2d_f_argb8888_rev,
fetch_texel_3d_f_argb8888_rev
},
{
- MESA_FORMAT_RGBX8888,
+ MESA_FORMAT_XBGR_UNORM8,
fetch_texel_1d_f_rgbx8888,
fetch_texel_2d_f_rgbx8888,
fetch_texel_3d_f_rgbx8888
},
{
- MESA_FORMAT_RGBX8888_REV,
+ MESA_FORMAT_RGBX_UNORM8,
fetch_texel_1d_f_rgbx8888_rev,
fetch_texel_2d_f_rgbx8888_rev,
fetch_texel_3d_f_rgbx8888_rev
},
{
- MESA_FORMAT_XRGB8888,
+ MESA_FORMAT_BGRX_UNORM8,
fetch_texel_1d_f_xrgb8888,
fetch_texel_2d_f_xrgb8888,
fetch_texel_3d_f_xrgb8888
},
{
- MESA_FORMAT_XRGB8888_REV,
+ MESA_FORMAT_XRGB_UNORM8,
fetch_texel_1d_f_xrgb8888_rev,
fetch_texel_2d_f_xrgb8888_rev,
fetch_texel_3d_f_xrgb8888_rev
diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h
index e2521b5..7698635 100644
--- a/src/mesa/swrast/s_texfetch_tmp.h
+++ b/src/mesa/swrast/s_texfetch_tmp.h
@@ -388,7 +388,7 @@ static void FETCH(f_rg_f16)( const struct swrast_texture_image *texImage,
* Begin Hardware formats
*/
-/* MESA_FORMAT_RGBA8888 ******************************************************/
+/* MESA_FORMAT_ABGR_UNORM8 ******************************************************/
/* Fetch texel from 1D, 2D or 3D rgba8888 texture, return 4 GLfloats */
static void FETCH(f_rgba8888)( const struct swrast_texture_image *texImage,
@@ -422,7 +422,7 @@ static void FETCH(f_rgba8888_rev)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_ARGB8888 ******************************************************/
+/* MESA_FORMAT_BGRA_UNORM8 ******************************************************/
/* Fetch texel from 1D, 2D or 3D argb8888 texture, return 4 GLchans */
static void FETCH(f_argb8888)( const struct swrast_texture_image *texImage,
@@ -438,7 +438,7 @@ static void FETCH(f_argb8888)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_ARGB8888_REV **************************************************/
+/* MESA_FORMAT_ARGB_UNORM8 **************************************************/
/* Fetch texel from 1D, 2D or 3D argb8888_rev texture, return 4 GLfloats */
static void FETCH(f_argb8888_rev)( const struct swrast_texture_image *texImage,
@@ -454,7 +454,7 @@ static void FETCH(f_argb8888_rev)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_RGBX8888 ******************************************************/
+/* MESA_FORMAT_XBGR_UNORM8 ******************************************************/
/* Fetch texel from 1D, 2D or 3D rgbx8888 texture, return 4 GLfloats */
static void FETCH(f_rgbx8888)( const struct swrast_texture_image *texImage,
@@ -486,7 +486,7 @@ static void FETCH(f_rgbx8888_rev)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_XRGB8888 ******************************************************/
+/* MESA_FORMAT_BGRX_UNORM8 ******************************************************/
/* Fetch texel from 1D, 2D or 3D xrgb8888 texture, return 4 GLchans */
static void FETCH(f_xrgb8888)( const struct swrast_texture_image *texImage,
@@ -502,7 +502,7 @@ static void FETCH(f_xrgb8888)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_XRGB8888_REV **************************************************/
+/* MESA_FORMAT_XRGB_UNORM8 **************************************************/
/* Fetch texel from 1D, 2D or 3D xrgb8888_rev texture, return 4 GLfloats */
static void FETCH(f_xrgb8888_rev)( const struct swrast_texture_image *texImage,
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
index 312b9ce..4f9af68 100644
--- a/src/mesa/swrast/s_texfilter.c
+++ b/src/mesa/swrast/s_texfilter.c
@@ -1473,7 +1473,7 @@ opt_sample_rgba_2d(struct gl_context *ctx,
ASSERT(samp->WrapS==GL_REPEAT);
ASSERT(samp->WrapT==GL_REPEAT);
ASSERT(img->Border==0);
- ASSERT(img->TexFormat == MESA_FORMAT_RGBA8888);
+ ASSERT(img->TexFormat == MESA_FORMAT_ABGR_UNORM8);
ASSERT(swImg->_IsPowerOfTwo);
(void) swImg;
@@ -1525,7 +1525,7 @@ sample_lambda_2d(struct gl_context *ctx,
opt_sample_rgb_2d(ctx, samp, tObj, m, texcoords + minStart,
NULL, rgba + minStart);
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_ABGR_UNORM8:
opt_sample_rgba_2d(ctx, samp, tObj, m, texcoords + minStart,
NULL, rgba + minStart);
break;
@@ -1582,7 +1582,7 @@ sample_lambda_2d(struct gl_context *ctx,
opt_sample_rgb_2d(ctx, samp, tObj, m, texcoords + magStart,
NULL, rgba + magStart);
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_ABGR_UNORM8:
opt_sample_rgba_2d(ctx, samp, tObj, m, texcoords + magStart,
NULL, rgba + magStart);
break;
@@ -3762,7 +3762,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
img->Border == 0) {
if (img->TexFormat == MESA_FORMAT_RGB888)
func = &opt_sample_rgb_2d;
- else if (img->TexFormat == MESA_FORMAT_RGBA8888)
+ else if (img->TexFormat == MESA_FORMAT_ABGR_UNORM8)
func = &opt_sample_rgba_2d;
}
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index 69c812f..0748e78 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -437,7 +437,7 @@ affine_span(struct gl_context *ctx, SWspan *span,
return;
}
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_ABGR_UNORM8:
switch(info->envmode) {
case GL_MODULATE:
SPAN_NEAREST(NEAREST_RGBA;MODULATE,4);
@@ -486,7 +486,7 @@ affine_span(struct gl_context *ctx, SWspan *span,
return;
}
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_ABGR_UNORM8:
switch (info->envmode) {
case GL_MODULATE:
SPAN_LINEAR(LINEAR_RGBA;MODULATE,4);
@@ -575,7 +575,7 @@ affine_span(struct gl_context *ctx, SWspan *span,
case MESA_FORMAT_RGB888: \
info.tbytesline = texImg->Width * 3; \
break; \
- case MESA_FORMAT_RGBA8888: \
+ case MESA_FORMAT_ABGR_UNORM8: \
info.tbytesline = texImg->Width * 4; \
break; \
default: \
@@ -709,7 +709,7 @@ fast_persp_span(struct gl_context *ctx, SWspan *span,
return;
}
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_ABGR_UNORM8:
switch(info->envmode) {
case GL_MODULATE:
SPAN_NEAREST(NEAREST_RGBA;MODULATE,4);
@@ -756,7 +756,7 @@ fast_persp_span(struct gl_context *ctx, SWspan *span,
return;
}
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_ABGR_UNORM8:
switch (info->envmode) {
case GL_MODULATE:
SPAN_LINEAR(LINEAR_RGBA;MODULATE,4);
@@ -841,7 +841,7 @@ fast_persp_span(struct gl_context *ctx, SWspan *span,
case MESA_FORMAT_RGB888: \
info.tbytesline = texImg->Width * 3; \
break; \
- case MESA_FORMAT_RGBA8888: \
+ case MESA_FORMAT_ABGR_UNORM8: \
info.tbytesline = texImg->Width * 4; \
break; \
default: \
@@ -1080,7 +1080,7 @@ _swrast_choose_triangle( struct gl_context *ctx )
&& texImg->Border == 0
&& (_mesa_format_row_stride(format, texImg->Width) ==
swImg->RowStride)
- && (format == MESA_FORMAT_RGB888 || format == MESA_FORMAT_RGBA8888)
+ && (format == MESA_FORMAT_RGB888 || format == MESA_FORMAT_ABGR_UNORM8)
&& minFilter == magFilter
&& ctx->Light.Model.ColorControl == GL_SINGLE_COLOR
&& !swrast->_FogEnabled
@@ -1107,7 +1107,7 @@ _swrast_choose_triangle( struct gl_context *ctx )
#if CHAN_BITS != 8
USE(general_triangle);
#else
- if (format == MESA_FORMAT_RGBA8888 && !_mesa_little_endian()) {
+ if (format == MESA_FORMAT_ABGR_UNORM8 && !_mesa_little_endian()) {
/* We only handle RGBA8888 correctly on little endian
* in the optimized code above.
*/
--
1.8.3.1
More information about the mesa-dev
mailing list