[Mesa-dev] [PATCH 1/1] Adjust MESA_FORMAT color component ordering to match API docs
Mark Mueller
markkmueller at gmail.com
Thu Dec 19 13:56:22 PST 2013
Adjust MESA_FORMAT color component ordering to match API docs, driver
specific formats (e.g. PIPE_FORMATs), and actual use on common platforms.
Add comment to reference API docs. Remove comments giving MESA_FORMAT
color packings, some of which are misleading.
The MESA_FORMAT changes are as follows:
s/MESA_FORMAT_ARGB/MESA_FORMAT_BGRA/g
s/MESA_FORMAT_ABGR/MESA_FORMAT_RGBA/g
s/MESA_FORMAT_XRGB/MESA_FORMAT_BGRX/G
MESA_FORMAT_XBGR was purposefully emitted because it exposes the
redundant MESA_FORMAT_XBGR8888_SNORM and thus requires a more
extensive patch which will be submitted separately.
This patch apply on top of the previous MESA_FORMAT change.
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 | 16 +-
src/mesa/drivers/dri/i915/i830_texstate.c | 8 +-
src/mesa/drivers/dri/i915/i830_vtbl.c | 8 +-
src/mesa/drivers/dri/i915/i915_context.c | 8 +-
src/mesa/drivers/dri/i915/i915_texstate.c | 8 +-
src/mesa/drivers/dri/i915/i915_vtbl.c | 8 +-
src/mesa/drivers/dri/i915/intel_blit.c | 20 +--
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 | 28 ++--
src/mesa/drivers/dri/i965/intel_blit.c | 12 +-
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 | 2 +-
src/mesa/drivers/dri/nouveau/nouveau_fbo.c | 4 +-
src/mesa/drivers/dri/nouveau/nouveau_screen.c | 4 +-
src/mesa/drivers/dri/nouveau/nouveau_texture.c | 12 +-
src/mesa/drivers/dri/nouveau/nouveau_util.h | 8 +-
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 | 8 +-
src/mesa/drivers/dri/nouveau/nv04_surface.c | 56 +++----
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 | 14 +-
src/mesa/drivers/dri/nouveau/nv20_state_fb.c | 4 +-
src/mesa/drivers/dri/nouveau/nv20_state_tex.c | 16 +-
src/mesa/drivers/dri/r200/r200_blit.c | 32 ++--
src/mesa/drivers/dri/r200/r200_state_init.c | 4 +-
src/mesa/drivers/dri/r200/r200_texstate.c | 6 +-
src/mesa/drivers/dri/radeon/radeon_blit.c | 24 +--
src/mesa/drivers/dri/radeon/radeon_pixel_read.c | 12 +-
src/mesa/drivers/dri/radeon/radeon_screen.c | 16 +-
src/mesa/drivers/dri/radeon/radeon_state_init.c | 4 +-
src/mesa/drivers/dri/radeon/radeon_tex_copy.c | 4 +-
src/mesa/drivers/dri/radeon/radeon_texstate.c | 6 +-
src/mesa/drivers/dri/radeon/radeon_texture.c | 12 +-
src/mesa/drivers/dri/swrast/swrast.c | 14 +-
src/mesa/drivers/haiku/swrast/SoftwareRast.cpp | 6 +-
src/mesa/drivers/osmesa/osmesa.c | 8 +-
src/mesa/drivers/x11/xm_buffer.c | 6 +-
src/mesa/main/debug.c | 2 +-
src/mesa/main/fbobject.c | 2 +-
src/mesa/main/format_pack.c | 94 +++++------
src/mesa/main/format_unpack.c | 54 +++---
src/mesa/main/formats.c | 114 ++++++-------
src/mesa/main/formats.h | 183 ++++++++++-----------
src/mesa/main/framebuffer.c | 2 +-
src/mesa/main/readpix.c | 2 +-
src/mesa/main/texcompress_etc.c | 2 +-
src/mesa/main/texformat.c | 50 +++---
src/mesa/main/texstore.c | 72 ++++----
src/mesa/state_tracker/st_format.c | 44 ++---
src/mesa/swrast/s_drawpix.c | 12 +-
src/mesa/swrast/s_texfetch.c | 28 ++--
src/mesa/swrast/s_texfetch_tmp.h | 18 +-
64 files changed, 579 insertions(+), 580 deletions(-)
diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c
index a026eb9..1575f71 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 gl_format mesa_formats[3] = {
- MESA_FORMAT_ARGB8888_UNORM,
- MESA_FORMAT_XRGB8888_UNORM,
+ MESA_FORMAT_BGRA8888_UNORM,
+ MESA_FORMAT_BGRX8888_UNORM,
MESA_FORMAT_RGB565_UNORM,
};
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 e7a0aef..4bf6f62 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -811,13 +811,13 @@ driGLFormatToImageFormat(gl_format format)
switch (format) {
case MESA_FORMAT_RGB565_UNORM:
return __DRI_IMAGE_FORMAT_RGB565;
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
return __DRI_IMAGE_FORMAT_XRGB8888;
- case MESA_FORMAT_ARGB2101010_UNORM:
+ case MESA_FORMAT_BGRA2101010_UNORM:
return __DRI_IMAGE_FORMAT_ARGB2101010;
- case MESA_FORMAT_XRGB2101010_UNORM:
+ case MESA_FORMAT_BGRX2101010_UNORM:
return __DRI_IMAGE_FORMAT_XRGB2101010;
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
return __DRI_IMAGE_FORMAT_ARGB8888;
case MESA_FORMAT_RGBA8888_REV_UNORM:
return __DRI_IMAGE_FORMAT_ABGR8888;
@@ -843,13 +843,13 @@ driImageFormatToGLFormat(uint32_t image_format)
case __DRI_IMAGE_FORMAT_RGB565:
return MESA_FORMAT_RGB565_UNORM;
case __DRI_IMAGE_FORMAT_XRGB8888:
- return MESA_FORMAT_XRGB8888_UNORM;
+ return MESA_FORMAT_BGRX8888_UNORM;
case __DRI_IMAGE_FORMAT_ARGB2101010:
- return MESA_FORMAT_ARGB2101010_UNORM;
+ return MESA_FORMAT_BGRA2101010_UNORM;
case __DRI_IMAGE_FORMAT_XRGB2101010:
- return MESA_FORMAT_XRGB2101010_UNORM;
+ return MESA_FORMAT_BGRX2101010_UNORM;
case __DRI_IMAGE_FORMAT_ARGB8888:
- return MESA_FORMAT_ARGB8888_UNORM;
+ return MESA_FORMAT_BGRA8888_UNORM;
case __DRI_IMAGE_FORMAT_ABGR8888:
return MESA_FORMAT_RGBA8888_REV_UNORM;
case __DRI_IMAGE_FORMAT_XBGR8888:
diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index 396e4ab..3a6a491 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -186,13 +186,13 @@ driCreateConfigs(gl_format format,
static const uint32_t masks_table[][4] = {
/* MESA_FORMAT_RGB565_UNORM */
{ 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 },
- /* MESA_FORMAT_XRGB8888_UNORM */
+ /* MESA_FORMAT_BGRX8888_UNORM */
{ 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 },
- /* MESA_FORMAT_ARGB8888_UNORM */
+ /* MESA_FORMAT_BGRA8888_UNORM */
{ 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000 },
- /* MESA_FORMAT_XRGB2101010_UNORM */
+ /* MESA_FORMAT_BGRX2101010_UNORM */
{ 0x3FF00000, 0x000FFC00, 0x000003FF, 0x00000000 },
- /* MESA_FORMAT_ARGB2101010_UNORM */
+ /* MESA_FORMAT_BGRA2101010_UNORM */
{ 0x3FF00000, 0x000FFC00, 0x000003FF, 0xC0000000 },
};
@@ -212,17 +212,17 @@ driCreateConfigs(gl_format format,
case MESA_FORMAT_RGB565_UNORM:
masks = masks_table[0];
break;
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
masks = masks_table[1];
break;
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
case MESA_FORMAT_SARGB8:
masks = masks_table[2];
break;
- case MESA_FORMAT_XRGB2101010_UNORM:
+ case MESA_FORMAT_BGRX2101010_UNORM:
masks = masks_table[3];
break;
- case MESA_FORMAT_ARGB2101010_UNORM:
+ case MESA_FORMAT_BGRA2101010_UNORM:
masks = masks_table[4];
break;
default:
diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c
index 631d129..16255ca 100644
--- a/src/mesa/drivers/dri/i915/i830_texstate.c
+++ b/src/mesa/drivers/dri/i915/i830_texstate.c
@@ -53,13 +53,13 @@ translate_texture_format(GLuint mesa_format)
return MAPSURF_16BIT | MT_16BIT_AY88;
case MESA_FORMAT_RGB565_UNORM:
return MAPSURF_16BIT | MT_16BIT_RGB565;
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
return MAPSURF_16BIT | MT_16BIT_ARGB1555;
- case MESA_FORMAT_ARGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
return MAPSURF_16BIT | MT_16BIT_ARGB4444;
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
return MAPSURF_32BIT | MT_32BIT_ARGB8888;
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
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 504ed26..3083660 100644
--- a/src/mesa/drivers/dri/i915/i830_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i830_vtbl.c
@@ -582,11 +582,11 @@ i830_destroy_context(struct intel_context *intel)
static uint32_t i830_render_target_format_for_mesa_format[MESA_FORMAT_COUNT] =
{
- [MESA_FORMAT_ARGB8888_UNORM] = DV_PF_8888,
- [MESA_FORMAT_XRGB8888_UNORM] = DV_PF_8888,
+ [MESA_FORMAT_BGRA8888_UNORM] = DV_PF_8888,
+ [MESA_FORMAT_BGRX8888_UNORM] = DV_PF_8888,
[MESA_FORMAT_RGB565_UNORM] = DV_PF_565,
- [MESA_FORMAT_ARGB1555_UNORM] = DV_PF_1555,
- [MESA_FORMAT_ARGB4444_UNORM] = DV_PF_4444,
+ [MESA_FORMAT_BGRA1555_UNORM] = DV_PF_1555,
+ [MESA_FORMAT_BGRA4444_UNORM] = DV_PF_4444,
};
static bool
diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c
index e23ba18..5de6ba5 100644
--- a/src/mesa/drivers/dri/i915/i915_context.c
+++ b/src/mesa/drivers/dri/i915/i915_context.c
@@ -99,14 +99,14 @@ 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_UNORM] = true;
+ ctx->TextureFormatSupported[MESA_FORMAT_BGRA8888_UNORM] = true;
if (intel_screen->deviceID != PCI_CHIP_I830_M &&
intel_screen->deviceID != PCI_CHIP_845_G)
- ctx->TextureFormatSupported[MESA_FORMAT_XRGB8888_UNORM] = true;
+ ctx->TextureFormatSupported[MESA_FORMAT_BGRX8888_UNORM] = true;
if (intel->gen == 3)
ctx->TextureFormatSupported[MESA_FORMAT_SARGB8] = true;
- ctx->TextureFormatSupported[MESA_FORMAT_ARGB4444_UNORM] = true;
- ctx->TextureFormatSupported[MESA_FORMAT_ARGB1555_UNORM] = true;
+ ctx->TextureFormatSupported[MESA_FORMAT_BGRA4444_UNORM] = true;
+ ctx->TextureFormatSupported[MESA_FORMAT_BGRA1555_UNORM] = true;
ctx->TextureFormatSupported[MESA_FORMAT_RGB565_UNORM] = true;
ctx->TextureFormatSupported[MESA_FORMAT_L8_UNORM] = true;
ctx->TextureFormatSupported[MESA_FORMAT_A8_UNORM] = true;
diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c
index 9dda99d..89ffbff 100644
--- a/src/mesa/drivers/dri/i915/i915_texstate.c
+++ b/src/mesa/drivers/dri/i915/i915_texstate.c
@@ -52,14 +52,14 @@ translate_texture_format(gl_format mesa_format, GLenum DepthMode)
return MAPSURF_16BIT | MT_16BIT_AY88;
case MESA_FORMAT_RGB565_UNORM:
return MAPSURF_16BIT | MT_16BIT_RGB565;
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
return MAPSURF_16BIT | MT_16BIT_ARGB1555;
- case MESA_FORMAT_ARGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
return MAPSURF_16BIT | MT_16BIT_ARGB4444;
case MESA_FORMAT_SARGB8:
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
return MAPSURF_32BIT | MT_32BIT_ARGB8888;
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
return MAPSURF_32BIT | MT_32BIT_XRGB8888;
case MESA_FORMAT_RGBA8888_REV_UNORM:
return MAPSURF_32BIT | MT_32BIT_ABGR8888;
diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c
index 07c1648..4b91b86 100644
--- a/src/mesa/drivers/dri/i915/i915_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i915_vtbl.c
@@ -549,11 +549,11 @@ 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_UNORM] = DV_PF_8888,
- [MESA_FORMAT_XRGB8888_UNORM] = DV_PF_8888,
+ [MESA_FORMAT_BGRA8888_UNORM] = DV_PF_8888,
+ [MESA_FORMAT_BGRX8888_UNORM] = DV_PF_8888,
[MESA_FORMAT_RGB565_UNORM] = DV_PF_565 | DITHER_FULL_ALWAYS,
- [MESA_FORMAT_ARGB1555_UNORM] = DV_PF_1555 | DITHER_FULL_ALWAYS,
- [MESA_FORMAT_ARGB4444_UNORM] = DV_PF_4444 | DITHER_FULL_ALWAYS,
+ [MESA_FORMAT_BGRA1555_UNORM] = DV_PF_1555 | DITHER_FULL_ALWAYS,
+ [MESA_FORMAT_BGRA4444_UNORM] = DV_PF_4444 | DITHER_FULL_ALWAYS,
};
static bool
diff --git a/src/mesa/drivers/dri/i915/intel_blit.c b/src/mesa/drivers/dri/i915/intel_blit.c
index c1ebfb0..f20f662 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_UNORM &&
- src_format != MESA_FORMAT_XRGB8888_UNORM) ||
- (dst_format != MESA_FORMAT_ARGB8888_UNORM &&
- dst_format != MESA_FORMAT_XRGB8888_UNORM))) {
+ ((src_format != MESA_FORMAT_BGRA8888_UNORM &&
+ src_format != MESA_FORMAT_BGRX8888_UNORM) ||
+ (dst_format != MESA_FORMAT_BGRA8888_UNORM &&
+ dst_format != MESA_FORMAT_BGRX8888_UNORM))) {
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_UNORM &&
- dst_mt->format == MESA_FORMAT_ARGB8888_UNORM) {
+ if (src_mt->format == MESA_FORMAT_BGRX8888_UNORM &&
+ dst_mt->format == MESA_FORMAT_BGRA8888_UNORM) {
intel_miptree_set_alpha_to_one(intel, dst_mt,
dst_x, dst_y,
width, height);
@@ -450,19 +450,19 @@ intelClearWithBlit(struct gl_context *ctx, GLbitfield mask)
_mesa_unclamped_float_rgba_to_ubyte(clear, color);
switch (intel_rb_format(irb)) {
- case MESA_FORMAT_ARGB8888_UNORM:
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
clear_val = PACK_COLOR_8888(clear[3], clear[0],
clear[1], clear[2]);
break;
case MESA_FORMAT_RGB565_UNORM:
clear_val = PACK_COLOR_565(clear[0], clear[1], clear[2]);
break;
- case MESA_FORMAT_ARGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
clear_val = PACK_COLOR_4444(clear[3], clear[0],
clear[1], clear[2]);
break;
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
clear_val = PACK_COLOR_1555(clear[3], clear[0],
clear[1], clear[2]);
break;
diff --git a/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i915/intel_pixel_bitmap.c
index c17405e..76213c4 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_UNORM:
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
color = PACK_COLOR_8888(ubcolor[3], ubcolor[0], ubcolor[1], ubcolor[2]);
break;
case MESA_FORMAT_RGB565_UNORM:
diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c
index b667945..c36901c 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_UNORM:
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
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_UNORM;
+ rgbFormat = MESA_FORMAT_BGRX8888_UNORM;
else
- rgbFormat = MESA_FORMAT_ARGB8888_UNORM;
+ rgbFormat = MESA_FORMAT_BGRA8888_UNORM;
/* setup the hardware-based renderbuffers */
rb = intel_create_renderbuffer(rgbFormat);
@@ -1044,7 +1044,7 @@ intel_screen_make_configs(__DRIscreen *dri_screen)
{
static const gl_format formats[] = {
MESA_FORMAT_RGB565_UNORM,
- MESA_FORMAT_ARGB8888_UNORM
+ MESA_FORMAT_BGRA8888_UNORM
};
/* 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 d09d557..a14040d 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_UNORM;
+ texFormat = MESA_FORMAT_BGRX8888_UNORM;
}
else {
internalFormat = GL_RGBA;
- texFormat = MESA_FORMAT_ARGB8888_UNORM;
+ texFormat = MESA_FORMAT_BGRA8888_UNORM;
}
} 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 9d1948c..e70819d 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(gl_format src_format, gl_format dst_format)
* (overriding alpha to 1.0 via blending).
*/
return linear_src_format == linear_dst_format ||
- (linear_src_format == MESA_FORMAT_XRGB8888_UNORM &&
- linear_dst_format == MESA_FORMAT_ARGB8888_UNORM) ||
- (linear_src_format == MESA_FORMAT_ARGB8888_UNORM &&
- linear_dst_format == MESA_FORMAT_XRGB8888_UNORM);
+ (linear_src_format == MESA_FORMAT_BGRX8888_UNORM &&
+ linear_dst_format == MESA_FORMAT_BGRA8888_UNORM) ||
+ (linear_src_format == MESA_FORMAT_BGRA8888_UNORM &&
+ linear_dst_format == MESA_FORMAT_BGRX8888_UNORM);
}
static bool
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index c54ea63..46e4a6f 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -882,7 +882,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_UNORM;
+ fb->Attachment[i].Renderbuffer->Format = MESA_FORMAT_BGRA8888_UNORM;
}
}
}
diff --git a/src/mesa/drivers/dri/i965/brw_surface_formats.c b/src/mesa/drivers/dri/i965/brw_surface_formats.c
index c26f596..6c64d0d 100644
--- a/src/mesa/drivers/dri/i965/brw_surface_formats.c
+++ b/src/mesa/drivers/dri/i965/brw_surface_formats.c
@@ -321,21 +321,21 @@ brw_format_for_mesa_format(gl_format mesa_format)
{
[MESA_FORMAT_RGBA8888_UNORM] = 0,
[MESA_FORMAT_RGBA8888_REV_UNORM] = BRW_SURFACEFORMAT_R8G8B8A8_UNORM,
- [MESA_FORMAT_ARGB8888_UNORM] = BRW_SURFACEFORMAT_B8G8R8A8_UNORM,
- [MESA_FORMAT_ARGB8888_REV_UNORM] = 0,
+ [MESA_FORMAT_BGRA8888_UNORM] = BRW_SURFACEFORMAT_B8G8R8A8_UNORM,
+ [MESA_FORMAT_BGRA8888_REV_UNORM] = 0,
[MESA_FORMAT_RGBX8888_UNORM] = 0,
[MESA_FORMAT_RGBX8888_REV_UNORM] = BRW_SURFACEFORMAT_R8G8B8X8_UNORM,
- [MESA_FORMAT_XRGB8888_UNORM] = BRW_SURFACEFORMAT_B8G8R8X8_UNORM,
- [MESA_FORMAT_XRGB8888_REV_UNORM] = 0,
+ [MESA_FORMAT_BGRX8888_UNORM] = BRW_SURFACEFORMAT_B8G8R8X8_UNORM,
+ [MESA_FORMAT_BGRX8888_REV_UNORM] = 0,
[MESA_FORMAT_RGB888] = 0,
[MESA_FORMAT_BGR888] = BRW_SURFACEFORMAT_R8G8B8_UNORM,
[MESA_FORMAT_RGB565_UNORM] = BRW_SURFACEFORMAT_B5G6R5_UNORM,
[MESA_FORMAT_RGB565_REV_UNORM] = 0,
- [MESA_FORMAT_ARGB4444_UNORM] = BRW_SURFACEFORMAT_B4G4R4A4_UNORM,
- [MESA_FORMAT_ARGB4444_REV_UNORM] = 0,
+ [MESA_FORMAT_BGRA4444_UNORM] = BRW_SURFACEFORMAT_B4G4R4A4_UNORM,
+ [MESA_FORMAT_BGRA4444_REV_UNORM] = 0,
[MESA_FORMAT_RGBA5551_UNORM] = 0,
- [MESA_FORMAT_ARGB1555_UNORM] = BRW_SURFACEFORMAT_B5G5R5A1_UNORM,
- [MESA_FORMAT_ARGB1555_REV_UNORM] = 0,
+ [MESA_FORMAT_BGRA1555_UNORM] = BRW_SURFACEFORMAT_B5G5R5A1_UNORM,
+ [MESA_FORMAT_BGRA1555_REV_UNORM] = 0,
[MESA_FORMAT_AL44_UNORM] = 0,
[MESA_FORMAT_AL88_UNORM] = BRW_SURFACEFORMAT_L8A8_UNORM,
[MESA_FORMAT_AL88_REV_UNORM] = 0,
@@ -356,7 +356,7 @@ brw_format_for_mesa_format(gl_format mesa_format)
[MESA_FORMAT_R16_UNORM] = BRW_SURFACEFORMAT_R16_UNORM,
[MESA_FORMAT_GR1616_UNORM] = BRW_SURFACEFORMAT_R16G16_UNORM,
[MESA_FORMAT_RG1616_UNORM] = 0,
- [MESA_FORMAT_ARGB2101010_UNORM] = BRW_SURFACEFORMAT_B10G10R10A2_UNORM,
+ [MESA_FORMAT_BGRA2101010_UNORM] = BRW_SURFACEFORMAT_B10G10R10A2_UNORM,
[MESA_FORMAT_Z24_UNORM_S8_UINT] = 0,
[MESA_FORMAT_S8_UINT_Z24_UNORM] = 0,
[MESA_FORMAT_Z16_UNORM] = 0,
@@ -502,16 +502,16 @@ brw_format_for_mesa_format(gl_format mesa_format)
[MESA_FORMAT_Z32_FLOAT] = 0,
[MESA_FORMAT_Z32_FLOAT_X24S8] = 0,
- [MESA_FORMAT_ARGB2101010_UINT] = BRW_SURFACEFORMAT_B10G10R10A2_UINT,
- [MESA_FORMAT_ABGR2101010_UINT] = BRW_SURFACEFORMAT_R10G10B10A2_UINT,
+ [MESA_FORMAT_BGRA2101010_UINT] = BRW_SURFACEFORMAT_B10G10R10A2_UINT,
+ [MESA_FORMAT_RGBA2101010_UINT] = BRW_SURFACEFORMAT_R10G10B10A2_UINT,
- [MESA_FORMAT_XRGB4444_UNORM] = 0,
- [MESA_FORMAT_XRGB1555_UNORM] = BRW_SURFACEFORMAT_B5G5R5X1_UNORM,
+ [MESA_FORMAT_BGRX4444_UNORM] = 0,
+ [MESA_FORMAT_BGRX1555_UNORM] = BRW_SURFACEFORMAT_B5G5R5X1_UNORM,
[MESA_FORMAT_XBGR8888_SNORM] = 0,
[MESA_FORMAT_XBGR8888_SRGB] = 0,
[MESA_FORMAT_XBGR8888_UINT] = 0,
[MESA_FORMAT_XBGR8888_SINT] = 0,
- [MESA_FORMAT_XRGB2101010_UNORM] = BRW_SURFACEFORMAT_B10G10R10X2_UNORM,
+ [MESA_FORMAT_BGRX2101010_UNORM] = BRW_SURFACEFORMAT_B10G10R10X2_UNORM,
[MESA_FORMAT_XBGR16161616_UNORM] = BRW_SURFACEFORMAT_R16G16B16X16_UNORM,
[MESA_FORMAT_XBGR16161616_SNORM] = 0,
[MESA_FORMAT_XBGR16161616_FLOAT] = BRW_SURFACEFORMAT_R16G16B16X16_FLOAT,
diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c
index add1b9a..00f3fb5 100644
--- a/src/mesa/drivers/dri/i965/intel_blit.c
+++ b/src/mesa/drivers/dri/i965/intel_blit.c
@@ -170,10 +170,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_UNORM &&
- src_format != MESA_FORMAT_XRGB8888_UNORM) ||
- (dst_format != MESA_FORMAT_ARGB8888_UNORM &&
- dst_format != MESA_FORMAT_XRGB8888_UNORM))) {
+ ((src_format != MESA_FORMAT_BGRA8888_UNORM &&
+ src_format != MESA_FORMAT_BGRX8888_UNORM) ||
+ (dst_format != MESA_FORMAT_BGRA8888_UNORM &&
+ dst_format != MESA_FORMAT_BGRX8888_UNORM))) {
perf_debug("%s: Can't use hardware blitter from %s to %s, "
"falling back.\n", __FUNCTION__,
_mesa_get_format_name(src_format),
@@ -250,8 +250,8 @@ intel_miptree_blit(struct brw_context *brw,
return false;
}
- if (src_mt->format == MESA_FORMAT_XRGB8888_UNORM &&
- dst_mt->format == MESA_FORMAT_ARGB8888_UNORM) {
+ if (src_mt->format == MESA_FORMAT_BGRX8888_UNORM &&
+ dst_mt->format == MESA_FORMAT_BGRA8888_UNORM) {
intel_miptree_set_alpha_to_one(brw, dst_mt,
dst_x, dst_y,
width, height);
diff --git a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
index 13b1099..2a4b56f 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_UNORM:
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
color = PACK_COLOR_8888(ubcolor[3], ubcolor[0], ubcolor[1], ubcolor[2]);
break;
case MESA_FORMAT_RGB565_UNORM:
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index f684a9d..c8e9e58 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_UNORM:
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
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_UNORM;
+ rgbFormat = MESA_FORMAT_BGRX8888_UNORM;
else {
rgbFormat = MESA_FORMAT_SARGB8;
fb->Visual.sRGBCapable = true;
@@ -1126,7 +1126,7 @@ intel_screen_make_configs(__DRIscreen *dri_screen)
{
static const gl_format formats[] = {
MESA_FORMAT_RGB565_UNORM,
- MESA_FORMAT_ARGB8888_UNORM
+ MESA_FORMAT_BGRA8888_UNORM
};
/* 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 93f0786..1f01158 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_UNORM;
+ texFormat = MESA_FORMAT_BGRX8888_UNORM;
}
else {
internalFormat = GL_RGBA;
- texFormat = MESA_FORMAT_ARGB8888_UNORM;
+ texFormat = MESA_FORMAT_BGRA8888_UNORM;
}
} 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 8bee491..3a4ec76 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_subimage.c
@@ -577,7 +577,7 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
(texImage->TexFormat == MESA_FORMAT_A8_UNORM && format == GL_ALPHA)) {
cpp = 1;
mem_copy = memcpy;
- } else if (texImage->TexFormat == MESA_FORMAT_ARGB8888_UNORM) {
+ } else if (texImage->TexFormat == MESA_FORMAT_BGRA8888_UNORM) {
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 35d241d..82e6868 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_UNORM;
+ rb->Format = MESA_FORMAT_BGRX8888_UNORM;
s->cpp = 4;
break;
case GL_RGBA:
case GL_RGBA8:
rb->_BaseFormat = GL_RGBA;
- rb->Format = MESA_FORMAT_ARGB8888_UNORM;
+ rb->Format = MESA_FORMAT_BGRA8888_UNORM;
s->cpp = 4;
break;
case GL_RGB5:
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_screen.c b/src/mesa/drivers/dri/nouveau/nouveau_screen.c
index 7069b02..e331cd8 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 gl_format formats[3] = {
MESA_FORMAT_RGB565_UNORM,
- MESA_FORMAT_ARGB8888_UNORM,
- MESA_FORMAT_XRGB8888_UNORM,
+ MESA_FORMAT_BGRA8888_UNORM,
+ MESA_FORMAT_BGRX8888_UNORM,
};
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 51fdc26..146c4b3 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
@@ -175,9 +175,9 @@ 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_UNORM;
+ return MESA_FORMAT_BGRA8888_UNORM;
case GL_RGB5_A1:
- return MESA_FORMAT_ARGB1555_UNORM;
+ return MESA_FORMAT_BGRA1555_UNORM;
case GL_RGB:
case GL_RGB8:
@@ -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_UNORM;
+ return MESA_FORMAT_BGRX8888_UNORM;
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_UNORM;
+ return MESA_FORMAT_BGRA8888_UNORM;
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_UNORM;
+ return MESA_FORMAT_BGRA8888_UNORM;
else
- return MESA_FORMAT_XRGB8888_UNORM;
+ return MESA_FORMAT_BGRX8888_UNORM;
}
void
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_util.h b/src/mesa/drivers/dri/nouveau/nouveau_util.h
index fa89c0d..7505e49 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_util.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_util.h
@@ -34,13 +34,13 @@ static inline unsigned
pack_rgba_i(gl_format f, uint8_t c[])
{
switch (f) {
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
return PACK_COLOR_8888(c[ACOMP], c[RCOMP], c[GCOMP], c[BCOMP]);
- case MESA_FORMAT_ARGB8888_REV_UNORM:
+ case MESA_FORMAT_BGRA8888_REV_UNORM:
return PACK_COLOR_8888(c[BCOMP], c[GCOMP], c[RCOMP], c[ACOMP]);
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
return PACK_COLOR_8888(0, c[RCOMP], c[GCOMP], c[BCOMP]);
- case MESA_FORMAT_XRGB8888_REV_UNORM:
+ case MESA_FORMAT_BGRX8888_REV_UNORM:
return PACK_COLOR_8888(c[BCOMP], c[GCOMP], c[RCOMP], 0);
case MESA_FORMAT_RGBA8888_UNORM:
return PACK_COLOR_8888(c[RCOMP], c[GCOMP], c[BCOMP], c[ACOMP]);
diff --git a/src/mesa/drivers/dri/nouveau/nv04_context.c b/src/mesa/drivers/dri/nouveau/nv04_context.c
index 4739305..3cdca73 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_UNORM, 1, 1);
+ MESA_FORMAT_BGRA8888_UNORM, 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 afeb70f..467d18e 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(gl_format format)
{
switch (format) {
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X8R8G8B8_X8R8G8B8;
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_A8R8G8B8;
case MESA_FORMAT_RGB565_UNORM:
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 4245c16..0e01dff 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_UNORM,
+ nv04->factor = pack_rgba_f(MESA_FORMAT_BGRA8888_UNORM,
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 c69900c..4603e2d 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_UNORM, ctx->Fog.Color);
+ nv04->fog = pack_rgba_f(MESA_FORMAT_BGRA8888_UNORM, 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 8ca9dc0..1958847 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c
@@ -42,15 +42,15 @@ get_tex_format(struct gl_texture_image *ti)
case MESA_FORMAT_L8_UNORM:
case MESA_FORMAT_I8_UNORM:
return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_Y8;
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_A1R5G5B5;
- case MESA_FORMAT_ARGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_A4R4G4B4;
case MESA_FORMAT_RGB565_UNORM:
return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_R5G6B5;
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_A8R8G8B8;
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
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 25dbf3e..28305a2 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_surface.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_surface.c
@@ -45,11 +45,11 @@ swzsurf_format(gl_format format)
case MESA_FORMAT_RGB565_UNORM:
case MESA_FORMAT_RGB565_REV_UNORM:
- case MESA_FORMAT_ARGB4444_UNORM:
- case MESA_FORMAT_ARGB4444_REV_UNORM:
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
+ case MESA_FORMAT_BGRA4444_REV_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
case MESA_FORMAT_RGBA5551_UNORM:
- case MESA_FORMAT_ARGB1555_REV_UNORM:
+ case MESA_FORMAT_BGRA1555_REV_UNORM:
case MESA_FORMAT_AL88_UNORM:
case MESA_FORMAT_AL88_REV_UNORM:
case MESA_FORMAT_YCBCR:
@@ -59,9 +59,9 @@ swzsurf_format(gl_format format)
case MESA_FORMAT_RGBA8888_UNORM:
case MESA_FORMAT_RGBA8888_REV_UNORM:
- case MESA_FORMAT_XRGB8888_UNORM:
- case MESA_FORMAT_ARGB8888_UNORM:
- case MESA_FORMAT_ARGB8888_REV_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
+ case MESA_FORMAT_BGRA8888_REV_UNORM:
case MESA_FORMAT_S8_UINT_Z24_UNORM:
case MESA_FORMAT_Z24_UNORM_S8_UINT:
case MESA_FORMAT_Z32_UNORM:
@@ -84,11 +84,11 @@ surf2d_format(gl_format format)
case MESA_FORMAT_RGB565_UNORM:
case MESA_FORMAT_RGB565_REV_UNORM:
- case MESA_FORMAT_ARGB4444_UNORM:
- case MESA_FORMAT_ARGB4444_REV_UNORM:
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
+ case MESA_FORMAT_BGRA4444_REV_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
case MESA_FORMAT_RGBA5551_UNORM:
- case MESA_FORMAT_ARGB1555_REV_UNORM:
+ case MESA_FORMAT_BGRA1555_REV_UNORM:
case MESA_FORMAT_AL88_UNORM:
case MESA_FORMAT_AL88_REV_UNORM:
case MESA_FORMAT_YCBCR:
@@ -98,9 +98,9 @@ surf2d_format(gl_format format)
case MESA_FORMAT_RGBA8888_UNORM:
case MESA_FORMAT_RGBA8888_REV_UNORM:
- case MESA_FORMAT_XRGB8888_UNORM:
- case MESA_FORMAT_ARGB8888_UNORM:
- case MESA_FORMAT_ARGB8888_REV_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
+ case MESA_FORMAT_BGRA8888_REV_UNORM:
case MESA_FORMAT_S8_UINT_Z24_UNORM:
case MESA_FORMAT_Z24_UNORM_S8_UINT:
case MESA_FORMAT_Z32_UNORM:
@@ -123,11 +123,11 @@ rect_format(gl_format format)
case MESA_FORMAT_RGB565_UNORM:
case MESA_FORMAT_RGB565_REV_UNORM:
- case MESA_FORMAT_ARGB4444_UNORM:
- case MESA_FORMAT_ARGB4444_REV_UNORM:
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
+ case MESA_FORMAT_BGRA4444_REV_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
case MESA_FORMAT_RGBA5551_UNORM:
- case MESA_FORMAT_ARGB1555_REV_UNORM:
+ case MESA_FORMAT_BGRA1555_REV_UNORM:
case MESA_FORMAT_AL88_UNORM:
case MESA_FORMAT_AL88_REV_UNORM:
case MESA_FORMAT_YCBCR:
@@ -137,9 +137,9 @@ rect_format(gl_format format)
case MESA_FORMAT_RGBA8888_UNORM:
case MESA_FORMAT_RGBA8888_REV_UNORM:
- case MESA_FORMAT_XRGB8888_UNORM:
- case MESA_FORMAT_ARGB8888_UNORM:
- case MESA_FORMAT_ARGB8888_REV_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
+ case MESA_FORMAT_BGRA8888_REV_UNORM:
case MESA_FORMAT_S8_UINT_Z24_UNORM:
case MESA_FORMAT_Z24_UNORM_S8_UINT:
case MESA_FORMAT_Z32_UNORM:
@@ -162,11 +162,11 @@ sifm_format(gl_format format)
case MESA_FORMAT_RGB565_UNORM:
case MESA_FORMAT_RGB565_REV_UNORM:
- case MESA_FORMAT_ARGB4444_UNORM:
- case MESA_FORMAT_ARGB4444_REV_UNORM:
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
+ case MESA_FORMAT_BGRA4444_REV_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
case MESA_FORMAT_RGBA5551_UNORM:
- case MESA_FORMAT_ARGB1555_REV_UNORM:
+ case MESA_FORMAT_BGRA1555_REV_UNORM:
case MESA_FORMAT_AL88_UNORM:
case MESA_FORMAT_AL88_REV_UNORM:
case MESA_FORMAT_YCBCR:
@@ -176,9 +176,9 @@ sifm_format(gl_format format)
case MESA_FORMAT_RGBA8888_UNORM:
case MESA_FORMAT_RGBA8888_REV_UNORM:
- case MESA_FORMAT_XRGB8888_UNORM:
- case MESA_FORMAT_ARGB8888_UNORM:
- case MESA_FORMAT_ARGB8888_REV_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
+ case MESA_FORMAT_BGRA8888_REV_UNORM:
case MESA_FORMAT_S8_UINT_Z24_UNORM:
case MESA_FORMAT_Z24_UNORM_S8_UINT:
case MESA_FORMAT_Z32_UNORM:
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_fb.c b/src/mesa/drivers/dri/nouveau/nv10_state_fb.c
index 9c2111c..c9a5395 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(gl_format format)
{
switch (format) {
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
return NV10_3D_RT_FORMAT_COLOR_X8R8G8B8;
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
return NV10_3D_RT_FORMAT_COLOR_A8R8G8B8;
case MESA_FORMAT_RGB565_UNORM:
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 e79ad9b..0f16466 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_UNORM) {
+ } else if (format == MESA_FORMAT_BGRX8888_UNORM) {
/* 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_UNORM,
+ *k = pack_rgba_f(MESA_FORMAT_BGRA8888_UNORM,
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 7213c59..ab86743 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
@@ -90,16 +90,16 @@ static uint32_t
get_tex_format_pot(struct gl_texture_image *ti)
{
switch (ti->TexFormat) {
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
return NV10_3D_TEX_FORMAT_FORMAT_A8R8G8B8;
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
return NV10_3D_TEX_FORMAT_FORMAT_X8R8G8B8;
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
return NV10_3D_TEX_FORMAT_FORMAT_A1R5G5B5;
- case MESA_FORMAT_ARGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
return NV10_3D_TEX_FORMAT_FORMAT_A4R4G4B4;
case MESA_FORMAT_RGB565_UNORM:
@@ -131,14 +131,14 @@ static uint32_t
get_tex_format_rect(struct gl_texture_image *ti)
{
switch (ti->TexFormat) {
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
return NV10_3D_TEX_FORMAT_FORMAT_A1R5G5B5_RECT;
case MESA_FORMAT_RGB565_UNORM:
return NV10_3D_TEX_FORMAT_FORMAT_R5G6B5_RECT;
- case MESA_FORMAT_ARGB8888_UNORM:
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
return NV10_3D_TEX_FORMAT_FORMAT_A8R8G8B8_RECT;
case MESA_FORMAT_A8_UNORM:
diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_fb.c b/src/mesa/drivers/dri/nouveau/nv20_state_fb.c
index 8186d4f..e18e566 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(gl_format format)
{
switch (format) {
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
return NV20_3D_RT_FORMAT_COLOR_X8R8G8B8;
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
return NV20_3D_RT_FORMAT_COLOR_A8R8G8B8;
case MESA_FORMAT_RGB565_UNORM:
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 2115d50..4a2b6be 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
@@ -87,16 +87,16 @@ static uint32_t
get_tex_format_pot(struct gl_texture_image *ti)
{
switch (ti->TexFormat) {
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
return NV20_3D_TEX_FORMAT_FORMAT_A8R8G8B8;
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
return NV20_3D_TEX_FORMAT_FORMAT_A1R5G5B5;
- case MESA_FORMAT_ARGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
return NV20_3D_TEX_FORMAT_FORMAT_A4R4G4B4;
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
return NV20_3D_TEX_FORMAT_FORMAT_X8R8G8B8;
case MESA_FORMAT_RGB565_UNORM:
@@ -128,16 +128,16 @@ static uint32_t
get_tex_format_rect(struct gl_texture_image *ti)
{
switch (ti->TexFormat) {
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
return NV20_3D_TEX_FORMAT_FORMAT_A8R8G8B8_RECT;
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
return NV20_3D_TEX_FORMAT_FORMAT_A1R5G5B5_RECT;
- case MESA_FORMAT_ARGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
return NV20_3D_TEX_FORMAT_FORMAT_A4R4G4B4_RECT;
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
return NV20_3D_TEX_FORMAT_FORMAT_R8G8B8_RECT;
case MESA_FORMAT_RGB565_UNORM:
diff --git a/src/mesa/drivers/dri/r200/r200_blit.c b/src/mesa/drivers/dri/r200/r200_blit.c
index 2b5277f..179bc2b 100644
--- a/src/mesa/drivers/dri/r200/r200_blit.c
+++ b/src/mesa/drivers/dri/r200/r200_blit.c
@@ -42,11 +42,11 @@ unsigned r200_check_blit(gl_format mesa_format, uint32_t dst_pitch)
{
/* XXX others? BE/LE? */
switch (mesa_format) {
- case MESA_FORMAT_ARGB8888_UNORM:
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
case MESA_FORMAT_RGB565_UNORM:
- case MESA_FORMAT_ARGB4444_UNORM:
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
case MESA_FORMAT_A8_UNORM:
case MESA_FORMAT_L8_UNORM:
case MESA_FORMAT_I8_UNORM:
@@ -114,7 +114,7 @@ static void inline emit_tx_setup(struct r200_context *r200,
/* XXX others? BE/LE? */
switch (src_mesa_format) {
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
txformat |= R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP;
break;
case MESA_FORMAT_RGBA8888_UNORM:
@@ -123,16 +123,16 @@ static void inline emit_tx_setup(struct r200_context *r200,
case MESA_FORMAT_RGBA8888_REV_UNORM:
txformat |= R200_TXFORMAT_ABGR8888 | R200_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
txformat |= R200_TXFORMAT_ARGB8888;
break;
case MESA_FORMAT_RGB565_UNORM:
txformat |= R200_TXFORMAT_RGB565;
break;
- case MESA_FORMAT_ARGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
txformat |= R200_TXFORMAT_ARGB4444 | R200_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
txformat |= R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP;
break;
case MESA_FORMAT_A8_UNORM:
@@ -155,11 +155,11 @@ static void inline emit_tx_setup(struct r200_context *r200,
offset |= R200_TXO_MICRO_TILE;
switch (dst_mesa_format) {
- case MESA_FORMAT_ARGB8888_UNORM:
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
case MESA_FORMAT_RGB565_UNORM:
- case MESA_FORMAT_ARGB4444_UNORM:
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
case MESA_FORMAT_A8_UNORM:
case MESA_FORMAT_L8_UNORM:
case MESA_FORMAT_I8_UNORM:
@@ -308,8 +308,8 @@ static inline void emit_cb_setup(struct r200_context *r200,
/* XXX others? BE/LE? */
switch (mesa_format) {
- case MESA_FORMAT_ARGB8888_UNORM:
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
case MESA_FORMAT_RGBA8888_UNORM:
case MESA_FORMAT_RGBA8888_REV_UNORM:
dst_format = RADEON_COLOR_FORMAT_ARGB8888;
@@ -317,10 +317,10 @@ static inline void emit_cb_setup(struct r200_context *r200,
case MESA_FORMAT_RGB565_UNORM:
dst_format = RADEON_COLOR_FORMAT_RGB565;
break;
- case MESA_FORMAT_ARGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
dst_format = RADEON_COLOR_FORMAT_ARGB4444;
break;
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
dst_format = RADEON_COLOR_FORMAT_ARGB1555;
break;
case MESA_FORMAT_A8_UNORM:
diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c b/src/mesa/drivers/dri/r200/r200_state_init.c
index 82283d9..73fa1d8 100644
--- a/src/mesa/drivers/dri/r200/r200_state_init.c
+++ b/src/mesa/drivers/dri/r200/r200_state_init.c
@@ -455,10 +455,10 @@ static void ctx_emit_cs(struct gl_context *ctx, struct radeon_state_atom *atom)
case MESA_FORMAT_RGB565_UNORM:
atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_RGB565;
break;
- case MESA_FORMAT_ARGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB4444;
break;
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB1555;
break;
default:
diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c
index c0a90bb..df14c0f 100644
--- a/src/mesa/drivers/dri/r200/r200_texstate.c
+++ b/src/mesa/drivers/dri/r200/r200_texstate.c
@@ -788,10 +788,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_UNORM;
- t->pp_txformat = tx_table_le[MESA_FORMAT_ARGB8888_UNORM].format;
+ texFormat = MESA_FORMAT_BGRA8888_UNORM;
+ t->pp_txformat = tx_table_le[MESA_FORMAT_BGRA8888_UNORM].format;
}
- t->pp_txfilter |= tx_table_le[MESA_FORMAT_ARGB8888_UNORM].filter;
+ t->pp_txfilter |= tx_table_le[MESA_FORMAT_BGRA8888_UNORM].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 5e832a5..2062b39 100644
--- a/src/mesa/drivers/dri/radeon/radeon_blit.c
+++ b/src/mesa/drivers/dri/radeon/radeon_blit.c
@@ -42,11 +42,11 @@ unsigned r100_check_blit(gl_format mesa_format, uint32_t dst_pitch)
{
/* XXX others? BE/LE? */
switch (mesa_format) {
- case MESA_FORMAT_ARGB8888_UNORM:
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
case MESA_FORMAT_RGB565_UNORM:
- case MESA_FORMAT_ARGB4444_UNORM:
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
case MESA_FORMAT_A8_UNORM:
case MESA_FORMAT_L8_UNORM:
case MESA_FORMAT_I8_UNORM:
@@ -108,22 +108,22 @@ static void inline emit_tx_setup(struct r100_context *r100,
/* XXX others? BE/LE? */
switch (mesa_format) {
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
txformat |= RADEON_TXFORMAT_ARGB8888 | RADEON_TXFORMAT_ALPHA_IN_MAP;
break;
case MESA_FORMAT_RGBA8888_UNORM:
txformat |= RADEON_TXFORMAT_RGBA8888 | RADEON_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
txformat |= RADEON_TXFORMAT_ARGB8888;
break;
case MESA_FORMAT_RGB565_UNORM:
txformat |= RADEON_TXFORMAT_RGB565;
break;
- case MESA_FORMAT_ARGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
txformat |= RADEON_TXFORMAT_ARGB4444 | RADEON_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
txformat |= RADEON_TXFORMAT_ARGB1555 | RADEON_TXFORMAT_ALPHA_IN_MAP;
break;
case MESA_FORMAT_A8_UNORM:
@@ -186,17 +186,17 @@ static inline void emit_cb_setup(struct r100_context *r100,
/* XXX others? BE/LE? */
switch (mesa_format) {
- case MESA_FORMAT_ARGB8888_UNORM:
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
dst_format = RADEON_COLOR_FORMAT_ARGB8888;
break;
case MESA_FORMAT_RGB565_UNORM:
dst_format = RADEON_COLOR_FORMAT_RGB565;
break;
- case MESA_FORMAT_ARGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
dst_format = RADEON_COLOR_FORMAT_ARGB4444;
break;
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
dst_format = RADEON_COLOR_FORMAT_ARGB1555;
break;
case MESA_FORMAT_A8_UNORM:
diff --git a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
index d22845c..47e4ecf 100644
--- a/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
+++ b/src/mesa/drivers/dri/radeon/radeon_pixel_read.c
@@ -66,18 +66,18 @@ static gl_format gl_format_and_type_to_mesa_format(GLenum format, GLenum type)
case GL_BGRA:
switch (type) {
case GL_UNSIGNED_SHORT_4_4_4_4:
- return MESA_FORMAT_ARGB4444_REV_UNORM;
+ return MESA_FORMAT_BGRA4444_REV_UNORM;
case GL_UNSIGNED_SHORT_4_4_4_4_REV:
- return MESA_FORMAT_ARGB4444_UNORM;
+ return MESA_FORMAT_BGRA4444_UNORM;
case GL_UNSIGNED_SHORT_5_5_5_1:
- return MESA_FORMAT_ARGB1555_REV_UNORM;
+ return MESA_FORMAT_BGRA1555_REV_UNORM;
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
- return MESA_FORMAT_ARGB1555_UNORM;
+ return MESA_FORMAT_BGRA1555_UNORM;
case GL_UNSIGNED_INT_8_8_8_8:
- return MESA_FORMAT_ARGB8888_REV_UNORM;
+ return MESA_FORMAT_BGRA8888_REV_UNORM;
case GL_UNSIGNED_BYTE:
case GL_UNSIGNED_INT_8_8_8_8_REV:
- return MESA_FORMAT_ARGB8888_UNORM;
+ return MESA_FORMAT_BGRA8888_UNORM;
}
break;
diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c
index 98100ac..44128f6 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_UNORM;
+ image->format = MESA_FORMAT_BGRX8888_UNORM;
image->internal_format = GL_RGB;
image->data_type = GL_UNSIGNED_BYTE;
break;
case __DRI_IMAGE_FORMAT_ARGB8888:
- image->format = MESA_FORMAT_ARGB8888_UNORM;
+ image->format = MESA_FORMAT_BGRA8888_UNORM;
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_UNORM;
+ image->format = MESA_FORMAT_BGRX8888_UNORM;
image->internal_format = GL_RGB;
image->data_type = GL_UNSIGNED_BYTE;
break;
case __DRI_IMAGE_FORMAT_ARGB8888:
- image->format = MESA_FORMAT_ARGB8888_UNORM;
+ image->format = MESA_FORMAT_BGRA8888_UNORM;
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_UNORM : MESA_FORMAT_RGB565_REV_UNORM;
else if (mesaVis->alphaBits == 0)
- rgbFormat = _mesa_little_endian() ? MESA_FORMAT_XRGB8888_UNORM : MESA_FORMAT_XRGB8888_REV_UNORM;
+ rgbFormat = _mesa_little_endian() ? MESA_FORMAT_BGRX8888_UNORM : MESA_FORMAT_BGRX8888_REV_UNORM;
else
- rgbFormat = _mesa_little_endian() ? MESA_FORMAT_ARGB8888_UNORM : MESA_FORMAT_ARGB8888_REV_UNORM;
+ rgbFormat = _mesa_little_endian() ? MESA_FORMAT_BGRA8888_UNORM : MESA_FORMAT_BGRA8888_REV_UNORM;
/* front color renderbuffer */
rfb->color_rb[0] = radeon_create_renderbuffer(rgbFormat, driDrawPriv);
@@ -710,8 +710,8 @@ __DRIconfig **radeonInitScreen2(__DRIscreen *psp)
{
static const gl_format formats[3] = {
MESA_FORMAT_RGB565_UNORM,
- MESA_FORMAT_XRGB8888_UNORM,
- MESA_FORMAT_ARGB8888_UNORM
+ MESA_FORMAT_BGRX8888_UNORM,
+ MESA_FORMAT_BGRA8888_UNORM
};
/* 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_state_init.c b/src/mesa/drivers/dri/radeon/radeon_state_init.c
index 31e031c..11bc78c 100644
--- a/src/mesa/drivers/dri/radeon/radeon_state_init.c
+++ b/src/mesa/drivers/dri/radeon/radeon_state_init.c
@@ -338,10 +338,10 @@ static void ctx_emit_cs(struct gl_context *ctx, struct radeon_state_atom *atom)
case MESA_FORMAT_RGB565_UNORM:
atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_RGB565;
break;
- case MESA_FORMAT_ARGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB4444;
break;
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB1555;
break;
default:
diff --git a/src/mesa/drivers/dri/radeon/radeon_tex_copy.c b/src/mesa/drivers/dri/radeon/radeon_tex_copy.c
index 96f654f..e51892e 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_UNORM;
break;
case 4:
- src_mesaformat = MESA_FORMAT_ARGB8888_UNORM;
- dst_mesaformat = MESA_FORMAT_ARGB8888_UNORM;
+ src_mesaformat = MESA_FORMAT_BGRA8888_UNORM;
+ dst_mesaformat = MESA_FORMAT_BGRA8888_UNORM;
break;
case 1:
src_mesaformat = MESA_FORMAT_A8_UNORM;
diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c
index 03a8144..a2a46f6 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texstate.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c
@@ -663,10 +663,10 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_form
texFormat = MESA_FORMAT_RGB888;
}
else {
- t->pp_txformat = tx_table[MESA_FORMAT_ARGB8888_UNORM].format;
- texFormat = MESA_FORMAT_ARGB8888_UNORM;
+ t->pp_txformat = tx_table[MESA_FORMAT_BGRA8888_UNORM].format;
+ texFormat = MESA_FORMAT_BGRA8888_UNORM;
}
- t->pp_txfilter |= tx_table[MESA_FORMAT_ARGB8888_UNORM].filter;
+ t->pp_txfilter |= tx_table[MESA_FORMAT_BGRA8888_UNORM].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 79d3b10..3f04669 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -593,18 +593,18 @@ radeonInitTextureFormats(void)
{
if (_mesa_little_endian()) {
_radeon_texformat_rgba8888 = MESA_FORMAT_RGBA8888_UNORM;
- _radeon_texformat_argb8888 = MESA_FORMAT_ARGB8888_UNORM;
+ _radeon_texformat_argb8888 = MESA_FORMAT_BGRA8888_UNORM;
_radeon_texformat_rgb565 = MESA_FORMAT_RGB565_UNORM;
- _radeon_texformat_argb4444 = MESA_FORMAT_ARGB4444_UNORM;
- _radeon_texformat_argb1555 = MESA_FORMAT_ARGB1555_UNORM;
+ _radeon_texformat_argb4444 = MESA_FORMAT_BGRA4444_UNORM;
+ _radeon_texformat_argb1555 = MESA_FORMAT_BGRA1555_UNORM;
_radeon_texformat_al88 = MESA_FORMAT_AL88_UNORM;
}
else {
_radeon_texformat_rgba8888 = MESA_FORMAT_RGBA8888_REV_UNORM;
- _radeon_texformat_argb8888 = MESA_FORMAT_ARGB8888_REV_UNORM;
+ _radeon_texformat_argb8888 = MESA_FORMAT_BGRA8888_REV_UNORM;
_radeon_texformat_rgb565 = MESA_FORMAT_RGB565_REV_UNORM;
- _radeon_texformat_argb4444 = MESA_FORMAT_ARGB4444_REV_UNORM;
- _radeon_texformat_argb1555 = MESA_FORMAT_ARGB1555_REV_UNORM;
+ _radeon_texformat_argb4444 = MESA_FORMAT_BGRA4444_REV_UNORM;
+ _radeon_texformat_argb1555 = MESA_FORMAT_BGRA1555_REV_UNORM;
_radeon_texformat_al88 = MESA_FORMAT_AL88_REV_UNORM;
}
}
diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
index 80973e1..0a76d56 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_UNORM;
+ texFormat = MESA_FORMAT_BGRX8888_UNORM;
else
- texFormat = MESA_FORMAT_ARGB8888_UNORM;
+ texFormat = MESA_FORMAT_BGRA8888_UNORM;
_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_UNORM;
break;
case 24:
- format = MESA_FORMAT_XRGB8888_UNORM;
+ format = MESA_FORMAT_BGRX8888_UNORM;
break;
case 32:
- format = MESA_FORMAT_ARGB8888_UNORM;
+ format = MESA_FORMAT_BGRA8888_UNORM;
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_UNORM;
+ rb->Format = MESA_FORMAT_BGRA8888_UNORM;
rb->InternalFormat = GL_RGBA;
rb->_BaseFormat = GL_RGBA;
xrb->bpp = 32;
break;
case PF_X8R8G8B8:
- rb->Format = MESA_FORMAT_ARGB8888_UNORM; /* XXX */
+ rb->Format = MESA_FORMAT_BGRA8888_UNORM; /* XXX */
rb->InternalFormat = GL_RGB;
rb->_BaseFormat = GL_RGB;
xrb->bpp = 32;
@@ -638,7 +638,7 @@ static gl_format swrastChooseTextureFormat(struct gl_context * ctx,
GLenum type)
{
if (internalFormat == GL_RGB)
- return MESA_FORMAT_XRGB8888_UNORM;
+ return MESA_FORMAT_BGRX8888_UNORM;
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 baac959..201e67f 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_UNORM;
+ rb->Format = MESA_FORMAT_BGRA8888_UNORM;
break;
case B_RGB32:
rb->_BaseFormat = GL_RGB;
- rb->Format = MESA_FORMAT_XRGB8888_UNORM;
+ rb->Format = MESA_FORMAT_BGRX8888_UNORM;
break;
case B_RGB24:
rb->_BaseFormat = GL_RGB;
@@ -609,7 +609,7 @@ MesaSoftwareRast::_SetupRenderBuffer(struct gl_renderbuffer* rb,
break;
case B_RGB15:
rb->_BaseFormat = GL_RGB;
- rb->Format = MESA_FORMAT_ARGB1555_UNORM;
+ rb->Format = MESA_FORMAT_BGRA1555_UNORM;
break;
default:
fprintf(stderr, "Unsupported screen color space %s\n",
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index d95b40d..a5fd53d 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -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_UNORM;
+ rb->Format = MESA_FORMAT_BGRA8888_UNORM;
else
- rb->Format = MESA_FORMAT_ARGB8888_REV_UNORM;
+ rb->Format = MESA_FORMAT_BGRA8888_REV_UNORM;
}
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_UNORM;
+ rb->Format = MESA_FORMAT_BGRA8888_REV_UNORM;
else
- rb->Format = MESA_FORMAT_ARGB8888_UNORM;
+ rb->Format = MESA_FORMAT_BGRA8888_UNORM;
}
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 2560c17..f18bf2f 100644
--- a/src/mesa/drivers/x11/xm_buffer.c
+++ b/src/mesa/drivers/x11/xm_buffer.c
@@ -343,10 +343,10 @@ 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_UNORM;
+ xrb->Base.Base.Format = MESA_FORMAT_BGRX8888_UNORM;
break;
case PF_8A8R8G8B:
- xrb->Base.Base.Format = MESA_FORMAT_ARGB8888_UNORM;
+ xrb->Base.Base.Format = MESA_FORMAT_BGRA8888_UNORM;
break;
case PF_8A8B8G8R:
xrb->Base.Base.Format = MESA_FORMAT_RGBA8888_REV_UNORM;
@@ -356,7 +356,7 @@ xmesa_new_renderbuffer(struct gl_context *ctx, GLuint name,
break;
default:
_mesa_warning(ctx, "Bad pixel format in xmesa_new_renderbuffer");
- xrb->Base.Base.Format = MESA_FORMAT_ARGB8888_UNORM;
+ xrb->Base.Base.Format = MESA_FORMAT_BGRA8888_UNORM;
break;
}
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index 15c4853..2b264aa 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -629,7 +629,7 @@ _mesa_print_texture(struct gl_context *ctx, struct gl_texture_image *img)
c = 3;
break;
case MESA_FORMAT_RGBA8888_UNORM:
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
c = 4;
break;
default:
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 32c071e..24ce2ee 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -669,7 +669,7 @@ is_format_color_renderable(const struct gl_context *ctx, gl_format format, GLenu
break;
}
- if (format == MESA_FORMAT_ARGB2101010_UNORM && internalFormat != GL_RGB10_A2) {
+ if (format == MESA_FORMAT_BGRA2101010_UNORM && internalFormat != GL_RGB10_A2) {
return GL_FALSE;
}
diff --git a/src/mesa/main/format_pack.c b/src/mesa/main/format_pack.c
index b1f8329..8dd5b37 100644
--- a/src/mesa/main/format_pack.c
+++ b/src/mesa/main/format_pack.c
@@ -179,7 +179,7 @@ pack_row_float_RGBA8888_REV(GLuint n, const GLfloat src[][4], void *dst)
/*
- * MESA_FORMAT_ARGB8888_UNORM
+ * MESA_FORMAT_BGRA8888_UNORM
*/
static void
@@ -222,7 +222,7 @@ pack_row_float_ARGB8888(GLuint n, const GLfloat src[][4], void *dst)
/*
- * MESA_FORMAT_ARGB8888_REV_UNORM
+ * MESA_FORMAT_BGRA8888_REV_UNORM
*/
static void
@@ -265,7 +265,7 @@ pack_row_float_ARGB8888_REV(GLuint n, const GLfloat src[][4], void *dst)
/*
- * MESA_FORMAT_XRGB8888_UNORM
+ * MESA_FORMAT_BGRX8888_UNORM
*/
static void
@@ -307,7 +307,7 @@ pack_row_float_XRGB8888(GLuint n, const GLfloat src[][4], void *dst)
/*
- * MESA_FORMAT_XRGB8888_REV_UNORM
+ * MESA_FORMAT_BGRX8888_REV_UNORM
*/
static void
@@ -536,7 +536,7 @@ pack_row_float_RGB565_REV(GLuint n, const GLfloat src[][4], void *dst)
/*
- * MESA_FORMAT_ARGB4444_UNORM
+ * MESA_FORMAT_BGRA4444_UNORM
*/
static void
@@ -558,7 +558,7 @@ pack_float_ARGB4444(const GLfloat src[4], void *dst)
/*
- * MESA_FORMAT_ARGB4444_REV_UNORM
+ * MESA_FORMAT_BGRA4444_REV_UNORM
*/
static void
@@ -602,7 +602,7 @@ pack_float_RGBA5551(const GLfloat src[4], void *dst)
/*
- * MESA_FORMAT_ARGB1555_UNORM
+ * MESA_FORMAT_BGRA1555_UNORM
*/
static void
@@ -621,7 +621,7 @@ pack_float_ARGB1555(const GLfloat src[4], void *dst)
}
-/* MESA_FORMAT_ARGB1555_REV_UNORM */
+/* MESA_FORMAT_BGRA1555_REV_UNORM */
static void
pack_ubyte_ARGB1555_REV(const GLubyte src[4], void *dst)
@@ -980,7 +980,7 @@ pack_float_RG1616(const GLfloat src[4], void *dst)
}
-/* MESA_FORMAT_ARGB2101010_UNORM */
+/* MESA_FORMAT_BGRA2101010_UNORM */
static void
pack_ubyte_ARGB2101010(const GLubyte src[4], void *dst)
@@ -1006,7 +1006,7 @@ pack_float_ARGB2101010(const GLfloat src[4], void *dst)
}
-/* MESA_FORMAT_ABGR2101010_UINT */
+/* MESA_FORMAT_RGBA2101010_UINT */
static void
pack_ubyte_ABGR2101010_UINT(const GLubyte src[4], void *dst)
@@ -1671,7 +1671,7 @@ pack_float_R11_G11_B10_FLOAT(const GLfloat src[4], void *dst)
/*
- * MESA_FORMAT_XRGB4444_UNORM
+ * MESA_FORMAT_BGRX4444_UNORM
*/
static void
@@ -1691,7 +1691,7 @@ pack_float_XRGB4444_UNORM(const GLfloat src[4], void *dst)
/*
- * MESA_FORMAT_XRGB1555_UNORM
+ * MESA_FORMAT_BGRX1555_UNORM
*/
static void
@@ -1740,7 +1740,7 @@ pack_float_XBGR8888_SRGB(const GLfloat src[4], void *dst)
}
-/* MESA_FORMAT_XRGB2101010_UNORM */
+/* MESA_FORMAT_BGRX2101010_UNORM */
static void
pack_ubyte_XRGB2101010_UNORM(const GLubyte src[4], void *dst)
@@ -1841,21 +1841,21 @@ _mesa_get_pack_ubyte_rgba_function(gl_format format)
table[MESA_FORMAT_RGBA8888_UNORM] = pack_ubyte_RGBA8888;
table[MESA_FORMAT_RGBA8888_REV_UNORM] = pack_ubyte_RGBA8888_REV;
- table[MESA_FORMAT_ARGB8888_UNORM] = pack_ubyte_ARGB8888;
- table[MESA_FORMAT_ARGB8888_REV_UNORM] = pack_ubyte_ARGB8888_REV;
+ table[MESA_FORMAT_BGRA8888_UNORM] = pack_ubyte_ARGB8888;
+ table[MESA_FORMAT_BGRA8888_REV_UNORM] = pack_ubyte_ARGB8888_REV;
table[MESA_FORMAT_RGBX8888_UNORM] = pack_ubyte_RGBA8888; /* reused */
table[MESA_FORMAT_RGBX8888_REV_UNORM] = pack_ubyte_RGBA8888_REV; /* reused */
- table[MESA_FORMAT_XRGB8888_UNORM] = pack_ubyte_XRGB8888;
- table[MESA_FORMAT_XRGB8888_REV_UNORM] = pack_ubyte_XRGB8888_REV;
+ table[MESA_FORMAT_BGRX8888_UNORM] = pack_ubyte_XRGB8888;
+ table[MESA_FORMAT_BGRX8888_REV_UNORM] = pack_ubyte_XRGB8888_REV;
table[MESA_FORMAT_RGB888] = pack_ubyte_RGB888;
table[MESA_FORMAT_BGR888] = pack_ubyte_BGR888;
table[MESA_FORMAT_RGB565_UNORM] = pack_ubyte_RGB565;
table[MESA_FORMAT_RGB565_REV_UNORM] = pack_ubyte_RGB565_REV;
- table[MESA_FORMAT_ARGB4444_UNORM] = pack_ubyte_ARGB4444;
- table[MESA_FORMAT_ARGB4444_REV_UNORM] = pack_ubyte_ARGB4444_REV;
+ table[MESA_FORMAT_BGRA4444_UNORM] = pack_ubyte_ARGB4444;
+ table[MESA_FORMAT_BGRA4444_REV_UNORM] = pack_ubyte_ARGB4444_REV;
table[MESA_FORMAT_RGBA5551_UNORM] = pack_ubyte_RGBA5551;
- table[MESA_FORMAT_ARGB1555_UNORM] = pack_ubyte_ARGB1555;
- table[MESA_FORMAT_ARGB1555_REV_UNORM] = pack_ubyte_ARGB1555_REV;
+ table[MESA_FORMAT_BGRA1555_UNORM] = pack_ubyte_ARGB1555;
+ table[MESA_FORMAT_BGRA1555_REV_UNORM] = pack_ubyte_ARGB1555_REV;
table[MESA_FORMAT_AL44_UNORM] = pack_ubyte_AL44;
table[MESA_FORMAT_AL88_UNORM] = pack_ubyte_AL88;
table[MESA_FORMAT_AL88_REV_UNORM] = pack_ubyte_AL88_REV;
@@ -1876,8 +1876,8 @@ _mesa_get_pack_ubyte_rgba_function(gl_format format)
table[MESA_FORMAT_R16_UNORM] = pack_ubyte_R16;
table[MESA_FORMAT_GR1616_UNORM] = pack_ubyte_GR1616;
table[MESA_FORMAT_RG1616_UNORM] = pack_ubyte_RG1616;
- table[MESA_FORMAT_ARGB2101010_UNORM] = pack_ubyte_ARGB2101010;
- table[MESA_FORMAT_ABGR2101010_UINT] = pack_ubyte_ABGR2101010_UINT;
+ table[MESA_FORMAT_BGRA2101010_UNORM] = pack_ubyte_ARGB2101010;
+ table[MESA_FORMAT_RGBA2101010_UINT] = pack_ubyte_ABGR2101010_UINT;
/* should never convert RGBA to these formats */
table[MESA_FORMAT_Z24_UNORM_S8_UINT] = NULL;
@@ -1962,13 +1962,13 @@ _mesa_get_pack_ubyte_rgba_function(gl_format format)
table[MESA_FORMAT_RGB9_E5_FLOAT] = pack_ubyte_RGB9_E5_FLOAT;
table[MESA_FORMAT_R11_G11_B10_FLOAT] = pack_ubyte_R11_G11_B10_FLOAT;
- table[MESA_FORMAT_XRGB4444_UNORM] = pack_ubyte_XRGB4444_UNORM;
- table[MESA_FORMAT_XRGB1555_UNORM] = pack_ubyte_XRGB1555_UNORM;
+ table[MESA_FORMAT_BGRX4444_UNORM] = pack_ubyte_XRGB4444_UNORM;
+ table[MESA_FORMAT_BGRX1555_UNORM] = pack_ubyte_XRGB1555_UNORM;
table[MESA_FORMAT_XBGR8888_SNORM] = NULL;
table[MESA_FORMAT_XBGR8888_SRGB] = NULL;
table[MESA_FORMAT_XBGR8888_UINT] = NULL;
table[MESA_FORMAT_XBGR8888_SINT] = NULL;
- table[MESA_FORMAT_XRGB2101010_UNORM] = pack_ubyte_XRGB2101010_UNORM;
+ table[MESA_FORMAT_BGRX2101010_UNORM] = pack_ubyte_XRGB2101010_UNORM;
table[MESA_FORMAT_XBGR16161616_UNORM] = pack_ubyte_XBGR16161616_UNORM;
table[MESA_FORMAT_XBGR16161616_SNORM] = NULL;
table[MESA_FORMAT_XBGR16161616_FLOAT] = NULL;
@@ -2002,21 +2002,21 @@ _mesa_get_pack_float_rgba_function(gl_format format)
table[MESA_FORMAT_RGBA8888_UNORM] = pack_float_RGBA8888;
table[MESA_FORMAT_RGBA8888_REV_UNORM] = pack_float_RGBA8888_REV;
- table[MESA_FORMAT_ARGB8888_UNORM] = pack_float_ARGB8888;
- table[MESA_FORMAT_ARGB8888_REV_UNORM] = pack_float_ARGB8888_REV;
+ table[MESA_FORMAT_BGRA8888_UNORM] = pack_float_ARGB8888;
+ table[MESA_FORMAT_BGRA8888_REV_UNORM] = pack_float_ARGB8888_REV;
table[MESA_FORMAT_RGBX8888_UNORM] = pack_float_RGBA8888; /* reused */
table[MESA_FORMAT_RGBX8888_REV_UNORM] = pack_float_RGBA8888_REV; /* reused */
- table[MESA_FORMAT_XRGB8888_UNORM] = pack_float_XRGB8888;
- table[MESA_FORMAT_XRGB8888_REV_UNORM] = pack_float_XRGB8888_REV;
+ table[MESA_FORMAT_BGRX8888_UNORM] = pack_float_XRGB8888;
+ table[MESA_FORMAT_BGRX8888_REV_UNORM] = pack_float_XRGB8888_REV;
table[MESA_FORMAT_RGB888] = pack_float_RGB888;
table[MESA_FORMAT_BGR888] = pack_float_BGR888;
table[MESA_FORMAT_RGB565_UNORM] = pack_float_RGB565;
table[MESA_FORMAT_RGB565_REV_UNORM] = pack_float_RGB565_REV;
- table[MESA_FORMAT_ARGB4444_UNORM] = pack_float_ARGB4444;
- table[MESA_FORMAT_ARGB4444_REV_UNORM] = pack_float_ARGB4444_REV;
+ table[MESA_FORMAT_BGRA4444_UNORM] = pack_float_ARGB4444;
+ table[MESA_FORMAT_BGRA4444_REV_UNORM] = pack_float_ARGB4444_REV;
table[MESA_FORMAT_RGBA5551_UNORM] = pack_float_RGBA5551;
- table[MESA_FORMAT_ARGB1555_UNORM] = pack_float_ARGB1555;
- table[MESA_FORMAT_ARGB1555_REV_UNORM] = pack_float_ARGB1555_REV;
+ table[MESA_FORMAT_BGRA1555_UNORM] = pack_float_ARGB1555;
+ table[MESA_FORMAT_BGRA1555_REV_UNORM] = pack_float_ARGB1555_REV;
table[MESA_FORMAT_AL44_UNORM] = pack_float_AL44;
table[MESA_FORMAT_AL88_UNORM] = pack_float_AL88;
@@ -2038,8 +2038,8 @@ _mesa_get_pack_float_rgba_function(gl_format format)
table[MESA_FORMAT_R16_UNORM] = pack_float_R16;
table[MESA_FORMAT_GR1616_UNORM] = pack_float_GR1616;
table[MESA_FORMAT_RG1616_UNORM] = pack_float_RG1616;
- table[MESA_FORMAT_ARGB2101010_UNORM] = pack_float_ARGB2101010;
- table[MESA_FORMAT_ABGR2101010_UINT] = pack_float_ABGR2101010_UINT;
+ table[MESA_FORMAT_BGRA2101010_UNORM] = pack_float_ARGB2101010;
+ table[MESA_FORMAT_RGBA2101010_UINT] = pack_float_ABGR2101010_UINT;
/* should never convert RGBA to these formats */
table[MESA_FORMAT_Z24_UNORM_S8_UINT] = NULL;
@@ -2120,13 +2120,13 @@ _mesa_get_pack_float_rgba_function(gl_format format)
table[MESA_FORMAT_RGB9_E5_FLOAT] = pack_float_RGB9_E5_FLOAT;
table[MESA_FORMAT_R11_G11_B10_FLOAT] = pack_float_R11_G11_B10_FLOAT;
- table[MESA_FORMAT_XRGB4444_UNORM] = pack_float_XRGB4444_UNORM;
- table[MESA_FORMAT_XRGB1555_UNORM] = pack_float_XRGB1555_UNORM;
+ table[MESA_FORMAT_BGRX4444_UNORM] = pack_float_XRGB4444_UNORM;
+ table[MESA_FORMAT_BGRX1555_UNORM] = pack_float_XRGB1555_UNORM;
table[MESA_FORMAT_XBGR8888_SNORM] = pack_float_XBGR8888_SNORM;
table[MESA_FORMAT_XBGR8888_SRGB] = pack_float_XBGR8888_SRGB;
table[MESA_FORMAT_XBGR8888_UINT] = NULL;
table[MESA_FORMAT_XBGR8888_SINT] = NULL;
- table[MESA_FORMAT_XRGB2101010_UNORM] = pack_float_XRGB2101010_UNORM;
+ table[MESA_FORMAT_BGRX2101010_UNORM] = pack_float_XRGB2101010_UNORM;
table[MESA_FORMAT_XBGR16161616_UNORM] = pack_float_XBGR16161616_UNORM;
table[MESA_FORMAT_XBGR16161616_SNORM] = pack_float_XBGR16161616_SNORM;
table[MESA_FORMAT_XBGR16161616_FLOAT] = pack_float_XBGR16161616_FLOAT;
@@ -2158,12 +2158,12 @@ get_pack_float_rgba_row_function(gl_format format)
table[MESA_FORMAT_RGBA8888_UNORM] = pack_row_float_RGBA8888;
table[MESA_FORMAT_RGBA8888_REV_UNORM] = pack_row_float_RGBA8888_REV;
- table[MESA_FORMAT_ARGB8888_UNORM] = pack_row_float_ARGB8888;
- table[MESA_FORMAT_ARGB8888_REV_UNORM] = pack_row_float_ARGB8888_REV;
+ table[MESA_FORMAT_BGRA8888_UNORM] = pack_row_float_ARGB8888;
+ table[MESA_FORMAT_BGRA8888_REV_UNORM] = pack_row_float_ARGB8888_REV;
table[MESA_FORMAT_RGBX8888_UNORM] = pack_row_float_RGBA8888; /* reused */
table[MESA_FORMAT_RGBX8888_REV_UNORM] = pack_row_float_RGBA8888_REV; /* reused */
- table[MESA_FORMAT_XRGB8888_UNORM] = pack_row_float_XRGB8888;
- table[MESA_FORMAT_XRGB8888_REV_UNORM] = pack_row_float_XRGB8888_REV;
+ table[MESA_FORMAT_BGRX8888_UNORM] = pack_row_float_XRGB8888;
+ table[MESA_FORMAT_BGRX8888_REV_UNORM] = pack_row_float_XRGB8888_REV;
table[MESA_FORMAT_RGB888] = pack_row_float_RGB888;
table[MESA_FORMAT_BGR888] = pack_row_float_BGR888;
table[MESA_FORMAT_RGB565_UNORM] = pack_row_float_RGB565;
@@ -2191,12 +2191,12 @@ get_pack_ubyte_rgba_row_function(gl_format format)
table[MESA_FORMAT_RGBA8888_UNORM] = pack_row_ubyte_RGBA8888;
table[MESA_FORMAT_RGBA8888_REV_UNORM] = pack_row_ubyte_RGBA8888_REV;
- table[MESA_FORMAT_ARGB8888_UNORM] = pack_row_ubyte_ARGB8888;
- table[MESA_FORMAT_ARGB8888_REV_UNORM] = pack_row_ubyte_ARGB8888_REV;
+ table[MESA_FORMAT_BGRA8888_UNORM] = pack_row_ubyte_ARGB8888;
+ table[MESA_FORMAT_BGRA8888_REV_UNORM] = pack_row_ubyte_ARGB8888_REV;
table[MESA_FORMAT_RGBX8888_UNORM] = pack_row_ubyte_RGBA8888; /* reused */
table[MESA_FORMAT_RGBX8888_REV_UNORM] = pack_row_ubyte_RGBA8888_REV; /* reused */
- table[MESA_FORMAT_XRGB8888_UNORM] = pack_row_ubyte_XRGB8888;
- table[MESA_FORMAT_XRGB8888_REV_UNORM] = pack_row_ubyte_XRGB8888_REV;
+ table[MESA_FORMAT_BGRX8888_UNORM] = pack_row_ubyte_XRGB8888;
+ table[MESA_FORMAT_BGRX8888_REV_UNORM] = pack_row_ubyte_XRGB8888_REV;
table[MESA_FORMAT_RGB888] = pack_row_ubyte_RGB888;
table[MESA_FORMAT_BGR888] = pack_row_ubyte_BGR888;
table[MESA_FORMAT_RGB565_UNORM] = pack_row_ubyte_RGB565;
diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c
index 2624455..0a0b034 100644
--- a/src/mesa/main/format_unpack.c
+++ b/src/mesa/main/format_unpack.c
@@ -2283,21 +2283,21 @@ get_unpack_rgba_function(gl_format format)
table[MESA_FORMAT_RGBA8888_UNORM] = unpack_RGBA8888;
table[MESA_FORMAT_RGBA8888_REV_UNORM] = unpack_RGBA8888_REV;
- table[MESA_FORMAT_ARGB8888_UNORM] = unpack_ARGB8888;
- table[MESA_FORMAT_ARGB8888_REV_UNORM] = unpack_ARGB8888_REV;
+ table[MESA_FORMAT_BGRA8888_UNORM] = unpack_ARGB8888;
+ table[MESA_FORMAT_BGRA8888_REV_UNORM] = unpack_ARGB8888_REV;
table[MESA_FORMAT_RGBX8888_UNORM] = unpack_RGBX8888;
table[MESA_FORMAT_RGBX8888_REV_UNORM] = unpack_RGBX8888_REV;
- table[MESA_FORMAT_XRGB8888_UNORM] = unpack_XRGB8888;
- table[MESA_FORMAT_XRGB8888_REV_UNORM] = unpack_XRGB8888_REV;
+ table[MESA_FORMAT_BGRX8888_UNORM] = unpack_XRGB8888;
+ table[MESA_FORMAT_BGRX8888_REV_UNORM] = unpack_XRGB8888_REV;
table[MESA_FORMAT_RGB888] = unpack_RGB888;
table[MESA_FORMAT_BGR888] = unpack_BGR888;
table[MESA_FORMAT_RGB565_UNORM] = unpack_RGB565;
table[MESA_FORMAT_RGB565_REV_UNORM] = unpack_RGB565_REV;
- table[MESA_FORMAT_ARGB4444_UNORM] = unpack_ARGB4444;
- table[MESA_FORMAT_ARGB4444_REV_UNORM] = unpack_ARGB4444_REV;
+ table[MESA_FORMAT_BGRA4444_UNORM] = unpack_ARGB4444;
+ table[MESA_FORMAT_BGRA4444_REV_UNORM] = unpack_ARGB4444_REV;
table[MESA_FORMAT_RGBA5551_UNORM] = unpack_RGBA5551;
- table[MESA_FORMAT_ARGB1555_UNORM] = unpack_ARGB1555;
- table[MESA_FORMAT_ARGB1555_REV_UNORM] = unpack_ARGB1555_REV;
+ table[MESA_FORMAT_BGRA1555_UNORM] = unpack_ARGB1555;
+ table[MESA_FORMAT_BGRA1555_REV_UNORM] = unpack_ARGB1555_REV;
table[MESA_FORMAT_AL44_UNORM] = unpack_AL44;
table[MESA_FORMAT_AL88_UNORM] = unpack_AL88;
table[MESA_FORMAT_AL88_REV_UNORM] = unpack_AL88_REV;
@@ -2318,9 +2318,9 @@ get_unpack_rgba_function(gl_format format)
table[MESA_FORMAT_R16_UNORM] = unpack_R16;
table[MESA_FORMAT_GR1616_UNORM] = unpack_GR1616;
table[MESA_FORMAT_RG1616_UNORM] = unpack_RG1616;
- table[MESA_FORMAT_ARGB2101010_UNORM] = unpack_ARGB2101010;
- table[MESA_FORMAT_ARGB2101010_UINT] = unpack_ARGB2101010_UINT;
- table[MESA_FORMAT_ABGR2101010_UINT] = unpack_ABGR2101010_UINT;
+ table[MESA_FORMAT_BGRA2101010_UNORM] = unpack_ARGB2101010;
+ table[MESA_FORMAT_BGRA2101010_UINT] = unpack_ARGB2101010_UINT;
+ table[MESA_FORMAT_RGBA2101010_UINT] = unpack_ABGR2101010_UINT;
table[MESA_FORMAT_Z24_UNORM_S8_UINT] = unpack_Z24_S8;
table[MESA_FORMAT_S8_UINT_Z24_UNORM] = unpack_S8_Z24;
table[MESA_FORMAT_Z16_UNORM] = unpack_Z16;
@@ -2465,13 +2465,13 @@ get_unpack_rgba_function(gl_format format)
table[MESA_FORMAT_Z32_FLOAT] = unpack_Z32_FLOAT;
table[MESA_FORMAT_Z32_FLOAT_X24S8] = unpack_Z32_FLOAT_X24S8;
- table[MESA_FORMAT_XRGB4444_UNORM] = unpack_XRGB4444_UNORM;
- table[MESA_FORMAT_XRGB1555_UNORM] = unpack_XRGB1555_UNORM;
+ table[MESA_FORMAT_BGRX4444_UNORM] = unpack_XRGB4444_UNORM;
+ table[MESA_FORMAT_BGRX1555_UNORM] = unpack_XRGB1555_UNORM;
table[MESA_FORMAT_XBGR8888_SNORM] = unpack_XBGR8888_SNORM;
table[MESA_FORMAT_XBGR8888_SRGB] = unpack_XBGR8888_SRGB;
table[MESA_FORMAT_XBGR8888_UINT] = unpack_XBGR8888_UINT;
table[MESA_FORMAT_XBGR8888_SINT] = unpack_XBGR8888_SINT;
- table[MESA_FORMAT_XRGB2101010_UNORM] = unpack_XRGB2101010_UNORM;
+ table[MESA_FORMAT_BGRX2101010_UNORM] = unpack_XRGB2101010_UNORM;
table[MESA_FORMAT_XBGR16161616_UNORM] = unpack_XBGR16161616_UNORM;
table[MESA_FORMAT_XBGR16161616_SNORM] = unpack_XBGR16161616_SNORM;
table[MESA_FORMAT_XBGR16161616_FLOAT] = unpack_XBGR16161616_FLOAT;
@@ -2880,10 +2880,10 @@ _mesa_unpack_ubyte_rgba_row(gl_format format, GLuint n,
case MESA_FORMAT_RGBA8888_REV_UNORM:
unpack_ubyte_RGBA8888_REV(src, dst, n);
break;
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
unpack_ubyte_ARGB8888(src, dst, n);
break;
- case MESA_FORMAT_ARGB8888_REV_UNORM:
+ case MESA_FORMAT_BGRA8888_REV_UNORM:
unpack_ubyte_ARGB8888_REV(src, dst, n);
break;
case MESA_FORMAT_RGBX8888_UNORM:
@@ -2892,10 +2892,10 @@ _mesa_unpack_ubyte_rgba_row(gl_format format, GLuint n,
case MESA_FORMAT_RGBX8888_REV_UNORM:
unpack_ubyte_RGBX8888_REV(src, dst, n);
break;
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
unpack_ubyte_XRGB8888(src, dst, n);
break;
- case MESA_FORMAT_XRGB8888_REV_UNORM:
+ case MESA_FORMAT_BGRX8888_REV_UNORM:
unpack_ubyte_XRGB8888_REV(src, dst, n);
break;
case MESA_FORMAT_RGB888:
@@ -2910,19 +2910,19 @@ _mesa_unpack_ubyte_rgba_row(gl_format format, GLuint n,
case MESA_FORMAT_RGB565_REV_UNORM:
unpack_ubyte_RGB565_REV(src, dst, n);
break;
- case MESA_FORMAT_ARGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
unpack_ubyte_ARGB4444(src, dst, n);
break;
- case MESA_FORMAT_ARGB4444_REV_UNORM:
+ case MESA_FORMAT_BGRA4444_REV_UNORM:
unpack_ubyte_ARGB4444_REV(src, dst, n);
break;
case MESA_FORMAT_RGBA5551_UNORM:
unpack_ubyte_RGBA5551(src, dst, n);
break;
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
unpack_ubyte_ARGB1555(src, dst, n);
break;
- case MESA_FORMAT_ARGB1555_REV_UNORM:
+ case MESA_FORMAT_BGRA1555_REV_UNORM:
unpack_ubyte_ARGB1555_REV(src, dst, n);
break;
case MESA_FORMAT_AL44_UNORM:
@@ -3609,11 +3609,11 @@ _mesa_unpack_uint_rgba_row(gl_format format, GLuint n,
unpack_int_rgba_RGBA_INT8(src, dst, n);
break;
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
unpack_int_rgba_ARGB8888(src, dst, n);
break;
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
unpack_int_rgba_XRGB8888(src, dst, n);
break;
@@ -3749,15 +3749,15 @@ _mesa_unpack_uint_rgba_row(gl_format format, GLuint n,
unpack_int_rgba_INTENSITY_INT8(src, dst, n);
break;
- case MESA_FORMAT_ARGB2101010_UINT:
+ case MESA_FORMAT_BGRA2101010_UINT:
unpack_int_rgba_ARGB2101010_UINT(src, dst, n);
break;
- case MESA_FORMAT_ABGR2101010_UINT:
+ case MESA_FORMAT_RGBA2101010_UINT:
unpack_int_rgba_ABGR2101010_UINT(src, dst, n);
break;
- case MESA_FORMAT_ARGB2101010_UNORM:
+ case MESA_FORMAT_BGRA2101010_UNORM:
unpack_int_rgba_ARGB2101010(src, dst, n);
break;
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 878da8a..7232a82 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -106,8 +106,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_ARGB8888_UNORM, /* Name */
- "MESA_FORMAT_ARGB8888_UNORM", /* StrName */
+ MESA_FORMAT_BGRA8888_UNORM, /* Name */
+ "MESA_FORMAT_BGRA8888_UNORM", /* 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_UNORM, /* Name */
- "MESA_FORMAT_ARGB8888_REV_UNORM", /* StrName */
+ MESA_FORMAT_BGRA8888_REV_UNORM, /* Name */
+ "MESA_FORMAT_BGRA8888_REV_UNORM", /* StrName */
GL_RGBA, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 8, /* 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_UNORM, /* Name */
- "MESA_FORMAT_XRGB8888_UNORM", /* StrName */
+ MESA_FORMAT_BGRX8888_UNORM, /* Name */
+ "MESA_FORMAT_BGRX8888_UNORM", /* 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_UNORM, /* Name */
- "MESA_FORMAT_XRGB8888_REV_UNORM", /* StrName */
+ MESA_FORMAT_BGRX8888_REV_UNORM, /* Name */
+ "MESA_FORMAT_BGRX8888_REV_UNORM", /* StrName */
GL_RGB, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */
@@ -196,8 +196,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 2 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_ARGB4444_UNORM, /* Name */
- "MESA_FORMAT_ARGB4444_UNORM", /* StrName */
+ MESA_FORMAT_BGRA4444_UNORM, /* Name */
+ "MESA_FORMAT_BGRA4444_UNORM", /* StrName */
GL_RGBA, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */
@@ -205,8 +205,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 2 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_ARGB4444_REV_UNORM, /* Name */
- "MESA_FORMAT_ARGB4444_REV_UNORM", /* StrName */
+ MESA_FORMAT_BGRA4444_REV_UNORM, /* Name */
+ "MESA_FORMAT_BGRA4444_REV_UNORM", /* StrName */
GL_RGBA, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */
@@ -223,8 +223,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 2 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_ARGB1555_UNORM, /* Name */
- "MESA_FORMAT_ARGB1555_UNORM", /* StrName */
+ MESA_FORMAT_BGRA1555_UNORM, /* Name */
+ "MESA_FORMAT_BGRA1555_UNORM", /* StrName */
GL_RGBA, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */
@@ -232,8 +232,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 2 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_ARGB1555_REV_UNORM, /* Name */
- "MESA_FORMAT_ARGB1555_REV_UNORM", /* StrName */
+ MESA_FORMAT_BGRA1555_REV_UNORM, /* Name */
+ "MESA_FORMAT_BGRA1555_REV_UNORM", /* StrName */
GL_RGBA, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */
@@ -421,8 +421,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 4
},
{
- MESA_FORMAT_ARGB2101010_UNORM,
- "MESA_FORMAT_ARGB2101010_UNORM",
+ MESA_FORMAT_BGRA2101010_UNORM,
+ "MESA_FORMAT_BGRA2101010_UNORM",
GL_RGBA,
GL_UNSIGNED_NORMALIZED,
10, 10, 10, 2,
@@ -1611,8 +1611,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 8 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_ARGB2101010_UINT,
- "MESA_FORMAT_ARGB2101010_UINT",
+ MESA_FORMAT_BGRA2101010_UINT,
+ "MESA_FORMAT_BGRA2101010_UINT",
GL_RGBA,
GL_UNSIGNED_INT,
10, 10, 10, 2,
@@ -1620,8 +1620,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 4
},
{
- MESA_FORMAT_ABGR2101010_UINT,
- "MESA_FORMAT_ABGR2101010_UINT",
+ MESA_FORMAT_RGBA2101010_UINT,
+ "MESA_FORMAT_RGBA2101010_UINT",
GL_RGBA,
GL_UNSIGNED_INT,
10, 10, 10, 2,
@@ -1629,8 +1629,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 4
},
{
- MESA_FORMAT_XRGB4444_UNORM,
- "MESA_FORMAT_XRGB4444_UNORM",
+ MESA_FORMAT_BGRX4444_UNORM,
+ "MESA_FORMAT_BGRX4444_UNORM",
GL_RGB,
GL_UNSIGNED_NORMALIZED,
4, 4, 4, 0,
@@ -1638,8 +1638,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 2
},
{
- MESA_FORMAT_XRGB1555_UNORM,
- "MESA_FORMAT_XRGB1555_UNORM",
+ MESA_FORMAT_BGRX1555_UNORM,
+ "MESA_FORMAT_BGRX1555_UNORM",
GL_RGB,
GL_UNSIGNED_NORMALIZED,
5, 5, 5, 0,
@@ -1683,8 +1683,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
1, 1, 4
},
{
- MESA_FORMAT_XRGB2101010_UNORM,
- "MESA_FORMAT_XRGB2101010_UNORM",
+ MESA_FORMAT_BGRX2101010_UNORM,
+ "MESA_FORMAT_BGRX2101010_UNORM",
GL_RGB,
GL_UNSIGNED_NORMALIZED,
10, 10, 10, 0,
@@ -2007,7 +2007,7 @@ _mesa_get_srgb_format_linear(gl_format format)
format = MESA_FORMAT_RGBA8888_UNORM;
break;
case MESA_FORMAT_SARGB8:
- format = MESA_FORMAT_ARGB8888_UNORM;
+ format = MESA_FORMAT_BGRA8888_UNORM;
break;
case MESA_FORMAT_SL8:
format = MESA_FORMAT_L8_UNORM;
@@ -2315,12 +2315,12 @@ _mesa_format_to_type_and_comps(gl_format format,
switch (format) {
case MESA_FORMAT_RGBA8888_UNORM:
case MESA_FORMAT_RGBA8888_REV_UNORM:
- case MESA_FORMAT_ARGB8888_UNORM:
- case MESA_FORMAT_ARGB8888_REV_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
+ case MESA_FORMAT_BGRA8888_REV_UNORM:
case MESA_FORMAT_RGBX8888_UNORM:
case MESA_FORMAT_RGBX8888_REV_UNORM:
- case MESA_FORMAT_XRGB8888_UNORM:
- case MESA_FORMAT_XRGB8888_REV_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
+ case MESA_FORMAT_BGRX8888_REV_UNORM:
*datatype = GL_UNSIGNED_BYTE;
*comps = 4;
return;
@@ -2335,21 +2335,21 @@ _mesa_format_to_type_and_comps(gl_format format,
*comps = 3;
return;
- case MESA_FORMAT_ARGB4444_UNORM:
- case MESA_FORMAT_ARGB4444_REV_UNORM:
- case MESA_FORMAT_XRGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
+ case MESA_FORMAT_BGRA4444_REV_UNORM:
+ case MESA_FORMAT_BGRX4444_UNORM:
*datatype = GL_UNSIGNED_SHORT_4_4_4_4;
*comps = 4;
return;
- case MESA_FORMAT_ARGB1555_UNORM:
- case MESA_FORMAT_ARGB1555_REV_UNORM:
- case MESA_FORMAT_XRGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
+ case MESA_FORMAT_BGRA1555_REV_UNORM:
+ case MESA_FORMAT_BGRX1555_UNORM:
*datatype = GL_UNSIGNED_SHORT_1_5_5_5_REV;
*comps = 4;
return;
- case MESA_FORMAT_ARGB2101010_UNORM:
+ case MESA_FORMAT_BGRA2101010_UNORM:
*datatype = GL_UNSIGNED_INT_2_10_10_10_REV;
*comps = 4;
return;
@@ -2766,8 +2766,8 @@ _mesa_format_to_type_and_comps(gl_format format,
*comps = 3;
return;
- case MESA_FORMAT_ARGB2101010_UINT:
- case MESA_FORMAT_ABGR2101010_UINT:
+ case MESA_FORMAT_BGRA2101010_UINT:
+ case MESA_FORMAT_RGBA2101010_UINT:
*datatype = GL_UNSIGNED_INT_2_10_10_10_REV;
*comps = 4;
return;
@@ -2784,7 +2784,7 @@ _mesa_format_to_type_and_comps(gl_format format,
*comps = 4;
return;
- case MESA_FORMAT_XRGB2101010_UNORM:
+ case MESA_FORMAT_BGRX2101010_UNORM:
*datatype = GL_UNSIGNED_INT_2_10_10_10_REV;
*comps = 4;
return;
@@ -2916,7 +2916,7 @@ _mesa_format_matches_format_and_type(gl_format gl_format,
return GL_FALSE;
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
case MESA_FORMAT_SARGB8:
if (format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV &&
!swapBytes)
@@ -2930,7 +2930,7 @@ _mesa_format_matches_format_and_type(gl_format gl_format,
return GL_FALSE;
- case MESA_FORMAT_ARGB8888_REV_UNORM:
+ case MESA_FORMAT_BGRA8888_REV_UNORM:
if (format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8 && !swapBytes)
return GL_TRUE;
@@ -2947,8 +2947,8 @@ _mesa_format_matches_format_and_type(gl_format gl_format,
case MESA_FORMAT_RGBX8888_REV_UNORM:
return GL_FALSE;
- case MESA_FORMAT_XRGB8888_UNORM:
- case MESA_FORMAT_XRGB8888_REV_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
+ case MESA_FORMAT_BGRX8888_REV_UNORM:
return GL_FALSE;
case MESA_FORMAT_RGB888:
@@ -2968,22 +2968,22 @@ _mesa_format_matches_format_and_type(gl_format gl_format,
*/
return GL_FALSE;
- case MESA_FORMAT_ARGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
return format == GL_BGRA && type == GL_UNSIGNED_SHORT_4_4_4_4_REV &&
!swapBytes;
- case MESA_FORMAT_ARGB4444_REV_UNORM:
+ case MESA_FORMAT_BGRA4444_REV_UNORM:
return GL_FALSE;
case MESA_FORMAT_RGBA5551_UNORM:
return format == GL_RGBA && type == GL_UNSIGNED_SHORT_5_5_5_1 &&
!swapBytes;
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
return format == GL_BGRA && type == GL_UNSIGNED_SHORT_1_5_5_5_REV &&
!swapBytes;
- case MESA_FORMAT_ARGB1555_REV_UNORM:
+ case MESA_FORMAT_BGRA1555_REV_UNORM:
return GL_FALSE;
case MESA_FORMAT_AL44_UNORM:
@@ -3041,7 +3041,7 @@ _mesa_format_matches_format_and_type(gl_format gl_format,
case MESA_FORMAT_RG1616_UNORM:
return GL_FALSE;
- case MESA_FORMAT_ARGB2101010_UNORM:
+ case MESA_FORMAT_BGRA2101010_UNORM:
return format == GL_BGRA && type == GL_UNSIGNED_INT_2_10_10_10_REV &&
!swapBytes;
@@ -3321,12 +3321,12 @@ _mesa_format_matches_format_and_type(gl_format gl_format,
return format == GL_INTENSITY && type == GL_SHORT && littleEndian &&
!swapBytes;
- case MESA_FORMAT_ARGB2101010_UINT:
+ case MESA_FORMAT_BGRA2101010_UINT:
return (format == GL_BGRA_INTEGER_EXT &&
type == GL_UNSIGNED_INT_2_10_10_10_REV &&
!swapBytes);
- case MESA_FORMAT_ABGR2101010_UINT:
+ case MESA_FORMAT_RGBA2101010_UINT:
return (format == GL_RGBA_INTEGER_EXT &&
type == GL_UNSIGNED_INT_2_10_10_10_REV &&
!swapBytes);
@@ -3346,13 +3346,13 @@ _mesa_format_matches_format_and_type(gl_format gl_format,
return format == GL_DEPTH_STENCIL &&
type == GL_FLOAT_32_UNSIGNED_INT_24_8_REV && !swapBytes;
- case MESA_FORMAT_XRGB4444_UNORM:
- case MESA_FORMAT_XRGB1555_UNORM:
+ case MESA_FORMAT_BGRX4444_UNORM:
+ case MESA_FORMAT_BGRX1555_UNORM:
case MESA_FORMAT_XBGR8888_SNORM:
case MESA_FORMAT_XBGR8888_SRGB:
case MESA_FORMAT_XBGR8888_UINT:
case MESA_FORMAT_XBGR8888_SINT:
- case MESA_FORMAT_XRGB2101010_UNORM:
+ case MESA_FORMAT_BGRX2101010_UNORM:
case MESA_FORMAT_XBGR16161616_UNORM:
case MESA_FORMAT_XBGR16161616_SNORM:
case MESA_FORMAT_XBGR16161616_FLOAT:
diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h
index 94fc7a0..f224ed5 100644
--- a/src/mesa/main/formats.h
+++ b/src/mesa/main/formats.h
@@ -62,67 +62,68 @@ typedef enum
MESA_FORMAT_NONE = 0,
/**
- * \name Basic hardware formats
+ * \name Basic API user space data formats
+ * Please refer to API documentation for more information on format
+ * packing
*/
/*@{*/
- /* msb <------ TEXEL BITS -----------> lsb */
- /* ---- ---- ---- ---- ---- ---- ---- ---- */
- MESA_FORMAT_RGBA8888_UNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */
- MESA_FORMAT_RGBA8888_REV_UNORM, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */
- MESA_FORMAT_ARGB8888_UNORM, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */
- MESA_FORMAT_ARGB8888_REV_UNORM, /* BBBB BBBB GGGG GGGG RRRR RRRR AAAA AAAA */
- MESA_FORMAT_RGBX8888_UNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB XXXX XXXX */
- MESA_FORMAT_RGBX8888_REV_UNORM, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */
- MESA_FORMAT_XRGB8888_UNORM, /* xxxx xxxx RRRR RRRR GGGG GGGG BBBB BBBB */
- MESA_FORMAT_XRGB8888_REV_UNORM, /* BBBB BBBB GGGG GGGG RRRR RRRR xxxx xxxx */
- MESA_FORMAT_RGB888, /* RRRR RRRR GGGG GGGG BBBB BBBB */
- MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */
- MESA_FORMAT_RGB565_UNORM, /* RRRR RGGG GGGB BBBB */
- MESA_FORMAT_RGB565_REV_UNORM, /* GGGB BBBB RRRR RGGG */
- MESA_FORMAT_ARGB4444_UNORM, /* AAAA RRRR GGGG BBBB */
- MESA_FORMAT_ARGB4444_REV_UNORM, /* GGGG BBBB AAAA RRRR */
- MESA_FORMAT_RGBA5551_UNORM, /* RRRR RGGG GGBB BBBA */
- MESA_FORMAT_ARGB1555_UNORM, /* ARRR RRGG GGGB BBBB */
- MESA_FORMAT_ARGB1555_REV_UNORM, /* GGGB BBBB ARRR RRGG */
- MESA_FORMAT_AL44_UNORM, /* AAAA LLLL */
- MESA_FORMAT_AL88_UNORM, /* AAAA AAAA LLLL LLLL */
- MESA_FORMAT_AL88_REV_UNORM, /* LLLL LLLL AAAA AAAA */
- MESA_FORMAT_AL1616_UNORM, /* AAAA AAAA AAAA AAAA LLLL LLLL LLLL LLLL */
- MESA_FORMAT_AL1616_REV_UNORM, /* LLLL LLLL LLLL LLLL AAAA AAAA AAAA AAAA */
- MESA_FORMAT_RGB332_UNORM, /* RRRG GGBB */
- MESA_FORMAT_A8_UNORM, /* AAAA AAAA */
- MESA_FORMAT_A16_UNORM, /* AAAA AAAA AAAA AAAA */
- MESA_FORMAT_L8_UNORM, /* LLLL LLLL */
- MESA_FORMAT_L16_UNORM, /* LLLL LLLL LLLL LLLL */
- MESA_FORMAT_I8_UNORM, /* IIII IIII */
- MESA_FORMAT_I16_UNORM, /* IIII IIII IIII IIII */
- MESA_FORMAT_YCBCR, /* YYYY YYYY UorV UorV */
- MESA_FORMAT_YCBCR_REV, /* UorV UorV YYYY YYYY */
- MESA_FORMAT_R8_UNORM, /* RRRR RRRR */
- MESA_FORMAT_GR88_UNORM, /* GGGG GGGG RRRR RRRR */
- MESA_FORMAT_RG88_UNORM, /* RRRR RRRR GGGG GGGG */
- MESA_FORMAT_R16_UNORM, /* RRRR RRRR RRRR RRRR */
- MESA_FORMAT_GR1616_UNORM, /* GGGG GGGG GGGG GGGG RRRR RRRR RRRR RRRR */
- MESA_FORMAT_RG1616_UNORM, /* RRRR RRRR RRRR RRRR GGGG GGGG GGGG GGGG */
- MESA_FORMAT_ARGB2101010_UNORM, /* AARR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */
- MESA_FORMAT_Z24_UNORM_S8_UINT, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ SSSS SSSS */
- MESA_FORMAT_S8_UINT_Z24_UNORM, /* SSSS SSSS ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */
- MESA_FORMAT_Z16_UNORM, /* ZZZZ ZZZZ ZZZZ ZZZZ */
- MESA_FORMAT_X8_Z24_UNORM, /* xxxx xxxx ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */
- MESA_FORMAT_Z24_X8_UNORM, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ xxxx xxxx */
- MESA_FORMAT_Z32_UNORM, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */
- MESA_FORMAT_S8_UNORM, /* SSSS SSSS */
+
+ MESA_FORMAT_RGBA8888_UNORM,
+ MESA_FORMAT_RGBA8888_REV_UNORM,
+ MESA_FORMAT_BGRA8888_UNORM,
+ MESA_FORMAT_BGRA8888_REV_UNORM,
+ MESA_FORMAT_RGBX8888_UNORM,
+ MESA_FORMAT_RGBX8888_REV_UNORM,
+ MESA_FORMAT_BGRX8888_UNORM,
+ MESA_FORMAT_BGRX8888_REV_UNORM,
+ MESA_FORMAT_RGB888,
+ MESA_FORMAT_BGR888,
+ MESA_FORMAT_RGB565_UNORM,
+ MESA_FORMAT_RGB565_REV_UNORM,
+ MESA_FORMAT_BGRA4444_UNORM,
+ MESA_FORMAT_BGRA4444_REV_UNORM,
+ MESA_FORMAT_RGBA5551_UNORM,
+ MESA_FORMAT_BGRA1555_UNORM,
+ MESA_FORMAT_BGRA1555_REV_UNORM,
+ MESA_FORMAT_AL44_UNORM,
+ MESA_FORMAT_AL88_UNORM,
+ MESA_FORMAT_AL88_REV_UNORM,
+ MESA_FORMAT_AL1616_UNORM,
+ MESA_FORMAT_AL1616_REV_UNORM,
+ MESA_FORMAT_RGB332_UNORM,
+ MESA_FORMAT_A8_UNORM,
+ MESA_FORMAT_A16_UNORM,
+ MESA_FORMAT_L8_UNORM,
+ MESA_FORMAT_L16_UNORM,
+ MESA_FORMAT_I8_UNORM,
+ MESA_FORMAT_I16_UNORM,
+ MESA_FORMAT_YCBCR,
+ MESA_FORMAT_YCBCR_REV,
+ MESA_FORMAT_R8_UNORM,
+ MESA_FORMAT_GR88_UNORM,
+ MESA_FORMAT_RG88_UNORM,
+ MESA_FORMAT_R16_UNORM,
+ MESA_FORMAT_GR1616_UNORM,
+ MESA_FORMAT_RG1616_UNORM,
+ MESA_FORMAT_BGRA2101010_UNORM,
+ MESA_FORMAT_Z24_UNORM_S8_UINT,
+ MESA_FORMAT_S8_UINT_Z24_UNORM,
+ MESA_FORMAT_Z16_UNORM,
+ MESA_FORMAT_X8_Z24_UNORM,
+ MESA_FORMAT_Z24_X8_UNORM,
+ MESA_FORMAT_Z32_UNORM,
+ MESA_FORMAT_S8_UNORM,
/*@}*/
/**
* \name 8-bit/channel sRGB formats
*/
/*@{*/
- MESA_FORMAT_SRGB8, /* RRRR RRRR GGGG GGGG BBBB BBBB */
- MESA_FORMAT_SRGBA8, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */
- MESA_FORMAT_SARGB8, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */
- MESA_FORMAT_SL8, /* LLLL LLLL */
- MESA_FORMAT_SLA8, /* AAAA AAAA LLLL LLLL */
+ MESA_FORMAT_SRGB8,
+ MESA_FORMAT_SRGBA8,
+ MESA_FORMAT_SARGB8,
+ MESA_FORMAT_SL8,
+ MESA_FORMAT_SLA8,
MESA_FORMAT_SRGB_DXT1,
MESA_FORMAT_SRGBA_DXT1,
MESA_FORMAT_SRGBA_DXT3,
@@ -225,23 +226,21 @@ typedef enum
MESA_FORMAT_RGB_UINT32,
MESA_FORMAT_RGBA_UINT32,
- /* msb <------ TEXEL BITS -----------> lsb */
- /* ---- ---- ---- ---- ---- ---- ---- ---- */
/**
* \name Signed fixed point texture formats.
*/
/*@{*/
- MESA_FORMAT_DUDV8, /* DUDU DUDU DVDV DVDV */
- MESA_FORMAT_R8_SNORM, /* RRRR RRRR */
- MESA_FORMAT_RG88_REV_SNORM, /* GGGG GGGG RRRR RRRR */
- MESA_FORMAT_RGBX8888_SNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB xxxx xxxx */
- MESA_FORMAT_RGBA8888_SNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */
- MESA_FORMAT_RGBA8888_REV_SNORM,/*AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */
- MESA_FORMAT_R16_SNORM, /* RRRR RRRR RRRR RRRR */
- MESA_FORMAT_GR1616_SNORM, /* GGGG GGGG GGGG GGGG RRRR RRRR RRRR RRRR */
- MESA_FORMAT_RGB_16_SNORM, /* ushort[0]=R, ushort[1]=G, ushort[2]=B */
- MESA_FORMAT_RGBA_16_SNORM, /* ... */
- MESA_FORMAT_RGBA_16_UNORM, /* ... */
+ MESA_FORMAT_DUDV8,
+ MESA_FORMAT_R8_SNORM,
+ MESA_FORMAT_RG88_REV_SNORM,
+ MESA_FORMAT_RGBX8888_SNORM,
+ MESA_FORMAT_RGBA8888_SNORM,
+ MESA_FORMAT_RGBA8888_REV_SNORM,
+ MESA_FORMAT_R16_SNORM,
+ MESA_FORMAT_GR1616_SNORM,
+ MESA_FORMAT_RGB_16_SNORM,
+ MESA_FORMAT_RGBA_16_SNORM,
+ MESA_FORMAT_RGBA_16_UNORM,
/*@}*/
/*@{*/
@@ -270,14 +269,14 @@ typedef enum
MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1,
MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1,
- MESA_FORMAT_A8_SNORM, /* AAAA AAAA */
- MESA_FORMAT_L8_SNORM, /* LLLL LLLL */
- MESA_FORMAT_AL88_SNORM, /* AAAA AAAA LLLL LLLL */
- MESA_FORMAT_I8_SNORM, /* IIII IIII */
- MESA_FORMAT_A16_SNORM, /* AAAA AAAA AAAA AAAA */
- MESA_FORMAT_L16_SNORM, /* LLLL LLLL LLLL LLLL */
- MESA_FORMAT_AL1616_SNORM, /* AAAA AAAA AAAA AAAA LLLL LLLL LLLL LLLL */
- MESA_FORMAT_I16_SNORM, /* IIII IIII IIII IIII */
+ MESA_FORMAT_A8_SNORM,
+ MESA_FORMAT_L8_SNORM,
+ MESA_FORMAT_AL88_SNORM,
+ MESA_FORMAT_I8_SNORM,
+ MESA_FORMAT_A16_SNORM,
+ MESA_FORMAT_L16_SNORM,
+ MESA_FORMAT_AL1616_SNORM,
+ MESA_FORMAT_I16_SNORM,
MESA_FORMAT_RGB9_E5_FLOAT,
MESA_FORMAT_R11_G11_B10_FLOAT,
@@ -285,24 +284,24 @@ typedef enum
MESA_FORMAT_Z32_FLOAT,
MESA_FORMAT_Z32_FLOAT_X24S8,
- MESA_FORMAT_ARGB2101010_UINT,
- MESA_FORMAT_ABGR2101010_UINT,
-
- MESA_FORMAT_XRGB4444_UNORM, /* xxxx RRRR GGGG BBBB */
- MESA_FORMAT_XRGB1555_UNORM, /* xRRR RRGG GGGB BBBB */
- MESA_FORMAT_XBGR8888_SNORM, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */
- MESA_FORMAT_XBGR8888_SRGB, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */
- MESA_FORMAT_XBGR8888_UINT, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */
- MESA_FORMAT_XBGR8888_SINT, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */
- MESA_FORMAT_XRGB2101010_UNORM, /* xxRR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */
- MESA_FORMAT_XBGR16161616_UNORM,/* ushort[3]=x, [2]=B, [1]=G, [0]=R */
- MESA_FORMAT_XBGR16161616_SNORM,/* ... */
- MESA_FORMAT_XBGR16161616_FLOAT,/* ... */
- MESA_FORMAT_XBGR16161616_UINT, /* ... */
- MESA_FORMAT_XBGR16161616_SINT, /* ... */
- MESA_FORMAT_XBGR32323232_FLOAT,/* float[3]=x, [2]=B, [1]=G, [0]=R */
- MESA_FORMAT_XBGR32323232_UINT, /* ... */
- MESA_FORMAT_XBGR32323232_SINT, /* ... */
+ MESA_FORMAT_BGRA2101010_UINT,
+ MESA_FORMAT_RGBA2101010_UINT,
+
+ MESA_FORMAT_BGRX4444_UNORM,
+ MESA_FORMAT_BGRX1555_UNORM,
+ MESA_FORMAT_XBGR8888_SNORM,
+ MESA_FORMAT_XBGR8888_SRGB,
+ MESA_FORMAT_XBGR8888_UINT,
+ MESA_FORMAT_XBGR8888_SINT,
+ MESA_FORMAT_BGRX2101010_UNORM,
+ MESA_FORMAT_XBGR16161616_UNORM,
+ MESA_FORMAT_XBGR16161616_SNORM,
+ MESA_FORMAT_XBGR16161616_FLOAT,
+ MESA_FORMAT_XBGR16161616_UINT,
+ MESA_FORMAT_XBGR16161616_SINT,
+ MESA_FORMAT_XBGR32323232_FLOAT,
+ MESA_FORMAT_XBGR32323232_UINT,
+ MESA_FORMAT_XBGR32323232_SINT,
MESA_FORMAT_COUNT
} gl_format;
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index 78810e5..2a89445 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_UNORM)
+ if (format == MESA_FORMAT_BGRA8888_UNORM)
return GL_BGRA;
else if (format == MESA_FORMAT_RGB565_UNORM)
return GL_BGR;
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index fa75039..a76aa53 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -430,7 +430,7 @@ read_rgba_pixels_swizzle(struct gl_context *ctx,
!ctx->Pack.SwapBytes) {
swizzle_rb = GL_TRUE;
}
- else if (rb->Format == MESA_FORMAT_XRGB8888_UNORM &&
+ else if (rb->Format == MESA_FORMAT_BGRX8888_UNORM &&
format == GL_BGRA &&
type == GL_UNSIGNED_INT_8_8_8_8_REV &&
!ctx->Pack.SwapBytes) {
diff --git a/src/mesa/main/texcompress_etc.c b/src/mesa/main/texcompress_etc.c
index a06d29f..f78872c 100644
--- a/src/mesa/main/texcompress_etc.c
+++ b/src/mesa/main/texcompress_etc.c
@@ -115,7 +115,7 @@ _mesa_texstore_etc1_rgb8(TEXSTORE_PARAMS)
/**
* Decode texture data in format `MESA_FORMAT_ETC1_RGB8` to
- * `MESA_FORMAT_ABGR8888`.
+ * `MESA_FORMAT_RGBA8888`.
*
* The size of the source data must be a multiple of the ETC1 block size,
* which is 8, even if the texture image's dimensions are not aligned to 4.
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index a8698f5..8f68d74 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -70,63 +70,63 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
case 4:
case GL_RGBA:
if (type == GL_UNSIGNED_SHORT_4_4_4_4_REV) {
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA4444_UNORM);
} else if (type == GL_UNSIGNED_SHORT_1_5_5_5_REV) {
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB1555_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA1555_UNORM);
} else if (type == GL_UNSIGNED_INT_2_10_10_10_REV) {
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA2101010_UNORM);
}
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888_UNORM);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA8888_UNORM);
break;
case GL_RGBA8:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888_UNORM);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA8888_UNORM);
break;
case GL_RGB5_A1:
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB1555_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA1555_UNORM);
break;
case GL_RGBA2:
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444_REV_UNORM); /* just to test another format*/
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA4444_REV_UNORM); /* just to test another format*/
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA4444_UNORM);
break;
case GL_RGBA4:
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB4444_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA4444_UNORM);
break;
/* deep RGBA formats */
case GL_RGB10_A2:
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010_UNORM);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA2101010_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA8888_UNORM);
break;
case GL_RGBA12:
case GL_RGBA16:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16_UNORM);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16_UNORM);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888_UNORM);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA8888_UNORM);
break;
/* shallow RGB formats */
case 3:
case GL_RGB:
if (type == GL_UNSIGNED_INT_2_10_10_10_REV) {
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA2101010_UNORM);
}
/* fallthrough */
case GL_RGB8:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888_UNORM);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRX8888_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA8888_UNORM);
break;
case GL_R3_G3_B2:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB332_UNORM);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565_UNORM);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565_REV_UNORM);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888_UNORM);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRX8888_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA8888_UNORM);
break;
case GL_RGB4:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565_REV_UNORM); /* 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_UNORM);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888_UNORM);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRX8888_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA8888_UNORM);
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_UNORM);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRX8888_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA8888_UNORM);
break;
case GL_COMPRESSED_RGBA_ARB:
/* We don't use texture compression for 1D and 1D array textures. */
@@ -255,7 +255,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FXT1);
}
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888_UNORM);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA8888_UNORM);
break;
case GL_RGB565:
@@ -804,12 +804,12 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
break;
case GL_RGB10_A2UI:
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010_UINT);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ABGR2101010_UINT);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA2101010_UINT);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA2101010_UINT);
break;
case GL_BGRA:
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGRA8888_UNORM);
break;
}
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index b05ef7e..42c2a16 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -970,7 +970,7 @@ memcpy_texture(struct gl_context *ctx,
/**
* General-case function for storing a color texture images with
* components that can be represented with ubytes. Example destination
- * texture formats are MESA_FORMAT_ARGB888, ARGB4444, RGB565.
+ * texture formats are MESA_FORMAT_BGRA888, ARGB4444, RGB565.
*/
static GLboolean
store_ubyte_texture(TEXSTORE_PARAMS)
@@ -1254,16 +1254,16 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
{
const GLboolean littleEndian = _mesa_little_endian();
- ASSERT(dstFormat == MESA_FORMAT_ARGB8888_UNORM ||
- dstFormat == MESA_FORMAT_ARGB8888_REV_UNORM ||
- dstFormat == MESA_FORMAT_XRGB8888_UNORM ||
- dstFormat == MESA_FORMAT_XRGB8888_REV_UNORM );
+ ASSERT(dstFormat == MESA_FORMAT_BGRA8888_UNORM ||
+ dstFormat == MESA_FORMAT_BGRA8888_REV_UNORM ||
+ dstFormat == MESA_FORMAT_BGRX8888_UNORM ||
+ dstFormat == MESA_FORMAT_BGRX8888_REV_UNORM );
ASSERT(_mesa_get_format_bytes(dstFormat) == 4);
if (!ctx->_ImageTransferState &&
!srcPacking->SwapBytes &&
- (dstFormat == MESA_FORMAT_ARGB8888_UNORM ||
- dstFormat == MESA_FORMAT_XRGB8888_UNORM) &&
+ (dstFormat == MESA_FORMAT_BGRA8888_UNORM ||
+ dstFormat == MESA_FORMAT_BGRX8888_UNORM) &&
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_UNORM &&
+ dstFormat == MESA_FORMAT_BGRA8888_UNORM &&
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_UNORM &&
+ dstFormat == MESA_FORMAT_BGRA8888_UNORM &&
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_UNORM) ||
- (littleEndian && dstFormat == MESA_FORMAT_XRGB8888_UNORM) ||
- (!littleEndian && dstFormat == MESA_FORMAT_ARGB8888_REV_UNORM) ||
- (!littleEndian && dstFormat == MESA_FORMAT_XRGB8888_REV_UNORM)) {
+ if ((littleEndian && dstFormat == MESA_FORMAT_BGRA8888_UNORM) ||
+ (littleEndian && dstFormat == MESA_FORMAT_BGRX8888_UNORM) ||
+ (!littleEndian && dstFormat == MESA_FORMAT_BGRA8888_REV_UNORM) ||
+ (!littleEndian && dstFormat == MESA_FORMAT_BGRX8888_REV_UNORM)) {
dstmap[3] = 3; /* alpha */
dstmap[2] = 0; /* red */
dstmap[1] = 1; /* green */
dstmap[0] = 2; /* blue */
}
else {
- assert((littleEndian && dstFormat == MESA_FORMAT_ARGB8888_REV_UNORM) ||
- (!littleEndian && dstFormat == MESA_FORMAT_ARGB8888_UNORM) ||
- (littleEndian && dstFormat == MESA_FORMAT_XRGB8888_REV_UNORM) ||
- (!littleEndian && dstFormat == MESA_FORMAT_XRGB8888_UNORM));
+ assert((littleEndian && dstFormat == MESA_FORMAT_BGRA8888_REV_UNORM) ||
+ (!littleEndian && dstFormat == MESA_FORMAT_BGRA8888_UNORM) ||
+ (littleEndian && dstFormat == MESA_FORMAT_BGRX8888_REV_UNORM) ||
+ (!littleEndian && dstFormat == MESA_FORMAT_BGRX8888_UNORM));
dstmap[3] = 2;
dstmap[2] = 1;
dstmap[1] = 0;
@@ -1525,8 +1525,8 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS)
static GLboolean
_mesa_texstore_argb2101010(TEXSTORE_PARAMS)
{
- ASSERT(dstFormat == MESA_FORMAT_ARGB2101010_UNORM ||
- dstFormat == MESA_FORMAT_XRGB2101010_UNORM);
+ ASSERT(dstFormat == MESA_FORMAT_BGRA2101010_UNORM ||
+ dstFormat == MESA_FORMAT_BGRX2101010_UNORM);
ASSERT(_mesa_get_format_bytes(dstFormat) == 4);
{
@@ -3265,7 +3265,7 @@ _mesa_texstore_sargb8(TEXSTORE_PARAMS)
ASSERT(dstFormat == MESA_FORMAT_SARGB8);
/* reuse normal rgba texstore code */
- newDstFormat = MESA_FORMAT_ARGB8888_UNORM;
+ newDstFormat = MESA_FORMAT_BGRA8888_UNORM;
k = _mesa_texstore_argb8888(ctx, dims, baseInternalFormat,
newDstFormat,
@@ -3451,7 +3451,7 @@ _mesa_texstore_argb2101010_uint(TEXSTORE_PARAMS)
{
const GLenum baseFormat = _mesa_get_format_base_format(dstFormat);
- ASSERT(dstFormat == MESA_FORMAT_ARGB2101010_UINT);
+ ASSERT(dstFormat == MESA_FORMAT_BGRA2101010_UINT);
ASSERT(_mesa_get_format_bytes(dstFormat) == 4);
{
@@ -3507,7 +3507,7 @@ _mesa_texstore_abgr2101010_uint(TEXSTORE_PARAMS)
{
const GLenum baseFormat = _mesa_get_format_base_format(dstFormat);
- ASSERT(dstFormat == MESA_FORMAT_ABGR2101010_UINT);
+ ASSERT(dstFormat == MESA_FORMAT_RGBA2101010_UINT);
ASSERT(_mesa_get_format_bytes(dstFormat) == 4);
{
@@ -3590,21 +3590,21 @@ _mesa_get_texstore_func(gl_format format)
table[MESA_FORMAT_RGBA8888_UNORM] = _mesa_texstore_rgba8888;
table[MESA_FORMAT_RGBA8888_REV_UNORM] = _mesa_texstore_rgba8888;
- table[MESA_FORMAT_ARGB8888_UNORM] = _mesa_texstore_argb8888;
- table[MESA_FORMAT_ARGB8888_REV_UNORM] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_BGRA8888_UNORM] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_BGRA8888_REV_UNORM] = _mesa_texstore_argb8888;
table[MESA_FORMAT_RGBX8888_UNORM] = _mesa_texstore_rgba8888;
table[MESA_FORMAT_RGBX8888_REV_UNORM] = _mesa_texstore_rgba8888;
- table[MESA_FORMAT_XRGB8888_UNORM] = _mesa_texstore_argb8888;
- table[MESA_FORMAT_XRGB8888_REV_UNORM] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_BGRX8888_UNORM] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_BGRX8888_REV_UNORM] = _mesa_texstore_argb8888;
table[MESA_FORMAT_RGB888] = _mesa_texstore_rgb888;
table[MESA_FORMAT_BGR888] = _mesa_texstore_bgr888;
table[MESA_FORMAT_RGB565_UNORM] = _mesa_texstore_rgb565;
table[MESA_FORMAT_RGB565_REV_UNORM] = _mesa_texstore_rgb565;
- table[MESA_FORMAT_ARGB4444_UNORM] = store_ubyte_texture;
- table[MESA_FORMAT_ARGB4444_REV_UNORM] = store_ubyte_texture;
+ table[MESA_FORMAT_BGRA4444_UNORM] = store_ubyte_texture;
+ table[MESA_FORMAT_BGRA4444_REV_UNORM] = store_ubyte_texture;
table[MESA_FORMAT_RGBA5551_UNORM] = store_ubyte_texture;
- table[MESA_FORMAT_ARGB1555_UNORM] = store_ubyte_texture;
- table[MESA_FORMAT_ARGB1555_REV_UNORM] = store_ubyte_texture;
+ table[MESA_FORMAT_BGRA1555_UNORM] = store_ubyte_texture;
+ table[MESA_FORMAT_BGRA1555_REV_UNORM] = store_ubyte_texture;
table[MESA_FORMAT_AL44_UNORM] = _mesa_texstore_unorm44;
table[MESA_FORMAT_AL88_UNORM] = _mesa_texstore_unorm88;
table[MESA_FORMAT_AL88_REV_UNORM] = _mesa_texstore_unorm88;
@@ -3625,7 +3625,7 @@ _mesa_get_texstore_func(gl_format format)
table[MESA_FORMAT_R16_UNORM] = _mesa_texstore_unorm16;
table[MESA_FORMAT_GR1616_UNORM] = _mesa_texstore_unorm1616;
table[MESA_FORMAT_RG1616_UNORM] = _mesa_texstore_unorm1616;
- table[MESA_FORMAT_ARGB2101010_UNORM] = _mesa_texstore_argb2101010;
+ table[MESA_FORMAT_BGRA2101010_UNORM] = _mesa_texstore_argb2101010;
table[MESA_FORMAT_Z24_UNORM_S8_UINT] = _mesa_texstore_z24_s8;
table[MESA_FORMAT_S8_UINT_Z24_UNORM] = _mesa_texstore_s8_z24;
table[MESA_FORMAT_Z16_UNORM] = _mesa_texstore_z16;
@@ -3763,16 +3763,16 @@ _mesa_get_texstore_func(gl_format format)
table[MESA_FORMAT_RGB_UINT32] = _mesa_texstore_rgba_uint32;
table[MESA_FORMAT_RGBA_UINT32] = _mesa_texstore_rgba_uint32;
- table[MESA_FORMAT_ARGB2101010_UINT] = _mesa_texstore_argb2101010_uint;
- table[MESA_FORMAT_ABGR2101010_UINT] = _mesa_texstore_abgr2101010_uint;
+ table[MESA_FORMAT_BGRA2101010_UINT] = _mesa_texstore_argb2101010_uint;
+ table[MESA_FORMAT_RGBA2101010_UINT] = _mesa_texstore_abgr2101010_uint;
- table[MESA_FORMAT_XRGB4444_UNORM] = store_ubyte_texture;
- table[MESA_FORMAT_XRGB1555_UNORM] = store_ubyte_texture;
+ table[MESA_FORMAT_BGRX4444_UNORM] = store_ubyte_texture;
+ table[MESA_FORMAT_BGRX1555_UNORM] = store_ubyte_texture;
table[MESA_FORMAT_XBGR8888_SNORM] = _mesa_texstore_signed_rgbx8888;
table[MESA_FORMAT_XBGR8888_SRGB] = _mesa_texstore_srgba8;
table[MESA_FORMAT_XBGR8888_UINT] = _mesa_texstore_rgba_uint8;
table[MESA_FORMAT_XBGR8888_SINT] = _mesa_texstore_rgba_int8;
- table[MESA_FORMAT_XRGB2101010_UNORM] = _mesa_texstore_argb2101010;
+ table[MESA_FORMAT_BGRX2101010_UNORM] = _mesa_texstore_argb2101010;
table[MESA_FORMAT_XBGR16161616_UNORM] = _mesa_texstore_rgba_16;
table[MESA_FORMAT_XBGR16161616_SNORM] = _mesa_texstore_signed_rgba_16;
table[MESA_FORMAT_XBGR16161616_FLOAT] = _mesa_texstore_rgba_float16;
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 9e0a282..6e69261 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -61,27 +61,27 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
return PIPE_FORMAT_ABGR8888_UNORM;
case MESA_FORMAT_RGBA8888_REV_UNORM:
return PIPE_FORMAT_RGBA8888_UNORM;
- case MESA_FORMAT_ARGB8888_UNORM:
+ case MESA_FORMAT_BGRA8888_UNORM:
return PIPE_FORMAT_BGRA8888_UNORM;
- case MESA_FORMAT_ARGB8888_REV_UNORM:
+ case MESA_FORMAT_BGRA8888_REV_UNORM:
return PIPE_FORMAT_ARGB8888_UNORM;
case MESA_FORMAT_RGBX8888_UNORM:
return PIPE_FORMAT_XBGR8888_UNORM;
case MESA_FORMAT_RGBX8888_REV_UNORM:
return PIPE_FORMAT_RGBX8888_UNORM;
- case MESA_FORMAT_XRGB8888_UNORM:
+ case MESA_FORMAT_BGRX8888_UNORM:
return PIPE_FORMAT_BGRX8888_UNORM;
- case MESA_FORMAT_XRGB8888_REV_UNORM:
+ case MESA_FORMAT_BGRX8888_REV_UNORM:
return PIPE_FORMAT_XRGB8888_UNORM;
- case MESA_FORMAT_ARGB1555_UNORM:
+ case MESA_FORMAT_BGRA1555_UNORM:
return PIPE_FORMAT_B5G5R5A1_UNORM;
- case MESA_FORMAT_ARGB4444_UNORM:
+ case MESA_FORMAT_BGRA4444_UNORM:
return PIPE_FORMAT_B4G4R4A4_UNORM;
case MESA_FORMAT_RGB565_UNORM:
return PIPE_FORMAT_B5G6R5_UNORM;
case MESA_FORMAT_RGB332_UNORM:
return PIPE_FORMAT_B2G3R3_UNORM;
- case MESA_FORMAT_ARGB2101010_UNORM:
+ case MESA_FORMAT_BGRA2101010_UNORM:
return PIPE_FORMAT_B10G10R10A2_UNORM;
case MESA_FORMAT_AL44_UNORM:
return PIPE_FORMAT_L4A4_UNORM;
@@ -357,12 +357,12 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
return PIPE_FORMAT_R9G9B9E5_FLOAT;
case MESA_FORMAT_R11_G11_B10_FLOAT:
return PIPE_FORMAT_R11G11B10_FLOAT;
- case MESA_FORMAT_ARGB2101010_UINT:
+ case MESA_FORMAT_BGRA2101010_UINT:
return PIPE_FORMAT_B10G10R10A2_UINT;
- case MESA_FORMAT_XRGB4444_UNORM:
+ case MESA_FORMAT_BGRX4444_UNORM:
return PIPE_FORMAT_B4G4R4X4_UNORM;
- case MESA_FORMAT_XRGB1555_UNORM:
+ case MESA_FORMAT_BGRX1555_UNORM:
return PIPE_FORMAT_B5G5R5X1_UNORM;
case MESA_FORMAT_XBGR8888_SNORM:
return PIPE_FORMAT_R8G8B8X8_SNORM;
@@ -372,7 +372,7 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
return PIPE_FORMAT_R8G8B8X8_UINT;
case MESA_FORMAT_XBGR8888_SINT:
return PIPE_FORMAT_R8G8B8X8_SINT;
- case MESA_FORMAT_XRGB2101010_UNORM:
+ case MESA_FORMAT_BGRX2101010_UNORM:
return PIPE_FORMAT_B10G10R10X2_UNORM;
case MESA_FORMAT_XBGR16161616_UNORM:
return PIPE_FORMAT_R16G16B16X16_UNORM;
@@ -409,27 +409,27 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
case PIPE_FORMAT_RGBA8888_UNORM:
return MESA_FORMAT_RGBA8888_REV_UNORM;
case PIPE_FORMAT_BGRA8888_UNORM:
- return MESA_FORMAT_ARGB8888_UNORM;
+ return MESA_FORMAT_BGRA8888_UNORM;
case PIPE_FORMAT_ARGB8888_UNORM:
- return MESA_FORMAT_ARGB8888_REV_UNORM;
+ return MESA_FORMAT_BGRA8888_REV_UNORM;
case PIPE_FORMAT_XBGR8888_UNORM:
return MESA_FORMAT_RGBX8888_UNORM;
case PIPE_FORMAT_RGBX8888_UNORM:
return MESA_FORMAT_RGBX8888_REV_UNORM;
case PIPE_FORMAT_BGRX8888_UNORM:
- return MESA_FORMAT_XRGB8888_UNORM;
+ return MESA_FORMAT_BGRX8888_UNORM;
case PIPE_FORMAT_XRGB8888_UNORM:
- return MESA_FORMAT_XRGB8888_REV_UNORM;
+ return MESA_FORMAT_BGRX8888_REV_UNORM;
case PIPE_FORMAT_B5G5R5A1_UNORM:
- return MESA_FORMAT_ARGB1555_UNORM;
+ return MESA_FORMAT_BGRA1555_UNORM;
case PIPE_FORMAT_B4G4R4A4_UNORM:
- return MESA_FORMAT_ARGB4444_UNORM;
+ return MESA_FORMAT_BGRA4444_UNORM;
case PIPE_FORMAT_B5G6R5_UNORM:
return MESA_FORMAT_RGB565_UNORM;
case PIPE_FORMAT_B2G3R3_UNORM:
return MESA_FORMAT_RGB332_UNORM;
case PIPE_FORMAT_B10G10R10A2_UNORM:
- return MESA_FORMAT_ARGB2101010_UNORM;
+ return MESA_FORMAT_BGRA2101010_UNORM;
case PIPE_FORMAT_L4A4_UNORM:
return MESA_FORMAT_AL44_UNORM;
case PIPE_FORMAT_L8A8_UNORM:
@@ -711,12 +711,12 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
return MESA_FORMAT_R11_G11_B10_FLOAT;
case PIPE_FORMAT_B10G10R10A2_UINT:
- return MESA_FORMAT_ARGB2101010_UINT;
+ return MESA_FORMAT_BGRA2101010_UINT;
case PIPE_FORMAT_B4G4R4X4_UNORM:
- return MESA_FORMAT_XRGB4444_UNORM;
+ return MESA_FORMAT_BGRX4444_UNORM;
case PIPE_FORMAT_B5G5R5X1_UNORM:
- return MESA_FORMAT_XRGB1555_UNORM;
+ return MESA_FORMAT_BGRX1555_UNORM;
case PIPE_FORMAT_R8G8B8X8_SNORM:
return MESA_FORMAT_XBGR8888_SNORM;
case PIPE_FORMAT_R8G8B8X8_SRGB:
@@ -726,7 +726,7 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
case PIPE_FORMAT_R8G8B8X8_SINT:
return MESA_FORMAT_XBGR8888_SINT;
case PIPE_FORMAT_B10G10R10X2_UNORM:
- return MESA_FORMAT_XRGB2101010_UNORM;
+ return MESA_FORMAT_BGRX2101010_UNORM;
case PIPE_FORMAT_R16G16B16X16_UNORM:
return MESA_FORMAT_XBGR16161616_UNORM;
case PIPE_FORMAT_R16G16B16X16_SNORM:
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index 376d2c4..ef0ff48 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -45,7 +45,7 @@
/**
* Handle a common case of drawing GL_RGB/GL_UNSIGNED_BYTE into a
- * MESA_FORMAT_XRGB888 or MESA_FORMAT_ARGB888 renderbuffer.
+ * MESA_FORMAT_BGRX888 or MESA_FORMAT_BGRA888 renderbuffer.
*/
static void
fast_draw_rgb_ubyte_pixels(struct gl_context *ctx,
@@ -92,7 +92,7 @@ fast_draw_rgb_ubyte_pixels(struct gl_context *ctx,
/**
* Handle a common case of drawing GL_RGBA/GL_UNSIGNED_BYTE into a
- * MESA_FORMAT_ARGB888 or MESA_FORMAT_xRGB888 renderbuffer.
+ * MESA_FORMAT_BGRA888 or MESA_FORMAT_xRGB888 renderbuffer.
*/
static void
fast_draw_rgba_ubyte_pixels(struct gl_context *ctx,
@@ -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_UNORM ||
- rb->Format == MESA_FORMAT_ARGB8888_UNORM)) {
+ (rb->Format == MESA_FORMAT_BGRX8888_UNORM ||
+ rb->Format == MESA_FORMAT_BGRA8888_UNORM)) {
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_UNORM ||
- rb->Format == MESA_FORMAT_ARGB8888_UNORM)) {
+ (rb->Format == MESA_FORMAT_BGRX8888_UNORM ||
+ rb->Format == MESA_FORMAT_BGRA8888_UNORM)) {
fast_draw_rgba_ubyte_pixels(ctx, rb, x, y, width, height,
&unpack, pixels);
return GL_TRUE;
diff --git a/src/mesa/swrast/s_texfetch.c b/src/mesa/swrast/s_texfetch.c
index fd7caed..cad8e2e 100644
--- a/src/mesa/swrast/s_texfetch.c
+++ b/src/mesa/swrast/s_texfetch.c
@@ -161,13 +161,13 @@ texfetch_funcs[] =
fetch_texel_3d_f_rgba8888_rev
},
{
- MESA_FORMAT_ARGB8888_UNORM,
+ MESA_FORMAT_BGRA8888_UNORM,
fetch_texel_1d_f_argb8888,
fetch_texel_2d_f_argb8888,
fetch_texel_3d_f_argb8888
},
{
- MESA_FORMAT_ARGB8888_REV_UNORM,
+ MESA_FORMAT_BGRA8888_REV_UNORM,
fetch_texel_1d_f_argb8888_rev,
fetch_texel_2d_f_argb8888_rev,
fetch_texel_3d_f_argb8888_rev
@@ -185,13 +185,13 @@ texfetch_funcs[] =
fetch_texel_3d_f_rgbx8888_rev
},
{
- MESA_FORMAT_XRGB8888_UNORM,
+ MESA_FORMAT_BGRX8888_UNORM,
fetch_texel_1d_f_xrgb8888,
fetch_texel_2d_f_xrgb8888,
fetch_texel_3d_f_xrgb8888
},
{
- MESA_FORMAT_XRGB8888_REV_UNORM,
+ MESA_FORMAT_BGRX8888_REV_UNORM,
fetch_texel_1d_f_xrgb8888_rev,
fetch_texel_2d_f_xrgb8888_rev,
fetch_texel_3d_f_xrgb8888_rev
@@ -221,13 +221,13 @@ texfetch_funcs[] =
fetch_texel_3d_f_rgb565_rev
},
{
- MESA_FORMAT_ARGB4444_UNORM,
+ MESA_FORMAT_BGRA4444_UNORM,
fetch_texel_1d_f_argb4444,
fetch_texel_2d_f_argb4444,
fetch_texel_3d_f_argb4444
},
{
- MESA_FORMAT_ARGB4444_REV_UNORM,
+ MESA_FORMAT_BGRA4444_REV_UNORM,
fetch_texel_1d_f_argb4444_rev,
fetch_texel_2d_f_argb4444_rev,
fetch_texel_3d_f_argb4444_rev
@@ -239,13 +239,13 @@ texfetch_funcs[] =
fetch_texel_3d_f_rgba5551
},
{
- MESA_FORMAT_ARGB1555_UNORM,
+ MESA_FORMAT_BGRA1555_UNORM,
fetch_texel_1d_f_argb1555,
fetch_texel_2d_f_argb1555,
fetch_texel_3d_f_argb1555
},
{
- MESA_FORMAT_ARGB1555_REV_UNORM,
+ MESA_FORMAT_BGRA1555_REV_UNORM,
fetch_texel_1d_f_argb1555_rev,
fetch_texel_2d_f_argb1555_rev,
fetch_texel_3d_f_argb1555_rev
@@ -371,7 +371,7 @@ texfetch_funcs[] =
fetch_texel_3d_f_rg1616_rev
},
{
- MESA_FORMAT_ARGB2101010_UNORM,
+ MESA_FORMAT_BGRA2101010_UNORM,
fetch_texel_1d_f_argb2101010,
fetch_texel_2d_f_argb2101010,
fetch_texel_3d_f_argb2101010
@@ -1185,25 +1185,25 @@ texfetch_funcs[] =
fetch_texel_3d_z32f_x24s8
},
{
- MESA_FORMAT_ARGB2101010_UINT,
+ MESA_FORMAT_BGRA2101010_UINT,
NULL,
NULL,
NULL
},
{
- MESA_FORMAT_ABGR2101010_UINT,
+ MESA_FORMAT_RGBA2101010_UINT,
NULL,
NULL,
NULL
},
{
- MESA_FORMAT_XRGB4444_UNORM,
+ MESA_FORMAT_BGRX4444_UNORM,
NULL,
NULL,
NULL
},
{
- MESA_FORMAT_XRGB1555_UNORM,
+ MESA_FORMAT_BGRX1555_UNORM,
NULL,
NULL,
NULL
@@ -1233,7 +1233,7 @@ texfetch_funcs[] =
NULL
},
{
- MESA_FORMAT_XRGB2101010_UNORM,
+ MESA_FORMAT_BGRX2101010_UNORM,
NULL,
NULL,
NULL
diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h
index 0ffc22f..96f8669 100644
--- a/src/mesa/swrast/s_texfetch_tmp.h
+++ b/src/mesa/swrast/s_texfetch_tmp.h
@@ -422,7 +422,7 @@ static void FETCH(f_rgba8888_rev)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_ARGB8888_UNORM ******************************************************/
+/* MESA_FORMAT_BGRA8888_UNORM ******************************************************/
/* 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_UNORM **************************************************/
+/* MESA_FORMAT_BGRA8888_REV_UNORM **************************************************/
/* 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,
@@ -486,7 +486,7 @@ static void FETCH(f_rgbx8888_rev)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_XRGB8888_UNORM ******************************************************/
+/* MESA_FORMAT_BGRX8888_UNORM ******************************************************/
/* 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_UNORM **************************************************/
+/* MESA_FORMAT_BGRX8888_REV_UNORM **************************************************/
/* 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,
@@ -587,7 +587,7 @@ static void FETCH(f_rgb565_rev)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_ARGB4444_UNORM ******************************************************/
+/* MESA_FORMAT_BGRA4444_UNORM ******************************************************/
/* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */
static void FETCH(f_argb4444)( const struct swrast_texture_image *texImage,
@@ -604,7 +604,7 @@ static void FETCH(f_argb4444)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_ARGB4444_REV_UNORM **************************************************/
+/* MESA_FORMAT_BGRA4444_REV_UNORM **************************************************/
/* Fetch texel from 1D, 2D or 3D argb4444_rev texture, return 4 GLchans */
static void FETCH(f_argb4444_rev)( const struct swrast_texture_image *texImage,
@@ -635,7 +635,7 @@ static void FETCH(f_rgba5551)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_ARGB1555_UNORM ******************************************************/
+/* MESA_FORMAT_BGRA1555_UNORM ******************************************************/
/* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */
static void FETCH(f_argb1555)( const struct swrast_texture_image *texImage,
@@ -652,7 +652,7 @@ static void FETCH(f_argb1555)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_ARGB1555_REV_UNORM **************************************************/
+/* MESA_FORMAT_BGRA1555_REV_UNORM **************************************************/
/* Fetch texel from 1D, 2D or 3D argb1555_rev texture, return 4 GLchans */
static void FETCH(f_argb1555_rev)( const struct swrast_texture_image *texImage,
@@ -669,7 +669,7 @@ static void FETCH(f_argb1555_rev)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_ARGB2101010_UNORM ***************************************************/
+/* MESA_FORMAT_BGRA2101010_UNORM ***************************************************/
/* Fetch texel from 1D, 2D or 3D argb2101010 texture, return 4 GLchans */
static void FETCH(f_argb2101010)( const struct swrast_texture_image *texImage,
--
1.8.3.1
More information about the mesa-dev
mailing list