return __DRI_IMAGE_FORMAT_ABGR8888;
case MESA_FORMAT_R8G8B8X8_UNORM:
return __DRI_IMAGE_FORMAT_XBGR8888;
- case MESA_FORMAT_R8:
+ case MESA_FORMAT_R_UNORM8:
return __DRI_IMAGE_FORMAT_R8;
case MESA_FORMAT_GR88:
return __DRI_IMAGE_FORMAT_GR88;
case __DRI_IMAGE_FORMAT_XBGR8888:
return MESA_FORMAT_R8G8B8X8_UNORM;
case __DRI_IMAGE_FORMAT_R8:
- return MESA_FORMAT_R8;
+ return MESA_FORMAT_R_UNORM8;
case __DRI_IMAGE_FORMAT_GR88:
return MESA_FORMAT_GR88;
case __DRI_IMAGE_FORMAT_SARGB8:
translate_texture_format(GLuint mesa_format)
{
switch (mesa_format) {
- case MESA_FORMAT_L8:
+ case MESA_FORMAT_L_UNORM8:
return MAPSURF_8BIT | MT_8BIT_L8;
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_I_UNORM8:
return MAPSURF_8BIT | MT_8BIT_I8;
- case MESA_FORMAT_A8:
+ case MESA_FORMAT_A_UNORM8:
return MAPSURF_8BIT | MT_8BIT_I8; /* Kludge! */
case MESA_FORMAT_AL88:
return MAPSURF_16BIT | MT_16BIT_AY88;
if (format == MESA_FORMAT_S8_Z24 ||
format == MESA_FORMAT_X8_Z24 ||
- format == MESA_FORMAT_Z16) {
+ format == MESA_FORMAT_Z_UNORM16) {
return true;
}
ctx->TextureFormatSupported[MESA_FORMAT_ARGB4444] = true;
ctx->TextureFormatSupported[MESA_FORMAT_ARGB1555] = true;
ctx->TextureFormatSupported[MESA_FORMAT_RGB565] = true;
- ctx->TextureFormatSupported[MESA_FORMAT_L8] = true;
- ctx->TextureFormatSupported[MESA_FORMAT_A8] = true;
- ctx->TextureFormatSupported[MESA_FORMAT_I8] = true;
+ ctx->TextureFormatSupported[MESA_FORMAT_L_UNORM8] = true;
+ ctx->TextureFormatSupported[MESA_FORMAT_A_UNORM8] = true;
+ ctx->TextureFormatSupported[MESA_FORMAT_I_UNORM8] = true;
ctx->TextureFormatSupported[MESA_FORMAT_AL88] = true;
/* Depth and stencil */
* combo that actually works, so this can probably be re-enabled.
*/
/*
- ctx->TextureFormatSupported[MESA_FORMAT_Z16] = true;
+ ctx->TextureFormatSupported[MESA_FORMAT_Z_UNORM16] = true;
ctx->TextureFormatSupported[MESA_FORMAT_Z24] = true;
*/
translate_texture_format(mesa_format mesa_format, GLenum DepthMode)
{
switch (mesa_format) {
- case MESA_FORMAT_L8:
+ case MESA_FORMAT_L_UNORM8:
return MAPSURF_8BIT | MT_8BIT_L8;
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_I_UNORM8:
return MAPSURF_8BIT | MT_8BIT_I8;
- case MESA_FORMAT_A8:
+ case MESA_FORMAT_A_UNORM8:
return MAPSURF_8BIT | MT_8BIT_A8;
case MESA_FORMAT_AL88:
return MAPSURF_16BIT | MT_16BIT_AY88;
case MESA_FORMAT_RGB_FXT1:
case MESA_FORMAT_RGBA_FXT1:
return (MAPSURF_COMPRESSED | MT_COMPRESS_FXT1);
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
if (DepthMode == GL_ALPHA)
return (MAPSURF_16BIT | MT_16BIT_A16);
else if (DepthMode == GL_INTENSITY)
if (format == MESA_FORMAT_S8_Z24 ||
format == MESA_FORMAT_X8_Z24 ||
- format == MESA_FORMAT_Z16) {
+ format == MESA_FORMAT_Z_UNORM16) {
return true;
}
clear_val = PACK_COLOR_1555(clear[3], clear[0],
clear[1], clear[2]);
break;
- case MESA_FORMAT_A8:
+ case MESA_FORMAT_A_UNORM8:
clear_val = PACK_COLOR_8888(clear[3], clear[3],
clear[3], clear[3]);
break;
}
else if (mesaVis->depthBits == 16) {
assert(mesaVis->stencilBits == 0);
- rb = intel_create_private_renderbuffer(MESA_FORMAT_Z16);
+ rb = intel_create_private_renderbuffer(MESA_FORMAT_Z_UNORM16);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base);
}
else {
this->msaa_layout = mt->msaa_layout;
switch (mt->format) {
- case MESA_FORMAT_S8:
+ case MESA_FORMAT_S_UINT8:
/* The miptree is a W-tiled stencil buffer. Surface states can't be set
* up for W tiling, so we'll need to use Y tiling and have the WM
* program swizzle the coordinates.
*/
this->brw_surfaceformat = BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
break;
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_FLOAT32:
this->brw_surfaceformat = BRW_SURFACEFORMAT_R32_FLOAT;
break;
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
this->brw_surfaceformat = BRW_SURFACEFORMAT_R16_UNORM;
break;
default: {
assert(intel_miptree_slice_has_hiz(mt, level, layer));
switch (mt->format) {
- case MESA_FORMAT_Z16: depth_format = BRW_DEPTHFORMAT_D16_UNORM; break;
- case MESA_FORMAT_Z32_FLOAT: depth_format = BRW_DEPTHFORMAT_D32_FLOAT; break;
+ case MESA_FORMAT_Z_UNORM16: depth_format = BRW_DEPTHFORMAT_D16_UNORM; break;
+ case MESA_FORMAT_Z_FLOAT32: depth_format = BRW_DEPTHFORMAT_D32_FLOAT; break;
case MESA_FORMAT_X8_Z24: depth_format = BRW_DEPTHFORMAT_D24_UNORM_X8_UINT; break;
default: assert(0); break;
}
/* Setting this flag indicates that the buffer's contents are W-tiled
* stencil data, but the surface state should be set up for Y tiled
- * MESA_FORMAT_R8 data (this is necessary because surface states don't
+ * MESA_FORMAT_R_UNORM8 data (this is necessary because surface states don't
* support W tiling).
*
* Since W tiles are 64 pixels wide by 64 pixels high, whereas Y tiles of
- * MESA_FORMAT_R8 data are 128 pixels wide by 32 pixels high, the width and
+ * MESA_FORMAT_R_UNORM8 data are 128 pixels wide by 32 pixels high, the width and
* pitch stored in the surface state will be multiplied by 2, and the
* height will be halved. Also, since W and Y tiles store their data in a
* different order, the width and height will be rounded up to a multiple
wm_prog_key.texture_data_type = BRW_REGISTER_TYPE_F;
break;
case GL_UNSIGNED_INT:
- if (src_mt->format == MESA_FORMAT_S8) {
+ if (src_mt->format == MESA_FORMAT_S_UINT8) {
/* We process stencil as though it's an unsigned normalized color */
wm_prog_key.texture_data_type = BRW_REGISTER_TYPE_F;
} else {
*/
return false;
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_FLOAT32:
depth_clear_value = float_as_int(ctx->Depth.Clear);
break;
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
/* From the Sandy Bridge PRM, volume 2 part 1, page 314:
*
* "[DevSNB+]: Several cases exist where Depth Buffer Clear cannot be
return BRW_DEPTHFORMAT_D32_FLOAT;
switch (drb->mt->format) {
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
return BRW_DEPTHFORMAT_D16_UNORM;
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_FLOAT32:
return BRW_DEPTHFORMAT_D32_FLOAT;
case MESA_FORMAT_X8_Z24:
if (brw->gen >= 6) {
if (stencil_mt->stencil_mt)
stencil_mt = stencil_mt->stencil_mt;
- if (stencil_mt->format == MESA_FORMAT_S8) {
+ if (stencil_mt->format == MESA_FORMAT_S_UINT8) {
/* Separate stencil buffer uses 64x64 tiles. */
tile_mask_x |= 63;
tile_mask_y |= 63;
stencil_mt = get_stencil_miptree(stencil_irb);
brw->depthstencil.stencil_mt = stencil_mt;
- if (stencil_mt->format == MESA_FORMAT_S8) {
+ if (stencil_mt->format == MESA_FORMAT_S_UINT8) {
/* Note: we can't compute the stencil offset using
* intel_region_get_aligned_offset(), because stencil_region claims
* that the region is untiled even though it's W tiled.
uint32_t width = 1, height = 1;
if (stencil_mt) {
- separate_stencil = stencil_mt->format == MESA_FORMAT_S8;
+ separate_stencil = stencil_mt->format == MESA_FORMAT_S_UINT8;
/* Gen7 supports only separate stencil */
assert(separate_stencil || brw->gen < 7);
[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_BGR_UNORM8] = 0,
+ [MESA_FORMAT_RGB_UNORM8] = BRW_SURFACEFORMAT_R8G8B8_UNORM,
[MESA_FORMAT_RGB565] = BRW_SURFACEFORMAT_B5G6R5_UNORM,
[MESA_FORMAT_RGB565_REV] = 0,
[MESA_FORMAT_ARGB4444] = BRW_SURFACEFORMAT_B4G4R4A4_UNORM,
[MESA_FORMAT_AL1616] = BRW_SURFACEFORMAT_L16A16_UNORM,
[MESA_FORMAT_AL1616_REV] = 0,
[MESA_FORMAT_RGB332] = 0,
- [MESA_FORMAT_A8] = BRW_SURFACEFORMAT_A8_UNORM,
- [MESA_FORMAT_A16] = BRW_SURFACEFORMAT_A16_UNORM,
- [MESA_FORMAT_L8] = BRW_SURFACEFORMAT_L8_UNORM,
- [MESA_FORMAT_L16] = BRW_SURFACEFORMAT_L16_UNORM,
- [MESA_FORMAT_I8] = BRW_SURFACEFORMAT_I8_UNORM,
- [MESA_FORMAT_I16] = BRW_SURFACEFORMAT_I16_UNORM,
+ [MESA_FORMAT_A_UNORM8] = BRW_SURFACEFORMAT_A8_UNORM,
+ [MESA_FORMAT_A_UNORM16] = BRW_SURFACEFORMAT_A16_UNORM,
+ [MESA_FORMAT_L_UNORM8] = BRW_SURFACEFORMAT_L8_UNORM,
+ [MESA_FORMAT_L_UNORM16] = BRW_SURFACEFORMAT_L16_UNORM,
+ [MESA_FORMAT_I_UNORM8] = BRW_SURFACEFORMAT_I8_UNORM,
+ [MESA_FORMAT_I_UNORM16] = BRW_SURFACEFORMAT_I16_UNORM,
[MESA_FORMAT_YCBCR_REV] = BRW_SURFACEFORMAT_YCRCB_NORMAL,
[MESA_FORMAT_YCBCR] = BRW_SURFACEFORMAT_YCRCB_SWAPUVY,
- [MESA_FORMAT_R8] = BRW_SURFACEFORMAT_R8_UNORM,
+ [MESA_FORMAT_R_UNORM8] = BRW_SURFACEFORMAT_R8_UNORM,
[MESA_FORMAT_GR88] = BRW_SURFACEFORMAT_R8G8_UNORM,
[MESA_FORMAT_RG88] = 0,
- [MESA_FORMAT_R16] = BRW_SURFACEFORMAT_R16_UNORM,
+ [MESA_FORMAT_R_UNORM16] = BRW_SURFACEFORMAT_R16_UNORM,
[MESA_FORMAT_GR1616] = BRW_SURFACEFORMAT_R16G16_UNORM,
[MESA_FORMAT_RG1616] = 0,
[MESA_FORMAT_ARGB2101010] = BRW_SURFACEFORMAT_B10G10R10A2_UNORM,
[MESA_FORMAT_Z24_S8] = 0,
[MESA_FORMAT_S8_Z24] = 0,
- [MESA_FORMAT_Z16] = 0,
+ [MESA_FORMAT_Z_UNORM16] = 0,
[MESA_FORMAT_X8_Z24] = 0,
[MESA_FORMAT_Z24_X8] = 0,
- [MESA_FORMAT_Z32] = 0,
- [MESA_FORMAT_S8] = 0,
+ [MESA_FORMAT_Z_UNORM32] = 0,
+ [MESA_FORMAT_S_UINT8] = 0,
- [MESA_FORMAT_SRGB8] = 0,
+ [MESA_FORMAT_BGR_SRGB8] = 0,
[MESA_FORMAT_SRGBA8] = 0,
[MESA_FORMAT_SARGB8] = BRW_SURFACEFORMAT_B8G8R8A8_UNORM_SRGB,
- [MESA_FORMAT_SL8] = BRW_SURFACEFORMAT_L8_UNORM_SRGB,
+ [MESA_FORMAT_L_SRGB8] = BRW_SURFACEFORMAT_L8_UNORM_SRGB,
[MESA_FORMAT_SLA8] = BRW_SURFACEFORMAT_L8A8_UNORM_SRGB,
[MESA_FORMAT_SRGB_DXT1] = BRW_SURFACEFORMAT_DXT1_RGB_SRGB,
[MESA_FORMAT_SRGBA_DXT1] = BRW_SURFACEFORMAT_BC1_UNORM_SRGB,
[MESA_FORMAT_SIGNED_GR1616] = BRW_SURFACEFORMAT_R16G16_SNORM,
[MESA_FORMAT_SIGNED_RGB_16] = BRW_SURFACEFORMAT_R16G16B16_SNORM,
[MESA_FORMAT_SIGNED_RGBA_16] = BRW_SURFACEFORMAT_R16G16B16A16_SNORM,
- [MESA_FORMAT_RGBA_16] = BRW_SURFACEFORMAT_R16G16B16A16_UNORM,
+ [MESA_FORMAT_RGBA_UNORM16] = BRW_SURFACEFORMAT_R16G16B16A16_UNORM,
[MESA_FORMAT_RED_RGTC1] = BRW_SURFACEFORMAT_BC4_UNORM,
[MESA_FORMAT_SIGNED_RED_RGTC1] = BRW_SURFACEFORMAT_BC4_SNORM,
[MESA_FORMAT_RGB9_E5_FLOAT] = BRW_SURFACEFORMAT_R9G9B9E5_SHAREDEXP,
[MESA_FORMAT_R11_G11_B10_FLOAT] = BRW_SURFACEFORMAT_R11G11B10_FLOAT,
- [MESA_FORMAT_Z32_FLOAT] = 0,
+ [MESA_FORMAT_Z_FLOAT32] = 0,
[MESA_FORMAT_Z32_FLOAT_X24S8] = 0,
[MESA_FORMAT_ARGB2101010_UINT] = BRW_SURFACEFORMAT_B10G10R10A2_UINT,
[MESA_FORMAT_XRGB1555_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_RGBX_UINT8] = 0,
+ [MESA_FORMAT_RGBX_SINT8] = 0,
[MESA_FORMAT_XRGB2101010_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,
- [MESA_FORMAT_XBGR16161616_UINT] = 0,
- [MESA_FORMAT_XBGR16161616_SINT] = 0,
- [MESA_FORMAT_XBGR32323232_FLOAT] = BRW_SURFACEFORMAT_R32G32B32X32_FLOAT,
- [MESA_FORMAT_XBGR32323232_UINT] = 0,
- [MESA_FORMAT_XBGR32323232_SINT] = 0,
+ [MESA_FORMAT_RGBX_UNORM16] = BRW_SURFACEFORMAT_R16G16B16X16_UNORM,
+ [MESA_FORMAT_RGBX_SNORM16] = 0,
+ [MESA_FORMAT_RGBX_FLOAT16] = BRW_SURFACEFORMAT_R16G16B16X16_FLOAT,
+ [MESA_FORMAT_RGBX_UINT16] = 0,
+ [MESA_FORMAT_RGBX_SINT16] = 0,
+ [MESA_FORMAT_RGBX_FLOAT32] = BRW_SURFACEFORMAT_R32G32B32X32_FLOAT,
+ [MESA_FORMAT_RGBX_UINT32] = 0,
+ [MESA_FORMAT_RGBX_SINT32] = 0,
};
assert(mesa_format < MESA_FORMAT_COUNT);
return table[mesa_format];
*/
brw->format_supported_as_render_target[MESA_FORMAT_S8_Z24] = true;
brw->format_supported_as_render_target[MESA_FORMAT_X8_Z24] = true;
- brw->format_supported_as_render_target[MESA_FORMAT_S8] = true;
- brw->format_supported_as_render_target[MESA_FORMAT_Z16] = true;
- brw->format_supported_as_render_target[MESA_FORMAT_Z32_FLOAT] = true;
+ brw->format_supported_as_render_target[MESA_FORMAT_S_UINT8] = true;
+ brw->format_supported_as_render_target[MESA_FORMAT_Z_UNORM16] = true;
+ brw->format_supported_as_render_target[MESA_FORMAT_Z_FLOAT32] = true;
brw->format_supported_as_render_target[MESA_FORMAT_Z32_FLOAT_X24S8] = true;
/* We remap depth formats to a supported texturing format in
*/
ctx->TextureFormatSupported[MESA_FORMAT_S8_Z24] = true;
ctx->TextureFormatSupported[MESA_FORMAT_X8_Z24] = true;
- ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT] = true;
+ ctx->TextureFormatSupported[MESA_FORMAT_Z_FLOAT32] = true;
ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT_X24S8] = true;
/* It appears that Z16 is slower than Z24 (on Intel Ivybridge and newer
* asking for DEPTH_COMPONENT16, so we have to respect that.
*/
if (_mesa_is_desktop_gl(ctx))
- ctx->TextureFormatSupported[MESA_FORMAT_Z16] = true;
+ ctx->TextureFormatSupported[MESA_FORMAT_Z_UNORM16] = true;
/* On hardware that lacks support for ETC1, we map ETC1 to RGBX
* during glCompressedTexImage2D(). See intel_mipmap_tree::wraps_etc1.
switch( mesa_format ) {
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
return BRW_SURFACEFORMAT_R16_UNORM;
case MESA_FORMAT_S8_Z24:
case MESA_FORMAT_X8_Z24:
return BRW_SURFACEFORMAT_R24_UNORM_X8_TYPELESS;
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_FLOAT32:
return BRW_SURFACEFORMAT_R32_FLOAT;
case MESA_FORMAT_Z32_FLOAT_X24S8:
return false;
switch (format) {
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_FLOAT32:
case MESA_FORMAT_Z32_FLOAT_X24S8:
case MESA_FORMAT_X8_Z24:
case MESA_FORMAT_S8_Z24:
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
return true;
default:
return false;
return i;
}
- if (format == MESA_FORMAT_S8)
+ if (format == MESA_FORMAT_S_UINT8)
return 8;
- if (brw->gen >= 7 && format == MESA_FORMAT_Z16)
+ if (brw->gen >= 7 && format == MESA_FORMAT_Z_UNORM16)
return 8;
return 4;
if (_mesa_is_format_compressed(format))
return 4;
- if (format == MESA_FORMAT_S8)
+ if (format == MESA_FORMAT_S_UINT8)
return brw->gen >= 7 ? 8 : 4;
/* Broadwell only supports VALIGN of 4, 8, and 16. The BSpec says 4
case GL_STENCIL_INDEX16_EXT:
/* These aren't actual texture formats, so force them here. */
if (brw->has_separate_stencil) {
- rb->Format = MESA_FORMAT_S8;
+ rb->Format = MESA_FORMAT_S_UINT8;
} else {
assert(!brw->must_use_separate_stencil);
rb->Format = MESA_FORMAT_S8_Z24;
fbo_incomplete(fb, "FBO incomplete: separate stencil "
"unsupported\n");
}
- if (stencil_mt->format != MESA_FORMAT_S8) {
+ if (stencil_mt->format != MESA_FORMAT_S_UINT8) {
fbo_incomplete(fb, "FBO incomplete: separate stencil is %s "
"instead of S8\n",
_mesa_get_format_name(stencil_mt->format));
(brw->has_separate_stencil && brw_is_hiz_depth_format(brw, format)))) {
mt->stencil_mt = intel_miptree_create(brw,
mt->target,
- MESA_FORMAT_S8,
+ MESA_FORMAT_S_UINT8,
mt->first_level,
mt->last_level,
mt->logical_width0,
if (mt->format == MESA_FORMAT_S8_Z24) {
mt->format = MESA_FORMAT_X8_Z24;
} else if (mt->format == MESA_FORMAT_Z32_FLOAT_X24S8) {
- mt->format = MESA_FORMAT_Z32_FLOAT;
+ mt->format = MESA_FORMAT_Z_FLOAT32;
mt->cpp = 4;
} else {
_mesa_problem(NULL, "Unknown format %s in separate stencil mt\n",
enum intel_miptree_tiling_mode requested,
struct intel_mipmap_tree *mt)
{
- if (format == MESA_FORMAT_S8) {
+ if (format == MESA_FORMAT_S_UINT8) {
/* The stencil buffer is W tiled. However, we request from the kernel a
* non-tiled buffer because the GTT is incapable of W fencing.
*/
format = MESA_FORMAT_R8G8B8A8_UNORM;
break;
case MESA_FORMAT_ETC2_R11_EAC:
- format = MESA_FORMAT_R16;
+ format = MESA_FORMAT_R_UNORM16;
break;
case MESA_FORMAT_ETC2_SIGNED_R11_EAC:
format = MESA_FORMAT_SIGNED_R16;
total_width = mt->total_width;
total_height = mt->total_height;
- if (format == MESA_FORMAT_S8) {
+ if (format == MESA_FORMAT_S_UINT8) {
/* Align to size of W tile, 64x64. */
total_width = ALIGN(total_width, 64);
total_height = ALIGN(total_height, 64);
mesa_format mt_format = mt->format;
if (mt->format == MESA_FORMAT_X8_Z24 && mt->stencil_mt)
mt_format = MESA_FORMAT_S8_Z24;
- if (mt->format == MESA_FORMAT_Z32_FLOAT && mt->stencil_mt)
+ if (mt->format == MESA_FORMAT_Z_FLOAT32 && mt->stencil_mt)
mt_format = MESA_FORMAT_Z32_FLOAT_X24S8;
if (mt->etc_format != MESA_FORMAT_NONE)
mt_format = mt->etc_format;
/* 8 bits/pixel are required for MCS data when using 4x MSAA (2 bits for
* each sample).
*/
- format = MESA_FORMAT_R8;
+ format = MESA_FORMAT_R_UNORM8;
break;
case 8:
/* 32 bits/pixel are required for MCS data when using 8x MSAA (3 bits
{
struct intel_mipmap_tree *z_mt = mt;
struct intel_mipmap_tree *s_mt = mt->stencil_mt;
- bool map_z32f_x24s8 = mt->format == MESA_FORMAT_Z32_FLOAT;
+ bool map_z32f_x24s8 = mt->format == MESA_FORMAT_Z_FLOAT32;
int packed_bpp = map_z32f_x24s8 ? 8 : 4;
map->stride = map->w * packed_bpp;
{
struct intel_mipmap_tree *z_mt = mt;
struct intel_mipmap_tree *s_mt = mt->stencil_mt;
- bool map_z32f_x24s8 = mt->format == MESA_FORMAT_Z32_FLOAT;
+ bool map_z32f_x24s8 = mt->format == MESA_FORMAT_Z_FLOAT32;
if (map->mode & GL_MAP_WRITE_BIT) {
uint32_t *packed_map = map->ptr;
intel_miptree_slice_set_needs_hiz_resolve(mt, level, slice);
}
- if (mt->format == MESA_FORMAT_S8) {
+ if (mt->format == MESA_FORMAT_S_UINT8) {
intel_miptree_map_s8(brw, mt, map, level, slice);
} else if (mt->etc_format != MESA_FORMAT_NONE &&
!(mode & BRW_MAP_DIRECT_BIT)) {
DBG("%s: mt %p (%s) level %d slice %d\n", __FUNCTION__,
mt, _mesa_get_format_name(mt->format), level, slice);
- if (mt->format == MESA_FORMAT_S8) {
+ if (mt->format == MESA_FORMAT_S_UINT8) {
intel_miptree_unmap_s8(brw, mt, map, level, slice);
} else if (mt->etc_format != MESA_FORMAT_NONE &&
!(map->mode & BRW_MAP_DIRECT_BIT)) {
* on hardware where we want or need to use separate stencil, there will be
* two miptrees for storing the data. If the depthstencil texture or rb is
* MESA_FORMAT_Z32_FLOAT_X24S8, then mt->format will be
- * MESA_FORMAT_Z32_FLOAT, otherwise for MESA_FORMAT_S8_Z24 objects it will be
+ * MESA_FORMAT_Z_FLOAT32, otherwise for MESA_FORMAT_S8_Z24 objects it will be
* MESA_FORMAT_X8_Z24.
*
* For ETC1/ETC2 textures, this is one of the uncompressed mesa texture
rb = intel_create_private_renderbuffer(MESA_FORMAT_X8_Z24,
num_samples);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base);
- rb = intel_create_private_renderbuffer(MESA_FORMAT_S8,
+ rb = intel_create_private_renderbuffer(MESA_FORMAT_S_UINT8,
num_samples);
_mesa_add_renderbuffer(fb, BUFFER_STENCIL, &rb->Base.Base);
} else {
}
else if (mesaVis->depthBits == 16) {
assert(mesaVis->stencilBits == 0);
- rb = intel_create_private_renderbuffer(MESA_FORMAT_Z16,
+ rb = intel_create_private_renderbuffer(MESA_FORMAT_Z_UNORM16,
num_samples);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &rb->Base.Base);
}
packing->Invert)
return false;
- if ((texImage->TexFormat == MESA_FORMAT_L8 && format == GL_LUMINANCE) ||
- (texImage->TexFormat == MESA_FORMAT_A8 && format == GL_ALPHA)) {
+ if ((texImage->TexFormat == MESA_FORMAT_L_UNORM8 && format == GL_LUMINANCE) ||
+ (texImage->TexFormat == MESA_FORMAT_A_UNORM8 && format == GL_ALPHA)) {
cpp = 1;
mem_copy = memcpy;
} else if ((texImage->TexFormat == MESA_FORMAT_B8G8R8A8_UNORM) ||
break;
case GL_DEPTH_COMPONENT16:
rb->_BaseFormat = GL_DEPTH_COMPONENT;
- rb->Format = MESA_FORMAT_Z16;
+ rb->Format = MESA_FORMAT_Z_UNORM16;
s->cpp = 2;
break;
case GL_DEPTH_COMPONENT:
case MESA_FORMAT_Z24_S8:
return 32;
case MESA_FORMAT_RGB565:
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
return 16;
default:
return 0;
case GL_LUMINANCE16:
case GL_LUMINANCE8:
case GL_COMPRESSED_LUMINANCE:
- return MESA_FORMAT_L8;
+ return MESA_FORMAT_L_UNORM8;
case GL_ALPHA:
case GL_ALPHA4:
case GL_ALPHA16:
case GL_ALPHA8:
case GL_COMPRESSED_ALPHA:
- return MESA_FORMAT_A8;
+ return MESA_FORMAT_A_UNORM8;
case GL_INTENSITY:
case GL_INTENSITY4:
case GL_INTENSITY12:
case GL_INTENSITY16:
case GL_INTENSITY8:
- return MESA_FORMAT_I8;
+ return MESA_FORMAT_I_UNORM8;
case GL_RGB_S3TC:
case GL_RGB4_S3TC:
static unsigned
get_teximage_placement(struct gl_texture_image *ti)
{
- if (ti->TexFormat == MESA_FORMAT_A8 ||
- ti->TexFormat == MESA_FORMAT_L8 ||
- ti->TexFormat == MESA_FORMAT_I8)
+ if (ti->TexFormat == MESA_FORMAT_A_UNORM8 ||
+ ti->TexFormat == MESA_FORMAT_L_UNORM8 ||
+ ti->TexFormat == MESA_FORMAT_I_UNORM8)
/* 1 cpp formats will have to be swizzled by the CPU,
* so leave them in system RAM for now. */
return NOUVEAU_BO_MAP;
return (z & 0xffffff00) | (s & 0xff);
case MESA_FORMAT_Z24_X8:
return (z & 0xffffff00);
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
return (z & 0xffff0000) >> 16;
default:
assert(0);
struct gl_texture_object *t = u->_Current;
struct gl_texture_image *ti = t->Image[0][t->BaseLevel];
- return ti->TexFormat == MESA_FORMAT_A8 ||
- ti->TexFormat == MESA_FORMAT_L8 ||
+ return ti->TexFormat == MESA_FORMAT_A_UNORM8 ||
+ ti->TexFormat == MESA_FORMAT_L_UNORM8 ||
u->EnvMode == GL_COMBINE ||
u->EnvMode == GL_COMBINE4_NV ||
u->EnvMode == GL_BLEND ||
struct gl_texture_object *t = rc->ctx->Texture.Unit[i]._Current;
mesa_format format = t->Image[0][t->BaseLevel]->TexFormat;
- if (format == MESA_FORMAT_A8) {
+ if (format == MESA_FORMAT_A_UNORM8) {
/* Emulated using I8. */
if (is_color_operand(operand))
return COMBINER_SOURCE(ZERO) |
get_input_mapping(rc, operand, flags);
- } else if (format == MESA_FORMAT_L8) {
+ } else if (format == MESA_FORMAT_L_UNORM8) {
/* Emulated using I8. */
if (!is_color_operand(operand))
return COMBINER_SOURCE(ZERO) |
get_tex_format(struct gl_texture_image *ti)
{
switch (ti->TexFormat) {
- case MESA_FORMAT_A8:
- case MESA_FORMAT_L8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_L_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_Y8;
case MESA_FORMAT_ARGB1555:
return NV04_TEXTURED_TRIANGLE_FORMAT_COLOR_A1R5G5B5;
swzsurf_format(mesa_format format)
{
switch (format) {
- case MESA_FORMAT_A8:
- case MESA_FORMAT_L8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_L_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
case MESA_FORMAT_RGB332:
return NV04_SWIZZLED_SURFACE_FORMAT_COLOR_Y8;
case MESA_FORMAT_AL88_REV:
case MESA_FORMAT_YCBCR:
case MESA_FORMAT_YCBCR_REV:
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
return NV04_SWIZZLED_SURFACE_FORMAT_COLOR_R5G6B5;
case MESA_FORMAT_A8B8G8R8_UNORM:
case MESA_FORMAT_A8R8G8B8_UNORM:
case MESA_FORMAT_S8_Z24:
case MESA_FORMAT_Z24_S8:
- case MESA_FORMAT_Z32:
+ case MESA_FORMAT_Z_UNORM32:
return NV04_SWIZZLED_SURFACE_FORMAT_COLOR_A8R8G8B8;
default:
surf2d_format(mesa_format format)
{
switch (format) {
- case MESA_FORMAT_A8:
- case MESA_FORMAT_L8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_L_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
case MESA_FORMAT_RGB332:
return NV04_CONTEXT_SURFACES_2D_FORMAT_Y8;
case MESA_FORMAT_AL88_REV:
case MESA_FORMAT_YCBCR:
case MESA_FORMAT_YCBCR_REV:
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
return NV04_CONTEXT_SURFACES_2D_FORMAT_R5G6B5;
case MESA_FORMAT_A8B8G8R8_UNORM:
case MESA_FORMAT_A8R8G8B8_UNORM:
case MESA_FORMAT_S8_Z24:
case MESA_FORMAT_Z24_S8:
- case MESA_FORMAT_Z32:
+ case MESA_FORMAT_Z_UNORM32:
return NV04_CONTEXT_SURFACES_2D_FORMAT_Y32;
default:
rect_format(mesa_format format)
{
switch (format) {
- case MESA_FORMAT_A8:
- case MESA_FORMAT_L8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_L_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
case MESA_FORMAT_RGB332:
return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8;
case MESA_FORMAT_AL88_REV:
case MESA_FORMAT_YCBCR:
case MESA_FORMAT_YCBCR_REV:
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A16R5G6B5;
case MESA_FORMAT_A8B8G8R8_UNORM:
case MESA_FORMAT_A8R8G8B8_UNORM:
case MESA_FORMAT_S8_Z24:
case MESA_FORMAT_Z24_S8:
- case MESA_FORMAT_Z32:
+ case MESA_FORMAT_Z_UNORM32:
return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8;
default:
sifm_format(mesa_format format)
{
switch (format) {
- case MESA_FORMAT_A8:
- case MESA_FORMAT_L8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_L_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
case MESA_FORMAT_RGB332:
return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_AY8;
case MESA_FORMAT_AL88_REV:
case MESA_FORMAT_YCBCR:
case MESA_FORMAT_YCBCR_REV:
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_R5G6B5;
case MESA_FORMAT_A8B8G8R8_UNORM:
case MESA_FORMAT_A8R8G8B8_UNORM:
case MESA_FORMAT_S8_Z24:
case MESA_FORMAT_Z24_S8:
- case MESA_FORMAT_Z32:
+ case MESA_FORMAT_Z_UNORM32:
return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_A8R8G8B8;
default:
return NV10_3D_RT_FORMAT_COLOR_A8R8G8B8;
case MESA_FORMAT_RGB565:
return NV10_3D_RT_FORMAT_COLOR_R5G6B5;
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
return NV10_3D_RT_FORMAT_DEPTH_Z16;
case MESA_FORMAT_Z24_S8:
return NV10_3D_RT_FORMAT_DEPTH_Z24S8;
struct gl_texture_object *t = rc->ctx->Texture.Unit[i]._Current;
mesa_format format = t->Image[0][t->BaseLevel]->TexFormat;
- if (format == MESA_FORMAT_A8) {
+ if (format == MESA_FORMAT_A_UNORM8) {
/* Emulated using I8. */
if (is_color_operand(operand))
return RC_IN_SOURCE(ZERO) |
get_input_mapping(rc, operand, flags);
- } else if (format == MESA_FORMAT_L8) {
+ } else if (format == MESA_FORMAT_L_UNORM8) {
/* Sometimes emulated using I8. */
if (!is_color_operand(operand))
return RC_IN_SOURCE(ZERO) |
case MESA_FORMAT_RGB565:
return NV10_3D_TEX_FORMAT_FORMAT_R5G6B5;
- case MESA_FORMAT_A8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
return NV10_3D_TEX_FORMAT_FORMAT_I8;
- case MESA_FORMAT_L8:
+ case MESA_FORMAT_L_UNORM8:
return NV10_3D_TEX_FORMAT_FORMAT_L8;
case MESA_FORMAT_RGB_DXT1:
case MESA_FORMAT_B8G8R8X8_UNORM:
return NV10_3D_TEX_FORMAT_FORMAT_A8R8G8B8_RECT;
- case MESA_FORMAT_A8:
- case MESA_FORMAT_L8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_L_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
return NV10_3D_TEX_FORMAT_FORMAT_I8_RECT;
default:
return NV20_3D_RT_FORMAT_COLOR_A8R8G8B8;
case MESA_FORMAT_RGB565:
return NV20_3D_RT_FORMAT_COLOR_R5G6B5;
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
return NV20_3D_RT_FORMAT_DEPTH_Z16;
case MESA_FORMAT_Z24_S8:
return NV20_3D_RT_FORMAT_DEPTH_Z24S8;
case MESA_FORMAT_RGB565:
return NV20_3D_TEX_FORMAT_FORMAT_R5G6B5;
- case MESA_FORMAT_A8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
return NV20_3D_TEX_FORMAT_FORMAT_I8;
- case MESA_FORMAT_L8:
+ case MESA_FORMAT_L_UNORM8:
return NV20_3D_TEX_FORMAT_FORMAT_L8;
case MESA_FORMAT_RGB_DXT1:
case MESA_FORMAT_RGB565:
return NV20_3D_TEX_FORMAT_FORMAT_R5G6B5_RECT;
- case MESA_FORMAT_L8:
+ case MESA_FORMAT_L_UNORM8:
return NV20_3D_TEX_FORMAT_FORMAT_L8_RECT;
- case MESA_FORMAT_A8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
return NV20_3D_TEX_FORMAT_FORMAT_I8_RECT;
default:
case MESA_FORMAT_RGB565:
case MESA_FORMAT_ARGB4444:
case MESA_FORMAT_ARGB1555:
- case MESA_FORMAT_A8:
- case MESA_FORMAT_L8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_L_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
/* swizzled */
case MESA_FORMAT_A8B8G8R8_UNORM:
case MESA_FORMAT_R8G8B8A8_UNORM:
case MESA_FORMAT_ARGB1555:
txformat |= R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_A8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
txformat |= R200_TXFORMAT_I8 | R200_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_L8:
+ case MESA_FORMAT_L_UNORM8:
txformat |= R200_TXFORMAT_I8;
break;
case MESA_FORMAT_AL88:
case MESA_FORMAT_RGB565:
case MESA_FORMAT_ARGB4444:
case MESA_FORMAT_ARGB1555:
- case MESA_FORMAT_A8:
- case MESA_FORMAT_L8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_L_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
default:
/* no swizzle required */
BEGIN_BATCH(10);
case MESA_FORMAT_ARGB1555:
dst_format = RADEON_COLOR_FORMAT_ARGB1555;
break;
- case MESA_FORMAT_A8:
- case MESA_FORMAT_L8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_L_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
dst_format = RADEON_COLOR_FORMAT_RGB8;
break;
default:
[ 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_BGR_UNORM8 ] = { 0xffffffff, 0 },
[ MESA_FORMAT_RGB565 ] = { R200_TXFORMAT_RGB565, 0 },
[ MESA_FORMAT_RGB565_REV ] = { R200_TXFORMAT_RGB565, 0 },
[ MESA_FORMAT_ARGB4444 ] = { R200_TXFORMAT_ARGB4444 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_ARGB1555_REV ] = { R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_AL88 ] = { R200_TXFORMAT_AL88 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_AL88_REV ] = { R200_TXFORMAT_AL88 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_A8 ] = { R200_TXFORMAT_A8 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_L8 ] = { R200_TXFORMAT_L8, 0 },
- [ MESA_FORMAT_I8 ] = { R200_TXFORMAT_I8 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_A_UNORM8 ] = { R200_TXFORMAT_A8 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_L_UNORM8 ] = { R200_TXFORMAT_L8, 0 },
+ [ MESA_FORMAT_I_UNORM8 ] = { R200_TXFORMAT_I8 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_YCBCR ] = { R200_TXFORMAT_YCBCR, R200_YUV_TO_RGB },
[ MESA_FORMAT_YCBCR_REV ] = { R200_TXFORMAT_YCBCR_REV, R200_YUV_TO_RGB },
[ MESA_FORMAT_RGB_FXT1 ] = { 0xffffffff, 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_BGR_UNORM8 ] = { R200_TXFORMAT_ARGB8888, 0 },
[ MESA_FORMAT_RGB565 ] = { R200_TXFORMAT_RGB565, 0 },
[ MESA_FORMAT_RGB565_REV ] = { R200_TXFORMAT_RGB565, 0 },
[ MESA_FORMAT_ARGB4444 ] = { R200_TXFORMAT_ARGB4444 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_ARGB1555_REV ] = { R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_AL88 ] = { R200_TXFORMAT_AL88 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_AL88_REV ] = { R200_TXFORMAT_AL88 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_A8 ] = { R200_TXFORMAT_A8 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_L8 ] = { R200_TXFORMAT_L8, 0 },
- [ MESA_FORMAT_I8 ] = { R200_TXFORMAT_I8 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_A_UNORM8 ] = { R200_TXFORMAT_A8 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_L_UNORM8 ] = { R200_TXFORMAT_L8, 0 },
+ [ MESA_FORMAT_I_UNORM8 ] = { R200_TXFORMAT_I8 | R200_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_YCBCR ] = { R200_TXFORMAT_YCBCR, R200_YUV_TO_RGB },
[ MESA_FORMAT_YCBCR_REV ] = { R200_TXFORMAT_YCBCR_REV, R200_YUV_TO_RGB },
[ MESA_FORMAT_RGB_FXT1 ] = { 0xffffffff, 0 },
switch (rb->cpp) {
case 4:
if (texture_format == __DRI_TEXTURE_FORMAT_RGB) {
- texFormat = MESA_FORMAT_RGB888;
- t->pp_txformat = tx_table_le[MESA_FORMAT_RGB888].format;
+ texFormat = MESA_FORMAT_BGR_UNORM8;
+ t->pp_txformat = tx_table_le[MESA_FORMAT_BGR_UNORM8].format;
}
else {
texFormat = MESA_FORMAT_B8G8R8A8_UNORM;
break;
case 3:
default:
- texFormat = MESA_FORMAT_RGB888;
- t->pp_txformat = tx_table_le[MESA_FORMAT_RGB888].format;
- t->pp_txfilter |= tx_table_le[MESA_FORMAT_RGB888].filter;
+ texFormat = MESA_FORMAT_BGR_UNORM8;
+ t->pp_txformat = tx_table_le[MESA_FORMAT_BGR_UNORM8].format;
+ t->pp_txfilter |= tx_table_le[MESA_FORMAT_BGR_UNORM8].filter;
break;
case 2:
texFormat = MESA_FORMAT_RGB565;
case MESA_FORMAT_RGB565:
case MESA_FORMAT_ARGB4444:
case MESA_FORMAT_ARGB1555:
- case MESA_FORMAT_A8:
- case MESA_FORMAT_L8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_L_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
break;
default:
return 0;
case MESA_FORMAT_ARGB1555:
txformat |= RADEON_TXFORMAT_ARGB1555 | RADEON_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_A8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
txformat |= RADEON_TXFORMAT_I8 | RADEON_TXFORMAT_ALPHA_IN_MAP;
break;
- case MESA_FORMAT_L8:
+ case MESA_FORMAT_L_UNORM8:
txformat |= RADEON_TXFORMAT_I8;
break;
case MESA_FORMAT_AL88:
case MESA_FORMAT_ARGB1555:
dst_format = RADEON_COLOR_FORMAT_ARGB1555;
break;
- case MESA_FORMAT_A8:
- case MESA_FORMAT_L8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_L_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
dst_format = RADEON_COLOR_FORMAT_RGB8;
break;
default:
mode, out_map, out_stride);
return;
}
- if (rb->Format == MESA_FORMAT_Z16) {
+ if (rb->Format == MESA_FORMAT_Z_UNORM16) {
radeon_map_renderbuffer_z16(ctx, rb, x, y, w, h,
mode, out_map, out_stride);
return;
radeon_unmap_renderbuffer_s8z24(ctx, rb);
return;
}
- if (rb->Format == MESA_FORMAT_Z16) {
+ if (rb->Format == MESA_FORMAT_Z_UNORM16) {
radeon_unmap_renderbuffer_z16(ctx, rb);
return;
}
cpp = 4;
break;
case GL_DEPTH_COMPONENT16:
- rb->Format = MESA_FORMAT_Z16;
+ rb->Format = MESA_FORMAT_Z_UNORM16;
cpp = 2;
break;
case GL_DEPTH_COMPONENT:
} else if (mesaVis->depthBits == 16) {
/* just 16-bit depth buffer, no hw stencil */
struct radeon_renderbuffer *depth =
- radeon_create_renderbuffer(MESA_FORMAT_Z16, driDrawPriv);
+ radeon_create_renderbuffer(MESA_FORMAT_Z_UNORM16, driDrawPriv);
_mesa_add_renderbuffer(&rfb->base, BUFFER_DEPTH, &depth->base.Base);
depth->has_surface = screen->depthHasSurface;
}
dst_mesaformat = MESA_FORMAT_B8G8R8A8_UNORM;
break;
case 1:
- src_mesaformat = MESA_FORMAT_A8;
- dst_mesaformat = MESA_FORMAT_A8;
+ src_mesaformat = MESA_FORMAT_A_UNORM8;
+ dst_mesaformat = MESA_FORMAT_A_UNORM8;
break;
default:
return GL_FALSE;
[ 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_BGR_UNORM8 ] = { RADEON_TXFORMAT_ARGB8888, 0 },
[ MESA_FORMAT_RGB565 ] = { RADEON_TXFORMAT_RGB565, 0 },
[ MESA_FORMAT_RGB565_REV ] = { RADEON_TXFORMAT_RGB565, 0 },
[ MESA_FORMAT_ARGB4444 ] = { RADEON_TXFORMAT_ARGB4444 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_ARGB1555_REV ] = { RADEON_TXFORMAT_ARGB1555 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_AL88 ] = { RADEON_TXFORMAT_AL88 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_AL88_REV ] = { RADEON_TXFORMAT_AL88 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_A8 ] = { RADEON_TXFORMAT_A8 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
- [ MESA_FORMAT_L8 ] = { RADEON_TXFORMAT_L8, 0 },
- [ MESA_FORMAT_I8 ] = { RADEON_TXFORMAT_I8 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_A_UNORM8 ] = { RADEON_TXFORMAT_A8 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
+ [ MESA_FORMAT_L_UNORM8 ] = { RADEON_TXFORMAT_L8, 0 },
+ [ MESA_FORMAT_I_UNORM8 ] = { RADEON_TXFORMAT_I8 | RADEON_TXFORMAT_ALPHA_IN_MAP, 0 },
[ MESA_FORMAT_YCBCR ] = { RADEON_TXFORMAT_YCBCR, RADEON_YUV_TO_RGB },
[ MESA_FORMAT_YCBCR_REV ] = { RADEON_TXFORMAT_YCBCR_REV, RADEON_YUV_TO_RGB },
[ MESA_FORMAT_RGB_FXT1 ] = { 0xffffffff, 0 },
switch (rb->cpp) {
case 4:
if (texture_format == __DRI_TEXTURE_FORMAT_RGB) {
- t->pp_txformat = tx_table[MESA_FORMAT_RGB888].format;
- texFormat = MESA_FORMAT_RGB888;
+ t->pp_txformat = tx_table[MESA_FORMAT_BGR_UNORM8].format;
+ texFormat = MESA_FORMAT_BGR_UNORM8;
}
else {
t->pp_txformat = tx_table[MESA_FORMAT_B8G8R8A8_UNORM].format;
break;
case 3:
default:
- texFormat = MESA_FORMAT_RGB888;
- t->pp_txformat = tx_table[MESA_FORMAT_RGB888].format;
- t->pp_txfilter |= tx_table[MESA_FORMAT_RGB888].filter;
+ texFormat = MESA_FORMAT_BGR_UNORM8;
+ t->pp_txformat = tx_table[MESA_FORMAT_BGR_UNORM8].format;
+ t->pp_txfilter |= tx_table[MESA_FORMAT_BGR_UNORM8].filter;
break;
case 2:
texFormat = MESA_FORMAT_RGB565;
in wrong rgb values (same as alpha value instead of 0). */
return _radeon_texformat_al88;
#else
- return MESA_FORMAT_A8;
+ return MESA_FORMAT_A_UNORM8;
#endif
case 1:
case GL_LUMINANCE:
case GL_LUMINANCE12:
case GL_LUMINANCE16:
case GL_COMPRESSED_LUMINANCE:
- return MESA_FORMAT_L8;
+ return MESA_FORMAT_L_UNORM8;
case 2:
case GL_LUMINANCE_ALPHA:
case GL_INTENSITY12:
case GL_INTENSITY16:
case GL_COMPRESSED_INTENSITY:
- return MESA_FORMAT_I8;
+ return MESA_FORMAT_I_UNORM8;
case GL_YCBCR_MESA:
if (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
case GL_SLUMINANCE:
case GL_SLUMINANCE8:
case GL_COMPRESSED_SLUMINANCE:
- return MESA_FORMAT_SL8;
+ return MESA_FORMAT_L_SRGB8;
case GL_SLUMINANCE_ALPHA:
case GL_SLUMINANCE8_ALPHA8:
switch (mesa_format)
{
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
case MESA_FORMAT_S8_Z24:
return 1;
default:
break;
case B_RGB24:
rb->_BaseFormat = GL_RGB;
- rb->Format = MESA_FORMAT_RGB888;
+ rb->Format = MESA_FORMAT_BGR_UNORM8;
break;
case B_RGB16:
rb->_BaseFormat = GL_RGB;
rb->Format = MESA_FORMAT_A8B8G8R8_UNORM;
}
else if (osmesa->DataType == GL_UNSIGNED_SHORT) {
- rb->Format = MESA_FORMAT_RGBA_16;
+ rb->Format = MESA_FORMAT_RGBA_UNORM16;
}
else {
rb->Format = MESA_FORMAT_RGBA_FLOAT32;
}
else if (osmesa->DataType == GL_UNSIGNED_SHORT) {
_mesa_warning(ctx, "Unsupported OSMesa format BGRA/GLushort");
- rb->Format = MESA_FORMAT_RGBA_16; /* not exactly right */
+ rb->Format = MESA_FORMAT_RGBA_UNORM16; /* not exactly right */
}
else {
_mesa_warning(ctx, "Unsupported OSMesa format BGRA/GLfloat");
}
else if (osmesa->DataType == GL_UNSIGNED_SHORT) {
_mesa_warning(ctx, "Unsupported OSMesa format ARGB/GLushort");
- rb->Format = MESA_FORMAT_RGBA_16; /* not exactly right */
+ rb->Format = MESA_FORMAT_RGBA_UNORM16; /* not exactly right */
}
else {
_mesa_warning(ctx, "Unsupported OSMesa format ARGB/GLfloat");
}
else if (osmesa->format == OSMESA_RGB) {
if (osmesa->DataType == GL_UNSIGNED_BYTE) {
- rb->Format = MESA_FORMAT_RGB888;
+ rb->Format = MESA_FORMAT_BGR_UNORM8;
}
else if (osmesa->DataType == GL_UNSIGNED_SHORT) {
_mesa_warning(ctx, "Unsupported OSMesa format RGB/GLushort");
- rb->Format = MESA_FORMAT_RGBA_16; /* not exactly right */
+ rb->Format = MESA_FORMAT_RGBA_UNORM16; /* not exactly right */
}
else {
_mesa_warning(ctx, "Unsupported OSMesa format RGB/GLfloat");
}
else if (osmesa->format == OSMESA_BGR) {
if (osmesa->DataType == GL_UNSIGNED_BYTE) {
- rb->Format = MESA_FORMAT_BGR888;
+ rb->Format = MESA_FORMAT_RGB_UNORM8;
}
else if (osmesa->DataType == GL_UNSIGNED_SHORT) {
_mesa_warning(ctx, "Unsupported OSMesa format BGR/GLushort");
- rb->Format = MESA_FORMAT_RGBA_16; /* not exactly right */
+ rb->Format = MESA_FORMAT_RGBA_UNORM16; /* not exactly right */
}
else {
_mesa_warning(ctx, "Unsupported OSMesa format BGR/GLfloat");
else {
/* XXX add more formats or make into a new format utility function */
switch (img->TexFormat) {
- case MESA_FORMAT_A8:
- case MESA_FORMAT_L8:
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_L_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
c = 1;
break;
case MESA_FORMAT_AL88:
case MESA_FORMAT_AL88_REV:
c = 2;
break;
- case MESA_FORMAT_RGB888:
- case MESA_FORMAT_BGR888:
+ case MESA_FORMAT_BGR_UNORM8:
+ case MESA_FORMAT_RGB_UNORM8:
c = 3;
break;
case MESA_FORMAT_A8B8G8R8_UNORM:
return;
}
- if (format == MESA_FORMAT_S8) {
+ if (format == MESA_FORMAT_S_UINT8) {
/* special cases */
*params = GL_INDEX;
}
/*
- * MESA_FORMAT_RGB888
+ * MESA_FORMAT_BGR_UNORM8
*/
static void
/*
- * MESA_FORMAT_BGR888
+ * MESA_FORMAT_RGB_UNORM8
*/
static void
}
-/* MESA_FORMAT_A8 */
+/* MESA_FORMAT_A_UNORM8 */
static void
pack_ubyte_A8(const GLubyte src[4], void *dst)
}
-/* MESA_FORMAT_A16 */
+/* MESA_FORMAT_A_UNORM16 */
static void
pack_ubyte_A16(const GLubyte src[4], void *dst)
}
-/* MESA_FORMAT_L8 */
+/* MESA_FORMAT_L_UNORM8 */
static void
pack_ubyte_L8(const GLubyte src[4], void *dst)
}
-/* MESA_FORMAT_L16 */
+/* MESA_FORMAT_L_UNORM16 */
static void
pack_ubyte_L16(const GLubyte src[4], void *dst)
}
-/* MESA_FORMAT_R8 */
+/* MESA_FORMAT_R_UNORM8 */
static void
pack_ubyte_R8(const GLubyte src[4], void *dst)
}
-/* MESA_FORMAT_R16 */
+/* MESA_FORMAT_R_UNORM16 */
static void
pack_ubyte_R16(const GLubyte src[4], void *dst)
}
-/* MESA_FORMAT_SRGB8 */
+/* MESA_FORMAT_BGR_SRGB8 */
static void
pack_ubyte_SRGB8(const GLubyte src[4], void *dst)
}
-/* MESA_FORMAT_SL8 */
+/* MESA_FORMAT_L_SRGB8 */
static void
pack_ubyte_SL8(const GLubyte src[4], void *dst)
}
-/* MESA_FORMAT_RGBA_16 */
+/* MESA_FORMAT_RGBA_UNORM16 */
static void
pack_ubyte_RGBA_16(const GLubyte src[4], void *dst)
}
-/* MESA_FORMAT_XBGR16161616_UNORM */
+/* MESA_FORMAT_RGBX_UNORM16 */
static void
pack_ubyte_XBGR16161616_UNORM(const GLubyte src[4], void *dst)
}
-/* MESA_FORMAT_XBGR16161616_SNORM */
+/* MESA_FORMAT_RGBX_SNORM16 */
static void
pack_float_XBGR16161616_SNORM(const GLfloat src[4], void *dst)
}
-/* MESA_FORMAT_XBGR16161616_FLOAT */
+/* MESA_FORMAT_RGBX_FLOAT16 */
static void
pack_float_XBGR16161616_FLOAT(const GLfloat src[4], void *dst)
d[3] = _mesa_float_to_half(1.0);
}
-/* MESA_FORMAT_XBGR32323232_FLOAT */
+/* MESA_FORMAT_RGBX_FLOAT32 */
static void
pack_float_XBGR32323232_FLOAT(const GLfloat src[4], void *dst)
table[MESA_FORMAT_R8G8B8X8_UNORM] = pack_ubyte_RGBA8888_REV; /* reused */
table[MESA_FORMAT_B8G8R8X8_UNORM] = pack_ubyte_XRGB8888;
table[MESA_FORMAT_X8R8G8B8_UNORM] = pack_ubyte_XRGB8888_REV;
- table[MESA_FORMAT_RGB888] = pack_ubyte_RGB888;
- table[MESA_FORMAT_BGR888] = pack_ubyte_BGR888;
+ table[MESA_FORMAT_BGR_UNORM8] = pack_ubyte_RGB888;
+ table[MESA_FORMAT_RGB_UNORM8] = pack_ubyte_BGR888;
table[MESA_FORMAT_RGB565] = pack_ubyte_RGB565;
table[MESA_FORMAT_RGB565_REV] = pack_ubyte_RGB565_REV;
table[MESA_FORMAT_ARGB4444] = pack_ubyte_ARGB4444;
table[MESA_FORMAT_AL1616] = pack_ubyte_AL1616;
table[MESA_FORMAT_AL1616_REV] = pack_ubyte_AL1616_REV;
table[MESA_FORMAT_RGB332] = pack_ubyte_RGB332;
- table[MESA_FORMAT_A8] = pack_ubyte_A8;
- table[MESA_FORMAT_A16] = pack_ubyte_A16;
- table[MESA_FORMAT_L8] = pack_ubyte_L8;
- table[MESA_FORMAT_L16] = pack_ubyte_L16;
- table[MESA_FORMAT_I8] = pack_ubyte_L8; /* reuse pack_ubyte_L8 */
- table[MESA_FORMAT_I16] = pack_ubyte_L16; /* reuse pack_ubyte_L16 */
+ table[MESA_FORMAT_A_UNORM8] = pack_ubyte_A8;
+ table[MESA_FORMAT_A_UNORM16] = pack_ubyte_A16;
+ table[MESA_FORMAT_L_UNORM8] = pack_ubyte_L8;
+ table[MESA_FORMAT_L_UNORM16] = pack_ubyte_L16;
+ table[MESA_FORMAT_I_UNORM8] = pack_ubyte_L8; /* reuse pack_ubyte_L8 */
+ table[MESA_FORMAT_I_UNORM16] = pack_ubyte_L16; /* reuse pack_ubyte_L16 */
table[MESA_FORMAT_YCBCR] = pack_ubyte_YCBCR;
table[MESA_FORMAT_YCBCR_REV] = pack_ubyte_YCBCR_REV;
- table[MESA_FORMAT_R8] = pack_ubyte_R8;
+ table[MESA_FORMAT_R_UNORM8] = pack_ubyte_R8;
table[MESA_FORMAT_GR88] = pack_ubyte_GR88;
table[MESA_FORMAT_RG88] = pack_ubyte_RG88;
- table[MESA_FORMAT_R16] = pack_ubyte_R16;
+ table[MESA_FORMAT_R_UNORM16] = pack_ubyte_R16;
table[MESA_FORMAT_GR1616] = pack_ubyte_GR1616;
table[MESA_FORMAT_RG1616] = pack_ubyte_RG1616;
table[MESA_FORMAT_ARGB2101010] = pack_ubyte_ARGB2101010;
/* should never convert RGBA to these formats */
table[MESA_FORMAT_Z24_S8] = NULL;
table[MESA_FORMAT_S8_Z24] = NULL;
- table[MESA_FORMAT_Z16] = NULL;
+ table[MESA_FORMAT_Z_UNORM16] = NULL;
table[MESA_FORMAT_X8_Z24] = NULL;
table[MESA_FORMAT_Z24_X8] = NULL;
- table[MESA_FORMAT_Z32] = NULL;
- table[MESA_FORMAT_S8] = NULL;
+ table[MESA_FORMAT_Z_UNORM32] = NULL;
+ table[MESA_FORMAT_S_UINT8] = NULL;
/* sRGB */
- table[MESA_FORMAT_SRGB8] = pack_ubyte_SRGB8;
+ table[MESA_FORMAT_BGR_SRGB8] = pack_ubyte_SRGB8;
table[MESA_FORMAT_SRGBA8] = pack_ubyte_SRGBA8;
table[MESA_FORMAT_SARGB8] = pack_ubyte_SARGB8;
- table[MESA_FORMAT_SL8] = pack_ubyte_SL8;
+ table[MESA_FORMAT_L_SRGB8] = pack_ubyte_SL8;
table[MESA_FORMAT_SLA8] = pack_ubyte_SLA8;
/* n/a */
table[MESA_FORMAT_DUDV8] = pack_ubyte_DUDV8;
- table[MESA_FORMAT_RGBA_16] = pack_ubyte_RGBA_16;
+ table[MESA_FORMAT_RGBA_UNORM16] = pack_ubyte_RGBA_16;
/* n/a */
table[MESA_FORMAT_SIGNED_R8] = NULL;
table[MESA_FORMAT_SIGNED_I16] = NULL;
- table[MESA_FORMAT_RGBA_16] = pack_ubyte_RGBA_16;
+ table[MESA_FORMAT_RGBA_UNORM16] = pack_ubyte_RGBA_16;
table[MESA_FORMAT_RGB9_E5_FLOAT] = pack_ubyte_RGB9_E5_FLOAT;
table[MESA_FORMAT_R11_G11_B10_FLOAT] = pack_ubyte_R11_G11_B10_FLOAT;
table[MESA_FORMAT_XRGB1555_UNORM] = pack_ubyte_XRGB1555_UNORM;
table[MESA_FORMAT_XBGR8888_SNORM] = NULL;
table[MESA_FORMAT_XBGR8888_SRGB] = NULL;
- table[MESA_FORMAT_XBGR8888_UINT] = NULL;
- table[MESA_FORMAT_XBGR8888_SINT] = NULL;
+ table[MESA_FORMAT_RGBX_UINT8] = NULL;
+ table[MESA_FORMAT_RGBX_SINT8] = NULL;
table[MESA_FORMAT_XRGB2101010_UNORM] = pack_ubyte_XRGB2101010_UNORM;
- table[MESA_FORMAT_XBGR16161616_UNORM] = pack_ubyte_XBGR16161616_UNORM;
- table[MESA_FORMAT_XBGR16161616_SNORM] = NULL;
- table[MESA_FORMAT_XBGR16161616_FLOAT] = NULL;
- table[MESA_FORMAT_XBGR16161616_UINT] = NULL;
- table[MESA_FORMAT_XBGR16161616_SINT] = NULL;
- table[MESA_FORMAT_XBGR32323232_FLOAT] = NULL;
- table[MESA_FORMAT_XBGR32323232_UINT] = NULL;
- table[MESA_FORMAT_XBGR32323232_SINT] = NULL;
+ table[MESA_FORMAT_RGBX_UNORM16] = pack_ubyte_XBGR16161616_UNORM;
+ table[MESA_FORMAT_RGBX_SNORM16] = NULL;
+ table[MESA_FORMAT_RGBX_FLOAT16] = NULL;
+ table[MESA_FORMAT_RGBX_UINT16] = NULL;
+ table[MESA_FORMAT_RGBX_SINT16] = NULL;
+ table[MESA_FORMAT_RGBX_FLOAT32] = NULL;
+ table[MESA_FORMAT_RGBX_UINT32] = NULL;
+ table[MESA_FORMAT_RGBX_SINT32] = NULL;
table[MESA_FORMAT_ABGR2101010] = pack_ubyte_ABGR2101010;
table[MESA_FORMAT_R8G8B8X8_UNORM] = pack_float_RGBA8888_REV; /* reused */
table[MESA_FORMAT_B8G8R8X8_UNORM] = pack_float_XRGB8888;
table[MESA_FORMAT_X8R8G8B8_UNORM] = pack_float_XRGB8888_REV;
- table[MESA_FORMAT_RGB888] = pack_float_RGB888;
- table[MESA_FORMAT_BGR888] = pack_float_BGR888;
+ table[MESA_FORMAT_BGR_UNORM8] = pack_float_RGB888;
+ table[MESA_FORMAT_RGB_UNORM8] = pack_float_BGR888;
table[MESA_FORMAT_RGB565] = pack_float_RGB565;
table[MESA_FORMAT_RGB565_REV] = pack_float_RGB565_REV;
table[MESA_FORMAT_ARGB4444] = pack_float_ARGB4444;
table[MESA_FORMAT_AL1616] = pack_float_AL1616;
table[MESA_FORMAT_AL1616_REV] = pack_float_AL1616_REV;
table[MESA_FORMAT_RGB332] = pack_float_RGB332;
- table[MESA_FORMAT_A8] = pack_float_A8;
- table[MESA_FORMAT_A16] = pack_float_A16;
- table[MESA_FORMAT_L8] = pack_float_L8;
- table[MESA_FORMAT_L16] = pack_float_L16;
- table[MESA_FORMAT_I8] = pack_float_L8; /* reuse pack_float_L8 */
- table[MESA_FORMAT_I16] = pack_float_L16; /* reuse pack_float_L16 */
+ table[MESA_FORMAT_A_UNORM8] = pack_float_A8;
+ table[MESA_FORMAT_A_UNORM16] = pack_float_A16;
+ table[MESA_FORMAT_L_UNORM8] = pack_float_L8;
+ table[MESA_FORMAT_L_UNORM16] = pack_float_L16;
+ table[MESA_FORMAT_I_UNORM8] = pack_float_L8; /* reuse pack_float_L8 */
+ table[MESA_FORMAT_I_UNORM16] = pack_float_L16; /* reuse pack_float_L16 */
table[MESA_FORMAT_YCBCR] = pack_float_YCBCR;
table[MESA_FORMAT_YCBCR_REV] = pack_float_YCBCR_REV;
- table[MESA_FORMAT_R8] = pack_float_R8;
+ table[MESA_FORMAT_R_UNORM8] = pack_float_R8;
table[MESA_FORMAT_GR88] = pack_float_GR88;
table[MESA_FORMAT_RG88] = pack_float_RG88;
- table[MESA_FORMAT_R16] = pack_float_R16;
+ table[MESA_FORMAT_R_UNORM16] = pack_float_R16;
table[MESA_FORMAT_GR1616] = pack_float_GR1616;
table[MESA_FORMAT_RG1616] = pack_float_RG1616;
table[MESA_FORMAT_ARGB2101010] = pack_float_ARGB2101010;
/* should never convert RGBA to these formats */
table[MESA_FORMAT_Z24_S8] = NULL;
table[MESA_FORMAT_S8_Z24] = NULL;
- table[MESA_FORMAT_Z16] = NULL;
+ table[MESA_FORMAT_Z_UNORM16] = NULL;
table[MESA_FORMAT_X8_Z24] = NULL;
table[MESA_FORMAT_Z24_X8] = NULL;
- table[MESA_FORMAT_Z32] = NULL;
- table[MESA_FORMAT_S8] = NULL;
+ table[MESA_FORMAT_Z_UNORM32] = NULL;
+ table[MESA_FORMAT_S_UINT8] = NULL;
- table[MESA_FORMAT_SRGB8] = pack_float_SRGB8;
+ table[MESA_FORMAT_BGR_SRGB8] = pack_float_SRGB8;
table[MESA_FORMAT_SRGBA8] = pack_float_SRGBA8;
table[MESA_FORMAT_SARGB8] = pack_float_SARGB8;
- table[MESA_FORMAT_SL8] = pack_float_SL8;
+ table[MESA_FORMAT_L_SRGB8] = pack_float_SL8;
table[MESA_FORMAT_SLA8] = pack_float_SLA8;
/* n/a */
table[MESA_FORMAT_DUDV8] = pack_float_DUDV8;
- table[MESA_FORMAT_RGBA_16] = pack_float_RGBA_16;
+ table[MESA_FORMAT_RGBA_UNORM16] = pack_float_RGBA_16;
table[MESA_FORMAT_SIGNED_R8] = pack_float_SIGNED_R8;
table[MESA_FORMAT_SIGNED_RG88_REV] = pack_float_SIGNED_RG88_REV;
table[MESA_FORMAT_XRGB1555_UNORM] = pack_float_XRGB1555_UNORM;
table[MESA_FORMAT_XBGR8888_SNORM] = pack_float_XBGR8888_SNORM;
table[MESA_FORMAT_XBGR8888_SRGB] = pack_float_XBGR8888_SRGB;
- table[MESA_FORMAT_XBGR8888_UINT] = NULL;
- table[MESA_FORMAT_XBGR8888_SINT] = NULL;
+ table[MESA_FORMAT_RGBX_UINT8] = NULL;
+ table[MESA_FORMAT_RGBX_SINT8] = NULL;
table[MESA_FORMAT_XRGB2101010_UNORM] = pack_float_XRGB2101010_UNORM;
- table[MESA_FORMAT_XBGR16161616_UNORM] = pack_float_XBGR16161616_UNORM;
- table[MESA_FORMAT_XBGR16161616_SNORM] = pack_float_XBGR16161616_SNORM;
- table[MESA_FORMAT_XBGR16161616_FLOAT] = pack_float_XBGR16161616_FLOAT;
- table[MESA_FORMAT_XBGR16161616_UINT] = NULL;
- table[MESA_FORMAT_XBGR16161616_SINT] = NULL;
- table[MESA_FORMAT_XBGR32323232_FLOAT] = pack_float_XBGR32323232_FLOAT;
- table[MESA_FORMAT_XBGR32323232_UINT] = NULL;
- table[MESA_FORMAT_XBGR32323232_SINT] = NULL;
+ table[MESA_FORMAT_RGBX_UNORM16] = pack_float_XBGR16161616_UNORM;
+ table[MESA_FORMAT_RGBX_SNORM16] = pack_float_XBGR16161616_SNORM;
+ table[MESA_FORMAT_RGBX_FLOAT16] = pack_float_XBGR16161616_FLOAT;
+ table[MESA_FORMAT_RGBX_UINT16] = NULL;
+ table[MESA_FORMAT_RGBX_SINT16] = NULL;
+ table[MESA_FORMAT_RGBX_FLOAT32] = pack_float_XBGR32323232_FLOAT;
+ table[MESA_FORMAT_RGBX_UINT32] = NULL;
+ table[MESA_FORMAT_RGBX_SINT32] = NULL;
table[MESA_FORMAT_ABGR2101010] = pack_float_ABGR2101010;
table[MESA_FORMAT_R8G8B8X8_UNORM] = pack_row_float_RGBA8888_REV; /* reused */
table[MESA_FORMAT_B8G8R8X8_UNORM] = pack_row_float_XRGB8888;
table[MESA_FORMAT_X8R8G8B8_UNORM] = pack_row_float_XRGB8888_REV;
- table[MESA_FORMAT_RGB888] = pack_row_float_RGB888;
- table[MESA_FORMAT_BGR888] = pack_row_float_BGR888;
+ table[MESA_FORMAT_BGR_UNORM8] = pack_row_float_RGB888;
+ table[MESA_FORMAT_RGB_UNORM8] = pack_row_float_BGR888;
table[MESA_FORMAT_RGB565] = pack_row_float_RGB565;
table[MESA_FORMAT_RGB565_REV] = pack_row_float_RGB565_REV;
table[MESA_FORMAT_R8G8B8X8_UNORM] = pack_row_ubyte_RGBA8888_REV; /* reused */
table[MESA_FORMAT_B8G8R8X8_UNORM] = pack_row_ubyte_XRGB8888;
table[MESA_FORMAT_X8R8G8B8_UNORM] = pack_row_ubyte_XRGB8888_REV;
- table[MESA_FORMAT_RGB888] = pack_row_ubyte_RGB888;
- table[MESA_FORMAT_BGR888] = pack_row_ubyte_BGR888;
+ table[MESA_FORMAT_BGR_UNORM8] = pack_row_ubyte_RGB888;
+ table[MESA_FORMAT_RGB_UNORM8] = pack_row_ubyte_BGR888;
table[MESA_FORMAT_RGB565] = pack_row_ubyte_RGB565;
table[MESA_FORMAT_RGB565_REV] = pack_row_ubyte_RGB565_REV;
case MESA_FORMAT_S8_Z24:
case MESA_FORMAT_X8_Z24:
return pack_float_z_S8_Z24;
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
return pack_float_z_Z16;
- case MESA_FORMAT_Z32:
+ case MESA_FORMAT_Z_UNORM32:
return pack_float_z_Z32;
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_FLOAT32:
case MESA_FORMAT_Z32_FLOAT_X24S8:
return pack_float_z_Z32_FLOAT;
default:
case MESA_FORMAT_S8_Z24:
case MESA_FORMAT_X8_Z24:
return pack_uint_z_S8_Z24;
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
return pack_uint_z_Z16;
- case MESA_FORMAT_Z32:
+ case MESA_FORMAT_Z_UNORM32:
return pack_uint_z_Z32;
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_FLOAT32:
return pack_uint_z_Z32_FLOAT;
case MESA_FORMAT_Z32_FLOAT_X24S8:
return pack_uint_z_Z32_FLOAT_X24S8;
return pack_ubyte_stencil_Z24_S8;
case MESA_FORMAT_S8_Z24:
return pack_ubyte_stencil_S8_Z24;
- case MESA_FORMAT_S8:
+ case MESA_FORMAT_S_UINT8:
return pack_ubyte_stencil_S8;
case MESA_FORMAT_Z32_FLOAT_X24S8:
return pack_ubyte_stencil_Z32_FLOAT_X24S8;
}
}
break;
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
{
GLushort *d = ((GLushort *) dst);
const GLfloat scale = (GLfloat) 0xffff;
}
}
break;
- case MESA_FORMAT_Z32:
+ case MESA_FORMAT_Z_UNORM32:
{
GLuint *d = ((GLuint *) dst);
const GLdouble scale = (GLdouble) 0xffffffff;
}
}
break;
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_FLOAT32:
memcpy(dst, src, n * sizeof(GLfloat));
break;
case MESA_FORMAT_Z32_FLOAT_X24S8:
}
}
break;
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
{
GLushort *d = ((GLushort *) dst);
GLuint i;
}
}
break;
- case MESA_FORMAT_Z32:
+ case MESA_FORMAT_Z_UNORM32:
memcpy(dst, src, n * sizeof(GLfloat));
break;
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_FLOAT32:
{
GLuint *d = ((GLuint *) dst);
const GLdouble scale = 1.0 / (GLdouble) 0xffffffff;
}
}
break;
- case MESA_FORMAT_S8:
+ case MESA_FORMAT_S_UINT8:
memcpy(dst, src, n * sizeof(GLubyte));
break;
case MESA_FORMAT_Z32_FLOAT_X24S8:
table[MESA_FORMAT_R8G8B8X8_UNORM] = unpack_RGBX8888_REV;
table[MESA_FORMAT_B8G8R8X8_UNORM] = unpack_XRGB8888;
table[MESA_FORMAT_X8R8G8B8_UNORM] = unpack_XRGB8888_REV;
- table[MESA_FORMAT_RGB888] = unpack_RGB888;
- table[MESA_FORMAT_BGR888] = unpack_BGR888;
+ table[MESA_FORMAT_BGR_UNORM8] = unpack_RGB888;
+ table[MESA_FORMAT_RGB_UNORM8] = unpack_BGR888;
table[MESA_FORMAT_RGB565] = unpack_RGB565;
table[MESA_FORMAT_RGB565_REV] = unpack_RGB565_REV;
table[MESA_FORMAT_ARGB4444] = unpack_ARGB4444;
table[MESA_FORMAT_AL1616] = unpack_AL1616;
table[MESA_FORMAT_AL1616_REV] = unpack_AL1616_REV;
table[MESA_FORMAT_RGB332] = unpack_RGB332;
- table[MESA_FORMAT_A8] = unpack_A8;
- table[MESA_FORMAT_A16] = unpack_A16;
- table[MESA_FORMAT_L8] = unpack_L8;
- table[MESA_FORMAT_L16] = unpack_L16;
- table[MESA_FORMAT_I8] = unpack_I8;
- table[MESA_FORMAT_I16] = unpack_I16;
+ table[MESA_FORMAT_A_UNORM8] = unpack_A8;
+ table[MESA_FORMAT_A_UNORM16] = unpack_A16;
+ table[MESA_FORMAT_L_UNORM8] = unpack_L8;
+ table[MESA_FORMAT_L_UNORM16] = unpack_L16;
+ table[MESA_FORMAT_I_UNORM8] = unpack_I8;
+ table[MESA_FORMAT_I_UNORM16] = unpack_I16;
table[MESA_FORMAT_YCBCR] = unpack_YCBCR;
table[MESA_FORMAT_YCBCR_REV] = unpack_YCBCR_REV;
- table[MESA_FORMAT_R8] = unpack_R8;
+ table[MESA_FORMAT_R_UNORM8] = unpack_R8;
table[MESA_FORMAT_GR88] = unpack_GR88;
table[MESA_FORMAT_RG88] = unpack_RG88;
- table[MESA_FORMAT_R16] = unpack_R16;
+ table[MESA_FORMAT_R_UNORM16] = unpack_R16;
table[MESA_FORMAT_GR1616] = unpack_GR1616;
table[MESA_FORMAT_RG1616] = unpack_RG1616;
table[MESA_FORMAT_ARGB2101010] = unpack_ARGB2101010;
table[MESA_FORMAT_ABGR2101010_UINT] = unpack_ABGR2101010_UINT;
table[MESA_FORMAT_Z24_S8] = unpack_Z24_S8;
table[MESA_FORMAT_S8_Z24] = unpack_S8_Z24;
- table[MESA_FORMAT_Z16] = unpack_Z16;
+ table[MESA_FORMAT_Z_UNORM16] = unpack_Z16;
table[MESA_FORMAT_X8_Z24] = unpack_X8_Z24;
table[MESA_FORMAT_Z24_X8] = unpack_Z24_X8;
- table[MESA_FORMAT_Z32] = unpack_Z32;
- table[MESA_FORMAT_S8] = unpack_S8;
- table[MESA_FORMAT_SRGB8] = unpack_SRGB8;
+ table[MESA_FORMAT_Z_UNORM32] = unpack_Z32;
+ table[MESA_FORMAT_S_UINT8] = unpack_S8;
+ table[MESA_FORMAT_BGR_SRGB8] = unpack_SRGB8;
table[MESA_FORMAT_SRGBA8] = unpack_SRGBA8;
table[MESA_FORMAT_SARGB8] = unpack_SARGB8;
- table[MESA_FORMAT_SL8] = unpack_SL8;
+ table[MESA_FORMAT_L_SRGB8] = unpack_SL8;
table[MESA_FORMAT_SLA8] = unpack_SLA8;
table[MESA_FORMAT_SRGB_DXT1] = unpack_SRGB_DXT1;
table[MESA_FORMAT_SRGBA_DXT1] = unpack_SRGBA_DXT1;
table[MESA_FORMAT_SIGNED_GR1616] = unpack_SIGNED_GR1616;
table[MESA_FORMAT_SIGNED_RGB_16] = unpack_SIGNED_RGB_16;
table[MESA_FORMAT_SIGNED_RGBA_16] = unpack_SIGNED_RGBA_16;
- table[MESA_FORMAT_RGBA_16] = unpack_RGBA_16;
+ table[MESA_FORMAT_RGBA_UNORM16] = unpack_RGBA_16;
table[MESA_FORMAT_RED_RGTC1] = unpack_RED_RGTC1;
table[MESA_FORMAT_SIGNED_RED_RGTC1] = unpack_SIGNED_RED_RGTC1;
table[MESA_FORMAT_RGB9_E5_FLOAT] = unpack_RGB9_E5_FLOAT;
table[MESA_FORMAT_R11_G11_B10_FLOAT] = unpack_R11_G11_B10_FLOAT;
- table[MESA_FORMAT_Z32_FLOAT] = unpack_Z32_FLOAT;
+ table[MESA_FORMAT_Z_FLOAT32] = unpack_Z32_FLOAT;
table[MESA_FORMAT_Z32_FLOAT_X24S8] = unpack_Z32_FLOAT_X24S8;
table[MESA_FORMAT_XRGB4444_UNORM] = unpack_XRGB4444_UNORM;
table[MESA_FORMAT_XRGB1555_UNORM] = unpack_XRGB1555_UNORM;
table[MESA_FORMAT_XBGR8888_SNORM] = unpack_XBGR8888_SNORM;
table[MESA_FORMAT_XBGR8888_SRGB] = unpack_XBGR8888_SRGB;
- table[MESA_FORMAT_XBGR8888_UINT] = unpack_XBGR8888_UINT;
- table[MESA_FORMAT_XBGR8888_SINT] = unpack_XBGR8888_SINT;
+ table[MESA_FORMAT_RGBX_UINT8] = unpack_XBGR8888_UINT;
+ table[MESA_FORMAT_RGBX_SINT8] = unpack_XBGR8888_SINT;
table[MESA_FORMAT_XRGB2101010_UNORM] = unpack_XRGB2101010_UNORM;
- table[MESA_FORMAT_XBGR16161616_UNORM] = unpack_XBGR16161616_UNORM;
- table[MESA_FORMAT_XBGR16161616_SNORM] = unpack_XBGR16161616_SNORM;
- table[MESA_FORMAT_XBGR16161616_FLOAT] = unpack_XBGR16161616_FLOAT;
- table[MESA_FORMAT_XBGR16161616_UINT] = unpack_XBGR16161616_UINT;
- table[MESA_FORMAT_XBGR16161616_SINT] = unpack_XBGR16161616_SINT;
- table[MESA_FORMAT_XBGR32323232_FLOAT] = unpack_XBGR32323232_FLOAT;
- table[MESA_FORMAT_XBGR32323232_UINT] = unpack_XBGR32323232_UINT;
- table[MESA_FORMAT_XBGR32323232_SINT] = unpack_XBGR32323232_SINT;
+ table[MESA_FORMAT_RGBX_UNORM16] = unpack_XBGR16161616_UNORM;
+ table[MESA_FORMAT_RGBX_SNORM16] = unpack_XBGR16161616_SNORM;
+ table[MESA_FORMAT_RGBX_FLOAT16] = unpack_XBGR16161616_FLOAT;
+ table[MESA_FORMAT_RGBX_UINT16] = unpack_XBGR16161616_UINT;
+ table[MESA_FORMAT_RGBX_SINT16] = unpack_XBGR16161616_SINT;
+ table[MESA_FORMAT_RGBX_FLOAT32] = unpack_XBGR32323232_FLOAT;
+ table[MESA_FORMAT_RGBX_UINT32] = unpack_XBGR32323232_UINT;
+ table[MESA_FORMAT_RGBX_SINT32] = unpack_XBGR32323232_SINT;
table[MESA_FORMAT_ABGR2101010] = unpack_ABGR2101010;
case MESA_FORMAT_X8R8G8B8_UNORM:
unpack_ubyte_XRGB8888_REV(src, dst, n);
break;
- case MESA_FORMAT_RGB888:
+ case MESA_FORMAT_BGR_UNORM8:
unpack_ubyte_RGB888(src, dst, n);
break;
- case MESA_FORMAT_BGR888:
+ case MESA_FORMAT_RGB_UNORM8:
unpack_ubyte_BGR888(src, dst, n);
break;
case MESA_FORMAT_RGB565:
case MESA_FORMAT_RGB332:
unpack_ubyte_RGB332(src, dst, n);
break;
- case MESA_FORMAT_A8:
+ case MESA_FORMAT_A_UNORM8:
unpack_ubyte_A8(src, dst, n);
break;
- case MESA_FORMAT_L8:
+ case MESA_FORMAT_L_UNORM8:
unpack_ubyte_L8(src, dst, n);
break;
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_I_UNORM8:
unpack_ubyte_I8(src, dst, n);
break;
- case MESA_FORMAT_R8:
+ case MESA_FORMAT_R_UNORM8:
unpack_ubyte_R8(src, dst, n);
break;
case MESA_FORMAT_GR88:
unpack_int_rgba_ARGB2101010(src, dst, n);
break;
- case MESA_FORMAT_XBGR8888_UINT:
+ case MESA_FORMAT_RGBX_UINT8:
unpack_int_rgba_XBGR8888_UINT(src, dst, n);
break;
- case MESA_FORMAT_XBGR8888_SINT:
+ case MESA_FORMAT_RGBX_SINT8:
unpack_int_rgba_XBGR8888_SINT(src, dst, n);
break;
- case MESA_FORMAT_XBGR16161616_UINT:
+ case MESA_FORMAT_RGBX_UINT16:
unpack_int_rgba_XBGR16161616_UINT(src, dst, n);
break;
- case MESA_FORMAT_XBGR16161616_SINT:
+ case MESA_FORMAT_RGBX_SINT16:
unpack_int_rgba_XBGR16161616_SINT(src, dst, n);
break;
- case MESA_FORMAT_XBGR32323232_UINT:
- case MESA_FORMAT_XBGR32323232_SINT:
+ case MESA_FORMAT_RGBX_UINT32:
+ case MESA_FORMAT_RGBX_SINT32:
unpack_int_rgba_XBGR32323232_UINT(src, dst, n);
break;
case MESA_FORMAT_X8_Z24:
unpack = unpack_float_z_X8_Z24;
break;
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
unpack = unpack_float_z_Z16;
break;
- case MESA_FORMAT_Z32:
+ case MESA_FORMAT_Z_UNORM32:
unpack = unpack_float_z_Z32;
break;
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_FLOAT32:
unpack = unpack_float_z_Z32F;
break;
case MESA_FORMAT_Z32_FLOAT_X24S8:
case MESA_FORMAT_X8_Z24:
unpack = unpack_uint_z_X8_Z24;
break;
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
unpack = unpack_uint_z_Z16;
break;
- case MESA_FORMAT_Z32:
+ case MESA_FORMAT_Z_UNORM32:
unpack = unpack_uint_z_Z32;
break;
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_FLOAT32:
unpack = unpack_uint_z_Z32_FLOAT;
break;
case MESA_FORMAT_Z32_FLOAT_X24S8:
const void *src, GLubyte *dst)
{
switch (format) {
- case MESA_FORMAT_S8:
+ case MESA_FORMAT_S_UINT8:
unpack_ubyte_s_S8(src, dst, n);
break;
case MESA_FORMAT_Z24_S8:
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_RGB888, /* Name */
- "MESA_FORMAT_RGB888", /* StrName */
+ MESA_FORMAT_BGR_UNORM8, /* Name */
+ "MESA_FORMAT_BGR_UNORM8", /* StrName */
GL_RGB, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */
1, 1, 3 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_BGR888, /* Name */
- "MESA_FORMAT_BGR888", /* StrName */
+ MESA_FORMAT_RGB_UNORM8, /* Name */
+ "MESA_FORMAT_RGB_UNORM8", /* StrName */
GL_RGB, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */
1, 1, 1 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_A8, /* Name */
- "MESA_FORMAT_A8", /* StrName */
+ MESA_FORMAT_A_UNORM8, /* Name */
+ "MESA_FORMAT_A_UNORM8", /* StrName */
GL_ALPHA, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
0, 0, 0, 8, /* Red/Green/Blue/AlphaBits */
1, 1, 1 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_A16, /* Name */
- "MESA_FORMAT_A16", /* StrName */
+ MESA_FORMAT_A_UNORM16, /* Name */
+ "MESA_FORMAT_A_UNORM16", /* StrName */
GL_ALPHA, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
0, 0, 0, 16, /* Red/Green/Blue/AlphaBits */
1, 1, 2 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_L8, /* Name */
- "MESA_FORMAT_L8", /* StrName */
+ MESA_FORMAT_L_UNORM8, /* Name */
+ "MESA_FORMAT_L_UNORM8", /* StrName */
GL_LUMINANCE, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */
1, 1, 1 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_L16, /* Name */
- "MESA_FORMAT_L16", /* StrName */
+ MESA_FORMAT_L_UNORM16, /* Name */
+ "MESA_FORMAT_L_UNORM16", /* StrName */
GL_LUMINANCE, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */
1, 1, 2 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_I8, /* Name */
- "MESA_FORMAT_I8", /* StrName */
+ MESA_FORMAT_I_UNORM8, /* Name */
+ "MESA_FORMAT_I_UNORM8", /* StrName */
GL_INTENSITY, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */
1, 1, 1 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_I16, /* Name */
- "MESA_FORMAT_I16", /* StrName */
+ MESA_FORMAT_I_UNORM16, /* Name */
+ "MESA_FORMAT_I_UNORM16", /* StrName */
GL_INTENSITY, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */
1, 1, 2 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_R8,
- "MESA_FORMAT_R8",
+ MESA_FORMAT_R_UNORM8,
+ "MESA_FORMAT_R_UNORM8",
GL_RED,
GL_UNSIGNED_NORMALIZED,
8, 0, 0, 0,
1, 1, 2
},
{
- MESA_FORMAT_R16,
- "MESA_FORMAT_R16",
+ MESA_FORMAT_R_UNORM16,
+ "MESA_FORMAT_R_UNORM16",
GL_RED,
GL_UNSIGNED_NORMALIZED,
16, 0, 0, 0,
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_Z16, /* Name */
- "MESA_FORMAT_Z16", /* StrName */
+ MESA_FORMAT_Z_UNORM16, /* Name */
+ "MESA_FORMAT_Z_UNORM16", /* StrName */
GL_DEPTH_COMPONENT, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_Z32, /* Name */
- "MESA_FORMAT_Z32", /* StrName */
+ MESA_FORMAT_Z_UNORM32, /* Name */
+ "MESA_FORMAT_Z_UNORM32", /* StrName */
GL_DEPTH_COMPONENT, /* BaseFormat */
GL_UNSIGNED_NORMALIZED, /* DataType */
0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */
1, 1, 4 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_S8, /* Name */
- "MESA_FORMAT_S8", /* StrName */
+ MESA_FORMAT_S_UINT8, /* Name */
+ "MESA_FORMAT_S_UINT8", /* StrName */
GL_STENCIL_INDEX, /* BaseFormat */
GL_UNSIGNED_INT, /* DataType */
0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */
1, 1, 1 /* BlockWidth/Height,Bytes */
},
{
- MESA_FORMAT_SRGB8,
- "MESA_FORMAT_SRGB8",
+ MESA_FORMAT_BGR_SRGB8,
+ "MESA_FORMAT_BGR_SRGB8",
GL_RGB,
GL_UNSIGNED_NORMALIZED,
8, 8, 8, 0,
1, 1, 4
},
{
- MESA_FORMAT_SL8,
- "MESA_FORMAT_SL8",
+ MESA_FORMAT_L_SRGB8,
+ "MESA_FORMAT_L_SRGB8",
GL_LUMINANCE,
GL_UNSIGNED_NORMALIZED,
0, 0, 0, 0,
1, 1, 8
},
{
- MESA_FORMAT_RGBA_16,
- "MESA_FORMAT_RGBA_16",
+ MESA_FORMAT_RGBA_UNORM16,
+ "MESA_FORMAT_RGBA_UNORM16",
GL_RGBA,
GL_UNSIGNED_NORMALIZED,
16, 16, 16, 16,
},
/* ARB_depth_buffer_float */
{
- MESA_FORMAT_Z32_FLOAT, /* Name */
- "MESA_FORMAT_Z32_FLOAT", /* StrName */
+ MESA_FORMAT_Z_FLOAT32, /* Name */
+ "MESA_FORMAT_Z_FLOAT32", /* StrName */
GL_DEPTH_COMPONENT, /* BaseFormat */
GL_FLOAT, /* DataType */
0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */
1, 1, 4
},
{
- MESA_FORMAT_XBGR8888_UINT,
- "MESA_FORMAT_XBGR8888_UINT",
+ MESA_FORMAT_RGBX_UINT8,
+ "MESA_FORMAT_RGBX_UINT8",
GL_RGB,
GL_UNSIGNED_INT,
8, 8, 8, 0,
1, 1, 4
},
{
- MESA_FORMAT_XBGR8888_SINT,
- "MESA_FORMAT_XBGR8888_SINT",
+ MESA_FORMAT_RGBX_SINT8,
+ "MESA_FORMAT_RGBX_SINT8",
GL_RGB,
GL_INT,
8, 8, 8, 0,
1, 1, 4
},
{
- MESA_FORMAT_XBGR16161616_UNORM,
- "MESA_FORMAT_XBGR16161616_UNORM",
+ MESA_FORMAT_RGBX_UNORM16,
+ "MESA_FORMAT_RGBX_UNORM16",
GL_RGB,
GL_UNSIGNED_NORMALIZED,
16, 16, 16, 0,
1, 1, 8
},
{
- MESA_FORMAT_XBGR16161616_SNORM,
- "MESA_FORMAT_XBGR16161616_SNORM",
+ MESA_FORMAT_RGBX_SNORM16,
+ "MESA_FORMAT_RGBX_SNORM16",
GL_RGB,
GL_SIGNED_NORMALIZED,
16, 16, 16, 0,
1, 1, 8
},
{
- MESA_FORMAT_XBGR16161616_FLOAT,
- "MESA_FORMAT_XBGR16161616_FLOAT",
+ MESA_FORMAT_RGBX_FLOAT16,
+ "MESA_FORMAT_RGBX_FLOAT16",
GL_RGB,
GL_FLOAT,
16, 16, 16, 0,
1, 1, 8
},
{
- MESA_FORMAT_XBGR16161616_UINT,
- "MESA_FORMAT_XBGR16161616_UINT",
+ MESA_FORMAT_RGBX_UINT16,
+ "MESA_FORMAT_RGBX_UINT16",
GL_RGB,
GL_UNSIGNED_INT,
16, 16, 16, 0,
1, 1, 8
},
{
- MESA_FORMAT_XBGR16161616_SINT,
- "MESA_FORMAT_XBGR16161616_SINT",
+ MESA_FORMAT_RGBX_SINT16,
+ "MESA_FORMAT_RGBX_SINT16",
GL_RGB,
GL_INT,
16, 16, 16, 0,
1, 1, 8
},
{
- MESA_FORMAT_XBGR32323232_FLOAT,
- "MESA_FORMAT_XBGR32323232_FLOAT",
+ MESA_FORMAT_RGBX_FLOAT32,
+ "MESA_FORMAT_RGBX_FLOAT32",
GL_RGB,
GL_FLOAT,
32, 32, 32, 0,
1, 1, 16
},
{
- MESA_FORMAT_XBGR32323232_UINT,
- "MESA_FORMAT_XBGR32323232_UINT",
+ MESA_FORMAT_RGBX_UINT32,
+ "MESA_FORMAT_RGBX_UINT32",
GL_RGB,
GL_UNSIGNED_INT,
32, 32, 32, 0,
1, 1, 16
},
{
- MESA_FORMAT_XBGR32323232_SINT,
- "MESA_FORMAT_XBGR32323232_SINT",
+ MESA_FORMAT_RGBX_SINT32,
+ "MESA_FORMAT_RGBX_SINT32",
GL_RGB,
GL_INT,
32, 32, 32, 0,
{
/* XXX this info should be encoded in gl_format_info */
switch (format) {
- case MESA_FORMAT_SRGB8:
+ case MESA_FORMAT_BGR_SRGB8:
case MESA_FORMAT_SRGBA8:
case MESA_FORMAT_SARGB8:
- case MESA_FORMAT_SL8:
+ case MESA_FORMAT_L_SRGB8:
case MESA_FORMAT_SLA8:
case MESA_FORMAT_SRGB_DXT1:
case MESA_FORMAT_SRGBA_DXT1:
_mesa_get_srgb_format_linear(mesa_format format)
{
switch (format) {
- case MESA_FORMAT_SRGB8:
- format = MESA_FORMAT_RGB888;
+ case MESA_FORMAT_BGR_SRGB8:
+ format = MESA_FORMAT_BGR_UNORM8;
break;
case MESA_FORMAT_SRGBA8:
format = MESA_FORMAT_A8B8G8R8_UNORM;
case MESA_FORMAT_SARGB8:
format = MESA_FORMAT_B8G8R8A8_UNORM;
break;
- case MESA_FORMAT_SL8:
- format = MESA_FORMAT_L8;
+ case MESA_FORMAT_L_SRGB8:
+ format = MESA_FORMAT_L_UNORM8;
break;
case MESA_FORMAT_SLA8:
format = MESA_FORMAT_AL88;
{
switch (format) {
case MESA_FORMAT_RGB_FXT1:
- return MESA_FORMAT_RGB888;
+ return MESA_FORMAT_BGR_UNORM8;
case MESA_FORMAT_RGBA_FXT1:
return MESA_FORMAT_A8B8G8R8_UNORM;
case MESA_FORMAT_RGB_DXT1:
case MESA_FORMAT_SRGB_DXT1:
- return MESA_FORMAT_RGB888;
+ return MESA_FORMAT_BGR_UNORM8;
case MESA_FORMAT_RGBA_DXT1:
case MESA_FORMAT_SRGBA_DXT1:
return MESA_FORMAT_A8B8G8R8_UNORM;
case MESA_FORMAT_SRGBA_DXT5:
return MESA_FORMAT_A8B8G8R8_UNORM;
case MESA_FORMAT_RED_RGTC1:
- return MESA_FORMAT_R8;
+ return MESA_FORMAT_R_UNORM8;
case MESA_FORMAT_SIGNED_RED_RGTC1:
return MESA_FORMAT_SIGNED_R8;
case MESA_FORMAT_RG_RGTC2:
case MESA_FORMAT_SIGNED_RG_RGTC2:
return MESA_FORMAT_SIGNED_RG88_REV;
case MESA_FORMAT_L_LATC1:
- return MESA_FORMAT_L8;
+ return MESA_FORMAT_L_UNORM8;
case MESA_FORMAT_SIGNED_L_LATC1:
return MESA_FORMAT_SIGNED_L8;
case MESA_FORMAT_LA_LATC2:
case MESA_FORMAT_ETC1_RGB8:
case MESA_FORMAT_ETC2_RGB8:
case MESA_FORMAT_ETC2_SRGB8:
- return MESA_FORMAT_RGB888;
+ return MESA_FORMAT_BGR_UNORM8;
case MESA_FORMAT_ETC2_RGBA8_EAC:
case MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC:
case MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1:
return MESA_FORMAT_A8B8G8R8_UNORM;
case MESA_FORMAT_ETC2_R11_EAC:
case MESA_FORMAT_ETC2_SIGNED_R11_EAC:
- return MESA_FORMAT_R16;
+ return MESA_FORMAT_R_UNORM16;
case MESA_FORMAT_ETC2_RG11_EAC:
case MESA_FORMAT_ETC2_SIGNED_RG11_EAC:
return MESA_FORMAT_GR1616;
*datatype = GL_UNSIGNED_BYTE;
*comps = 4;
return;
- case MESA_FORMAT_RGB888:
- case MESA_FORMAT_BGR888:
+ case MESA_FORMAT_BGR_UNORM8:
+ case MESA_FORMAT_RGB_UNORM8:
*datatype = GL_UNSIGNED_BYTE;
*comps = 3;
return;
*comps = 2;
return;
- case MESA_FORMAT_R16:
- case MESA_FORMAT_A16:
- case MESA_FORMAT_L16:
- case MESA_FORMAT_I16:
+ case MESA_FORMAT_R_UNORM16:
+ case MESA_FORMAT_A_UNORM16:
+ case MESA_FORMAT_L_UNORM16:
+ case MESA_FORMAT_I_UNORM16:
*datatype = GL_UNSIGNED_SHORT;
*comps = 1;
return;
*comps = 3;
return;
- case MESA_FORMAT_A8:
- case MESA_FORMAT_L8:
- case MESA_FORMAT_I8:
- case MESA_FORMAT_R8:
- case MESA_FORMAT_S8:
+ case MESA_FORMAT_A_UNORM8:
+ case MESA_FORMAT_L_UNORM8:
+ case MESA_FORMAT_I_UNORM8:
+ case MESA_FORMAT_R_UNORM8:
+ case MESA_FORMAT_S_UINT8:
*datatype = GL_UNSIGNED_BYTE;
*comps = 1;
return;
*comps = 2;
return;
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
*datatype = GL_UNSIGNED_SHORT;
*comps = 1;
return;
*comps = 1;
return;
- case MESA_FORMAT_Z32:
+ case MESA_FORMAT_Z_UNORM32:
*datatype = GL_UNSIGNED_INT;
*comps = 1;
return;
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_FLOAT32:
*datatype = GL_FLOAT;
*comps = 1;
return;
*comps = 4;
return;
- case MESA_FORMAT_RGBA_16:
+ case MESA_FORMAT_RGBA_UNORM16:
*datatype = GL_UNSIGNED_SHORT;
*comps = 4;
return;
*comps = 4;
return;
- case MESA_FORMAT_SRGB8:
+ case MESA_FORMAT_BGR_SRGB8:
*datatype = GL_UNSIGNED_BYTE;
*comps = 3;
return;
*datatype = GL_UNSIGNED_BYTE;
*comps = 4;
return;
- case MESA_FORMAT_SL8:
+ case MESA_FORMAT_L_SRGB8:
*datatype = GL_UNSIGNED_BYTE;
*comps = 1;
return;
return;
case MESA_FORMAT_XBGR8888_SRGB:
- case MESA_FORMAT_XBGR8888_UINT:
+ case MESA_FORMAT_RGBX_UINT8:
*datatype = GL_UNSIGNED_BYTE;
*comps = 4;
return;
case MESA_FORMAT_XBGR8888_SNORM:
- case MESA_FORMAT_XBGR8888_SINT:
+ case MESA_FORMAT_RGBX_SINT8:
*datatype = GL_BYTE;
*comps = 4;
return;
*comps = 4;
return;
- case MESA_FORMAT_XBGR16161616_UNORM:
- case MESA_FORMAT_XBGR16161616_UINT:
+ case MESA_FORMAT_RGBX_UNORM16:
+ case MESA_FORMAT_RGBX_UINT16:
*datatype = GL_UNSIGNED_SHORT;
*comps = 4;
return;
- case MESA_FORMAT_XBGR16161616_SNORM:
- case MESA_FORMAT_XBGR16161616_SINT:
+ case MESA_FORMAT_RGBX_SNORM16:
+ case MESA_FORMAT_RGBX_SINT16:
*datatype = GL_SHORT;
*comps = 4;
return;
- case MESA_FORMAT_XBGR16161616_FLOAT:
+ case MESA_FORMAT_RGBX_FLOAT16:
*datatype = GL_HALF_FLOAT;
*comps = 4;
return;
- case MESA_FORMAT_XBGR32323232_FLOAT:
+ case MESA_FORMAT_RGBX_FLOAT32:
*datatype = GL_FLOAT;
*comps = 4;
return;
- case MESA_FORMAT_XBGR32323232_UINT:
+ case MESA_FORMAT_RGBX_UINT32:
*datatype = GL_UNSIGNED_INT;
*comps = 4;
return;
- case MESA_FORMAT_XBGR32323232_SINT:
+ case MESA_FORMAT_RGBX_SINT32:
*datatype = GL_INT;
*comps = 4;
return;
case MESA_FORMAT_X8R8G8B8_UNORM:
return GL_FALSE;
- case MESA_FORMAT_RGB888:
- case MESA_FORMAT_SRGB8:
+ case MESA_FORMAT_BGR_UNORM8:
+ case MESA_FORMAT_BGR_SRGB8:
return format == GL_BGR && type == GL_UNSIGNED_BYTE && littleEndian;
- case MESA_FORMAT_BGR888:
+ case MESA_FORMAT_RGB_UNORM8:
return format == GL_RGB && type == GL_UNSIGNED_BYTE && littleEndian;
case MESA_FORMAT_RGB565:
case MESA_FORMAT_RGB332:
return format == GL_RGB && type == GL_UNSIGNED_BYTE_3_3_2;
- case MESA_FORMAT_A8:
+ case MESA_FORMAT_A_UNORM8:
return format == GL_ALPHA && type == GL_UNSIGNED_BYTE;
- case MESA_FORMAT_A16:
+ case MESA_FORMAT_A_UNORM16:
return format == GL_ALPHA && type == GL_UNSIGNED_SHORT && !swapBytes;
- case MESA_FORMAT_L8:
- case MESA_FORMAT_SL8:
+ case MESA_FORMAT_L_UNORM8:
+ case MESA_FORMAT_L_SRGB8:
return format == GL_LUMINANCE && type == GL_UNSIGNED_BYTE;
- case MESA_FORMAT_L16:
+ case MESA_FORMAT_L_UNORM16:
return format == GL_LUMINANCE && type == GL_UNSIGNED_SHORT && !swapBytes;
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_I_UNORM8:
return format == GL_INTENSITY && type == GL_UNSIGNED_BYTE;
- case MESA_FORMAT_I16:
+ case MESA_FORMAT_I_UNORM16:
return format == GL_INTENSITY && type == GL_UNSIGNED_SHORT && !swapBytes;
case MESA_FORMAT_YCBCR:
((type == GL_UNSIGNED_SHORT_8_8_MESA && littleEndian == swapBytes) ||
(type == GL_UNSIGNED_SHORT_8_8_REV_MESA && littleEndian != swapBytes));
- case MESA_FORMAT_R8:
+ case MESA_FORMAT_R_UNORM8:
return format == GL_RED && type == GL_UNSIGNED_BYTE;
case MESA_FORMAT_GR88:
return format == GL_RG && type == GL_UNSIGNED_BYTE && littleEndian;
case MESA_FORMAT_RG88:
return GL_FALSE;
- case MESA_FORMAT_R16:
+ case MESA_FORMAT_R_UNORM16:
return format == GL_RED && type == GL_UNSIGNED_SHORT &&
!swapBytes;
case MESA_FORMAT_GR1616:
case MESA_FORMAT_S8_Z24:
return GL_FALSE;
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
return format == GL_DEPTH_COMPONENT && type == GL_UNSIGNED_SHORT &&
!swapBytes;
case MESA_FORMAT_X8_Z24:
return GL_FALSE;
- case MESA_FORMAT_Z32:
+ case MESA_FORMAT_Z_UNORM32:
return format == GL_DEPTH_COMPONENT && type == GL_UNSIGNED_INT &&
!swapBytes;
- case MESA_FORMAT_S8:
+ case MESA_FORMAT_S_UINT8:
return format == GL_STENCIL_INDEX && type == GL_UNSIGNED_BYTE;
case MESA_FORMAT_SRGB_DXT1:
return format == GL_RGB && type == GL_SHORT && !swapBytes;
case MESA_FORMAT_SIGNED_RGBA_16:
return format == GL_RGBA && type == GL_SHORT && !swapBytes;
- case MESA_FORMAT_RGBA_16:
+ case MESA_FORMAT_RGBA_UNORM16:
return format == GL_RGBA && type == GL_UNSIGNED_SHORT &&
!swapBytes;
return format == GL_RGB && type == GL_UNSIGNED_INT_10F_11F_11F_REV &&
!swapBytes;
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_FLOAT32:
return format == GL_DEPTH_COMPONENT && type == GL_FLOAT && !swapBytes;
case MESA_FORMAT_Z32_FLOAT_X24S8:
case MESA_FORMAT_XRGB1555_UNORM:
case MESA_FORMAT_XBGR8888_SNORM:
case MESA_FORMAT_XBGR8888_SRGB:
- case MESA_FORMAT_XBGR8888_UINT:
- case MESA_FORMAT_XBGR8888_SINT:
+ case MESA_FORMAT_RGBX_UINT8:
+ case MESA_FORMAT_RGBX_SINT8:
case MESA_FORMAT_XRGB2101010_UNORM:
- case MESA_FORMAT_XBGR16161616_UNORM:
- case MESA_FORMAT_XBGR16161616_SNORM:
- case MESA_FORMAT_XBGR16161616_FLOAT:
- case MESA_FORMAT_XBGR16161616_UINT:
- case MESA_FORMAT_XBGR16161616_SINT:
- case MESA_FORMAT_XBGR32323232_FLOAT:
- case MESA_FORMAT_XBGR32323232_UINT:
- case MESA_FORMAT_XBGR32323232_SINT:
+ case MESA_FORMAT_RGBX_UNORM16:
+ case MESA_FORMAT_RGBX_SNORM16:
+ case MESA_FORMAT_RGBX_FLOAT16:
+ case MESA_FORMAT_RGBX_UINT16:
+ case MESA_FORMAT_RGBX_SINT16:
+ case MESA_FORMAT_RGBX_FLOAT32:
+ case MESA_FORMAT_RGBX_UINT32:
+ case MESA_FORMAT_RGBX_SINT32:
return GL_FALSE;
case MESA_FORMAT_ABGR2101010:
{
MESA_FORMAT_NONE = 0,
- /**
+ /**
* \name Basic hardware formats
+ *
+ * The mesa format name specification is as follows:
+ *
+ * There shall be 3 naming format base types: those for component array
+ * formats (type A); those for compressed formats (type C); and those for packed
+ * component formats (type P). With type A formats, color component order does not
+ * change with endianess. Each format name shall begin with MESA_FORMAT_,
+ * followed by a component label (from the Component Label list below) for each
+ * component in the order that the component(s) occur in the format, except for
+ * non-linear color formats where the first letter shall be 'S'. For type P formats,
+ * each component label is followed by the number of bits that represent it in the
+ * fundamental data type used by the format.
+ *
+ * Following the listing of the component labels shall be an underscore; a compression
+ * type followed by an underscore for Type C formats only; a storage type from the list
+ * below; and a bit with for type A formats, which is the bit width for each array element.
+ *
+ *
+ * ---------- Format Base Type A: Array ----------
+ * MESA_FORMAT_[component list]_[storage type][array element bit width]
+ *
+ * examples:
+ * MESA_FORMAT_A_SNORM8 - uchar[i] = A
+ * MESA_FORMAT_RGBA_16 - ushort[i * 4 + 0] = R, ushort[i * 4 + 1] = G,
+ * ushort[i * 4 + 2] = B, ushort[i * 4 + 3] = A
+ * MESA_FORMAT_Z_UNORM32 - float[i] = Z
+ *
+ *
+ *
+ * ---------- Format Base Type C: Compressed ----------
+ * MESA_FORMAT_[component list*][_*][compression type][storage type*]
+ * * where required
+ *
+ * examples:
+ * MESA_FORMAT_RGB_ETC1
+ * MESA_FORMAT_RGBA_ETC2
+ * MESA_FORMAT_LATC1_UNORM
+ * MESA_FORMAT_RGBA_FXT1
+ *
+ *
+ *
+ * ---------- Format Base Type P: Packed ----------
+ * MESA_FORMAT_[[component list,bit width][storage type*][_]][_][storage type**]
+ * * when type differs between component
+ * ** when type applies to all components
+ *
+ * examples: msb <------ TEXEL BITS -----------> lsb
+ * MESA_FORMAT_A8B8G8R8_UNORM, AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR
+ * MESA_FORMAT_R5G6B5_UNORM RRRR RGGG GGGB BBBB
+ * MESA_FORMAT_B4G4R4X4_UNORM BBBB GGGG RRRR XXXX
+ * MESA_FORMAT_Z32_FLOAT_S8X24_UINT
+ * MESA_FORMAT_R10G10B10A2_UINT
+ * MESA_FORMAT_R9G9B9E5_FLOAT
+ *
+ *
+ *
+ * ---------- Component Labels: ----------
+ * A - Alpha
+ * B - Blue
+ * DU - Delta U
+ * DV - Delta V
+ * E - Shared Exponent
+ * G - Green
+ * I - Intensity
+ * L - Luminance
+ * R - Red
+ * S - Stencil (when not followed by RGB or RGBA)
+ * U - Chrominance
+ * V - Chrominance
+ * Y - Luma
+ * X - Packing bits
+ * Z - Depth
+ *
+ *
+ *
+ * ---------- Type C Compression Types: ----------
+ * DXT1 - Color component labels shall be given
+ * DXT3 - Color component labels shall be given
+ * DXT5 - Color component labels shall be given
+ * ETC1 - No other information required
+ * ETC2 - No other information required
+ * FXT1 - Color component labels shall be given
+ * FXT3 - Color component labels shall be given
+ * LATC1 - Fundamental data type shall be given
+ * LATC2 - Fundamental data type shall be given
+ * RGTC1 - Color component labels and data type shall be given
+ * RGTC2 - Color component labels and data type shall be given
+ *
+ *
+ *
+ * ---------- Storage Types: ----------
+ * FLOAT
+ * SINT
+ * UINT
+ * SNORM
+ * UNORM
+ * SRGB - RGB components, or L are UNORMs in sRGB color space. Alpha, if present is linear.
+ *
+ *
+ * ---------- Type A Format List (based on format_unpack.c):
+ * BGR_UNORM8
+ * RGB_UNORM8
+ * A_UNORM8
+ * A_UNORM16
+ * L_UNORM8
+ * L_UNORM16
+ * I_UNORM8
+ * I_UNOMR16
+ * R_UNORM8
+ * R_UNORM16
+ * Z_UNORM16
+ * Z_UNORM32
+ * Z_FLOAT32
+ * S_UINT8
+ * BGR_SRGB8
+ * L_SRGB8
+ * RGBA_FLOAT32
+ * RGBA_FLOAT16
+ * RGB_FLOAT32
+ * RGB_FLOAT16
+ * A_FLOAT32
+ * A_FLOAT16
+ * L_FLOAT32
+ * L_FLOAT16
+ * LA_FLOAT32
+ * LA_FLOAT16
+ * I_FLOAT32
+ * I_FLOAT16
+ * R_FLOAT32
+ * R_FLOAT16
+ * RG_FLOAT32
+ * RG_FLOAT16
+ * A_UINT8
+ * A_UINT16
+ * A_UINT32
+ * A_SINT8
+ * A_SINT16
+ * A_SINT32
+ * I_UINT8
+ * I_UINT16
+ * I_UINT32
+ * I_SINT8
+ * I_SINT16
+ * I_SINT32
+ * L_UINT8
+ * L_UINT16
+ * L_UINT32
+ * L_SINT8
+ * L_SINT16
+ * L_SINT32
+ * LA_UINT8
+ * LA_UINT16
+ * LA_UINT32
+ * LA_SINT8
+ * LA_SINT16
+ * LA_SINT32
+ * R_SINT8
+ * RG_SINT8
+ * RGB_SINT8
+ * RGBA_SINT8
+ * R_SINT16
+ * RG_SINT16
+ * RGB_SINT16
+ * RGBA_SINT16
+ * R_SINT32
+ * RG_SINT32
+ * RGB_SINT32
+ * RGBA_SINT32
+ * R_SINT16
+ * R_SINT32
+ * R_UINT8
+ * RG_UINT8
+ * RGB_UINT8
+ * RGBA_UINT8
+ * R_UINT16
+ * RG_UINT16
+ * RGB_UINT16
+ * RGBA_UINT16
+ * R_UINT32
+ * RG_UINT32
+ * RGB_UINT32
+ * RGBA_UINT32
+ * R_UINT16
+ * R_UINT32
+ * R_SNORM8
+ * R_SNORM16
+ * RGB_SNORM16
+ * RGBA_SNORM16
+ * RGBA_UNORM16
+ * A_SNORM8
+ * L_SNORM8
+ * I_SNORM8
+ * A_SNORM16
+ * L_SNORM16
+ * LA_SNORM16
+ * I_SNORM16
+ * RGBX_UINT8
+ * RGBX_SINT8
+ * RGBX_UNORM16
+ * RGBX_SNORM16
+ * RGBX_FLOAT16
+ * RGBX_UINT16
+ * RGBX_SINT16
+ * RGBX_FLOAT32
+ * RGBX_UINT32
+ * RGBX_SINT32
+ *
+ *
+ *
+ * ---------- Type P Format List (based on format_unpack.c):
+ * A8B8G8R8_UNORM
+ * R8G8B8A8_UNORM
+ * B8G8R8A8_UNORM
+ * A8R8G8B8_UNORM
+ * X8B8G8R8_UNORM
+ * R8G8B8X8_UNORM
+ * B8G8R8X8_UNORM
+ * X8R8G8B8_UNORM
+ * B5G6R5_UNORM
+ * R5G6B5_UNORM
+ * B4G4R4A4_UNORM
+ * A4R4G4B4_UNORM
+ * A1B5G5R5_UNORM
+ * B5G5R5A1_UNORM
+ * A1R5G5B5_UNORM
+ * L4A4_UNORM
+ * L8A8_UNORM
+ * A8L8_UNORM
+ * L16A16_UNORM
+ * A16L16_UNORM
+ * B2G3R3_UNORM
+ * YCBCR
+ * YCBCR_REV
+ * R8G8_UNORM
+ * G8R8_UNORM
+ * R16G16_UNORM
+ * G16R16_UNORM
+ * B10G10R10A2_UNORM
+ * B10G10R10A2_UINT
+ * R10G10B10A2_UINT
+ * S8_UINT_Z24_UNORM
+ * Z24_UNORM_S8_UINT
+ * Z24_UNORM_X8_UINT
+ * X8_UINT_Z24_UNORM
+ * Z32_FLOAT_S8X24_UINT
+ * A8R8G8B8_SRGB
+ * B8G8R8A8_SRGB
+ * L8A8_SRGB
+ * R8G8_SNORM
+ * X8B8G8R8_SNORM
+ * A8B8G8R8_SNORM
+ * R8G8B8A8_SNORM
+ * R16G16_SNORM
+ * L8A8_SNORM
+ * R9G9B9E5_FLOAT
+ * R11G11B10_FLOAT
+ * B4G4R4X4_UNORM
+ * B5G5R5X1_UNORM
+ * R8G8_SNORM
+ * R8G8B8X8_SNORM
+ * R8G8B8X8_SRGB
+ * B10G10R10X2_UNORM
+ * R10G10B10A2_UNORM
+ * G8R8_SINT
+ * G16R16_SINT
+ *
*/
/*@{*/
- /* msb <------ TEXEL BITS -----------> lsb */
+
+ /* Type P formats */ /* msb <------ TEXEL BITS -----------> lsb */
/* ---- ---- ---- ---- ---- ---- ---- ---- */
MESA_FORMAT_A8B8G8R8_UNORM, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */
MESA_FORMAT_R8G8B8A8_UNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */
MESA_FORMAT_R8G8B8X8_UNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB xxxx xxxx */
MESA_FORMAT_B8G8R8X8_UNORM, /* BBBB BBBB GGGG GGGG RRRR RRRR xxxx xxxx */
MESA_FORMAT_X8R8G8B8_UNORM, /* xxxx xxxx RRRR RRRR GGGG GGGG BBBB BBBB */
- MESA_FORMAT_RGB888, /* RRRR RRRR GGGG GGGG BBBB BBBB */
- MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */
+
+ /* Type A formats */
+ MESA_FORMAT_BGR_UNORM8, /* uchar[i * 3] = B, [i * 3 + 1] = G, [i *3 + 2] = R */
+ MESA_FORMAT_RGB_UNORM8, /* uchar[i * 3] = R, [i * 3 + 1] = G, [i *3 + 2] = B */
+
+ /* Type P formats */
MESA_FORMAT_RGB565, /* RRRR RGGG GGGB BBBB */
MESA_FORMAT_RGB565_REV, /* GGGB BBBB RRRR RGGG */
MESA_FORMAT_ARGB4444, /* AAAA RRRR GGGG BBBB */
MESA_FORMAT_AL1616, /* AAAA AAAA AAAA AAAA LLLL LLLL LLLL LLLL */
MESA_FORMAT_AL1616_REV, /* LLLL LLLL LLLL LLLL AAAA AAAA AAAA AAAA */
MESA_FORMAT_RGB332, /* RRRG GGBB */
- MESA_FORMAT_A8, /* AAAA AAAA */
- MESA_FORMAT_A16, /* AAAA AAAA AAAA AAAA */
- MESA_FORMAT_L8, /* LLLL LLLL */
- MESA_FORMAT_L16, /* LLLL LLLL LLLL LLLL */
- MESA_FORMAT_I8, /* IIII IIII */
- MESA_FORMAT_I16, /* IIII IIII IIII IIII */
+
+ /* Type A formats */
+ MESA_FORMAT_A_UNORM8, /* uchar[i] = A */
+ MESA_FORMAT_A_UNORM16, /* ushort[i] = A */
+ MESA_FORMAT_L_UNORM8, /* uchar[i] = L */
+ MESA_FORMAT_L_UNORM16, /* ushort[i] = L */
+ MESA_FORMAT_I_UNORM8, /* uchar[i] = I */
+ MESA_FORMAT_I_UNORM16, /* ushort[i] = I */
+
+ /* Type P formats */
MESA_FORMAT_YCBCR, /* YYYY YYYY UorV UorV */
MESA_FORMAT_YCBCR_REV, /* UorV UorV YYYY YYYY */
- MESA_FORMAT_R8, /* RRRR RRRR */
+
+ /* Type A format(s) */
+ MESA_FORMAT_R_UNORM8, /* uchar[i] = R */
+
+ /* Type P formats */
MESA_FORMAT_GR88, /* GGGG GGGG RRRR RRRR */
MESA_FORMAT_RG88, /* RRRR RRRR GGGG GGGG */
- MESA_FORMAT_R16, /* RRRR RRRR RRRR RRRR */
+
+ /* Type A format(s) */
+ MESA_FORMAT_R_UNORM16, /* ushort[i] = R */
+
+ /* Type P formats */
MESA_FORMAT_GR1616, /* GGGG GGGG GGGG GGGG RRRR RRRR RRRR RRRR */
MESA_FORMAT_RG1616, /* RRRR RRRR RRRR RRRR GGGG GGGG GGGG GGGG */
MESA_FORMAT_ARGB2101010, /* AARR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */
MESA_FORMAT_Z24_S8, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ SSSS SSSS */
MESA_FORMAT_S8_Z24, /* SSSS SSSS ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */
- MESA_FORMAT_Z16, /* ZZZZ ZZZZ ZZZZ ZZZZ */
+
+ /* Type A format(s) */
+ MESA_FORMAT_Z_UNORM16, /* ushort[i] = Z */
+
+ /* Type P formats */
MESA_FORMAT_X8_Z24, /* xxxx xxxx ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */
MESA_FORMAT_Z24_X8, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ xxxx xxxx */
- MESA_FORMAT_Z32, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */
- MESA_FORMAT_S8, /* SSSS SSSS */
+
+ /* Type A formats */
+ MESA_FORMAT_Z_UNORM32, /* uint[i] = Z */
+ MESA_FORMAT_S_UINT8, /* uchar[i] = S */
/*@}*/
/**
* \name 8-bit/channel sRGB formats
*/
/*@{*/
- MESA_FORMAT_SRGB8, /* RRRR RRRR GGGG GGGG BBBB BBBB */
+ /* Type A format(s) */
+ MESA_FORMAT_BGR_SRGB8, /* uchar[i * 3] = B, [i * 3 + 1] = G, [i *3 + 2] = R */
+
+ /* Type P formats */
MESA_FORMAT_SRGBA8, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */
MESA_FORMAT_SARGB8, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */
- MESA_FORMAT_SL8, /* LLLL LLLL */
+
+ /* Type A format(s) */
+ MESA_FORMAT_L_SRGB8, /* uchar[i] = L */
+
+ /* Type P formats */
MESA_FORMAT_SLA8, /* AAAA AAAA LLLL LLLL */
+
+ /* Type C formats */
MESA_FORMAT_SRGB_DXT1,
MESA_FORMAT_SRGBA_DXT1,
MESA_FORMAT_SRGBA_DXT3,
* \name Compressed texture formats.
*/
/*@{*/
+ /* Type C formats */
MESA_FORMAT_RGB_FXT1,
MESA_FORMAT_RGBA_FXT1,
MESA_FORMAT_RGB_DXT1,
* \name Floating point texture formats.
*/
/*@{*/
- MESA_FORMAT_RGBA_FLOAT32,
+
+ /* Type A formats */
+ MESA_FORMAT_RGBA_FLOAT32, /* float[i * 4] = R, [i * 4 + 1] = G, [i * 4 + 2] = B, [i * 4 + 3] = A */
MESA_FORMAT_RGBA_FLOAT16,
MESA_FORMAT_RGB_FLOAT32,
MESA_FORMAT_RGB_FLOAT16,
* XXX Note: these are just stand-ins for some better hardware
* formats TBD such as BGRA or ARGB.
*/
+
+ /* Type A formats */
MESA_FORMAT_ALPHA_UINT8,
MESA_FORMAT_ALPHA_UINT16,
MESA_FORMAT_ALPHA_UINT32,
MESA_FORMAT_LUMINANCE_INT8,
MESA_FORMAT_LUMINANCE_INT16,
MESA_FORMAT_LUMINANCE_INT32,
-
MESA_FORMAT_LUMINANCE_ALPHA_UINT8,
MESA_FORMAT_LUMINANCE_ALPHA_UINT16,
MESA_FORMAT_LUMINANCE_ALPHA_UINT32,
MESA_FORMAT_RG_INT16,
MESA_FORMAT_RGB_INT16,
MESA_FORMAT_RGBA_INT16,
+
MESA_FORMAT_R_INT32,
MESA_FORMAT_RG_INT32,
MESA_FORMAT_RGB_INT32,
/**
* \name Non-normalized unsigned integer formats.
*/
+ /* Type A format(s) */
MESA_FORMAT_R_UINT8,
MESA_FORMAT_RG_UINT8,
MESA_FORMAT_RGB_UINT8,
MESA_FORMAT_RGBA_UINT8,
+
MESA_FORMAT_R_UINT16,
MESA_FORMAT_RG_UINT16,
MESA_FORMAT_RGB_UINT16,
MESA_FORMAT_RGBA_UINT16,
+
MESA_FORMAT_R_UINT32,
MESA_FORMAT_RG_UINT32,
MESA_FORMAT_RGB_UINT32,
*/
/*@{*/
MESA_FORMAT_DUDV8, /* DUDU DUDU DVDV DVDV */
+
+ /* Type A format(s) */
MESA_FORMAT_SIGNED_R8, /* RRRR RRRR */
+
+ /* Type P formats */
MESA_FORMAT_SIGNED_RG88_REV, /* GGGG GGGG RRRR RRRR */
MESA_FORMAT_SIGNED_RGBX8888, /* RRRR RRRR GGGG GGGG BBBB BBBB xxxx xxxx */
MESA_FORMAT_SIGNED_RGBA8888, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */
MESA_FORMAT_SIGNED_RGBA8888_REV,/*AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */
+
+ /* Type A format(s) */
MESA_FORMAT_SIGNED_R16, /* RRRR RRRR RRRR RRRR */
+
+ /* Type P format(s) */
MESA_FORMAT_SIGNED_GR1616, /* GGGG GGGG GGGG GGGG RRRR RRRR RRRR RRRR */
+
+ /* Type A format(s) */
MESA_FORMAT_SIGNED_RGB_16, /* ushort[0]=R, ushort[1]=G, ushort[2]=B */
MESA_FORMAT_SIGNED_RGBA_16, /* ... */
- MESA_FORMAT_RGBA_16, /* ... */
+ MESA_FORMAT_RGBA_UNORM16, /* ... */
/*@}*/
/*@{*/
+ /* Type C formats */
MESA_FORMAT_RED_RGTC1,
MESA_FORMAT_SIGNED_RED_RGTC1,
MESA_FORMAT_RG_RGTC2,
MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1,
MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1,
+ /* Type A format(s) */
MESA_FORMAT_SIGNED_A8, /* AAAA AAAA */
MESA_FORMAT_SIGNED_L8, /* LLLL LLLL */
+
+ /* Type P format(s) */
MESA_FORMAT_SIGNED_AL88, /* AAAA AAAA LLLL LLLL */
+
+ /* Type A format(s) */
MESA_FORMAT_SIGNED_I8, /* IIII IIII */
MESA_FORMAT_SIGNED_A16, /* AAAA AAAA AAAA AAAA */
MESA_FORMAT_SIGNED_L16, /* LLLL LLLL LLLL LLLL */
MESA_FORMAT_SIGNED_AL1616, /* AAAA AAAA AAAA AAAA LLLL LLLL LLLL LLLL */
MESA_FORMAT_SIGNED_I16, /* IIII IIII IIII IIII */
+ /* Type P format(s) */
MESA_FORMAT_RGB9_E5_FLOAT,
MESA_FORMAT_R11_G11_B10_FLOAT,
- MESA_FORMAT_Z32_FLOAT,
+ /* Type A format(s) */
+ MESA_FORMAT_Z_FLOAT32,
+
+ /* Type P formats */
MESA_FORMAT_Z32_FLOAT_X24S8,
MESA_FORMAT_ARGB2101010_UINT,
MESA_FORMAT_XRGB1555_UNORM, /* xRRR RRGG GGGB BBBB */
MESA_FORMAT_XBGR8888_SNORM, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */
MESA_FORMAT_XBGR8888_SRGB, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */
- MESA_FORMAT_XBGR8888_UINT, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */
- MESA_FORMAT_XBGR8888_SINT, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */
+
+ /* Type A formats */
+ MESA_FORMAT_RGBX_UINT8, /* uchar[i * 4] = R, [i * 4 + 1] = G, [i * 4 + 2] = B, [i * 4 + 3] = x */
+ MESA_FORMAT_RGBX_SINT8, /* char[i * 4] = R, [i * 4 + 1] = G, [i * 4 + 2] = B, [i * 4 + 3] = x */
+
+ /* Type P format(s) */
MESA_FORMAT_XRGB2101010_UNORM, /* xxRR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */
- MESA_FORMAT_XBGR16161616_UNORM,/* ushort[3]=x, [2]=B, [1]=G, [0]=R */
- MESA_FORMAT_XBGR16161616_SNORM,/* ... */
- MESA_FORMAT_XBGR16161616_FLOAT,/* ... */
- MESA_FORMAT_XBGR16161616_UINT, /* ... */
- MESA_FORMAT_XBGR16161616_SINT, /* ... */
- MESA_FORMAT_XBGR32323232_FLOAT,/* float[3]=x, [2]=B, [1]=G, [0]=R */
- MESA_FORMAT_XBGR32323232_UINT, /* ... */
- MESA_FORMAT_XBGR32323232_SINT, /* ... */
- MESA_FORMAT_ABGR2101010,
+ /* Type A format(s) */
+ MESA_FORMAT_RGBX_UNORM16, /* ushort[i * 4] = R, [i * 4 + 1] = G, [i * 4 + 2] = B, [i * 4 + 3] = x */
+ MESA_FORMAT_RGBX_SNORM16, /* ... */
+ MESA_FORMAT_RGBX_FLOAT16, /* ... */
+ MESA_FORMAT_RGBX_UINT16, /* ... */
+ MESA_FORMAT_RGBX_SINT16, /* ... */
+ MESA_FORMAT_RGBX_FLOAT32, /* float[i * 4] = R, [i * 4 + 1] = G, [i * 4 + 2] = B, [i * 4 + 3] = x */
+ MESA_FORMAT_RGBX_UINT32, /* ... */
+ MESA_FORMAT_RGBX_SINT32, /* ... */
+
+ /* Type P formats */
+ MESA_FORMAT_ABGR2101010,
MESA_FORMAT_SIGNED_RG88,
MESA_FORMAT_SIGNED_RG1616,
return MESA_FORMAT_R_INT8;
case GL_RGBA16:
- return MESA_FORMAT_RGBA_16;
+ return MESA_FORMAT_RGBA_UNORM16;
case GL_RGB10_A2:
return MESA_FORMAT_ABGR2101010;
return MESA_FORMAT_RG_8;
case GL_R16:
- return MESA_FORMAT_R16;
+ return MESA_FORMAT_R_UNORM16;
case GL_R8:
- return MESA_FORMAT_R8;
+ return MESA_FORMAT_R_UNORM8;
case GL_RGBA16_SNORM:
return MESA_FORMAT_SIGNED_RGBA_16;
case MESA_FORMAT_R_INT8:
return IMAGE_FORMAT_CLASS_1X8;
- case MESA_FORMAT_RGBA_16:
+ case MESA_FORMAT_RGBA_UNORM16:
return IMAGE_FORMAT_CLASS_4X16;
case MESA_FORMAT_ABGR2101010:
case MESA_FORMAT_RG_8:
return IMAGE_FORMAT_CLASS_2X8;
- case MESA_FORMAT_R16:
+ case MESA_FORMAT_R_UNORM16:
return IMAGE_FORMAT_CLASS_1X16;
- case MESA_FORMAT_R8:
+ case MESA_FORMAT_R_UNORM8:
return IMAGE_FORMAT_CLASS_1X8;
case MESA_FORMAT_SIGNED_RGBA_16:
break;
case GL_RGBA12:
case GL_RGBA16:
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16);
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UNORM16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UNORM16);
RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_UNORM);
RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
break;
}
/* fallthrough */
case GL_RGB8:
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGR_UNORM8);
RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8X8_UNORM);
RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
break;
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB332);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB565_REV);
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGR_UNORM8);
RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8X8_UNORM);
RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
break;
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
- RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_UNORM);
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_UNORM16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UNORM16);
RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8X8_UNORM);
RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
break;
case GL_ALPHA:
case GL_ALPHA4:
case GL_ALPHA8:
- RETURN_IF_SUPPORTED(MESA_FORMAT_A8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_A_UNORM8);
break;
case GL_ALPHA12:
case GL_ALPHA16:
- RETURN_IF_SUPPORTED(MESA_FORMAT_A16);
- RETURN_IF_SUPPORTED(MESA_FORMAT_A8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_A_UNORM16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_A_UNORM8);
break;
/* Luminance formats */
case GL_LUMINANCE:
case GL_LUMINANCE4:
case GL_LUMINANCE8:
- RETURN_IF_SUPPORTED(MESA_FORMAT_L8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_L_UNORM8);
break;
case GL_LUMINANCE12:
case GL_LUMINANCE16:
- RETURN_IF_SUPPORTED(MESA_FORMAT_L16);
- RETURN_IF_SUPPORTED(MESA_FORMAT_L8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_L_UNORM16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_L_UNORM8);
break;
/* Luminance/Alpha formats */
case GL_INTENSITY:
case GL_INTENSITY4:
case GL_INTENSITY8:
- RETURN_IF_SUPPORTED(MESA_FORMAT_I8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_I_UNORM8);
break;
case GL_INTENSITY12:
case GL_INTENSITY16:
- RETURN_IF_SUPPORTED(MESA_FORMAT_I16);
- RETURN_IF_SUPPORTED(MESA_FORMAT_I8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_I_UNORM16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_I_UNORM8);
break;
case GL_DEPTH_COMPONENT:
case GL_DEPTH_COMPONENT24:
case GL_DEPTH_COMPONENT32:
- RETURN_IF_SUPPORTED(MESA_FORMAT_Z32);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_Z_UNORM32);
RETURN_IF_SUPPORTED(MESA_FORMAT_X8_Z24);
RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24);
break;
case GL_DEPTH_COMPONENT16:
- RETURN_IF_SUPPORTED(MESA_FORMAT_Z16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_Z_UNORM16);
RETURN_IF_SUPPORTED(MESA_FORMAT_X8_Z24);
RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24);
break;
case GL_COMPRESSED_ALPHA_ARB:
- RETURN_IF_SUPPORTED(MESA_FORMAT_A8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_A_UNORM8);
break;
case GL_COMPRESSED_LUMINANCE_ARB:
- RETURN_IF_SUPPORTED(MESA_FORMAT_L8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_L_UNORM8);
break;
case GL_COMPRESSED_LUMINANCE_ALPHA_ARB:
RETURN_IF_SUPPORTED(MESA_FORMAT_AL88);
break;
case GL_COMPRESSED_INTENSITY_ARB:
- RETURN_IF_SUPPORTED(MESA_FORMAT_I8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_I_UNORM8);
break;
case GL_COMPRESSED_RGB_ARB:
/* We don't use texture compression for 1D and 1D array textures.
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_DXT1);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FXT1);
}
- RETURN_IF_SUPPORTED(MESA_FORMAT_RGB888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGR_UNORM8);
RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8X8_UNORM);
RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
break;
break;
case GL_RGB16F_ARB:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT16);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_FLOAT);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_FLOAT16);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT32);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32);
break;
case GL_RGB32F_ARB:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT32);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR32323232_FLOAT);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_FLOAT32);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT32);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_FLOAT16);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_FLOAT16);
break;
case GL_DEPTH_COMPONENT32F:
- ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT]);
- return MESA_FORMAT_Z32_FLOAT;
+ ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_Z_FLOAT32]);
+ return MESA_FORMAT_Z_FLOAT32;
case GL_DEPTH32F_STENCIL8:
ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT_X24S8]);
return MESA_FORMAT_Z32_FLOAT_X24S8;
break;
case GL_RGB16_SNORM:
RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGB_16);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_SNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_SNORM16);
/* FALLTHROUGH */
case GL_RGBA16_SNORM:
RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16);
case GL_SRGB_EXT:
case GL_SRGB8_EXT:
- RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGR_SRGB8);
RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8);
break;
case GL_SRGB_ALPHA_EXT:
break;
case GL_SLUMINANCE_EXT:
case GL_SLUMINANCE8_EXT:
- RETURN_IF_SUPPORTED(MESA_FORMAT_SL8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_L_SRGB8);
RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8);
break;
case GL_SLUMINANCE_ALPHA_EXT:
RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8);
break;
case GL_COMPRESSED_SLUMINANCE_EXT:
- RETURN_IF_SUPPORTED(MESA_FORMAT_SL8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_L_SRGB8);
RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8);
break;
case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT:
case GL_COMPRESSED_SRGB_EXT:
if (ctx->Mesa_DXTn)
RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB_DXT1);
- RETURN_IF_SUPPORTED(MESA_FORMAT_SRGB8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_BGR_SRGB8);
RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8);
break;
case GL_COMPRESSED_SRGB_ALPHA_EXT:
case GL_RGB8UI_EXT:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT8);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR8888_UINT);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_UINT8);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8);
break;
case GL_RGB16UI_EXT:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT16);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_UINT);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_UINT16);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT16);
break;
case GL_RGB32UI_EXT:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT32);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR32323232_UINT);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_UINT32);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT32);
break;
case GL_RGB8I_EXT:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_INT8);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR8888_SINT);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_SINT8);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT8);
break;
case GL_RGB16I_EXT:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_INT16);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR16161616_SINT);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_SINT16);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT16);
break;
case GL_RGB32I_EXT:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_INT32);
- RETURN_IF_SUPPORTED(MESA_FORMAT_XBGR32323232_SINT);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_SINT32);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32);
break;
case GL_RGBA8UI_EXT:
case GL_R8:
case GL_RED:
- RETURN_IF_SUPPORTED(MESA_FORMAT_R8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_R_UNORM8);
break;
case GL_COMPRESSED_RED:
if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY)
RETURN_IF_SUPPORTED(MESA_FORMAT_RED_RGTC1);
- RETURN_IF_SUPPORTED(MESA_FORMAT_R8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_R_UNORM8);
break;
case GL_R16:
- RETURN_IF_SUPPORTED(MESA_FORMAT_R16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_R_UNORM16);
break;
case GL_RG:
if (ctx->API != API_OPENGL_CORE) {
switch (internalFormat) {
case GL_ALPHA8:
- return MESA_FORMAT_A8;
+ return MESA_FORMAT_A_UNORM8;
case GL_ALPHA16:
- return MESA_FORMAT_A16;
+ return MESA_FORMAT_A_UNORM16;
case GL_ALPHA16F_ARB:
return MESA_FORMAT_ALPHA_FLOAT16;
case GL_ALPHA32F_ARB:
case GL_ALPHA32UI_EXT:
return MESA_FORMAT_ALPHA_UINT32;
case GL_LUMINANCE8:
- return MESA_FORMAT_L8;
+ return MESA_FORMAT_L_UNORM8;
case GL_LUMINANCE16:
- return MESA_FORMAT_L16;
+ return MESA_FORMAT_L_UNORM16;
case GL_LUMINANCE16F_ARB:
return MESA_FORMAT_LUMINANCE_FLOAT16;
case GL_LUMINANCE32F_ARB:
case GL_LUMINANCE_ALPHA32UI_EXT:
return MESA_FORMAT_LUMINANCE_ALPHA_UINT32;
case GL_INTENSITY8:
- return MESA_FORMAT_I8;
+ return MESA_FORMAT_I_UNORM8;
case GL_INTENSITY16:
- return MESA_FORMAT_I16;
+ return MESA_FORMAT_I_UNORM16;
case GL_INTENSITY16F_ARB:
return MESA_FORMAT_INTENSITY_FLOAT16;
case GL_INTENSITY32F_ARB:
case GL_RGBA8:
return MESA_FORMAT_R8G8B8A8_UNORM;
case GL_RGBA16:
- return MESA_FORMAT_RGBA_16;
+ return MESA_FORMAT_RGBA_UNORM16;
case GL_RGBA16F_ARB:
return MESA_FORMAT_RGBA_FLOAT16;
case GL_RGBA32F_ARB:
return MESA_FORMAT_RG_UINT32;
case GL_R8:
- return MESA_FORMAT_R8;
+ return MESA_FORMAT_R_UNORM8;
case GL_R16:
- return MESA_FORMAT_R16;
+ return MESA_FORMAT_R_UNORM16;
case GL_R16F:
return MESA_FORMAT_R_FLOAT16;
case GL_R32F:
obj->_Swizzle = SWIZZLE_NOOP;
obj->Sampler.sRGBDecode = GL_DECODE_EXT;
obj->BufferObjectFormat = GL_R8;
- obj->_BufferObjectFormat = MESA_FORMAT_R8;
+ obj->_BufferObjectFormat = MESA_FORMAT_R_UNORM8;
obj->ImageFormatCompatibilityType = GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE;
}
const GLuint depthScale = 0xffffffff;
GLenum dstType;
(void) dims;
- ASSERT(dstFormat == MESA_FORMAT_Z32 ||
- dstFormat == MESA_FORMAT_Z32_FLOAT);
+ ASSERT(dstFormat == MESA_FORMAT_Z_UNORM32 ||
+ dstFormat == MESA_FORMAT_Z_FLOAT32);
ASSERT(_mesa_get_format_bytes(dstFormat) == sizeof(GLuint));
- if (dstFormat == MESA_FORMAT_Z32)
+ if (dstFormat == MESA_FORMAT_Z_UNORM32)
dstType = GL_UNSIGNED_INT;
else
dstType = GL_FLOAT;
{
const GLuint depthScale = 0xffff;
(void) dims;
- ASSERT(dstFormat == MESA_FORMAT_Z16);
+ ASSERT(dstFormat == MESA_FORMAT_Z_UNORM16);
ASSERT(_mesa_get_format_bytes(dstFormat) == sizeof(GLushort));
{
static GLboolean
_mesa_texstore_rgb888(TEXSTORE_PARAMS)
{
- ASSERT(dstFormat == MESA_FORMAT_RGB888);
+ ASSERT(dstFormat == MESA_FORMAT_BGR_UNORM8);
ASSERT(_mesa_get_format_bytes(dstFormat) == 3);
if (!ctx->_ImageTransferState &&
static GLboolean
_mesa_texstore_bgr888(TEXSTORE_PARAMS)
{
- ASSERT(dstFormat == MESA_FORMAT_BGR888);
+ ASSERT(dstFormat == MESA_FORMAT_RGB_UNORM8);
ASSERT(_mesa_get_format_bytes(dstFormat) == 3);
if (!ctx->_ImageTransferState &&
{
const GLenum baseFormat = _mesa_get_format_base_format(dstFormat);
- ASSERT(dstFormat == MESA_FORMAT_R16 ||
- dstFormat == MESA_FORMAT_A16 ||
- dstFormat == MESA_FORMAT_L16 ||
- dstFormat == MESA_FORMAT_I16);
+ ASSERT(dstFormat == MESA_FORMAT_R_UNORM16 ||
+ dstFormat == MESA_FORMAT_A_UNORM16 ||
+ dstFormat == MESA_FORMAT_L_UNORM16 ||
+ dstFormat == MESA_FORMAT_I_UNORM16);
ASSERT(_mesa_get_format_bytes(dstFormat) == 2);
{
static GLboolean
_mesa_texstore_rgba_16(TEXSTORE_PARAMS)
{
- ASSERT(dstFormat == MESA_FORMAT_RGBA_16 ||
- dstFormat == MESA_FORMAT_XBGR16161616_UNORM);
+ ASSERT(dstFormat == MESA_FORMAT_RGBA_UNORM16 ||
+ dstFormat == MESA_FORMAT_RGBX_UNORM16);
ASSERT(_mesa_get_format_bytes(dstFormat) == 8);
{
ASSERT(dstFormat == MESA_FORMAT_SIGNED_RGB_16 ||
dstFormat == MESA_FORMAT_SIGNED_RGBA_16 ||
- dstFormat == MESA_FORMAT_XBGR16161616_SNORM);
+ dstFormat == MESA_FORMAT_RGBX_SNORM16);
{
/* general path */
dstRow += dstRowStride;
src += 4 * srcWidth;
}
- else if (dstFormat == MESA_FORMAT_XBGR16161616_SNORM) {
+ else if (dstFormat == MESA_FORMAT_RGBX_SNORM16) {
for (col = 0; col < srcWidth; col++) {
GLuint c;
{
const GLenum baseFormat = _mesa_get_format_base_format(dstFormat);
- ASSERT(dstFormat == MESA_FORMAT_A8 ||
- dstFormat == MESA_FORMAT_L8 ||
- dstFormat == MESA_FORMAT_I8 ||
- dstFormat == MESA_FORMAT_R8);
+ ASSERT(dstFormat == MESA_FORMAT_A_UNORM8 ||
+ dstFormat == MESA_FORMAT_L_UNORM8 ||
+ dstFormat == MESA_FORMAT_I_UNORM8 ||
+ dstFormat == MESA_FORMAT_R_UNORM8);
ASSERT(_mesa_get_format_bytes(dstFormat) == 1);
if (!ctx->_ImageTransferState &&
/* dstmap - how to swizzle from RGBA to dst format:
*/
- if (dstFormat == MESA_FORMAT_A8) {
+ if (dstFormat == MESA_FORMAT_A_UNORM8) {
dstmap[0] = 3;
}
else {
static GLboolean
_mesa_texstore_s8(TEXSTORE_PARAMS)
{
- ASSERT(dstFormat == MESA_FORMAT_S8);
+ ASSERT(dstFormat == MESA_FORMAT_S_UINT8);
ASSERT(srcFormat == GL_STENCIL_INDEX);
{
GLint components = _mesa_components_in_format(baseFormat);
/* this forces alpha to 1 in _mesa_make_temp_float_image */
- if (dstFormat == MESA_FORMAT_XBGR32323232_FLOAT) {
+ if (dstFormat == MESA_FORMAT_RGBX_FLOAT32) {
baseFormat = GL_RGBA;
components = 4;
}
dstFormat == MESA_FORMAT_INTENSITY_FLOAT32 ||
dstFormat == MESA_FORMAT_R_FLOAT32 ||
dstFormat == MESA_FORMAT_RG_FLOAT32 ||
- dstFormat == MESA_FORMAT_XBGR32323232_FLOAT);
+ dstFormat == MESA_FORMAT_RGBX_FLOAT32);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
baseInternalFormat == GL_ALPHA ||
GLint components = _mesa_components_in_format(baseFormat);
/* this forces alpha to 1 in _mesa_make_temp_float_image */
- if (dstFormat == MESA_FORMAT_XBGR16161616_FLOAT) {
+ if (dstFormat == MESA_FORMAT_RGBX_FLOAT16) {
baseFormat = GL_RGBA;
components = 4;
}
dstFormat == MESA_FORMAT_INTENSITY_FLOAT16 ||
dstFormat == MESA_FORMAT_R_FLOAT16 ||
dstFormat == MESA_FORMAT_RG_FLOAT16 ||
- dstFormat == MESA_FORMAT_XBGR16161616_FLOAT);
+ dstFormat == MESA_FORMAT_RGBX_FLOAT16);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
baseInternalFormat == GL_ALPHA ||
GLint components = _mesa_components_in_format(baseFormat);
/* this forces alpha to 1 in make_temp_uint_image */
- if (dstFormat == MESA_FORMAT_XBGR8888_SINT) {
+ if (dstFormat == MESA_FORMAT_RGBX_SINT8) {
baseFormat = GL_RGBA;
components = 4;
}
dstFormat == MESA_FORMAT_INTENSITY_INT8 ||
dstFormat == MESA_FORMAT_LUMINANCE_INT8 ||
dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_INT8 ||
- dstFormat == MESA_FORMAT_XBGR8888_SINT);
+ dstFormat == MESA_FORMAT_RGBX_SINT8);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
baseInternalFormat == GL_RG ||
GLint components = _mesa_components_in_format(baseFormat);
/* this forces alpha to 1 in make_temp_uint_image */
- if (dstFormat == MESA_FORMAT_XBGR16161616_SINT) {
+ if (dstFormat == MESA_FORMAT_RGBX_SINT16) {
baseFormat = GL_RGBA;
components = 4;
}
dstFormat == MESA_FORMAT_LUMINANCE_INT16 ||
dstFormat == MESA_FORMAT_INTENSITY_INT16 ||
dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_INT16 ||
- dstFormat == MESA_FORMAT_XBGR16161616_SINT);
+ dstFormat == MESA_FORMAT_RGBX_SINT16);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
baseInternalFormat == GL_RG ||
GLint components = _mesa_components_in_format(baseFormat);
/* this forces alpha to 1 in make_temp_uint_image */
- if (dstFormat == MESA_FORMAT_XBGR32323232_SINT) {
+ if (dstFormat == MESA_FORMAT_RGBX_SINT32) {
baseFormat = GL_RGBA;
components = 4;
}
dstFormat == MESA_FORMAT_INTENSITY_INT32 ||
dstFormat == MESA_FORMAT_LUMINANCE_INT32 ||
dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_INT32 ||
- dstFormat == MESA_FORMAT_XBGR32323232_SINT);
+ dstFormat == MESA_FORMAT_RGBX_SINT32);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
baseInternalFormat == GL_RG ||
GLint components = _mesa_components_in_format(baseFormat);
/* this forces alpha to 1 in make_temp_uint_image */
- if (dstFormat == MESA_FORMAT_XBGR8888_UINT) {
+ if (dstFormat == MESA_FORMAT_RGBX_UINT8) {
baseFormat = GL_RGBA;
components = 4;
}
dstFormat == MESA_FORMAT_INTENSITY_UINT8 ||
dstFormat == MESA_FORMAT_LUMINANCE_UINT8 ||
dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_UINT8 ||
- dstFormat == MESA_FORMAT_XBGR8888_UINT);
+ dstFormat == MESA_FORMAT_RGBX_UINT8);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
baseInternalFormat == GL_RG ||
GLint components = _mesa_components_in_format(baseFormat);
/* this forces alpha to 1 in make_temp_uint_image */
- if (dstFormat == MESA_FORMAT_XBGR16161616_UINT) {
+ if (dstFormat == MESA_FORMAT_RGBX_UINT16) {
baseFormat = GL_RGBA;
components = 4;
}
dstFormat == MESA_FORMAT_INTENSITY_UINT16 ||
dstFormat == MESA_FORMAT_LUMINANCE_UINT16 ||
dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_UINT16 ||
- dstFormat == MESA_FORMAT_XBGR16161616_UINT);
+ dstFormat == MESA_FORMAT_RGBX_UINT16);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
baseInternalFormat == GL_RG ||
GLint components = _mesa_components_in_format(baseFormat);
/* this forces alpha to 1 in make_temp_uint_image */
- if (dstFormat == MESA_FORMAT_XBGR32323232_UINT) {
+ if (dstFormat == MESA_FORMAT_RGBX_UINT32) {
baseFormat = GL_RGBA;
components = 4;
}
dstFormat == MESA_FORMAT_INTENSITY_UINT32 ||
dstFormat == MESA_FORMAT_LUMINANCE_UINT32 ||
dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_UINT32 ||
- dstFormat == MESA_FORMAT_XBGR32323232_UINT);
+ dstFormat == MESA_FORMAT_RGBX_UINT32);
ASSERT(baseInternalFormat == GL_RGBA ||
baseInternalFormat == GL_RGB ||
baseInternalFormat == GL_RG ||
mesa_format newDstFormat;
GLboolean k;
- ASSERT(dstFormat == MESA_FORMAT_SRGB8);
+ ASSERT(dstFormat == MESA_FORMAT_BGR_SRGB8);
/* reuse normal rgb texstore code */
- newDstFormat = MESA_FORMAT_RGB888;
+ newDstFormat = MESA_FORMAT_BGR_UNORM8;
k = _mesa_texstore_rgb888(ctx, dims, baseInternalFormat,
newDstFormat,
mesa_format newDstFormat;
GLboolean k;
- ASSERT(dstFormat == MESA_FORMAT_SL8);
+ ASSERT(dstFormat == MESA_FORMAT_L_SRGB8);
- newDstFormat = MESA_FORMAT_L8;
+ newDstFormat = MESA_FORMAT_L_UNORM8;
/* _mesa_textore_a8 handles luminance8 too */
k = _mesa_texstore_unorm8(ctx, dims, baseInternalFormat,
table[MESA_FORMAT_R8G8B8X8_UNORM] = _mesa_texstore_rgba8888;
table[MESA_FORMAT_B8G8R8X8_UNORM] = _mesa_texstore_argb8888;
table[MESA_FORMAT_X8R8G8B8_UNORM] = _mesa_texstore_argb8888;
- table[MESA_FORMAT_RGB888] = _mesa_texstore_rgb888;
- table[MESA_FORMAT_BGR888] = _mesa_texstore_bgr888;
+ table[MESA_FORMAT_BGR_UNORM8] = _mesa_texstore_rgb888;
+ table[MESA_FORMAT_RGB_UNORM8] = _mesa_texstore_bgr888;
table[MESA_FORMAT_RGB565] = _mesa_texstore_rgb565;
table[MESA_FORMAT_RGB565_REV] = _mesa_texstore_rgb565;
table[MESA_FORMAT_ARGB4444] = store_ubyte_texture;
table[MESA_FORMAT_AL1616] = _mesa_texstore_unorm1616;
table[MESA_FORMAT_AL1616_REV] = _mesa_texstore_unorm1616;
table[MESA_FORMAT_RGB332] = store_ubyte_texture;
- table[MESA_FORMAT_A8] = _mesa_texstore_unorm8;
- table[MESA_FORMAT_A16] = _mesa_texstore_unorm16;
- table[MESA_FORMAT_L8] = _mesa_texstore_unorm8;
- table[MESA_FORMAT_L16] = _mesa_texstore_unorm16;
- table[MESA_FORMAT_I8] = _mesa_texstore_unorm8;
- table[MESA_FORMAT_I16] = _mesa_texstore_unorm16;
+ table[MESA_FORMAT_A_UNORM8] = _mesa_texstore_unorm8;
+ table[MESA_FORMAT_A_UNORM16] = _mesa_texstore_unorm16;
+ table[MESA_FORMAT_L_UNORM8] = _mesa_texstore_unorm8;
+ table[MESA_FORMAT_L_UNORM16] = _mesa_texstore_unorm16;
+ table[MESA_FORMAT_I_UNORM8] = _mesa_texstore_unorm8;
+ table[MESA_FORMAT_I_UNORM16] = _mesa_texstore_unorm16;
table[MESA_FORMAT_YCBCR] = _mesa_texstore_ycbcr;
table[MESA_FORMAT_YCBCR_REV] = _mesa_texstore_ycbcr;
- table[MESA_FORMAT_R8] = _mesa_texstore_unorm8;
+ table[MESA_FORMAT_R_UNORM8] = _mesa_texstore_unorm8;
table[MESA_FORMAT_GR88] = _mesa_texstore_unorm88;
table[MESA_FORMAT_RG88] = _mesa_texstore_unorm88;
- table[MESA_FORMAT_R16] = _mesa_texstore_unorm16;
+ table[MESA_FORMAT_R_UNORM16] = _mesa_texstore_unorm16;
table[MESA_FORMAT_GR1616] = _mesa_texstore_unorm1616;
table[MESA_FORMAT_RG1616] = _mesa_texstore_unorm1616;
table[MESA_FORMAT_ARGB2101010] = _mesa_texstore_argb2101010;
table[MESA_FORMAT_Z24_S8] = _mesa_texstore_z24_s8;
table[MESA_FORMAT_S8_Z24] = _mesa_texstore_s8_z24;
- table[MESA_FORMAT_Z16] = _mesa_texstore_z16;
+ table[MESA_FORMAT_Z_UNORM16] = _mesa_texstore_z16;
table[MESA_FORMAT_X8_Z24] = _mesa_texstore_x8_z24;
table[MESA_FORMAT_Z24_X8] = _mesa_texstore_z24_x8;
- table[MESA_FORMAT_Z32] = _mesa_texstore_z32;
- table[MESA_FORMAT_S8] = _mesa_texstore_s8;
- table[MESA_FORMAT_SRGB8] = _mesa_texstore_srgb8;
+ table[MESA_FORMAT_Z_UNORM32] = _mesa_texstore_z32;
+ table[MESA_FORMAT_S_UINT8] = _mesa_texstore_s8;
+ table[MESA_FORMAT_BGR_SRGB8] = _mesa_texstore_srgb8;
table[MESA_FORMAT_SRGBA8] = _mesa_texstore_srgba8;
table[MESA_FORMAT_SARGB8] = _mesa_texstore_sargb8;
- table[MESA_FORMAT_SL8] = _mesa_texstore_sl8;
+ table[MESA_FORMAT_L_SRGB8] = _mesa_texstore_sl8;
table[MESA_FORMAT_SLA8] = _mesa_texstore_sla8;
table[MESA_FORMAT_SRGB_DXT1] = _mesa_texstore_rgb_dxt1;
table[MESA_FORMAT_SRGBA_DXT1] = _mesa_texstore_rgba_dxt1;
table[MESA_FORMAT_SIGNED_GR1616] = _mesa_texstore_snorm1616;
table[MESA_FORMAT_SIGNED_RGB_16] = _mesa_texstore_signed_rgba_16;
table[MESA_FORMAT_SIGNED_RGBA_16] = _mesa_texstore_signed_rgba_16;
- table[MESA_FORMAT_RGBA_16] = _mesa_texstore_rgba_16;
+ table[MESA_FORMAT_RGBA_UNORM16] = _mesa_texstore_rgba_16;
table[MESA_FORMAT_RED_RGTC1] = _mesa_texstore_red_rgtc1;
table[MESA_FORMAT_SIGNED_RED_RGTC1] = _mesa_texstore_signed_red_rgtc1;
table[MESA_FORMAT_RG_RGTC2] = _mesa_texstore_rg_rgtc2;
table[MESA_FORMAT_SIGNED_I16] = _mesa_texstore_snorm16;
table[MESA_FORMAT_RGB9_E5_FLOAT] = _mesa_texstore_rgb9_e5;
table[MESA_FORMAT_R11_G11_B10_FLOAT] = _mesa_texstore_r11_g11_b10f;
- table[MESA_FORMAT_Z32_FLOAT] = _mesa_texstore_z32;
+ table[MESA_FORMAT_Z_FLOAT32] = _mesa_texstore_z32;
table[MESA_FORMAT_Z32_FLOAT_X24S8] = _mesa_texstore_z32f_x24s8;
table[MESA_FORMAT_ALPHA_UINT8] = _mesa_texstore_rgba_uint8;
table[MESA_FORMAT_XRGB1555_UNORM] = store_ubyte_texture;
table[MESA_FORMAT_XBGR8888_SNORM] = _mesa_texstore_signed_rgbx8888;
table[MESA_FORMAT_XBGR8888_SRGB] = _mesa_texstore_srgba8;
- table[MESA_FORMAT_XBGR8888_UINT] = _mesa_texstore_rgba_uint8;
- table[MESA_FORMAT_XBGR8888_SINT] = _mesa_texstore_rgba_int8;
+ table[MESA_FORMAT_RGBX_UINT8] = _mesa_texstore_rgba_uint8;
+ table[MESA_FORMAT_RGBX_SINT8] = _mesa_texstore_rgba_int8;
table[MESA_FORMAT_XRGB2101010_UNORM] = _mesa_texstore_argb2101010;
- table[MESA_FORMAT_XBGR16161616_UNORM] = _mesa_texstore_rgba_16;
- table[MESA_FORMAT_XBGR16161616_SNORM] = _mesa_texstore_signed_rgba_16;
- table[MESA_FORMAT_XBGR16161616_FLOAT] = _mesa_texstore_rgba_float16;
- table[MESA_FORMAT_XBGR16161616_UINT] = _mesa_texstore_rgba_uint16;
- table[MESA_FORMAT_XBGR16161616_SINT] = _mesa_texstore_rgba_int16;
- table[MESA_FORMAT_XBGR32323232_FLOAT] = _mesa_texstore_rgba_float32;
- table[MESA_FORMAT_XBGR32323232_UINT] = _mesa_texstore_rgba_uint32;
- table[MESA_FORMAT_XBGR32323232_SINT] = _mesa_texstore_rgba_int32;
+ table[MESA_FORMAT_RGBX_UNORM16] = _mesa_texstore_rgba_16;
+ table[MESA_FORMAT_RGBX_SNORM16] = _mesa_texstore_signed_rgba_16;
+ table[MESA_FORMAT_RGBX_FLOAT16] = _mesa_texstore_rgba_float16;
+ table[MESA_FORMAT_RGBX_UINT16] = _mesa_texstore_rgba_uint16;
+ table[MESA_FORMAT_RGBX_SINT16] = _mesa_texstore_rgba_int16;
+ table[MESA_FORMAT_RGBX_FLOAT32] = _mesa_texstore_rgba_float32;
+ table[MESA_FORMAT_RGBX_UINT32] = _mesa_texstore_rgba_uint32;
+ table[MESA_FORMAT_RGBX_SINT32] = _mesa_texstore_rgba_int32;
table[MESA_FORMAT_ABGR2101010] = _mesa_texstore_abgr2101010;
return PIPE_FORMAT_L8A8_UNORM;
case MESA_FORMAT_AL1616:
return PIPE_FORMAT_L16A16_UNORM;
- case MESA_FORMAT_A8:
+ case MESA_FORMAT_A_UNORM8:
return PIPE_FORMAT_A8_UNORM;
- case MESA_FORMAT_A16:
+ case MESA_FORMAT_A_UNORM16:
return PIPE_FORMAT_A16_UNORM;
- case MESA_FORMAT_L8:
+ case MESA_FORMAT_L_UNORM8:
return PIPE_FORMAT_L8_UNORM;
- case MESA_FORMAT_L16:
+ case MESA_FORMAT_L_UNORM16:
return PIPE_FORMAT_L16_UNORM;
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_I_UNORM8:
return PIPE_FORMAT_I8_UNORM;
- case MESA_FORMAT_I16:
+ case MESA_FORMAT_I_UNORM16:
return PIPE_FORMAT_I16_UNORM;
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
return PIPE_FORMAT_Z16_UNORM;
- case MESA_FORMAT_Z32:
+ case MESA_FORMAT_Z_UNORM32:
return PIPE_FORMAT_Z32_UNORM;
case MESA_FORMAT_Z24_S8:
return PIPE_FORMAT_S8_UINT_Z24_UNORM;
return PIPE_FORMAT_X8Z24_UNORM;
case MESA_FORMAT_X8_Z24:
return PIPE_FORMAT_Z24X8_UNORM;
- case MESA_FORMAT_S8:
+ case MESA_FORMAT_S_UINT8:
return PIPE_FORMAT_S8_UINT;
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_FLOAT32:
return PIPE_FORMAT_Z32_FLOAT;
case MESA_FORMAT_Z32_FLOAT_X24S8:
return PIPE_FORMAT_Z32_FLOAT_S8X24_UINT;
return PIPE_FORMAT_DXT5_SRGBA;
case MESA_FORMAT_SLA8:
return PIPE_FORMAT_L8A8_SRGB;
- case MESA_FORMAT_SL8:
+ case MESA_FORMAT_L_SRGB8:
return PIPE_FORMAT_L8_SRGB;
- case MESA_FORMAT_SRGB8:
+ case MESA_FORMAT_BGR_SRGB8:
return PIPE_FORMAT_R8G8B8_SRGB;
case MESA_FORMAT_SRGBA8:
return PIPE_FORMAT_A8B8G8R8_SRGB;
case MESA_FORMAT_RG_FLOAT16:
return PIPE_FORMAT_R16G16_FLOAT;
- case MESA_FORMAT_R8:
+ case MESA_FORMAT_R_UNORM8:
return PIPE_FORMAT_R8_UNORM;
- case MESA_FORMAT_R16:
+ case MESA_FORMAT_R_UNORM16:
return PIPE_FORMAT_R16_UNORM;
case MESA_FORMAT_GR88:
return PIPE_FORMAT_R8G8_UNORM;
case MESA_FORMAT_GR1616:
return PIPE_FORMAT_R16G16_UNORM;
- case MESA_FORMAT_RGBA_16:
+ case MESA_FORMAT_RGBA_UNORM16:
return PIPE_FORMAT_R16G16B16A16_UNORM;
/* signed int formats */
return PIPE_FORMAT_R8G8B8X8_SNORM;
case MESA_FORMAT_XBGR8888_SRGB:
return PIPE_FORMAT_R8G8B8X8_SRGB;
- case MESA_FORMAT_XBGR8888_UINT:
+ case MESA_FORMAT_RGBX_UINT8:
return PIPE_FORMAT_R8G8B8X8_UINT;
- case MESA_FORMAT_XBGR8888_SINT:
+ case MESA_FORMAT_RGBX_SINT8:
return PIPE_FORMAT_R8G8B8X8_SINT;
case MESA_FORMAT_XRGB2101010_UNORM:
return PIPE_FORMAT_B10G10R10X2_UNORM;
- case MESA_FORMAT_XBGR16161616_UNORM:
+ case MESA_FORMAT_RGBX_UNORM16:
return PIPE_FORMAT_R16G16B16X16_UNORM;
- case MESA_FORMAT_XBGR16161616_SNORM:
+ case MESA_FORMAT_RGBX_SNORM16:
return PIPE_FORMAT_R16G16B16X16_SNORM;
- case MESA_FORMAT_XBGR16161616_FLOAT:
+ case MESA_FORMAT_RGBX_FLOAT16:
return PIPE_FORMAT_R16G16B16X16_FLOAT;
- case MESA_FORMAT_XBGR16161616_UINT:
+ case MESA_FORMAT_RGBX_UINT16:
return PIPE_FORMAT_R16G16B16X16_UINT;
- case MESA_FORMAT_XBGR16161616_SINT:
+ case MESA_FORMAT_RGBX_SINT16:
return PIPE_FORMAT_R16G16B16X16_SINT;
- case MESA_FORMAT_XBGR32323232_FLOAT:
+ case MESA_FORMAT_RGBX_FLOAT32:
return PIPE_FORMAT_R32G32B32X32_FLOAT;
- case MESA_FORMAT_XBGR32323232_UINT:
+ case MESA_FORMAT_RGBX_UINT32:
return PIPE_FORMAT_R32G32B32X32_UINT;
- case MESA_FORMAT_XBGR32323232_SINT:
+ case MESA_FORMAT_RGBX_SINT32:
return PIPE_FORMAT_R32G32B32X32_SINT;
default:
case PIPE_FORMAT_L16A16_UNORM:
return MESA_FORMAT_AL1616;
case PIPE_FORMAT_A8_UNORM:
- return MESA_FORMAT_A8;
+ return MESA_FORMAT_A_UNORM8;
case PIPE_FORMAT_A16_UNORM:
- return MESA_FORMAT_A16;
+ return MESA_FORMAT_A_UNORM16;
case PIPE_FORMAT_L8_UNORM:
- return MESA_FORMAT_L8;
+ return MESA_FORMAT_L_UNORM8;
case PIPE_FORMAT_L16_UNORM:
- return MESA_FORMAT_L16;
+ return MESA_FORMAT_L_UNORM16;
case PIPE_FORMAT_I8_UNORM:
- return MESA_FORMAT_I8;
+ return MESA_FORMAT_I_UNORM8;
case PIPE_FORMAT_I16_UNORM:
- return MESA_FORMAT_I16;
+ return MESA_FORMAT_I_UNORM16;
case PIPE_FORMAT_S8_UINT:
- return MESA_FORMAT_S8;
+ return MESA_FORMAT_S_UINT8;
case PIPE_FORMAT_R16G16B16A16_UNORM:
- return MESA_FORMAT_RGBA_16;
+ return MESA_FORMAT_RGBA_UNORM16;
case PIPE_FORMAT_Z16_UNORM:
- return MESA_FORMAT_Z16;
+ return MESA_FORMAT_Z_UNORM16;
case PIPE_FORMAT_Z32_UNORM:
- return MESA_FORMAT_Z32;
+ return MESA_FORMAT_Z_UNORM32;
case PIPE_FORMAT_S8_UINT_Z24_UNORM:
return MESA_FORMAT_Z24_S8;
case PIPE_FORMAT_X8Z24_UNORM:
case PIPE_FORMAT_Z24_UNORM_S8_UINT:
return MESA_FORMAT_S8_Z24;
case PIPE_FORMAT_Z32_FLOAT:
- return MESA_FORMAT_Z32_FLOAT;
+ return MESA_FORMAT_Z_FLOAT32;
case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT:
return MESA_FORMAT_Z32_FLOAT_X24S8;
case PIPE_FORMAT_L8A8_SRGB:
return MESA_FORMAT_SLA8;
case PIPE_FORMAT_L8_SRGB:
- return MESA_FORMAT_SL8;
+ return MESA_FORMAT_L_SRGB8;
case PIPE_FORMAT_R8G8B8_SRGB:
- return MESA_FORMAT_SRGB8;
+ return MESA_FORMAT_BGR_SRGB8;
case PIPE_FORMAT_A8B8G8R8_SRGB:
return MESA_FORMAT_SRGBA8;
case PIPE_FORMAT_B8G8R8A8_SRGB:
return MESA_FORMAT_RG_FLOAT16;
case PIPE_FORMAT_R8_UNORM:
- return MESA_FORMAT_R8;
+ return MESA_FORMAT_R_UNORM8;
case PIPE_FORMAT_R16_UNORM:
- return MESA_FORMAT_R16;
+ return MESA_FORMAT_R_UNORM16;
case PIPE_FORMAT_R8G8_UNORM:
return MESA_FORMAT_GR88;
case PIPE_FORMAT_R16G16_UNORM:
case PIPE_FORMAT_R8G8B8X8_SRGB:
return MESA_FORMAT_XBGR8888_SRGB;
case PIPE_FORMAT_R8G8B8X8_UINT:
- return MESA_FORMAT_XBGR8888_UINT;
+ return MESA_FORMAT_RGBX_UINT8;
case PIPE_FORMAT_R8G8B8X8_SINT:
- return MESA_FORMAT_XBGR8888_SINT;
+ return MESA_FORMAT_RGBX_SINT8;
case PIPE_FORMAT_B10G10R10X2_UNORM:
return MESA_FORMAT_XRGB2101010_UNORM;
case PIPE_FORMAT_R16G16B16X16_UNORM:
- return MESA_FORMAT_XBGR16161616_UNORM;
+ return MESA_FORMAT_RGBX_UNORM16;
case PIPE_FORMAT_R16G16B16X16_SNORM:
- return MESA_FORMAT_XBGR16161616_SNORM;
+ return MESA_FORMAT_RGBX_SNORM16;
case PIPE_FORMAT_R16G16B16X16_FLOAT:
- return MESA_FORMAT_XBGR16161616_FLOAT;
+ return MESA_FORMAT_RGBX_FLOAT16;
case PIPE_FORMAT_R16G16B16X16_UINT:
- return MESA_FORMAT_XBGR16161616_UINT;
+ return MESA_FORMAT_RGBX_UINT16;
case PIPE_FORMAT_R16G16B16X16_SINT:
- return MESA_FORMAT_XBGR16161616_SINT;
+ return MESA_FORMAT_RGBX_SINT16;
case PIPE_FORMAT_R32G32B32X32_FLOAT:
- return MESA_FORMAT_XBGR32323232_FLOAT;
+ return MESA_FORMAT_RGBX_FLOAT32;
case PIPE_FORMAT_R32G32B32X32_UINT:
- return MESA_FORMAT_XBGR32323232_UINT;
+ return MESA_FORMAT_RGBX_UINT32;
case PIPE_FORMAT_R32G32B32X32_SINT:
- return MESA_FORMAT_XBGR32323232_SINT;
+ return MESA_FORMAT_RGBX_SINT32;
default:
assert(0);
* using the core helpers for pack/unpack, we avoid needing to handle
* masking for things like DEPTH copies of Z24S8.
*/
- if (readRb->Format == MESA_FORMAT_Z32_FLOAT ||
+ if (readRb->Format == MESA_FORMAT_Z_FLOAT32 ||
readRb->Format == MESA_FORMAT_Z32_FLOAT_X24S8) {
mode = UNPACK_Z_FLOAT;
} else {
const GLubyte *map = _swrast_pixel_address(rb, 0, 0);
GLuint i;
- if (rb->Format == MESA_FORMAT_Z32) {
+ if (rb->Format == MESA_FORMAT_Z_UNORM32) {
const GLint rowStride = srb->RowStride;
for (i = 0; i < count; i++) {
if (x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) {
GLubyte *map = _swrast_pixel_address(rb, 0, 0);
GLuint i;
- if (rb->Format == MESA_FORMAT_Z32) {
+ if (rb->Format == MESA_FORMAT_Z_UNORM32) {
const GLint rowStride = srb->RowStride;
for (i = 0; i < count; i++) {
if (mask[i] && x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) {
else
zStart = _swrast_pixel_address(rb, span->x, span->y);
- if (rb->Format == MESA_FORMAT_Z16 && !(span->arrayMask & SPAN_XY)) {
+ if (rb->Format == MESA_FORMAT_Z_UNORM16 && !(span->arrayMask & SPAN_XY)) {
/* directly read/write row of 16-bit Z values */
zBufferVals = zStart;
ztest16 = GL_TRUE;
}
- else if (rb->Format == MESA_FORMAT_Z32 && !(span->arrayMask & SPAN_XY)) {
+ else if (rb->Format == MESA_FORMAT_Z_UNORM32 && !(span->arrayMask & SPAN_XY)) {
/* directly read/write row of 32-bit Z values */
zBufferVals = zStart;
}
else
zStart = _swrast_pixel_address(rb, span->x, span->y);
- if (rb->Format == MESA_FORMAT_Z32 && !(span->arrayMask & SPAN_XY)) {
+ if (rb->Format == MESA_FORMAT_Z_UNORM32 && !(span->arrayMask & SPAN_XY)) {
/* directly access 32-bit values in the depth buffer */
zBufferVals = (const GLuint *) zStart;
}
}
switch (rb->Format) {
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
{
GLfloat clear = (GLfloat) ctx->Depth.Clear;
GLushort clearVal = 0;
}
}
break;
- case MESA_FORMAT_Z32:
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_UNORM32:
+ case MESA_FORMAT_Z_FLOAT32:
{
GLfloat clear = (GLfloat) ctx->Depth.Clear;
GLuint clearVal = 0;
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
- rb->Format = MESA_FORMAT_RGB888;
+ rb->Format = MESA_FORMAT_BGR_UNORM8;
break;
case GL_RGBA:
case GL_RGBA2:
case GL_STENCIL_INDEX4_EXT:
case GL_STENCIL_INDEX8_EXT:
case GL_STENCIL_INDEX16_EXT:
- rb->Format = MESA_FORMAT_S8;
+ rb->Format = MESA_FORMAT_S_UINT8;
break;
case GL_DEPTH_COMPONENT:
case GL_DEPTH_COMPONENT16:
- rb->Format = MESA_FORMAT_Z16;
+ rb->Format = MESA_FORMAT_Z_UNORM16;
break;
case GL_DEPTH_COMPONENT24:
rb->Format = MESA_FORMAT_X8_Z24;
break;
case GL_DEPTH_COMPONENT32:
- rb->Format = MESA_FORMAT_Z32;
+ rb->Format = MESA_FORMAT_Z_UNORM32;
break;
case GL_DEPTH_STENCIL_EXT:
case GL_DEPTH24_STENCIL8_EXT:
const GLubyte *map = _swrast_pixel_address(rb, 0, 0);
GLuint i;
- if (rb->Format == MESA_FORMAT_S8) {
+ if (rb->Format == MESA_FORMAT_S_UINT8) {
const GLint rowStride = srb->RowStride;
for (i = 0; i < count; i++) {
if (x[i] >= 0 && y[i] >= 0 && x[i] < w && y[i] < h) {
}
switch (rb->Format) {
- case MESA_FORMAT_S8:
+ case MESA_FORMAT_S_UINT8:
{
GLubyte clear = ctx->Stencil.Clear & writeMask & 0xff;
GLubyte mask = (~writeMask) & 0xff;
fetch_texel_3d_f_xrgb8888_rev
},
{
- MESA_FORMAT_RGB888,
+ MESA_FORMAT_BGR_UNORM8,
fetch_texel_1d_f_rgb888,
fetch_texel_2d_f_rgb888,
fetch_texel_3d_f_rgb888
},
{
- MESA_FORMAT_BGR888,
+ MESA_FORMAT_RGB_UNORM8,
fetch_texel_1d_f_bgr888,
fetch_texel_2d_f_bgr888,
fetch_texel_3d_f_bgr888
fetch_texel_3d_f_rgb332
},
{
- MESA_FORMAT_A8,
+ MESA_FORMAT_A_UNORM8,
fetch_texel_1d_f_a8,
fetch_texel_2d_f_a8,
fetch_texel_3d_f_a8
},
{
- MESA_FORMAT_A16,
+ MESA_FORMAT_A_UNORM16,
fetch_texel_1d_f_a16,
fetch_texel_2d_f_a16,
fetch_texel_3d_f_a16
},
{
- MESA_FORMAT_L8,
+ MESA_FORMAT_L_UNORM8,
fetch_texel_1d_f_l8,
fetch_texel_2d_f_l8,
fetch_texel_3d_f_l8
},
{
- MESA_FORMAT_L16,
+ MESA_FORMAT_L_UNORM16,
fetch_texel_1d_f_l16,
fetch_texel_2d_f_l16,
fetch_texel_3d_f_l16
},
{
- MESA_FORMAT_I8,
+ MESA_FORMAT_I_UNORM8,
fetch_texel_1d_f_i8,
fetch_texel_2d_f_i8,
fetch_texel_3d_f_i8
},
{
- MESA_FORMAT_I16,
+ MESA_FORMAT_I_UNORM16,
fetch_texel_1d_f_i16,
fetch_texel_2d_f_i16,
fetch_texel_3d_f_i16
fetch_texel_3d_f_ycbcr_rev
},
{
- MESA_FORMAT_R8,
+ MESA_FORMAT_R_UNORM8,
fetch_texel_1d_f_r8,
fetch_texel_2d_f_r8,
fetch_texel_3d_f_r8
fetch_texel_3d_f_rg88
},
{
- MESA_FORMAT_R16,
+ MESA_FORMAT_R_UNORM16,
fetch_texel_1d_f_r16,
fetch_texel_2d_f_r16,
fetch_texel_3d_f_r16
fetch_texel_3d_f_s8_z24
},
{
- MESA_FORMAT_Z16,
+ MESA_FORMAT_Z_UNORM16,
fetch_texel_1d_f_z16,
fetch_texel_2d_f_z16,
fetch_texel_3d_f_z16
fetch_texel_3d_f_z24_s8
},
{
- MESA_FORMAT_Z32,
+ MESA_FORMAT_Z_UNORM32,
fetch_texel_1d_f_z32,
fetch_texel_2d_f_z32,
fetch_texel_3d_f_z32
},
{
- MESA_FORMAT_S8,
+ MESA_FORMAT_S_UINT8,
NULL,
NULL,
NULL
},
{
- MESA_FORMAT_SRGB8,
+ MESA_FORMAT_BGR_SRGB8,
fetch_texel_1d_srgb8,
fetch_texel_2d_srgb8,
fetch_texel_3d_srgb8
fetch_texel_3d_sargb8
},
{
- MESA_FORMAT_SL8,
+ MESA_FORMAT_L_SRGB8,
fetch_texel_1d_sl8,
fetch_texel_2d_sl8,
fetch_texel_3d_sl8
fetch_texel_3d_signed_rgba_16
},
{
- MESA_FORMAT_RGBA_16,
+ MESA_FORMAT_RGBA_UNORM16,
fetch_texel_1d_rgba_16,
fetch_texel_2d_rgba_16,
fetch_texel_3d_rgba_16
fetch_texel_3d_r11_g11_b10f
},
{
- MESA_FORMAT_Z32_FLOAT,
+ MESA_FORMAT_Z_FLOAT32,
fetch_texel_1d_f_r_f32, /* Reuse the R32F functions. */
fetch_texel_2d_f_r_f32,
fetch_texel_3d_f_r_f32
NULL
},
{
- MESA_FORMAT_XBGR8888_UINT,
+ MESA_FORMAT_RGBX_UINT8,
NULL,
NULL,
NULL
},
{
- MESA_FORMAT_XBGR8888_SINT,
+ MESA_FORMAT_RGBX_SINT8,
NULL,
NULL,
NULL
NULL
},
{
- MESA_FORMAT_XBGR16161616_UNORM,
+ MESA_FORMAT_RGBX_UNORM16,
fetch_texel_1d_xbgr16161616_unorm,
fetch_texel_2d_xbgr16161616_unorm,
fetch_texel_3d_xbgr16161616_unorm
},
{
- MESA_FORMAT_XBGR16161616_SNORM,
+ MESA_FORMAT_RGBX_SNORM16,
NULL,
NULL,
NULL
},
{
- MESA_FORMAT_XBGR16161616_FLOAT,
+ MESA_FORMAT_RGBX_FLOAT16,
fetch_texel_1d_xbgr16161616_float,
fetch_texel_2d_xbgr16161616_float,
fetch_texel_3d_xbgr16161616_float
},
{
- MESA_FORMAT_XBGR16161616_UINT,
+ MESA_FORMAT_RGBX_UINT16,
NULL,
NULL,
NULL
},
{
- MESA_FORMAT_XBGR16161616_SINT,
+ MESA_FORMAT_RGBX_SINT16,
NULL,
NULL,
NULL
},
{
- MESA_FORMAT_XBGR32323232_FLOAT,
+ MESA_FORMAT_RGBX_FLOAT32,
fetch_texel_1d_xbgr32323232_float,
fetch_texel_2d_xbgr32323232_float,
fetch_texel_3d_xbgr32323232_float
},
{
- MESA_FORMAT_XBGR32323232_UINT,
+ MESA_FORMAT_RGBX_UINT32,
NULL,
NULL,
NULL
},
{
- MESA_FORMAT_XBGR32323232_SINT,
+ MESA_FORMAT_RGBX_SINT32,
NULL,
NULL,
NULL
#endif
-/* MESA_FORMAT_Z32 ***********************************************************/
+/* MESA_FORMAT_Z_UNORM32 ***********************************************************/
/* Fetch depth texel from 1D, 2D or 3D 32-bit depth texture,
* returning 1 GLfloat.
}
-/* MESA_FORMAT_Z16 ***********************************************************/
+/* MESA_FORMAT_Z_UNORM16 ***********************************************************/
/* Fetch depth texel from 1D, 2D or 3D 16-bit depth texture,
* returning 1 GLfloat.
-/* MESA_FORMAT_RGB888 ********************************************************/
+/* MESA_FORMAT_BGR_UNORM8 ********************************************************/
/* Fetch texel from 1D, 2D or 3D rgb888 texture, return 4 GLchans */
static void FETCH(f_rgb888)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_BGR888 ********************************************************/
+/* MESA_FORMAT_RGB_UNORM8 ********************************************************/
/* Fetch texel from 1D, 2D or 3D bgr888 texture, return 4 GLchans */
static void FETCH(f_bgr888)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_R8 ************************************************************/
+/* MESA_FORMAT_R_UNORM8 ************************************************************/
/* Fetch texel from 1D, 2D or 3D rg88 texture, return 4 GLchans */
static void FETCH(f_r8)(const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_R16 ***********************************************************/
+/* MESA_FORMAT_R_UNORM16 ***********************************************************/
/* Fetch texel from 1D, 2D or 3D r16 texture, return 4 GLchans */
static void FETCH(f_r16)(const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_A8 ************************************************************/
+/* MESA_FORMAT_A_UNORM8 ************************************************************/
/* Fetch texel from 1D, 2D or 3D a8 texture, return 4 GLchans */
static void FETCH(f_a8)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_A16 ************************************************************/
+/* MESA_FORMAT_A_UNORM16 ************************************************************/
/* Fetch texel from 1D, 2D or 3D a8 texture, return 4 GLchans */
static void FETCH(f_a16)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_L8 ************************************************************/
+/* MESA_FORMAT_L_UNORM8 ************************************************************/
/* Fetch texel from 1D, 2D or 3D l8 texture, return 4 GLchans */
static void FETCH(f_l8)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_L16 ***********************************************************/
+/* MESA_FORMAT_L_UNORM16 ***********************************************************/
/* Fetch texel from 1D, 2D or 3D l16 texture, return 4 GLchans */
static void FETCH(f_l16)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_I8 ************************************************************/
+/* MESA_FORMAT_I_UNORM8 ************************************************************/
/* Fetch texel from 1D, 2D or 3D i8 texture, return 4 GLchans */
static void FETCH(f_i8)( const struct swrast_texture_image *texImage,
-/* MESA_FORMAT_I16 ***********************************************************/
+/* MESA_FORMAT_I_UNORM16 ***********************************************************/
/* Fetch texel from 1D, 2D or 3D i16 texture, return 4 GLchans */
static void FETCH(f_i16)( const struct swrast_texture_image *texImage,
/* Fetch texel from 1D, 2D or 3D srgb8 texture, return 4 GLfloats */
-/* Note: component order is same as for MESA_FORMAT_RGB888 */
+/* Note: component order is same as for MESA_FORMAT_BGR_UNORM8 */
static void FETCH(srgb8)(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel )
{
-/* MESA_FORMAT_RGBA_16 ***********************************************/
+/* MESA_FORMAT_RGBA_UNORM16 ***********************************************/
static void
FETCH(rgba_16)(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_RGB888);
+ ASSERT(img->TexFormat == MESA_FORMAT_BGR_UNORM8);
ASSERT(swImg->_IsPowerOfTwo);
(void) swImg;
case GL_NEAREST:
if (repeatNoBorderPOT) {
switch (tImg->TexFormat) {
- case MESA_FORMAT_RGB888:
+ case MESA_FORMAT_BGR_UNORM8:
opt_sample_rgb_2d(ctx, samp, tObj, m, texcoords + minStart,
NULL, rgba + minStart);
break;
case GL_NEAREST:
if (repeatNoBorderPOT) {
switch (tImg->TexFormat) {
- case MESA_FORMAT_RGB888:
+ case MESA_FORMAT_BGR_UNORM8:
opt_sample_rgb_2d(ctx, samp, tObj, m, texcoords + magStart,
NULL, rgba + magStart);
break;
sampler->WrapT == GL_REPEAT &&
swImg->_IsPowerOfTwo &&
img->Border == 0) {
- if (img->TexFormat == MESA_FORMAT_RGB888)
+ if (img->TexFormat == MESA_FORMAT_BGR_UNORM8)
func = &opt_sample_rgb_2d;
else if (img->TexFormat == MESA_FORMAT_A8B8G8R8_UNORM)
func = &opt_sample_rgba_2d;
const GLubyte *texture = (const GLubyte *) swImg->ImageSlices[0]; \
const GLint smask = texImg->Width - 1; \
const GLint tmask = texImg->Height - 1; \
- ASSERT(texImg->TexFormat == MESA_FORMAT_RGB888); \
+ ASSERT(texImg->TexFormat == MESA_FORMAT_BGR_UNORM8); \
if (!rb || !texture) { \
return; \
}
const GLubyte *texture = (const GLubyte *) swImg->ImageSlices[0]; \
const GLint smask = texImg->Width - 1; \
const GLint tmask = texImg->Height - 1; \
- ASSERT(texImg->TexFormat == MESA_FORMAT_RGB888); \
+ ASSERT(texImg->TexFormat == MESA_FORMAT_BGR_UNORM8); \
if (!rb || !texture) { \
return; \
}
switch (info->filter) {
case GL_NEAREST:
switch (info->format) {
- case MESA_FORMAT_RGB888:
+ case MESA_FORMAT_BGR_UNORM8:
switch (info->envmode) {
case GL_MODULATE:
SPAN_NEAREST(NEAREST_RGB;MODULATE,3);
span->intTex[0] -= FIXED_HALF;
span->intTex[1] -= FIXED_HALF;
switch (info->format) {
- case MESA_FORMAT_RGB888:
+ case MESA_FORMAT_BGR_UNORM8:
switch (info->envmode) {
case GL_MODULATE:
SPAN_LINEAR(LINEAR_RGB;MODULATE,3);
} \
\
switch (info.format) { \
- case MESA_FORMAT_RGB888: \
+ case MESA_FORMAT_BGR_UNORM8: \
info.tbytesline = texImg->Width * 3; \
break; \
case MESA_FORMAT_A8B8G8R8_UNORM: \
switch (info->filter) {
case GL_NEAREST:
switch (info->format) {
- case MESA_FORMAT_RGB888:
+ case MESA_FORMAT_BGR_UNORM8:
switch (info->envmode) {
case GL_MODULATE:
SPAN_NEAREST(NEAREST_RGB;MODULATE,3);
case GL_LINEAR:
switch (info->format) {
- case MESA_FORMAT_RGB888:
+ case MESA_FORMAT_BGR_UNORM8:
switch (info->envmode) {
case GL_MODULATE:
SPAN_LINEAR(LINEAR_RGB;MODULATE,3);
} \
\
switch (info.format) { \
- case MESA_FORMAT_RGB888: \
+ case MESA_FORMAT_BGR_UNORM8: \
info.tbytesline = texImg->Width * 3; \
break; \
case MESA_FORMAT_A8B8G8R8_UNORM: \
ASSERT(ctx->Depth.Test); \
ASSERT(!ctx->Depth.Mask); \
ASSERT(ctx->Depth.Func == GL_LESS); \
- assert(rb->Format == MESA_FORMAT_Z16); \
+ assert(rb->Format == MESA_FORMAT_Z_UNORM16); \
if (!q) { \
return; \
}
ctx->Depth.Func == GL_LESS &&
!ctx->Stencil._Enabled &&
depthRb &&
- depthRb->Format == MESA_FORMAT_Z16) {
+ depthRb->Format == MESA_FORMAT_Z_UNORM16) {
if (ctx->Color.ColorMask[0][0] == 0 &&
ctx->Color.ColorMask[0][1] == 0 &&
ctx->Color.ColorMask[0][2] == 0 &&
&& texImg->Border == 0
&& (_mesa_format_row_stride(format, texImg->Width) ==
swImg->RowStride)
- && (format == MESA_FORMAT_RGB888 || format == MESA_FORMAT_A8B8G8R8_UNORM)
+ && (format == MESA_FORMAT_BGR_UNORM8 || format == MESA_FORMAT_A8B8G8R8_UNORM)
&& minFilter == magFilter
&& ctx->Light.Model.ColorControl == GL_SINGLE_COLOR
&& !swrast->_FogEnabled
&& ctx->Texture.Unit[0].EnvMode != GL_COMBINE4_NV) {
if (ctx->Hint.PerspectiveCorrection==GL_FASTEST) {
if (minFilter == GL_NEAREST
- && format == MESA_FORMAT_RGB888
+ && format == MESA_FORMAT_BGR_UNORM8
&& (envMode == GL_REPLACE || envMode == GL_DECAL)
&& ((swrast->_RasterMask == (DEPTH_BIT | TEXTURE_BIT)
&& ctx->Depth.Func == GL_LESS