dri_fill_in_modes(struct dri_screen *screen)
{
static const mesa_format mesa_formats[3] = {
- MESA_FORMAT_ARGB8888,
- MESA_FORMAT_XRGB8888,
+ MESA_FORMAT_B8G8R8A8_UNORM,
+ MESA_FORMAT_B8G8R8X8_UNORM,
MESA_FORMAT_RGB565,
};
static const enum pipe_format pipe_formats[3] = {
switch (format) {
case MESA_FORMAT_RGB565:
return __DRI_IMAGE_FORMAT_RGB565;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
return __DRI_IMAGE_FORMAT_XRGB8888;
case MESA_FORMAT_ARGB2101010:
return __DRI_IMAGE_FORMAT_ARGB2101010;
case MESA_FORMAT_XRGB2101010_UNORM:
return __DRI_IMAGE_FORMAT_XRGB2101010;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
return __DRI_IMAGE_FORMAT_ARGB8888;
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
return __DRI_IMAGE_FORMAT_ABGR8888;
- case MESA_FORMAT_RGBX8888_REV:
+ case MESA_FORMAT_R8G8B8X8_UNORM:
return __DRI_IMAGE_FORMAT_XBGR8888;
case MESA_FORMAT_R8:
return __DRI_IMAGE_FORMAT_R8;
case __DRI_IMAGE_FORMAT_RGB565:
return MESA_FORMAT_RGB565;
case __DRI_IMAGE_FORMAT_XRGB8888:
- return MESA_FORMAT_XRGB8888;
+ return MESA_FORMAT_B8G8R8X8_UNORM;
case __DRI_IMAGE_FORMAT_ARGB2101010:
return MESA_FORMAT_ARGB2101010;
case __DRI_IMAGE_FORMAT_XRGB2101010:
return MESA_FORMAT_XRGB2101010_UNORM;
case __DRI_IMAGE_FORMAT_ARGB8888:
- return MESA_FORMAT_ARGB8888;
+ return MESA_FORMAT_B8G8R8A8_UNORM;
case __DRI_IMAGE_FORMAT_ABGR8888:
- return MESA_FORMAT_RGBA8888_REV;
+ return MESA_FORMAT_R8G8B8A8_UNORM;
case __DRI_IMAGE_FORMAT_XBGR8888:
- return MESA_FORMAT_RGBX8888_REV;
+ return MESA_FORMAT_R8G8B8X8_UNORM;
case __DRI_IMAGE_FORMAT_R8:
return MESA_FORMAT_R8;
case __DRI_IMAGE_FORMAT_GR88:
static const uint32_t masks_table[][4] = {
/* MESA_FORMAT_RGB565 */
{ 0x0000F800, 0x000007E0, 0x0000001F, 0x00000000 },
- /* MESA_FORMAT_XRGB8888 */
+ /* MESA_FORMAT_B8G8R8X8_UNORM */
{ 0x00FF0000, 0x0000FF00, 0x000000FF, 0x00000000 },
- /* MESA_FORMAT_ARGB8888 */
+ /* MESA_FORMAT_B8G8R8A8_UNORM */
{ 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000 },
/* MESA_FORMAT_XRGB2101010_UNORM */
{ 0x3FF00000, 0x000FFC00, 0x000003FF, 0x00000000 },
case MESA_FORMAT_RGB565:
masks = masks_table[0];
break;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
masks = masks_table[1];
break;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
case MESA_FORMAT_SARGB8:
masks = masks_table[2];
break;
return MAPSURF_16BIT | MT_16BIT_ARGB1555;
case MESA_FORMAT_ARGB4444:
return MAPSURF_16BIT | MT_16BIT_ARGB4444;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
return MAPSURF_32BIT | MT_32BIT_ARGB8888;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
return MAPSURF_32BIT | MT_32BIT_XRGB8888;
case MESA_FORMAT_YCBCR_REV:
return (MAPSURF_422 | MT_422_YCRCB_NORMAL);
static uint32_t i830_render_target_format_for_mesa_format[MESA_FORMAT_COUNT] =
{
- [MESA_FORMAT_ARGB8888] = DV_PF_8888,
- [MESA_FORMAT_XRGB8888] = DV_PF_8888,
+ [MESA_FORMAT_B8G8R8A8_UNORM] = DV_PF_8888,
+ [MESA_FORMAT_B8G8R8X8_UNORM] = DV_PF_8888,
[MESA_FORMAT_RGB565] = DV_PF_565,
[MESA_FORMAT_ARGB1555] = DV_PF_1555,
[MESA_FORMAT_ARGB4444] = DV_PF_4444,
struct intel_context *intel = intel_context(ctx);
struct intel_screen *intel_screen = intel->intelScreen;
- ctx->TextureFormatSupported[MESA_FORMAT_ARGB8888] = true;
+ ctx->TextureFormatSupported[MESA_FORMAT_B8G8R8A8_UNORM] = true;
if (intel_screen->deviceID != PCI_CHIP_I830_M &&
intel_screen->deviceID != PCI_CHIP_845_G)
- ctx->TextureFormatSupported[MESA_FORMAT_XRGB8888] = true;
+ ctx->TextureFormatSupported[MESA_FORMAT_B8G8R8X8_UNORM] = true;
if (intel->gen == 3)
ctx->TextureFormatSupported[MESA_FORMAT_SARGB8] = true;
ctx->TextureFormatSupported[MESA_FORMAT_ARGB4444] = true;
case MESA_FORMAT_ARGB4444:
return MAPSURF_16BIT | MT_16BIT_ARGB4444;
case MESA_FORMAT_SARGB8:
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
return MAPSURF_32BIT | MT_32BIT_ARGB8888;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
return MAPSURF_32BIT | MT_32BIT_XRGB8888;
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
return MAPSURF_32BIT | MT_32BIT_ABGR8888;
case MESA_FORMAT_YCBCR_REV:
return (MAPSURF_422 | MT_422_YCRCB_NORMAL);
static uint32_t i915_render_target_format_for_mesa_format[MESA_FORMAT_COUNT] =
{
- [MESA_FORMAT_ARGB8888] = DV_PF_8888,
- [MESA_FORMAT_XRGB8888] = DV_PF_8888,
+ [MESA_FORMAT_B8G8R8A8_UNORM] = DV_PF_8888,
+ [MESA_FORMAT_B8G8R8X8_UNORM] = DV_PF_8888,
[MESA_FORMAT_RGB565] = DV_PF_565 | DITHER_FULL_ALWAYS,
[MESA_FORMAT_ARGB1555] = DV_PF_1555 | DITHER_FULL_ALWAYS,
[MESA_FORMAT_ARGB4444] = DV_PF_4444 | DITHER_FULL_ALWAYS,
* channel to 1.0 at the end.
*/
if (src_format != dst_format &&
- ((src_format != MESA_FORMAT_ARGB8888 &&
- src_format != MESA_FORMAT_XRGB8888) ||
- (dst_format != MESA_FORMAT_ARGB8888 &&
- dst_format != MESA_FORMAT_XRGB8888))) {
+ ((src_format != MESA_FORMAT_B8G8R8A8_UNORM &&
+ src_format != MESA_FORMAT_B8G8R8X8_UNORM) ||
+ (dst_format != MESA_FORMAT_B8G8R8A8_UNORM &&
+ dst_format != MESA_FORMAT_B8G8R8X8_UNORM))) {
perf_debug("%s: Can't use hardware blitter from %s to %s, "
"falling back.\n", __FUNCTION__,
_mesa_get_format_name(src_format),
return false;
}
- if (src_mt->format == MESA_FORMAT_XRGB8888 &&
- dst_mt->format == MESA_FORMAT_ARGB8888) {
+ if (src_mt->format == MESA_FORMAT_B8G8R8X8_UNORM &&
+ dst_mt->format == MESA_FORMAT_B8G8R8A8_UNORM) {
intel_miptree_set_alpha_to_one(intel, dst_mt,
dst_x, dst_y,
width, height);
_mesa_unclamped_float_rgba_to_ubyte(clear, color);
switch (intel_rb_format(irb)) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
clear_val = PACK_COLOR_8888(clear[3], clear[0],
clear[1], clear[2]);
break;
/* __DRIimage is opaque to the core so it has to be checked here */
switch (image->format) {
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
_mesa_error(&intel->ctx, GL_INVALID_OPERATION,
"glEGLImageTargetRenderbufferStorage(unsupported image format");
return;
UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[3], tmpColor[3]);
switch (irb->mt->format) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
color = PACK_COLOR_8888(ubcolor[3], ubcolor[0], ubcolor[1], ubcolor[2]);
break;
case MESA_FORMAT_RGB565:
enum aub_dump_bmp_format format;
switch (irb->Base.Base.Format) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
format = AUB_DUMP_BMP_FORMAT_ARGB_8888;
break;
default:
else if (mesaVis->sRGBCapable)
rgbFormat = MESA_FORMAT_SARGB8;
else if (mesaVis->alphaBits == 0)
- rgbFormat = MESA_FORMAT_XRGB8888;
+ rgbFormat = MESA_FORMAT_B8G8R8X8_UNORM;
else
- rgbFormat = MESA_FORMAT_ARGB8888;
+ rgbFormat = MESA_FORMAT_B8G8R8A8_UNORM;
/* setup the hardware-based renderbuffers */
rb = intel_create_renderbuffer(rgbFormat);
{
static const mesa_format formats[] = {
MESA_FORMAT_RGB565,
- MESA_FORMAT_ARGB8888
+ MESA_FORMAT_B8G8R8A8_UNORM
};
/* GLX_SWAP_COPY_OML is not supported due to page flipping. */
if (rb->mt->cpp == 4) {
if (texture_format == __DRI_TEXTURE_FORMAT_RGB) {
internalFormat = GL_RGB;
- texFormat = MESA_FORMAT_XRGB8888;
+ texFormat = MESA_FORMAT_B8G8R8X8_UNORM;
}
else {
internalFormat = GL_RGBA;
- texFormat = MESA_FORMAT_ARGB8888;
+ texFormat = MESA_FORMAT_B8G8R8A8_UNORM;
}
} else if (rb->mt->cpp == 2) {
internalFormat = GL_RGB;
* (overriding alpha to 1.0 via blending).
*/
return linear_src_format == linear_dst_format ||
- (linear_src_format == MESA_FORMAT_XRGB8888 &&
- linear_dst_format == MESA_FORMAT_ARGB8888) ||
- (linear_src_format == MESA_FORMAT_ARGB8888 &&
- linear_dst_format == MESA_FORMAT_XRGB8888);
+ (linear_src_format == MESA_FORMAT_B8G8R8X8_UNORM &&
+ linear_dst_format == MESA_FORMAT_B8G8R8A8_UNORM) ||
+ (linear_src_format == MESA_FORMAT_B8G8R8A8_UNORM &&
+ linear_dst_format == MESA_FORMAT_B8G8R8X8_UNORM);
}
static bool
for (int i = 0; i < BUFFER_COUNT; i++) {
if (fb->Attachment[i].Renderbuffer &&
fb->Attachment[i].Renderbuffer->Format == MESA_FORMAT_SARGB8) {
- fb->Attachment[i].Renderbuffer->Format = MESA_FORMAT_ARGB8888;
+ fb->Attachment[i].Renderbuffer->Format = MESA_FORMAT_B8G8R8A8_UNORM;
}
}
}
*/
static const uint32_t table[MESA_FORMAT_COUNT] =
{
- [MESA_FORMAT_RGBA8888] = 0,
- [MESA_FORMAT_RGBA8888_REV] = BRW_SURFACEFORMAT_R8G8B8A8_UNORM,
- [MESA_FORMAT_ARGB8888] = BRW_SURFACEFORMAT_B8G8R8A8_UNORM,
- [MESA_FORMAT_ARGB8888_REV] = 0,
- [MESA_FORMAT_RGBX8888] = 0,
- [MESA_FORMAT_RGBX8888_REV] = BRW_SURFACEFORMAT_R8G8B8X8_UNORM,
- [MESA_FORMAT_XRGB8888] = BRW_SURFACEFORMAT_B8G8R8X8_UNORM,
- [MESA_FORMAT_XRGB8888_REV] = 0,
+ [MESA_FORMAT_A8B8G8R8_UNORM] = 0,
+ [MESA_FORMAT_R8G8B8A8_UNORM] = BRW_SURFACEFORMAT_R8G8B8A8_UNORM,
+ [MESA_FORMAT_B8G8R8A8_UNORM] = BRW_SURFACEFORMAT_B8G8R8A8_UNORM,
+ [MESA_FORMAT_A8R8G8B8_UNORM] = 0,
+ [MESA_FORMAT_X8B8G8R8_UNORM] = 0,
+ [MESA_FORMAT_R8G8B8X8_UNORM] = BRW_SURFACEFORMAT_R8G8B8X8_UNORM,
+ [MESA_FORMAT_B8G8R8X8_UNORM] = BRW_SURFACEFORMAT_B8G8R8X8_UNORM,
+ [MESA_FORMAT_X8R8G8B8_UNORM] = 0,
[MESA_FORMAT_RGB888] = 0,
[MESA_FORMAT_BGR888] = BRW_SURFACEFORMAT_R8G8B8_UNORM,
[MESA_FORMAT_RGB565] = BRW_SURFACEFORMAT_B5G6R5_UNORM,
* channel to 1.0 at the end.
*/
if (src_format != dst_format &&
- ((src_format != MESA_FORMAT_ARGB8888 &&
- src_format != MESA_FORMAT_XRGB8888) ||
- (dst_format != MESA_FORMAT_ARGB8888 &&
- dst_format != MESA_FORMAT_XRGB8888))) {
+ ((src_format != MESA_FORMAT_B8G8R8A8_UNORM &&
+ src_format != MESA_FORMAT_B8G8R8X8_UNORM) ||
+ (dst_format != MESA_FORMAT_B8G8R8A8_UNORM &&
+ dst_format != MESA_FORMAT_B8G8R8X8_UNORM))) {
perf_debug("%s: Can't use hardware blitter from %s to %s, "
"falling back.\n", __FUNCTION__,
_mesa_get_format_name(src_format),
return false;
}
- if (src_mt->format == MESA_FORMAT_XRGB8888 &&
- dst_mt->format == MESA_FORMAT_ARGB8888) {
+ if (src_mt->format == MESA_FORMAT_B8G8R8X8_UNORM &&
+ dst_mt->format == MESA_FORMAT_B8G8R8A8_UNORM) {
intel_miptree_set_alpha_to_one(brw, dst_mt,
dst_x, dst_y,
width, height);
/* __DRIimage is opaque to the core so it has to be checked here */
switch (image->format) {
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
_mesa_error(ctx, GL_INVALID_OPERATION,
"glEGLImageTargetRenderbufferStorage(unsupported image format");
return;
if (brw->gen < 8 && !brw->is_baytrail) {
switch (format) {
case MESA_FORMAT_ETC1_RGB8:
- format = MESA_FORMAT_RGBX8888_REV;
+ format = MESA_FORMAT_R8G8B8X8_UNORM;
break;
case MESA_FORMAT_ETC2_RGB8:
- format = MESA_FORMAT_RGBX8888_REV;
+ format = MESA_FORMAT_R8G8B8X8_UNORM;
break;
case MESA_FORMAT_ETC2_SRGB8:
case MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC:
break;
case MESA_FORMAT_ETC2_RGBA8_EAC:
case MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1:
- format = MESA_FORMAT_RGBA8888_REV;
+ format = MESA_FORMAT_R8G8B8A8_UNORM;
break;
case MESA_FORMAT_ETC2_R11_EAC:
format = MESA_FORMAT_R16;
{
assert(mt->etc_format != MESA_FORMAT_NONE);
if (mt->etc_format == MESA_FORMAT_ETC1_RGB8) {
- assert(mt->format == MESA_FORMAT_RGBX8888_REV);
+ assert(mt->format == MESA_FORMAT_R8G8B8X8_UNORM);
}
assert(map->mode & GL_MAP_WRITE_BIT);
UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[3], tmpColor[3]);
switch (_mesa_get_render_format(ctx, intel_rb_format(irb))) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
color = PACK_COLOR_8888(ubcolor[3], ubcolor[0], ubcolor[1], ubcolor[2]);
break;
case MESA_FORMAT_RGB565:
enum aub_dump_bmp_format format;
switch (irb->Base.Base.Format) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
format = AUB_DUMP_BMP_FORMAT_ARGB_8888;
break;
default:
else if (mesaVis->sRGBCapable)
rgbFormat = MESA_FORMAT_SARGB8;
else if (mesaVis->alphaBits == 0)
- rgbFormat = MESA_FORMAT_XRGB8888;
+ rgbFormat = MESA_FORMAT_B8G8R8X8_UNORM;
else {
rgbFormat = MESA_FORMAT_SARGB8;
fb->Visual.sRGBCapable = true;
{
static const mesa_format formats[] = {
MESA_FORMAT_RGB565,
- MESA_FORMAT_ARGB8888
+ MESA_FORMAT_B8G8R8A8_UNORM
};
/* GLX_SWAP_COPY_OML is not supported due to page flipping. */
if (rb->mt->cpp == 4) {
if (texture_format == __DRI_TEXTURE_FORMAT_RGB) {
internalFormat = GL_RGB;
- texFormat = MESA_FORMAT_XRGB8888;
+ texFormat = MESA_FORMAT_B8G8R8X8_UNORM;
}
else {
internalFormat = GL_RGBA;
- texFormat = MESA_FORMAT_ARGB8888;
+ texFormat = MESA_FORMAT_B8G8R8A8_UNORM;
}
} else if (rb->mt->cpp == 2) {
internalFormat = GL_RGB;
(texImage->TexFormat == MESA_FORMAT_A8 && format == GL_ALPHA)) {
cpp = 1;
mem_copy = memcpy;
- } else if ((texImage->TexFormat == MESA_FORMAT_ARGB8888) ||
- (texImage->TexFormat == MESA_FORMAT_XRGB8888)) {
+ } else if ((texImage->TexFormat == MESA_FORMAT_B8G8R8A8_UNORM) ||
+ (texImage->TexFormat == MESA_FORMAT_B8G8R8X8_UNORM)) {
cpp = 4;
if (format == GL_BGRA) {
mem_copy = memcpy;
case GL_RGB:
case GL_RGB8:
rb->_BaseFormat = GL_RGB;
- rb->Format = MESA_FORMAT_XRGB8888;
+ rb->Format = MESA_FORMAT_B8G8R8X8_UNORM;
s->cpp = 4;
break;
case GL_RGBA:
case GL_RGBA8:
rb->_BaseFormat = GL_RGBA;
- rb->Format = MESA_FORMAT_ARGB8888;
+ rb->Format = MESA_FORMAT_B8G8R8A8_UNORM;
s->cpp = 4;
break;
case GL_RGB5:
validate_format_bpp(mesa_format format)
{
switch (format) {
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
case MESA_FORMAT_Z24_S8:
return 32;
case MESA_FORMAT_RGB565:
static const mesa_format formats[3] = {
MESA_FORMAT_RGB565,
- MESA_FORMAT_ARGB8888,
- MESA_FORMAT_XRGB8888,
+ MESA_FORMAT_B8G8R8A8_UNORM,
+ MESA_FORMAT_B8G8R8X8_UNORM,
};
const GLenum back_buffer_modes[] = {
case GL_RGBA16:
case GL_RGB10_A2:
case GL_COMPRESSED_RGBA:
- return MESA_FORMAT_ARGB8888;
+ return MESA_FORMAT_B8G8R8A8_UNORM;
case GL_RGB5_A1:
return MESA_FORMAT_ARGB1555;
case GL_RGB12:
case GL_RGB16:
case GL_COMPRESSED_RGB:
- return MESA_FORMAT_XRGB8888;
+ return MESA_FORMAT_B8G8R8X8_UNORM;
case 3:
case GL_R3_G3_B2:
case GL_RGB4:
case GL_LUMINANCE16_ALPHA16:
case GL_LUMINANCE8_ALPHA8:
case GL_COMPRESSED_LUMINANCE_ALPHA:
- return MESA_FORMAT_ARGB8888;
+ return MESA_FORMAT_B8G8R8A8_UNORM;
case 1:
case GL_LUMINANCE:
if (s->cpp < 4)
return s->format;
else if (format == __DRI_TEXTURE_FORMAT_RGBA)
- return MESA_FORMAT_ARGB8888;
+ return MESA_FORMAT_B8G8R8A8_UNORM;
else
- return MESA_FORMAT_XRGB8888;
+ return MESA_FORMAT_B8G8R8X8_UNORM;
}
void
pack_rgba_i(mesa_format f, uint8_t c[])
{
switch (f) {
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
return PACK_COLOR_8888(c[ACOMP], c[RCOMP], c[GCOMP], c[BCOMP]);
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_A8R8G8B8_UNORM:
return PACK_COLOR_8888(c[BCOMP], c[GCOMP], c[RCOMP], c[ACOMP]);
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
return PACK_COLOR_8888(0, c[RCOMP], c[GCOMP], c[BCOMP]);
- case MESA_FORMAT_XRGB8888_REV:
+ case MESA_FORMAT_X8R8G8B8_UNORM:
return PACK_COLOR_8888(c[BCOMP], c[GCOMP], c[RCOMP], 0);
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
return PACK_COLOR_8888(c[RCOMP], c[GCOMP], c[BCOMP], c[ACOMP]);
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
return PACK_COLOR_8888(c[ACOMP], c[BCOMP], c[GCOMP], c[RCOMP]);
case MESA_FORMAT_RGB565:
return PACK_COLOR_565(c[RCOMP], c[GCOMP], c[BCOMP]);
nouveau_surface_alloc(ctx, s, SWIZZLED,
NOUVEAU_BO_MAP | NOUVEAU_BO_VRAM,
- MESA_FORMAT_ARGB8888, 1, 1);
+ MESA_FORMAT_B8G8R8A8_UNORM, 1, 1);
nouveau_bo_map(s->bo, NOUVEAU_BO_WR, context_client(ctx));
*(uint32_t *)s->bo->map = 0xffffffff;
get_rt_format(mesa_format format)
{
switch (format) {
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_X8R8G8B8_X8R8G8B8;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_A8R8G8B8;
case MESA_FORMAT_RGB565:
return NV04_CONTEXT_SURFACES_3D_FORMAT_COLOR_R5G6B5;
/* update calculated multitex state */
nv04->alpha[i] = rc_a.hw;
nv04->color[i] = rc_c.hw;
- nv04->factor = pack_rgba_f(MESA_FORMAT_ARGB8888,
+ nv04->factor = pack_rgba_f(MESA_FORMAT_B8G8R8A8_UNORM,
ctx->Texture.Unit[0].EnvColor);
}
/* Fog. */
if (ctx->Fog.Enabled) {
nv04->blend |= NV04_TEXTURED_TRIANGLE_BLEND_FOG_ENABLE;
- nv04->fog = pack_rgba_f(MESA_FORMAT_ARGB8888, ctx->Fog.Color);
+ nv04->fog = pack_rgba_f(MESA_FORMAT_B8G8R8A8_UNORM, ctx->Fog.Color);
}
}
return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_A4R4G4B4;
case MESA_FORMAT_RGB565:
return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_R5G6B5;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_A8R8G8B8;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_X8R8G8B8;
default:
assert(0);
case MESA_FORMAT_Z16:
return NV04_SWIZZLED_SURFACE_FORMAT_COLOR_R5G6B5;
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_RGBA8888_REV:
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
+ case MESA_FORMAT_A8R8G8B8_UNORM:
case MESA_FORMAT_S8_Z24:
case MESA_FORMAT_Z24_S8:
case MESA_FORMAT_Z32:
case MESA_FORMAT_Z16:
return NV04_CONTEXT_SURFACES_2D_FORMAT_R5G6B5;
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_RGBA8888_REV:
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
+ case MESA_FORMAT_A8R8G8B8_UNORM:
case MESA_FORMAT_S8_Z24:
case MESA_FORMAT_Z24_S8:
case MESA_FORMAT_Z32:
case MESA_FORMAT_Z16:
return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A16R5G6B5;
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_RGBA8888_REV:
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
+ case MESA_FORMAT_A8R8G8B8_UNORM:
case MESA_FORMAT_S8_Z24:
case MESA_FORMAT_Z24_S8:
case MESA_FORMAT_Z32:
case MESA_FORMAT_Z16:
return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_R5G6B5;
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_RGBA8888_REV:
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
+ case MESA_FORMAT_A8R8G8B8_UNORM:
case MESA_FORMAT_S8_Z24:
case MESA_FORMAT_Z24_S8:
case MESA_FORMAT_Z32:
get_rt_format(mesa_format format)
{
switch (format) {
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
return NV10_3D_RT_FORMAT_COLOR_X8R8G8B8;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
return NV10_3D_RT_FORMAT_COLOR_A8R8G8B8;
case MESA_FORMAT_RGB565:
return NV10_3D_RT_FORMAT_COLOR_R5G6B5;
get_input_mapping(rc, operand,
flags ^ INVERT);
- } else if (format == MESA_FORMAT_XRGB8888) {
+ } else if (format == MESA_FORMAT_B8G8R8X8_UNORM) {
/* Sometimes emulated using ARGB8888. */
if (!is_color_operand(operand))
return RC_IN_SOURCE(ZERO) |
rc_a.in = rc_a.out = rc_c.in = rc_c.out = 0;
}
- *k = pack_rgba_f(MESA_FORMAT_ARGB8888,
+ *k = pack_rgba_f(MESA_FORMAT_B8G8R8A8_UNORM,
ctx->Texture.Unit[i].EnvColor);
*a_in = rc_a.in;
*a_out = rc_a.out;
get_tex_format_pot(struct gl_texture_image *ti)
{
switch (ti->TexFormat) {
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
return NV10_3D_TEX_FORMAT_FORMAT_A8R8G8B8;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
return NV10_3D_TEX_FORMAT_FORMAT_X8R8G8B8;
case MESA_FORMAT_ARGB1555:
case MESA_FORMAT_RGB565:
return NV10_3D_TEX_FORMAT_FORMAT_R5G6B5_RECT;
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
return NV10_3D_TEX_FORMAT_FORMAT_A8R8G8B8_RECT;
case MESA_FORMAT_A8:
PUSH_DATA (push, get_fog_mode(f->Mode));
PUSH_DATA (push, get_fog_source(source, f->FogDistanceMode));
PUSH_DATAb(push, f->Enabled);
- PUSH_DATA (push, pack_rgba_f(MESA_FORMAT_RGBA8888_REV, f->Color));
+ PUSH_DATA (push, pack_rgba_f(MESA_FORMAT_R8G8B8A8_UNORM, f->Color));
BEGIN_NV04(push, NV10_3D(FOG_COEFF(0)), 3);
PUSH_DATAp(push, k, 3);
get_rt_format(mesa_format format)
{
switch (format) {
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
return NV20_3D_RT_FORMAT_COLOR_X8R8G8B8;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
return NV20_3D_RT_FORMAT_COLOR_A8R8G8B8;
case MESA_FORMAT_RGB565:
return NV20_3D_RT_FORMAT_COLOR_R5G6B5;
get_tex_format_pot(struct gl_texture_image *ti)
{
switch (ti->TexFormat) {
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
return NV20_3D_TEX_FORMAT_FORMAT_A8R8G8B8;
case MESA_FORMAT_ARGB1555:
case MESA_FORMAT_ARGB4444:
return NV20_3D_TEX_FORMAT_FORMAT_A4R4G4B4;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
return NV20_3D_TEX_FORMAT_FORMAT_X8R8G8B8;
case MESA_FORMAT_RGB565:
get_tex_format_rect(struct gl_texture_image *ti)
{
switch (ti->TexFormat) {
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
return NV20_3D_TEX_FORMAT_FORMAT_A8R8G8B8_RECT;
case MESA_FORMAT_ARGB1555:
case MESA_FORMAT_ARGB4444:
return NV20_3D_TEX_FORMAT_FORMAT_A4R4G4B4_RECT;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
return NV20_3D_TEX_FORMAT_FORMAT_R8G8B8_RECT;
case MESA_FORMAT_RGB565:
get_fog_mode_signed(f->Mode)));
PUSH_DATA (push, get_fog_source(source, f->FogDistanceMode));
PUSH_DATAb(push, f->Enabled);
- PUSH_DATA (push, pack_rgba_f(MESA_FORMAT_RGBA8888_REV, f->Color));
+ PUSH_DATA (push, pack_rgba_f(MESA_FORMAT_R8G8B8A8_UNORM, f->Color));
BEGIN_NV04(push, NV20_3D(FOG_COEFF(0)), 3);
PUSH_DATAp(push, k, 3);
{
/* XXX others? BE/LE? */
switch (mesa_format) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
case MESA_FORMAT_RGB565:
case MESA_FORMAT_ARGB4444:
case MESA_FORMAT_ARGB1555:
case MESA_FORMAT_L8:
case MESA_FORMAT_I8:
/* swizzled */
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
break;
default:
return 0;
/* XXX others? BE/LE? */
switch (src_mesa_format) {
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
txformat |= R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
txformat |= R200_TXFORMAT_RGBA8888 | R200_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
txformat |= R200_TXFORMAT_ABGR8888 | R200_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
txformat |= R200_TXFORMAT_ARGB8888;
break;
case MESA_FORMAT_RGB565:
offset |= R200_TXO_MICRO_TILE;
switch (dst_mesa_format) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
case MESA_FORMAT_RGB565:
case MESA_FORMAT_ARGB4444:
case MESA_FORMAT_ARGB1555:
R200_TXA_OUTPUT_REG_R0));
END_BATCH();
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
BEGIN_BATCH(10);
OUT_BATCH_REGVAL(RADEON_PP_CNTL, (RADEON_TEX_0_ENABLE |
RADEON_TEX_BLEND_0_ENABLE));
R200_TXA_OUTPUT_REG_R0));
END_BATCH();
break;
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
BEGIN_BATCH(34);
OUT_BATCH_REGVAL(RADEON_PP_CNTL, (RADEON_TEX_0_ENABLE |
RADEON_TEX_BLEND_0_ENABLE |
/* XXX others? BE/LE? */
switch (mesa_format) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
dst_format = RADEON_COLOR_FORMAT_ARGB8888;
break;
case MESA_FORMAT_RGB565:
static const struct tx_table tx_table_be[] =
{
- [ MESA_FORMAT_RGBA8888 ] = { R200_TXFORMAT_ABGR8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_RGBA8888_REV ] = { R200_TXFORMAT_RGBA8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_ARGB8888 ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_ARGB8888_REV ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_A8B8G8R8_UNORM ] = { R200_TXFORMAT_ABGR8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_R8G8B8A8_UNORM ] = { R200_TXFORMAT_RGBA8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_B8G8R8A8_UNORM ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_A8R8G8B8_UNORM ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_RGB888 ] = { 0xffffffff, 0 },
[ MESA_FORMAT_RGB565 ] = { R200_TXFORMAT_RGB565, 0 },
[ MESA_FORMAT_RGB565_REV ] = { R200_TXFORMAT_RGB565, 0 },
static const struct tx_table tx_table_le[] =
{
- [ MESA_FORMAT_RGBA8888 ] = { R200_TXFORMAT_RGBA8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_RGBA8888_REV ] = { R200_TXFORMAT_ABGR8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_ARGB8888 ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_ARGB8888_REV ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_A8B8G8R8_UNORM ] = { R200_TXFORMAT_RGBA8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_R8G8B8A8_UNORM ] = { R200_TXFORMAT_ABGR8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_B8G8R8A8_UNORM ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_A8R8G8B8_UNORM ] = { R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_RGB888 ] = { R200_TXFORMAT_ARGB8888, 0 },
[ MESA_FORMAT_RGB565 ] = { R200_TXFORMAT_RGB565, 0 },
[ MESA_FORMAT_RGB565_REV ] = { R200_TXFORMAT_RGB565, 0 },
t->pp_txformat = tx_table_le[MESA_FORMAT_RGB888].format;
}
else {
- texFormat = MESA_FORMAT_ARGB8888;
- t->pp_txformat = tx_table_le[MESA_FORMAT_ARGB8888].format;
+ texFormat = MESA_FORMAT_B8G8R8A8_UNORM;
+ t->pp_txformat = tx_table_le[MESA_FORMAT_B8G8R8A8_UNORM].format;
}
- t->pp_txfilter |= tx_table_le[MESA_FORMAT_ARGB8888].filter;
+ t->pp_txfilter |= tx_table_le[MESA_FORMAT_B8G8R8A8_UNORM].filter;
break;
case 3:
default:
{
/* XXX others? BE/LE? */
switch (mesa_format) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
case MESA_FORMAT_RGB565:
case MESA_FORMAT_ARGB4444:
case MESA_FORMAT_ARGB1555:
/* XXX others? BE/LE? */
switch (mesa_format) {
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
txformat |= RADEON_TXFORMAT_ARGB8888 | RADEON_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
txformat |= RADEON_TXFORMAT_RGBA8888 | RADEON_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
txformat |= RADEON_TXFORMAT_ARGB8888;
break;
case MESA_FORMAT_RGB565:
/* XXX others? BE/LE? */
switch (mesa_format) {
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
dst_format = RADEON_COLOR_FORMAT_ARGB8888;
break;
case MESA_FORMAT_RGB565:
case GL_UNSIGNED_SHORT_5_5_5_1:
return MESA_FORMAT_RGBA5551;
case GL_UNSIGNED_INT_8_8_8_8:
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_A8B8G8R8_UNORM;
case GL_UNSIGNED_BYTE:
case GL_UNSIGNED_INT_8_8_8_8_REV:
- return MESA_FORMAT_RGBA8888_REV;
+ return MESA_FORMAT_R8G8B8A8_UNORM;
}
break;
case GL_BGRA:
case GL_UNSIGNED_SHORT_1_5_5_5_REV:
return MESA_FORMAT_ARGB1555;
case GL_UNSIGNED_INT_8_8_8_8:
- return MESA_FORMAT_ARGB8888_REV;
+ return MESA_FORMAT_A8R8G8B8_UNORM;
case GL_UNSIGNED_BYTE:
case GL_UNSIGNED_INT_8_8_8_8_REV:
- return MESA_FORMAT_ARGB8888;
+ return MESA_FORMAT_B8G8R8A8_UNORM;
}
break;
image->data_type = GL_UNSIGNED_BYTE;
break;
case __DRI_IMAGE_FORMAT_XRGB8888:
- image->format = MESA_FORMAT_XRGB8888;
+ image->format = MESA_FORMAT_B8G8R8X8_UNORM;
image->internal_format = GL_RGB;
image->data_type = GL_UNSIGNED_BYTE;
break;
case __DRI_IMAGE_FORMAT_ARGB8888:
- image->format = MESA_FORMAT_ARGB8888;
+ image->format = MESA_FORMAT_B8G8R8A8_UNORM;
image->internal_format = GL_RGBA;
image->data_type = GL_UNSIGNED_BYTE;
break;
image->data_type = GL_UNSIGNED_BYTE;
break;
case __DRI_IMAGE_FORMAT_XRGB8888:
- image->format = MESA_FORMAT_XRGB8888;
+ image->format = MESA_FORMAT_B8G8R8X8_UNORM;
image->internal_format = GL_RGB;
image->data_type = GL_UNSIGNED_BYTE;
break;
case __DRI_IMAGE_FORMAT_ARGB8888:
- image->format = MESA_FORMAT_ARGB8888;
+ image->format = MESA_FORMAT_B8G8R8A8_UNORM;
image->internal_format = GL_RGBA;
image->data_type = GL_UNSIGNED_BYTE;
break;
if (mesaVis->redBits == 5)
rgbFormat = _mesa_little_endian() ? MESA_FORMAT_RGB565 : MESA_FORMAT_RGB565_REV;
else if (mesaVis->alphaBits == 0)
- rgbFormat = _mesa_little_endian() ? MESA_FORMAT_XRGB8888 : MESA_FORMAT_XRGB8888_REV;
+ rgbFormat = _mesa_little_endian() ? MESA_FORMAT_B8G8R8X8_UNORM : MESA_FORMAT_X8R8G8B8_UNORM;
else
- rgbFormat = _mesa_little_endian() ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB8888_REV;
+ rgbFormat = _mesa_little_endian() ? MESA_FORMAT_B8G8R8A8_UNORM : MESA_FORMAT_A8R8G8B8_UNORM;
/* front color renderbuffer */
rfb->color_rb[0] = radeon_create_renderbuffer(rgbFormat, driDrawPriv);
{
static const mesa_format formats[3] = {
MESA_FORMAT_RGB565,
- MESA_FORMAT_XRGB8888,
- MESA_FORMAT_ARGB8888
+ MESA_FORMAT_B8G8R8X8_UNORM,
+ MESA_FORMAT_B8G8R8A8_UNORM
};
/* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
* support pageflipping at all.
dst_mesaformat = MESA_FORMAT_RGB565;
break;
case 4:
- src_mesaformat = MESA_FORMAT_ARGB8888;
- dst_mesaformat = MESA_FORMAT_ARGB8888;
+ src_mesaformat = MESA_FORMAT_B8G8R8A8_UNORM;
+ dst_mesaformat = MESA_FORMAT_B8G8R8A8_UNORM;
break;
case 1:
src_mesaformat = MESA_FORMAT_A8;
static const struct tx_table tx_table[] =
{
[ MESA_FORMAT_NONE ] = { 0xffffffff, 0 },
- [ MESA_FORMAT_RGBA8888 ] = { RADEON_TXFORMAT_RGBA8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_RGBA8888_REV ] = { RADEON_TXFORMAT_RGBA8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_ARGB8888 ] = { RADEON_TXFORMAT_ARGB8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_ARGB8888_REV ] = { RADEON_TXFORMAT_ARGB8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_A8B8G8R8_UNORM ] = { RADEON_TXFORMAT_RGBA8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_R8G8B8A8_UNORM ] = { RADEON_TXFORMAT_RGBA8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_B8G8R8A8_UNORM ] = { RADEON_TXFORMAT_ARGB8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_A8R8G8B8_UNORM ] = { RADEON_TXFORMAT_ARGB8888 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_RGB888 ] = { RADEON_TXFORMAT_ARGB8888, 0 },
[ MESA_FORMAT_RGB565 ] = { RADEON_TXFORMAT_RGB565, 0 },
[ MESA_FORMAT_RGB565_REV ] = { RADEON_TXFORMAT_RGB565, 0 },
texFormat = MESA_FORMAT_RGB888;
}
else {
- t->pp_txformat = tx_table[MESA_FORMAT_ARGB8888].format;
- texFormat = MESA_FORMAT_ARGB8888;
+ t->pp_txformat = tx_table[MESA_FORMAT_B8G8R8A8_UNORM].format;
+ texFormat = MESA_FORMAT_B8G8R8A8_UNORM;
}
- t->pp_txfilter |= tx_table[MESA_FORMAT_ARGB8888].filter;
+ t->pp_txfilter |= tx_table[MESA_FORMAT_B8G8R8A8_UNORM].filter;
break;
case 3:
default:
(srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && !littleEndian) ||
(srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
(srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && littleEndian)) {
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_A8B8G8R8_UNORM;
} else if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
(srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && littleEndian) ||
(srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8) ||
(srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && !littleEndian)) {
- return MESA_FORMAT_RGBA8888_REV;
+ return MESA_FORMAT_R8G8B8A8_UNORM;
} else
return _radeon_texformat_argb8888;
#endif
radeonInitTextureFormats(void)
{
if (_mesa_little_endian()) {
- _radeon_texformat_rgba8888 = MESA_FORMAT_RGBA8888;
- _radeon_texformat_argb8888 = MESA_FORMAT_ARGB8888;
+ _radeon_texformat_rgba8888 = MESA_FORMAT_A8B8G8R8_UNORM;
+ _radeon_texformat_argb8888 = MESA_FORMAT_B8G8R8A8_UNORM;
_radeon_texformat_rgb565 = MESA_FORMAT_RGB565;
_radeon_texformat_argb4444 = MESA_FORMAT_ARGB4444;
_radeon_texformat_argb1555 = MESA_FORMAT_ARGB1555;
_radeon_texformat_al88 = MESA_FORMAT_AL88;
}
else {
- _radeon_texformat_rgba8888 = MESA_FORMAT_RGBA8888_REV;
- _radeon_texformat_argb8888 = MESA_FORMAT_ARGB8888_REV;
+ _radeon_texformat_rgba8888 = MESA_FORMAT_R8G8B8A8_UNORM;
+ _radeon_texformat_argb8888 = MESA_FORMAT_A8R8G8B8_UNORM;
_radeon_texformat_rgb565 = MESA_FORMAT_RGB565_REV;
_radeon_texformat_argb4444 = MESA_FORMAT_ARGB4444_REV;
_radeon_texformat_argb1555 = MESA_FORMAT_ARGB1555_REV;
sPriv->swrast_loader->getDrawableInfo(dPriv, &x, &y, &w, &h, dPriv->loaderPrivate);
if (texture_format == __DRI_TEXTURE_FORMAT_RGB)
- texFormat = MESA_FORMAT_XRGB8888;
+ texFormat = MESA_FORMAT_B8G8R8X8_UNORM;
else
- texFormat = MESA_FORMAT_ARGB8888;
+ texFormat = MESA_FORMAT_B8G8R8A8_UNORM;
_mesa_init_teximage_fields(&dri_ctx->Base, texImage,
w, h, 1, 0, internalFormat, texFormat);
format = MESA_FORMAT_RGB565;
break;
case 24:
- format = MESA_FORMAT_XRGB8888;
+ format = MESA_FORMAT_B8G8R8X8_UNORM;
break;
case 32:
- format = MESA_FORMAT_ARGB8888;
+ format = MESA_FORMAT_B8G8R8A8_UNORM;
break;
default:
fprintf(stderr, "[%s:%u] bad depth %d\n", __func__, __LINE__,
switch (pixel_format) {
case PF_A8R8G8B8:
- rb->Format = MESA_FORMAT_ARGB8888;
+ rb->Format = MESA_FORMAT_B8G8R8A8_UNORM;
rb->InternalFormat = GL_RGBA;
rb->_BaseFormat = GL_RGBA;
xrb->bpp = 32;
break;
case PF_X8R8G8B8:
- rb->Format = MESA_FORMAT_ARGB8888; /* XXX */
+ rb->Format = MESA_FORMAT_B8G8R8A8_UNORM; /* XXX */
rb->InternalFormat = GL_RGB;
rb->_BaseFormat = GL_RGB;
xrb->bpp = 32;
GLenum type)
{
if (internalFormat == GL_RGB)
- return MESA_FORMAT_XRGB8888;
+ return MESA_FORMAT_B8G8R8X8_UNORM;
return _mesa_choose_tex_format(ctx, target, internalFormat, format, type);
}
switch (colorSpace) {
case B_RGBA32:
rb->_BaseFormat = GL_RGBA;
- rb->Format = MESA_FORMAT_ARGB8888;
+ rb->Format = MESA_FORMAT_B8G8R8A8_UNORM;
break;
case B_RGB32:
rb->_BaseFormat = GL_RGB;
- rb->Format = MESA_FORMAT_XRGB8888;
+ rb->Format = MESA_FORMAT_B8G8R8X8_UNORM;
break;
case B_RGB24:
rb->_BaseFormat = GL_RGB;
if (osmesa->format == OSMESA_RGBA) {
if (osmesa->DataType == GL_UNSIGNED_BYTE) {
if (_mesa_little_endian())
- rb->Format = MESA_FORMAT_RGBA8888_REV;
+ rb->Format = MESA_FORMAT_R8G8B8A8_UNORM;
else
- rb->Format = MESA_FORMAT_RGBA8888;
+ rb->Format = MESA_FORMAT_A8B8G8R8_UNORM;
}
else if (osmesa->DataType == GL_UNSIGNED_SHORT) {
rb->Format = MESA_FORMAT_RGBA_16;
else if (osmesa->format == OSMESA_BGRA) {
if (osmesa->DataType == GL_UNSIGNED_BYTE) {
if (_mesa_little_endian())
- rb->Format = MESA_FORMAT_ARGB8888;
+ rb->Format = MESA_FORMAT_B8G8R8A8_UNORM;
else
- rb->Format = MESA_FORMAT_ARGB8888_REV;
+ rb->Format = MESA_FORMAT_A8R8G8B8_UNORM;
}
else if (osmesa->DataType == GL_UNSIGNED_SHORT) {
_mesa_warning(ctx, "Unsupported OSMesa format BGRA/GLushort");
else if (osmesa->format == OSMESA_ARGB) {
if (osmesa->DataType == GL_UNSIGNED_BYTE) {
if (_mesa_little_endian())
- rb->Format = MESA_FORMAT_ARGB8888_REV;
+ rb->Format = MESA_FORMAT_A8R8G8B8_UNORM;
else
- rb->Format = MESA_FORMAT_ARGB8888;
+ rb->Format = MESA_FORMAT_B8G8R8A8_UNORM;
}
else if (osmesa->DataType == GL_UNSIGNED_SHORT) {
_mesa_warning(ctx, "Unsupported OSMesa format ARGB/GLushort");
/* This will really only happen for pixmaps. We'll access the
* pixmap via a temporary XImage which will be 32bpp.
*/
- xrb->Base.Base.Format = MESA_FORMAT_XRGB8888;
+ xrb->Base.Base.Format = MESA_FORMAT_B8G8R8X8_UNORM;
break;
case PF_8A8R8G8B:
- xrb->Base.Base.Format = MESA_FORMAT_ARGB8888;
+ xrb->Base.Base.Format = MESA_FORMAT_B8G8R8A8_UNORM;
break;
case PF_8A8B8G8R:
- xrb->Base.Base.Format = MESA_FORMAT_RGBA8888_REV;
+ xrb->Base.Base.Format = MESA_FORMAT_R8G8B8A8_UNORM;
break;
case PF_5R6G5B:
xrb->Base.Base.Format = MESA_FORMAT_RGB565;
break;
default:
_mesa_warning(ctx, "Bad pixel format in xmesa_new_renderbuffer");
- xrb->Base.Base.Format = MESA_FORMAT_ARGB8888;
+ xrb->Base.Base.Format = MESA_FORMAT_B8G8R8A8_UNORM;
break;
}
case MESA_FORMAT_BGR888:
c = 3;
break;
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
c = 4;
break;
default:
/*
- * MESA_FORMAT_RGBA8888
+ * MESA_FORMAT_A8B8G8R8_UNORM
*/
static void
/*
- * MESA_FORMAT_RGBA8888_REV
+ * MESA_FORMAT_R8G8B8A8_UNORM
*/
static void
/*
- * MESA_FORMAT_ARGB8888
+ * MESA_FORMAT_B8G8R8A8_UNORM
*/
static void
/*
- * MESA_FORMAT_ARGB8888_REV
+ * MESA_FORMAT_A8R8G8B8_UNORM
*/
static void
/*
- * MESA_FORMAT_XRGB8888
+ * MESA_FORMAT_B8G8R8X8_UNORM
*/
static void
/*
- * MESA_FORMAT_XRGB8888_REV
+ * MESA_FORMAT_X8R8G8B8_UNORM
*/
static void
table[MESA_FORMAT_NONE] = NULL;
- table[MESA_FORMAT_RGBA8888] = pack_ubyte_RGBA8888;
- table[MESA_FORMAT_RGBA8888_REV] = pack_ubyte_RGBA8888_REV;
- table[MESA_FORMAT_ARGB8888] = pack_ubyte_ARGB8888;
- table[MESA_FORMAT_ARGB8888_REV] = pack_ubyte_ARGB8888_REV;
- table[MESA_FORMAT_RGBX8888] = pack_ubyte_RGBA8888; /* reused */
- table[MESA_FORMAT_RGBX8888_REV] = pack_ubyte_RGBA8888_REV; /* reused */
- table[MESA_FORMAT_XRGB8888] = pack_ubyte_XRGB8888;
- table[MESA_FORMAT_XRGB8888_REV] = pack_ubyte_XRGB8888_REV;
+ table[MESA_FORMAT_A8B8G8R8_UNORM] = pack_ubyte_RGBA8888;
+ table[MESA_FORMAT_R8G8B8A8_UNORM] = pack_ubyte_RGBA8888_REV;
+ table[MESA_FORMAT_B8G8R8A8_UNORM] = pack_ubyte_ARGB8888;
+ table[MESA_FORMAT_A8R8G8B8_UNORM] = pack_ubyte_ARGB8888_REV;
+ table[MESA_FORMAT_X8B8G8R8_UNORM] = pack_ubyte_RGBA8888; /* reused */
+ table[MESA_FORMAT_R8G8B8X8_UNORM] = pack_ubyte_RGBA8888_REV; /* reused */
+ table[MESA_FORMAT_B8G8R8X8_UNORM] = pack_ubyte_XRGB8888;
+ table[MESA_FORMAT_X8R8G8B8_UNORM] = pack_ubyte_XRGB8888_REV;
table[MESA_FORMAT_RGB888] = pack_ubyte_RGB888;
table[MESA_FORMAT_BGR888] = pack_ubyte_BGR888;
table[MESA_FORMAT_RGB565] = pack_ubyte_RGB565;
table[MESA_FORMAT_NONE] = NULL;
- table[MESA_FORMAT_RGBA8888] = pack_float_RGBA8888;
- table[MESA_FORMAT_RGBA8888_REV] = pack_float_RGBA8888_REV;
- table[MESA_FORMAT_ARGB8888] = pack_float_ARGB8888;
- table[MESA_FORMAT_ARGB8888_REV] = pack_float_ARGB8888_REV;
- table[MESA_FORMAT_RGBX8888] = pack_float_RGBA8888; /* reused */
- table[MESA_FORMAT_RGBX8888_REV] = pack_float_RGBA8888_REV; /* reused */
- table[MESA_FORMAT_XRGB8888] = pack_float_XRGB8888;
- table[MESA_FORMAT_XRGB8888_REV] = pack_float_XRGB8888_REV;
+ table[MESA_FORMAT_A8B8G8R8_UNORM] = pack_float_RGBA8888;
+ table[MESA_FORMAT_R8G8B8A8_UNORM] = pack_float_RGBA8888_REV;
+ table[MESA_FORMAT_B8G8R8A8_UNORM] = pack_float_ARGB8888;
+ table[MESA_FORMAT_A8R8G8B8_UNORM] = pack_float_ARGB8888_REV;
+ table[MESA_FORMAT_X8B8G8R8_UNORM] = pack_float_RGBA8888; /* reused */
+ table[MESA_FORMAT_R8G8B8X8_UNORM] = pack_float_RGBA8888_REV; /* reused */
+ table[MESA_FORMAT_B8G8R8X8_UNORM] = pack_float_XRGB8888;
+ table[MESA_FORMAT_X8R8G8B8_UNORM] = pack_float_XRGB8888_REV;
table[MESA_FORMAT_RGB888] = pack_float_RGB888;
table[MESA_FORMAT_BGR888] = pack_float_BGR888;
table[MESA_FORMAT_RGB565] = pack_float_RGB565;
*/
memset(table, 0, sizeof(table));
- table[MESA_FORMAT_RGBA8888] = pack_row_float_RGBA8888;
- table[MESA_FORMAT_RGBA8888_REV] = pack_row_float_RGBA8888_REV;
- table[MESA_FORMAT_ARGB8888] = pack_row_float_ARGB8888;
- table[MESA_FORMAT_ARGB8888_REV] = pack_row_float_ARGB8888_REV;
- table[MESA_FORMAT_RGBX8888] = pack_row_float_RGBA8888; /* reused */
- table[MESA_FORMAT_RGBX8888_REV] = pack_row_float_RGBA8888_REV; /* reused */
- table[MESA_FORMAT_XRGB8888] = pack_row_float_XRGB8888;
- table[MESA_FORMAT_XRGB8888_REV] = pack_row_float_XRGB8888_REV;
+ table[MESA_FORMAT_A8B8G8R8_UNORM] = pack_row_float_RGBA8888;
+ table[MESA_FORMAT_R8G8B8A8_UNORM] = pack_row_float_RGBA8888_REV;
+ table[MESA_FORMAT_B8G8R8A8_UNORM] = pack_row_float_ARGB8888;
+ table[MESA_FORMAT_A8R8G8B8_UNORM] = pack_row_float_ARGB8888_REV;
+ table[MESA_FORMAT_X8B8G8R8_UNORM] = pack_row_float_RGBA8888; /* reused */
+ table[MESA_FORMAT_R8G8B8X8_UNORM] = pack_row_float_RGBA8888_REV; /* reused */
+ table[MESA_FORMAT_B8G8R8X8_UNORM] = pack_row_float_XRGB8888;
+ table[MESA_FORMAT_X8R8G8B8_UNORM] = pack_row_float_XRGB8888_REV;
table[MESA_FORMAT_RGB888] = pack_row_float_RGB888;
table[MESA_FORMAT_BGR888] = pack_row_float_BGR888;
table[MESA_FORMAT_RGB565] = pack_row_float_RGB565;
*/
memset(table, 0, sizeof(table));
- table[MESA_FORMAT_RGBA8888] = pack_row_ubyte_RGBA8888;
- table[MESA_FORMAT_RGBA8888_REV] = pack_row_ubyte_RGBA8888_REV;
- table[MESA_FORMAT_ARGB8888] = pack_row_ubyte_ARGB8888;
- table[MESA_FORMAT_ARGB8888_REV] = pack_row_ubyte_ARGB8888_REV;
- table[MESA_FORMAT_RGBX8888] = pack_row_ubyte_RGBA8888; /* reused */
- table[MESA_FORMAT_RGBX8888_REV] = pack_row_ubyte_RGBA8888_REV; /* reused */
- table[MESA_FORMAT_XRGB8888] = pack_row_ubyte_XRGB8888;
- table[MESA_FORMAT_XRGB8888_REV] = pack_row_ubyte_XRGB8888_REV;
+ table[MESA_FORMAT_A8B8G8R8_UNORM] = pack_row_ubyte_RGBA8888;
+ table[MESA_FORMAT_R8G8B8A8_UNORM] = pack_row_ubyte_RGBA8888_REV;
+ table[MESA_FORMAT_B8G8R8A8_UNORM] = pack_row_ubyte_ARGB8888;
+ table[MESA_FORMAT_A8R8G8B8_UNORM] = pack_row_ubyte_ARGB8888_REV;
+ table[MESA_FORMAT_X8B8G8R8_UNORM] = pack_row_ubyte_RGBA8888; /* reused */
+ table[MESA_FORMAT_R8G8B8X8_UNORM] = pack_row_ubyte_RGBA8888_REV; /* reused */
+ table[MESA_FORMAT_B8G8R8X8_UNORM] = pack_row_ubyte_XRGB8888;
+ table[MESA_FORMAT_X8R8G8B8_UNORM] = pack_row_ubyte_XRGB8888_REV;
table[MESA_FORMAT_RGB888] = pack_row_ubyte_RGB888;
table[MESA_FORMAT_BGR888] = pack_row_ubyte_BGR888;
table[MESA_FORMAT_RGB565] = pack_row_ubyte_RGB565;
if (!initialized) {
table[MESA_FORMAT_NONE] = NULL;
- table[MESA_FORMAT_RGBA8888] = unpack_RGBA8888;
- table[MESA_FORMAT_RGBA8888_REV] = unpack_RGBA8888_REV;
- table[MESA_FORMAT_ARGB8888] = unpack_ARGB8888;
- table[MESA_FORMAT_ARGB8888_REV] = unpack_ARGB8888_REV;
- table[MESA_FORMAT_RGBX8888] = unpack_RGBX8888;
- table[MESA_FORMAT_RGBX8888_REV] = unpack_RGBX8888_REV;
- table[MESA_FORMAT_XRGB8888] = unpack_XRGB8888;
- table[MESA_FORMAT_XRGB8888_REV] = unpack_XRGB8888_REV;
+ table[MESA_FORMAT_A8B8G8R8_UNORM] = unpack_RGBA8888;
+ table[MESA_FORMAT_R8G8B8A8_UNORM] = unpack_RGBA8888_REV;
+ table[MESA_FORMAT_B8G8R8A8_UNORM] = unpack_ARGB8888;
+ table[MESA_FORMAT_A8R8G8B8_UNORM] = unpack_ARGB8888_REV;
+ table[MESA_FORMAT_X8B8G8R8_UNORM] = unpack_RGBX8888;
+ table[MESA_FORMAT_R8G8B8X8_UNORM] = unpack_RGBX8888_REV;
+ table[MESA_FORMAT_B8G8R8X8_UNORM] = unpack_XRGB8888;
+ table[MESA_FORMAT_X8R8G8B8_UNORM] = unpack_XRGB8888_REV;
table[MESA_FORMAT_RGB888] = unpack_RGB888;
table[MESA_FORMAT_BGR888] = unpack_BGR888;
table[MESA_FORMAT_RGB565] = unpack_RGB565;
const void *src, GLubyte dst[][4])
{
switch (format) {
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
unpack_ubyte_RGBA8888(src, dst, n);
break;
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
unpack_ubyte_RGBA8888_REV(src, dst, n);
break;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
unpack_ubyte_ARGB8888(src, dst, n);
break;
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_A8R8G8B8_UNORM:
unpack_ubyte_ARGB8888_REV(src, dst, n);
break;
- case MESA_FORMAT_RGBX8888:
+ case MESA_FORMAT_X8B8G8R8_UNORM:
unpack_ubyte_RGBX8888(src, dst, n);
break;
- case MESA_FORMAT_RGBX8888_REV:
+ case MESA_FORMAT_R8G8B8X8_UNORM:
unpack_ubyte_RGBX8888_REV(src, dst, n);
break;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
unpack_ubyte_XRGB8888(src, dst, n);
break;
- case MESA_FORMAT_XRGB8888_REV:
+ case MESA_FORMAT_X8R8G8B8_UNORM:
unpack_ubyte_XRGB8888_REV(src, dst, n);
break;
case MESA_FORMAT_RGB888:
unpack_int_rgba_RGBA_INT8(src, dst, n);
break;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
unpack_int_rgba_ARGB8888(src, dst, n);
break;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
unpack_int_rgba_XRGB8888(src, dst, n);
break;
0, 0, 0 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_RGBA8888, /* Name */
- "MESA_FORMAT_RGBA8888", /* StrName */
+ MESA_FORMAT_A8B8G8R8_UNORM, /* Name */
+ "MESA_FORMAT_A8B8G8R8_UNORM", /* StrName */
GL_RGBA, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_RGBA8888_REV, /* Name */
- "MESA_FORMAT_RGBA8888_REV", /* StrName */
+ MESA_FORMAT_R8G8B8A8_UNORM, /* Name */
+ "MESA_FORMAT_R8G8B8A8_UNORM", /* StrName */
GL_RGBA, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_ARGB8888, /* Name */
- "MESA_FORMAT_ARGB8888", /* StrName */
+ MESA_FORMAT_B8G8R8A8_UNORM, /* Name */
+ "MESA_FORMAT_B8G8R8A8_UNORM", /* StrName */
GL_RGBA, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_ARGB8888_REV, /* Name */
- "MESA_FORMAT_ARGB8888_REV", /* StrName */
+ MESA_FORMAT_A8R8G8B8_UNORM, /* Name */
+ "MESA_FORMAT_A8R8G8B8_UNORM", /* StrName */
GL_RGBA, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_RGBX8888, /* Name */
- "MESA_FORMAT_RGBX8888", /* StrName */
+ MESA_FORMAT_X8B8G8R8_UNORM, /* Name */
+ "MESA_FORMAT_X8B8G8R8_UNORM", /* StrName */
GL_RGB, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_RGBX8888_REV, /* Name */
- "MESA_FORMAT_RGBX8888_REV", /* StrName */
+ MESA_FORMAT_R8G8B8X8_UNORM, /* Name */
+ "MESA_FORMAT_R8G8B8X8_UNORM", /* StrName */
GL_RGB, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_XRGB8888, /* Name */
- "MESA_FORMAT_XRGB8888", /* StrName */
+ MESA_FORMAT_B8G8R8X8_UNORM, /* Name */
+ "MESA_FORMAT_B8G8R8X8_UNORM", /* StrName */
GL_RGB, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_XRGB8888_REV, /* Name */
- "MESA_FORMAT_XRGB8888_REV", /* StrName */
+ MESA_FORMAT_X8R8G8B8_UNORM, /* Name */
+ "MESA_FORMAT_X8R8G8B8_UNORM", /* StrName */
GL_RGB, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */
format = MESA_FORMAT_RGB888;
break;
case MESA_FORMAT_SRGBA8:
- format = MESA_FORMAT_RGBA8888;
+ format = MESA_FORMAT_A8B8G8R8_UNORM;
break;
case MESA_FORMAT_SARGB8:
- format = MESA_FORMAT_ARGB8888;
+ format = MESA_FORMAT_B8G8R8A8_UNORM;
break;
case MESA_FORMAT_SL8:
format = MESA_FORMAT_L8;
format = MESA_FORMAT_RGBA_DXT5;
break;
case MESA_FORMAT_XBGR8888_SRGB:
- format = MESA_FORMAT_RGBX8888_REV;
+ format = MESA_FORMAT_R8G8B8X8_UNORM;
break;
case MESA_FORMAT_ETC2_SRGB8:
format = MESA_FORMAT_ETC2_RGB8;
case MESA_FORMAT_RGB_FXT1:
return MESA_FORMAT_RGB888;
case MESA_FORMAT_RGBA_FXT1:
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_A8B8G8R8_UNORM;
case MESA_FORMAT_RGB_DXT1:
case MESA_FORMAT_SRGB_DXT1:
return MESA_FORMAT_RGB888;
case MESA_FORMAT_RGBA_DXT1:
case MESA_FORMAT_SRGBA_DXT1:
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_A8B8G8R8_UNORM;
case MESA_FORMAT_RGBA_DXT3:
case MESA_FORMAT_SRGBA_DXT3:
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_A8B8G8R8_UNORM;
case MESA_FORMAT_RGBA_DXT5:
case MESA_FORMAT_SRGBA_DXT5:
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_A8B8G8R8_UNORM;
case MESA_FORMAT_RED_RGTC1:
return MESA_FORMAT_R8;
case MESA_FORMAT_SIGNED_RED_RGTC1:
case MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC:
case MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1:
case MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1:
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_A8B8G8R8_UNORM;
case MESA_FORMAT_ETC2_R11_EAC:
case MESA_FORMAT_ETC2_SIGNED_R11_EAC:
return MESA_FORMAT_R16;
GLenum *datatype, GLuint *comps)
{
switch (format) {
- case MESA_FORMAT_RGBA8888:
- case MESA_FORMAT_RGBA8888_REV:
- case MESA_FORMAT_ARGB8888:
- case MESA_FORMAT_ARGB8888_REV:
- case MESA_FORMAT_RGBX8888:
- case MESA_FORMAT_RGBX8888_REV:
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_XRGB8888_REV:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
+ case MESA_FORMAT_A8R8G8B8_UNORM:
+ case MESA_FORMAT_X8B8G8R8_UNORM:
+ case MESA_FORMAT_R8G8B8X8_UNORM:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
+ case MESA_FORMAT_X8R8G8B8_UNORM:
*datatype = GL_UNSIGNED_BYTE;
*comps = 4;
return;
case MESA_FORMAT_COUNT:
return GL_FALSE;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
case MESA_FORMAT_SRGBA8:
if (format == GL_RGBA && type == GL_UNSIGNED_INT_8_8_8_8 && !swapBytes)
return GL_TRUE;
return GL_FALSE;
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
if (format == GL_RGBA && type == GL_UNSIGNED_INT_8_8_8_8_REV &&
!swapBytes)
return GL_TRUE;
return GL_FALSE;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
case MESA_FORMAT_SARGB8:
if (format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV &&
!swapBytes)
return GL_FALSE;
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_A8R8G8B8_UNORM:
if (format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8 && !swapBytes)
return GL_TRUE;
return GL_FALSE;
- case MESA_FORMAT_RGBX8888:
- case MESA_FORMAT_RGBX8888_REV:
+ case MESA_FORMAT_X8B8G8R8_UNORM:
+ case MESA_FORMAT_R8G8B8X8_UNORM:
return GL_FALSE;
- case MESA_FORMAT_XRGB8888:
- case MESA_FORMAT_XRGB8888_REV:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
+ case MESA_FORMAT_X8R8G8B8_UNORM:
return GL_FALSE;
case MESA_FORMAT_RGB888:
* \name Basic hardware formats
*/
/*@{*/
- /* msb <------ TEXEL BITS -----------> lsb */
- /* ---- ---- ---- ---- ---- ---- ---- ---- */
- MESA_FORMAT_RGBA8888, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */
- MESA_FORMAT_RGBA8888_REV, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */
- MESA_FORMAT_ARGB8888, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */
- MESA_FORMAT_ARGB8888_REV, /* BBBB BBBB GGGG GGGG RRRR RRRR AAAA AAAA */
- MESA_FORMAT_RGBX8888, /* RRRR RRRR GGGG GGGG BBBB BBBB XXXX XXXX */
- MESA_FORMAT_RGBX8888_REV, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */
- MESA_FORMAT_XRGB8888, /* xxxx xxxx RRRR RRRR GGGG GGGG BBBB BBBB */
- MESA_FORMAT_XRGB8888_REV, /* BBBB BBBB GGGG GGGG RRRR RRRR xxxx xxxx */
+ /* msb <------ TEXEL BITS -----------> lsb */
+ /* ---- ---- ---- ---- ---- ---- ---- ---- */
+ MESA_FORMAT_A8B8G8R8_UNORM, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */
+ MESA_FORMAT_R8G8B8A8_UNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */
+ MESA_FORMAT_B8G8R8A8_UNORM, /* BBBB BBBB GGGG GGGG RRRR RRRR AAAA AAAA */
+ MESA_FORMAT_A8R8G8B8_UNORM, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */
+ MESA_FORMAT_X8B8G8R8_UNORM, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */
+ MESA_FORMAT_R8G8B8X8_UNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB xxxx xxxx */
+ MESA_FORMAT_B8G8R8X8_UNORM, /* BBBB BBBB GGGG GGGG RRRR RRRR xxxx xxxx */
+ MESA_FORMAT_X8R8G8B8_UNORM, /* xxxx xxxx RRRR RRRR GGGG GGGG BBBB BBBB */
MESA_FORMAT_RGB888, /* RRRR RRRR GGGG GGGG BBBB BBBB */
MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */
MESA_FORMAT_RGB565, /* RRRR RGGG GGGB BBBB */
const GLenum format = ctx->ReadBuffer->_ColorReadBuffer->Format;
const GLenum data_type = _mesa_get_format_datatype(format);
- if (format == MESA_FORMAT_ARGB8888)
+ if (format == MESA_FORMAT_B8G8R8A8_UNORM)
return GL_BGRA;
else if (format == MESA_FORMAT_RGB565)
return GL_BGR;
GLboolean swizzle_rb = GL_FALSE, copy_xrgb = GL_FALSE;
/* XXX we could check for other swizzle/special cases here as needed */
- if (rb->Format == MESA_FORMAT_RGBA8888_REV &&
+ if (rb->Format == MESA_FORMAT_R8G8B8A8_UNORM &&
format == GL_BGRA &&
type == GL_UNSIGNED_INT_8_8_8_8_REV &&
!ctx->Pack.SwapBytes) {
swizzle_rb = GL_TRUE;
}
- else if (rb->Format == MESA_FORMAT_XRGB8888 &&
+ else if (rb->Format == MESA_FORMAT_B8G8R8X8_UNORM &&
format == GL_BGRA &&
type == GL_UNSIGNED_INT_8_8_8_8_REV &&
!ctx->Pack.SwapBytes) {
* results.
*/
#ifdef MESA_BIG_ENDIAN
-# define MESA_FORMAT_RGBA_8 MESA_FORMAT_RGBA8888
+# define MESA_FORMAT_RGBA_8 MESA_FORMAT_A8B8G8R8_UNORM
# define MESA_FORMAT_RG_16 MESA_FORMAT_RG1616
# define MESA_FORMAT_RG_8 MESA_FORMAT_RG88
# define MESA_FORMAT_SIGNED_RGBA_8 MESA_FORMAT_SIGNED_RGBA8888
# define MESA_FORMAT_SIGNED_RG_16 MESA_FORMAT_SIGNED_RG1616
# define MESA_FORMAT_SIGNED_RG_8 MESA_FORMAT_SIGNED_RG88
#else
-# define MESA_FORMAT_RGBA_8 MESA_FORMAT_RGBA8888_REV
+# define MESA_FORMAT_RGBA_8 MESA_FORMAT_R8G8B8A8_UNORM
# define MESA_FORMAT_RG_16 MESA_FORMAT_GR1616
# define MESA_FORMAT_RG_8 MESA_FORMAT_GR88
# define MESA_FORMAT_SIGNED_RGBA_8 MESA_FORMAT_SIGNED_RGBA8888_REV
} else if (type == GL_UNSIGNED_INT_2_10_10_10_REV) {
RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010);
}
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
break;
case GL_RGBA8:
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
break;
case GL_RGB5_A1:
RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB1555);
/* deep RGBA formats */
case GL_RGB10_A2:
RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
break;
case GL_RGBA12:
case GL_RGBA16:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16);
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
break;
/* shallow RGB formats */
/* fallthrough */
case GL_RGB8:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8X8_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
break;
case GL_R3_G3_B2:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB332);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565_REV);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8X8_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
break;
case GL_RGB4:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565_REV); /* just to test another format */
case GL_RGB16:
RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_UNORM);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8X8_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
break;
/* Alpha formats */
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FXT1);
}
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XRGB8888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8X8_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
break;
case GL_COMPRESSED_RGBA_ARB:
/* We don't use texture compression for 1D and 1D array textures. */
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_DXT3); /* Not rgba_dxt1, see spec */
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FXT1);
}
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA8888);
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
break;
case GL_RGB565:
break;
case GL_BGRA:
- RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
break;
}
switch (internalFormat) {
case GL_RGBA8:
- return MESA_FORMAT_RGBA8888_REV;
+ return MESA_FORMAT_R8G8B8A8_UNORM;
case GL_RGBA16:
return MESA_FORMAT_RGBA_16;
case GL_RGBA16F_ARB:
/**
- * Store a texture in MESA_FORMAT_RGBA8888 or MESA_FORMAT_RGBA8888_REV.
+ * Store a texture in MESA_FORMAT_A8B8G8R8_UNORM or MESA_FORMAT_R8G8B8A8_UNORM.
*/
static GLboolean
_mesa_texstore_rgba8888(TEXSTORE_PARAMS)
{
const GLboolean littleEndian = _mesa_little_endian();
- ASSERT(dstFormat == MESA_FORMAT_RGBA8888 ||
- dstFormat == MESA_FORMAT_RGBA8888_REV ||
- dstFormat == MESA_FORMAT_RGBX8888 ||
- dstFormat == MESA_FORMAT_RGBX8888_REV);
+ ASSERT(dstFormat == MESA_FORMAT_A8B8G8R8_UNORM ||
+ dstFormat == MESA_FORMAT_R8G8B8A8_UNORM ||
+ dstFormat == MESA_FORMAT_X8B8G8R8_UNORM ||
+ dstFormat == MESA_FORMAT_R8G8B8X8_UNORM);
ASSERT(_mesa_get_format_bytes(dstFormat) == 4);
if (!ctx->_ImageTransferState &&
/* dstmap - how to swizzle from RGBA to dst format:
*/
- if ((littleEndian && (dstFormat == MESA_FORMAT_RGBA8888 ||
- dstFormat == MESA_FORMAT_RGBX8888)) ||
- (!littleEndian && (dstFormat == MESA_FORMAT_RGBA8888_REV ||
- dstFormat == MESA_FORMAT_RGBX8888_REV))) {
+ if ((littleEndian && (dstFormat == MESA_FORMAT_A8B8G8R8_UNORM ||
+ dstFormat == MESA_FORMAT_X8B8G8R8_UNORM)) ||
+ (!littleEndian && (dstFormat == MESA_FORMAT_R8G8B8A8_UNORM ||
+ dstFormat == MESA_FORMAT_R8G8B8X8_UNORM))) {
dstmap[3] = 0;
dstmap[2] = 1;
dstmap[1] = 2;
{
const GLboolean littleEndian = _mesa_little_endian();
- ASSERT(dstFormat == MESA_FORMAT_ARGB8888 ||
- dstFormat == MESA_FORMAT_ARGB8888_REV ||
- dstFormat == MESA_FORMAT_XRGB8888 ||
- dstFormat == MESA_FORMAT_XRGB8888_REV );
+ ASSERT(dstFormat == MESA_FORMAT_B8G8R8A8_UNORM ||
+ dstFormat == MESA_FORMAT_A8R8G8B8_UNORM ||
+ dstFormat == MESA_FORMAT_B8G8R8X8_UNORM ||
+ dstFormat == MESA_FORMAT_X8R8G8B8_UNORM );
ASSERT(_mesa_get_format_bytes(dstFormat) == 4);
if (!ctx->_ImageTransferState &&
!srcPacking->SwapBytes &&
- (dstFormat == MESA_FORMAT_ARGB8888 ||
- dstFormat == MESA_FORMAT_XRGB8888) &&
+ (dstFormat == MESA_FORMAT_B8G8R8A8_UNORM ||
+ dstFormat == MESA_FORMAT_B8G8R8X8_UNORM) &&
srcFormat == GL_RGB &&
(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB) &&
}
else if (!ctx->_ImageTransferState &&
!srcPacking->SwapBytes &&
- dstFormat == MESA_FORMAT_ARGB8888 &&
+ dstFormat == MESA_FORMAT_B8G8R8A8_UNORM &&
srcFormat == GL_LUMINANCE_ALPHA &&
baseInternalFormat == GL_RGBA &&
srcType == GL_UNSIGNED_BYTE) {
}
else if (!ctx->_ImageTransferState &&
!srcPacking->SwapBytes &&
- dstFormat == MESA_FORMAT_ARGB8888 &&
+ dstFormat == MESA_FORMAT_B8G8R8A8_UNORM &&
srcFormat == GL_RGBA &&
baseInternalFormat == GL_RGBA &&
srcType == GL_UNSIGNED_BYTE) {
/* dstmap - how to swizzle from RGBA to dst format:
*/
- if ((littleEndian && dstFormat == MESA_FORMAT_ARGB8888) ||
- (littleEndian && dstFormat == MESA_FORMAT_XRGB8888) ||
- (!littleEndian && dstFormat == MESA_FORMAT_ARGB8888_REV) ||
- (!littleEndian && dstFormat == MESA_FORMAT_XRGB8888_REV)) {
+ if ((littleEndian && dstFormat == MESA_FORMAT_B8G8R8A8_UNORM) ||
+ (littleEndian && dstFormat == MESA_FORMAT_B8G8R8X8_UNORM) ||
+ (!littleEndian && dstFormat == MESA_FORMAT_A8R8G8B8_UNORM) ||
+ (!littleEndian && dstFormat == MESA_FORMAT_X8R8G8B8_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) ||
- (!littleEndian && dstFormat == MESA_FORMAT_ARGB8888) ||
- (littleEndian && dstFormat == MESA_FORMAT_XRGB8888_REV) ||
- (!littleEndian && dstFormat == MESA_FORMAT_XRGB8888));
+ assert((littleEndian && dstFormat == MESA_FORMAT_A8R8G8B8_UNORM) ||
+ (!littleEndian && dstFormat == MESA_FORMAT_B8G8R8A8_UNORM) ||
+ (littleEndian && dstFormat == MESA_FORMAT_X8R8G8B8_UNORM) ||
+ (!littleEndian && dstFormat == MESA_FORMAT_B8G8R8X8_UNORM));
dstmap[3] = 2;
dstmap[2] = 1;
dstmap[1] = 0;
/* reuse normal rgba texstore code */
if (dstFormat == MESA_FORMAT_SRGBA8) {
- newDstFormat = MESA_FORMAT_RGBA8888;
+ newDstFormat = MESA_FORMAT_A8B8G8R8_UNORM;
}
else if (dstFormat == MESA_FORMAT_XBGR8888_SRGB) {
- newDstFormat = MESA_FORMAT_RGBX8888_REV;
+ newDstFormat = MESA_FORMAT_R8G8B8X8_UNORM;
}
else {
ASSERT(0);
ASSERT(dstFormat == MESA_FORMAT_SARGB8);
/* reuse normal rgba texstore code */
- newDstFormat = MESA_FORMAT_ARGB8888;
+ newDstFormat = MESA_FORMAT_B8G8R8A8_UNORM;
k = _mesa_texstore_argb8888(ctx, dims, baseInternalFormat,
newDstFormat,
if (!initialized) {
table[MESA_FORMAT_NONE] = _mesa_texstore_null;
- table[MESA_FORMAT_RGBA8888] = _mesa_texstore_rgba8888;
- table[MESA_FORMAT_RGBA8888_REV] = _mesa_texstore_rgba8888;
- table[MESA_FORMAT_ARGB8888] = _mesa_texstore_argb8888;
- table[MESA_FORMAT_ARGB8888_REV] = _mesa_texstore_argb8888;
- table[MESA_FORMAT_RGBX8888] = _mesa_texstore_rgba8888;
- table[MESA_FORMAT_RGBX8888_REV] = _mesa_texstore_rgba8888;
- table[MESA_FORMAT_XRGB8888] = _mesa_texstore_argb8888;
- table[MESA_FORMAT_XRGB8888_REV] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_A8B8G8R8_UNORM] = _mesa_texstore_rgba8888;
+ table[MESA_FORMAT_R8G8B8A8_UNORM] = _mesa_texstore_rgba8888;
+ table[MESA_FORMAT_B8G8R8A8_UNORM] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_A8R8G8B8_UNORM] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_X8B8G8R8_UNORM] = _mesa_texstore_rgba8888;
+ table[MESA_FORMAT_R8G8B8X8_UNORM] = _mesa_texstore_rgba8888;
+ table[MESA_FORMAT_B8G8R8X8_UNORM] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_X8R8G8B8_UNORM] = _mesa_texstore_argb8888;
table[MESA_FORMAT_RGB888] = _mesa_texstore_rgb888;
table[MESA_FORMAT_BGR888] = _mesa_texstore_bgr888;
table[MESA_FORMAT_RGB565] = _mesa_texstore_rgb565;
st_mesa_format_to_pipe_format(mesa_format mesaFormat)
{
switch (mesaFormat) {
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
return PIPE_FORMAT_ABGR8888_UNORM;
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
return PIPE_FORMAT_RGBA8888_UNORM;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
return PIPE_FORMAT_BGRA8888_UNORM;
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_A8R8G8B8_UNORM:
return PIPE_FORMAT_ARGB8888_UNORM;
- case MESA_FORMAT_RGBX8888:
+ case MESA_FORMAT_X8B8G8R8_UNORM:
return PIPE_FORMAT_XBGR8888_UNORM;
- case MESA_FORMAT_RGBX8888_REV:
+ case MESA_FORMAT_R8G8B8X8_UNORM:
return PIPE_FORMAT_RGBX8888_UNORM;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
return PIPE_FORMAT_BGRX8888_UNORM;
- case MESA_FORMAT_XRGB8888_REV:
+ case MESA_FORMAT_X8R8G8B8_UNORM:
return PIPE_FORMAT_XRGB8888_UNORM;
case MESA_FORMAT_ARGB1555:
return PIPE_FORMAT_B5G5R5A1_UNORM;
{
switch (format) {
case PIPE_FORMAT_ABGR8888_UNORM:
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_A8B8G8R8_UNORM;
case PIPE_FORMAT_RGBA8888_UNORM:
- return MESA_FORMAT_RGBA8888_REV;
+ return MESA_FORMAT_R8G8B8A8_UNORM;
case PIPE_FORMAT_BGRA8888_UNORM:
- return MESA_FORMAT_ARGB8888;
+ return MESA_FORMAT_B8G8R8A8_UNORM;
case PIPE_FORMAT_ARGB8888_UNORM:
- return MESA_FORMAT_ARGB8888_REV;
+ return MESA_FORMAT_A8R8G8B8_UNORM;
case PIPE_FORMAT_XBGR8888_UNORM:
- return MESA_FORMAT_RGBX8888;
+ return MESA_FORMAT_X8B8G8R8_UNORM;
case PIPE_FORMAT_RGBX8888_UNORM:
- return MESA_FORMAT_RGBX8888_REV;
+ return MESA_FORMAT_R8G8B8X8_UNORM;
case PIPE_FORMAT_BGRX8888_UNORM:
- return MESA_FORMAT_XRGB8888;
+ return MESA_FORMAT_B8G8R8X8_UNORM;
case PIPE_FORMAT_XRGB8888_UNORM:
- return MESA_FORMAT_XRGB8888_REV;
+ return MESA_FORMAT_X8R8G8B8_UNORM;
case PIPE_FORMAT_B5G5R5A1_UNORM:
return MESA_FORMAT_ARGB1555;
case PIPE_FORMAT_B4G4R4A4_UNORM:
if (format == GL_RGB &&
type == GL_UNSIGNED_BYTE &&
- (rb->Format == MESA_FORMAT_XRGB8888 ||
- rb->Format == MESA_FORMAT_ARGB8888)) {
+ (rb->Format == MESA_FORMAT_B8G8R8X8_UNORM ||
+ rb->Format == MESA_FORMAT_B8G8R8A8_UNORM)) {
fast_draw_rgb_ubyte_pixels(ctx, rb, x, y, width, height,
&unpack, pixels);
return GL_TRUE;
if (format == GL_RGBA &&
type == GL_UNSIGNED_BYTE &&
- (rb->Format == MESA_FORMAT_XRGB8888 ||
- rb->Format == MESA_FORMAT_ARGB8888)) {
+ (rb->Format == MESA_FORMAT_B8G8R8X8_UNORM ||
+ rb->Format == MESA_FORMAT_B8G8R8A8_UNORM)) {
fast_draw_rgba_ubyte_pixels(ctx, rb, x, y, width, height,
&unpack, pixels);
return GL_TRUE;
case GL_RGBA12:
#endif
if (_mesa_little_endian())
- rb->Format = MESA_FORMAT_RGBA8888_REV;
+ rb->Format = MESA_FORMAT_R8G8B8A8_UNORM;
else
- rb->Format = MESA_FORMAT_RGBA8888;
+ rb->Format = MESA_FORMAT_A8B8G8R8_UNORM;
break;
case GL_RGBA16:
case GL_RGBA16_SNORM:
},
{
- MESA_FORMAT_RGBA8888,
+ MESA_FORMAT_A8B8G8R8_UNORM,
fetch_texel_1d_f_rgba8888,
fetch_texel_2d_f_rgba8888,
fetch_texel_3d_f_rgba8888
},
{
- MESA_FORMAT_RGBA8888_REV,
+ MESA_FORMAT_R8G8B8A8_UNORM,
fetch_texel_1d_f_rgba8888_rev,
fetch_texel_2d_f_rgba8888_rev,
fetch_texel_3d_f_rgba8888_rev
},
{
- MESA_FORMAT_ARGB8888,
+ MESA_FORMAT_B8G8R8A8_UNORM,
fetch_texel_1d_f_argb8888,
fetch_texel_2d_f_argb8888,
fetch_texel_3d_f_argb8888
},
{
- MESA_FORMAT_ARGB8888_REV,
+ MESA_FORMAT_A8R8G8B8_UNORM,
fetch_texel_1d_f_argb8888_rev,
fetch_texel_2d_f_argb8888_rev,
fetch_texel_3d_f_argb8888_rev
},
{
- MESA_FORMAT_RGBX8888,
+ MESA_FORMAT_X8B8G8R8_UNORM,
fetch_texel_1d_f_rgbx8888,
fetch_texel_2d_f_rgbx8888,
fetch_texel_3d_f_rgbx8888
},
{
- MESA_FORMAT_RGBX8888_REV,
+ MESA_FORMAT_R8G8B8X8_UNORM,
fetch_texel_1d_f_rgbx8888_rev,
fetch_texel_2d_f_rgbx8888_rev,
fetch_texel_3d_f_rgbx8888_rev
},
{
- MESA_FORMAT_XRGB8888,
+ MESA_FORMAT_B8G8R8X8_UNORM,
fetch_texel_1d_f_xrgb8888,
fetch_texel_2d_f_xrgb8888,
fetch_texel_3d_f_xrgb8888
},
{
- MESA_FORMAT_XRGB8888_REV,
+ MESA_FORMAT_X8R8G8B8_UNORM,
fetch_texel_1d_f_xrgb8888_rev,
fetch_texel_2d_f_xrgb8888_rev,
fetch_texel_3d_f_xrgb8888_rev
* Begin Hardware formats
*/
-/* MESA_FORMAT_RGBA8888 ******************************************************/
+/* MESA_FORMAT_A8B8G8R8_UNORM ******************************************************/
/* Fetch texel from 1D, 2D or 3D rgba8888 texture, return 4 GLfloats */
static void FETCH(f_rgba8888)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_ARGB8888 ******************************************************/
+/* MESA_FORMAT_B8G8R8A8_UNORM ******************************************************/
/* Fetch texel from 1D, 2D or 3D argb8888 texture, return 4 GLchans */
static void FETCH(f_argb8888)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_ARGB8888_REV **************************************************/
+/* MESA_FORMAT_A8R8G8B8_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,
-/* MESA_FORMAT_RGBX8888 ******************************************************/
+/* MESA_FORMAT_X8B8G8R8_UNORM ******************************************************/
/* Fetch texel from 1D, 2D or 3D rgbx8888 texture, return 4 GLfloats */
static void FETCH(f_rgbx8888)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_XRGB8888 ******************************************************/
+/* MESA_FORMAT_B8G8R8X8_UNORM ******************************************************/
/* Fetch texel from 1D, 2D or 3D xrgb8888 texture, return 4 GLchans */
static void FETCH(f_xrgb8888)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_XRGB8888_REV **************************************************/
+/* MESA_FORMAT_X8R8G8B8_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,
ASSERT(samp->WrapS==GL_REPEAT);
ASSERT(samp->WrapT==GL_REPEAT);
ASSERT(img->Border==0);
- ASSERT(img->TexFormat == MESA_FORMAT_RGBA8888);
+ ASSERT(img->TexFormat == MESA_FORMAT_A8B8G8R8_UNORM);
ASSERT(swImg->_IsPowerOfTwo);
(void) swImg;
opt_sample_rgb_2d(ctx, samp, tObj, m, texcoords + minStart,
NULL, rgba + minStart);
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
opt_sample_rgba_2d(ctx, samp, tObj, m, texcoords + minStart,
NULL, rgba + minStart);
break;
opt_sample_rgb_2d(ctx, samp, tObj, m, texcoords + magStart,
NULL, rgba + magStart);
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
opt_sample_rgba_2d(ctx, samp, tObj, m, texcoords + magStart,
NULL, rgba + magStart);
break;
img->Border == 0) {
if (img->TexFormat == MESA_FORMAT_RGB888)
func = &opt_sample_rgb_2d;
- else if (img->TexFormat == MESA_FORMAT_RGBA8888)
+ else if (img->TexFormat == MESA_FORMAT_A8B8G8R8_UNORM)
func = &opt_sample_rgba_2d;
}
return;
}
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
switch(info->envmode) {
case GL_MODULATE:
SPAN_NEAREST(NEAREST_RGBA;MODULATE,4);
return;
}
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
switch (info->envmode) {
case GL_MODULATE:
SPAN_LINEAR(LINEAR_RGBA;MODULATE,4);
case MESA_FORMAT_RGB888: \
info.tbytesline = texImg->Width * 3; \
break; \
- case MESA_FORMAT_RGBA8888: \
+ case MESA_FORMAT_A8B8G8R8_UNORM: \
info.tbytesline = texImg->Width * 4; \
break; \
default: \
return;
}
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
switch(info->envmode) {
case GL_MODULATE:
SPAN_NEAREST(NEAREST_RGBA;MODULATE,4);
return;
}
break;
- case MESA_FORMAT_RGBA8888:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
switch (info->envmode) {
case GL_MODULATE:
SPAN_LINEAR(LINEAR_RGBA;MODULATE,4);
case MESA_FORMAT_RGB888: \
info.tbytesline = texImg->Width * 3; \
break; \
- case MESA_FORMAT_RGBA8888: \
+ case MESA_FORMAT_A8B8G8R8_UNORM: \
info.tbytesline = texImg->Width * 4; \
break; \
default: \
&& texImg->Border == 0
&& (_mesa_format_row_stride(format, texImg->Width) ==
swImg->RowStride)
- && (format == MESA_FORMAT_RGB888 || format == MESA_FORMAT_RGBA8888)
+ && (format == MESA_FORMAT_RGB888 || format == MESA_FORMAT_A8B8G8R8_UNORM)
&& minFilter == magFilter
&& ctx->Light.Model.ColorControl == GL_SINGLE_COLOR
&& !swrast->_FogEnabled
#if CHAN_BITS != 8
USE(general_triangle);
#else
- if (format == MESA_FORMAT_RGBA8888 && !_mesa_little_endian()) {
+ if (format == MESA_FORMAT_A8B8G8R8_UNORM && !_mesa_little_endian()) {
/* We only handle RGBA8888 correctly on little endian
* in the optimized code above.
*/