return PIPE_FORMAT_R11G11B10_FLOAT;
case MESA_FORMAT_ARGB2101010_UINT:
return PIPE_FORMAT_B10G10R10A2_UINT;
+
+ case MESA_FORMAT_XRGB4444_UNORM:
+ return PIPE_FORMAT_B4G4R4X4_UNORM;
+ case MESA_FORMAT_XRGB1555_UNORM:
+ return PIPE_FORMAT_B5G5R5X1_UNORM;
+ case MESA_FORMAT_XBGR8888_SNORM:
+ return PIPE_FORMAT_R8G8B8X8_SNORM;
+ case MESA_FORMAT_XBGR8888_SRGB:
+ return PIPE_FORMAT_R8G8B8X8_SRGB;
+ case MESA_FORMAT_XBGR8888_UINT:
+ return PIPE_FORMAT_R8G8B8X8_UINT;
+ case MESA_FORMAT_XBGR8888_SINT:
+ return PIPE_FORMAT_R8G8B8X8_SINT;
+ case MESA_FORMAT_XRGB2101010_UNORM:
+ return PIPE_FORMAT_B10G10R10X2_UNORM;
+ case MESA_FORMAT_XBGR16161616_UNORM:
+ return PIPE_FORMAT_R16G16B16X16_UNORM;
+ case MESA_FORMAT_XBGR16161616_SNORM:
+ return PIPE_FORMAT_R16G16B16X16_SNORM;
+ case MESA_FORMAT_XBGR16161616_FLOAT:
+ return PIPE_FORMAT_R16G16B16X16_FLOAT;
+ case MESA_FORMAT_XBGR16161616_UINT:
+ return PIPE_FORMAT_R16G16B16X16_UINT;
+ case MESA_FORMAT_XBGR16161616_SINT:
+ return PIPE_FORMAT_R16G16B16X16_SINT;
+ case MESA_FORMAT_XBGR32323232_FLOAT:
+ return PIPE_FORMAT_R32G32B32X32_FLOAT;
+ case MESA_FORMAT_XBGR32323232_UINT:
+ return PIPE_FORMAT_R32G32B32X32_UINT;
+ case MESA_FORMAT_XBGR32323232_SINT:
+ return PIPE_FORMAT_R32G32B32X32_SINT;
+
default:
assert(0);
return PIPE_FORMAT_NONE;
case PIPE_FORMAT_B10G10R10A2_UINT:
return MESA_FORMAT_ARGB2101010_UINT;
+
+ case PIPE_FORMAT_B4G4R4X4_UNORM:
+ return MESA_FORMAT_XRGB4444_UNORM;
+ case PIPE_FORMAT_B5G5R5X1_UNORM:
+ return MESA_FORMAT_XRGB1555_UNORM;
+ case PIPE_FORMAT_R8G8B8X8_SNORM:
+ return MESA_FORMAT_XBGR8888_SNORM;
+ case PIPE_FORMAT_R8G8B8X8_SRGB:
+ return MESA_FORMAT_XBGR8888_SRGB;
+ case PIPE_FORMAT_R8G8B8X8_UINT:
+ return MESA_FORMAT_XBGR8888_UINT;
+ case PIPE_FORMAT_R8G8B8X8_SINT:
+ return MESA_FORMAT_XBGR8888_SINT;
+ case PIPE_FORMAT_B10G10R10X2_UNORM:
+ return MESA_FORMAT_XRGB2101010_UNORM;
+ case PIPE_FORMAT_R16G16B16X16_UNORM:
+ return MESA_FORMAT_XBGR16161616_UNORM;
+ case PIPE_FORMAT_R16G16B16X16_SNORM:
+ return MESA_FORMAT_XBGR16161616_SNORM;
+ case PIPE_FORMAT_R16G16B16X16_FLOAT:
+ return MESA_FORMAT_XBGR16161616_FLOAT;
+ case PIPE_FORMAT_R16G16B16X16_UINT:
+ return MESA_FORMAT_XBGR16161616_UINT;
+ case PIPE_FORMAT_R16G16B16X16_SINT:
+ return MESA_FORMAT_XBGR16161616_SINT;
+ case PIPE_FORMAT_R32G32B32X32_FLOAT:
+ return MESA_FORMAT_XBGR32323232_FLOAT;
+ case PIPE_FORMAT_R32G32B32X32_UINT:
+ return MESA_FORMAT_XBGR32323232_UINT;
+ case PIPE_FORMAT_R32G32B32X32_SINT:
+ return MESA_FORMAT_XBGR32323232_SINT;
+
default:
assert(0);
return MESA_FORMAT_NONE;
static const struct format_mapping format_map[] = {
/* Basic RGB, RGBA formats */
{
- { GL_RGB10, GL_RGB10_A2, 0 },
+ { GL_RGB10, 0 },
+ { PIPE_FORMAT_B10G10R10X2_UNORM, PIPE_FORMAT_B10G10R10A2_UNORM,
+ DEFAULT_RGB_FORMATS }
+ },
+ {
+ { GL_RGB10_A2, 0 },
{ PIPE_FORMAT_B10G10R10A2_UNORM, DEFAULT_RGBA_FORMATS }
},
{
{ DEFAULT_RGB_FORMATS }
},
{
- { GL_RGB12, GL_RGB16, GL_RGBA12, GL_RGBA16, 0 },
+ { GL_RGB12, GL_RGB16, 0 },
+ { PIPE_FORMAT_R16G16B16X16_UNORM, PIPE_FORMAT_R16G16B16A16_UNORM,
+ DEFAULT_RGB_FORMATS }
+ },
+ {
+ { GL_RGBA12, GL_RGBA16, 0 },
{ PIPE_FORMAT_R16G16B16A16_UNORM, DEFAULT_RGBA_FORMATS }
},
{
PIPE_FORMAT_B5G5R5A1_UNORM, DEFAULT_RGB_FORMATS }
},
{
- { GL_RGB5, GL_RGB4 },
- { PIPE_FORMAT_B5G6R5_UNORM, PIPE_FORMAT_B5G5R5A1_UNORM,
+ { GL_RGB4 },
+ { PIPE_FORMAT_B4G4R4X4_UNORM, PIPE_FORMAT_B4G4R4A4_UNORM,
+ DEFAULT_RGB_FORMATS }
+ },
+ {
+ { GL_RGB5 },
+ { PIPE_FORMAT_B5G5R5X1_UNORM, PIPE_FORMAT_B5G5R5A1_UNORM,
DEFAULT_RGB_FORMATS }
},
{
/* sRGB formats */
{
- { GL_SRGB_EXT, GL_SRGB8_EXT, GL_SRGB_ALPHA_EXT, GL_SRGB8_ALPHA8_EXT, 0 },
+ { GL_SRGB_EXT, GL_SRGB8_EXT, 0 },
+ { PIPE_FORMAT_R8G8B8X8_SRGB, DEFAULT_SRGBA_FORMATS }
+ },
+ {
+ { GL_SRGB_ALPHA_EXT, GL_SRGB8_ALPHA8_EXT, 0 },
{ DEFAULT_SRGBA_FORMATS }
},
{
{ GL_COMPRESSED_SRGB_EXT, GL_COMPRESSED_SRGB_S3TC_DXT1_EXT, 0 },
- { PIPE_FORMAT_DXT1_SRGB, DEFAULT_SRGBA_FORMATS }
+ { PIPE_FORMAT_DXT1_SRGB, PIPE_FORMAT_R8G8B8X8_SRGB,
+ DEFAULT_SRGBA_FORMATS }
},
{
{ GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, 0 },
},
{
{ GL_RGB16F_ARB, 0 },
- { PIPE_FORMAT_R16G16B16_FLOAT, PIPE_FORMAT_R16G16B16A16_FLOAT,
+ { PIPE_FORMAT_R16G16B16_FLOAT, PIPE_FORMAT_R16G16B16X16_FLOAT,
+ PIPE_FORMAT_R16G16B16A16_FLOAT,
PIPE_FORMAT_R32G32B32_FLOAT, PIPE_FORMAT_R32G32B32A32_FLOAT, 0 }
},
{
},
{
{ GL_RGB32F_ARB, 0 },
- { PIPE_FORMAT_R32G32B32_FLOAT, PIPE_FORMAT_R32G32B32A32_FLOAT,
- PIPE_FORMAT_R16G16B16A16_FLOAT, 0 }
+ { PIPE_FORMAT_R32G32B32_FLOAT, PIPE_FORMAT_R32G32B32X32_FLOAT,
+ PIPE_FORMAT_R32G32B32A32_FLOAT, PIPE_FORMAT_R16G16B16A16_FLOAT, 0 }
},
{
{ GL_LUMINANCE_ALPHA32F_ARB, 0 },
GL_BGR_INTEGER_EXT,
GL_RGB8I_EXT,
GL_BLUE_INTEGER_EXT, 0 },
- { PIPE_FORMAT_R8G8B8_SINT,
+ { PIPE_FORMAT_R8G8B8_SINT, PIPE_FORMAT_R8G8B8X8_SINT,
PIPE_FORMAT_R8G8B8A8_SINT, 0 }
},
{
},
{
{ GL_RGB16I_EXT, 0 },
- { PIPE_FORMAT_R16G16B16_SINT,
+ { PIPE_FORMAT_R16G16B16_SINT, PIPE_FORMAT_R16G16B16X16_SINT,
PIPE_FORMAT_R16G16B16A16_SINT, 0 },
},
{
},
{
{ GL_RGB32I_EXT, 0 },
- { PIPE_FORMAT_R32G32B32_SINT,
+ { PIPE_FORMAT_R32G32B32_SINT, PIPE_FORMAT_R32G32B32X32_SINT,
PIPE_FORMAT_R32G32B32A32_SINT, 0 },
},
{
},
{
{ GL_RGB8UI_EXT, 0 },
- { PIPE_FORMAT_R8G8B8_UINT,
+ { PIPE_FORMAT_R8G8B8_UINT, PIPE_FORMAT_R8G8B8X8_UINT,
PIPE_FORMAT_R8G8B8A8_UINT, 0 }
},
{
{ GL_RGB16UI_EXT, 0 },
- { PIPE_FORMAT_R16G16B16_UINT,
+ { PIPE_FORMAT_R16G16B16_UINT, PIPE_FORMAT_R16G16B16X16_UINT,
PIPE_FORMAT_R16G16B16A16_UINT, 0 }
},
{
},
{
{ GL_RGB32UI_EXT, 0},
- { PIPE_FORMAT_R32G32B32_UINT,
+ { PIPE_FORMAT_R32G32B32_UINT, PIPE_FORMAT_R32G32B32X32_UINT,
PIPE_FORMAT_R32G32B32A32_UINT, 0 }
},
{
PIPE_FORMAT_R8G8_SNORM, PIPE_FORMAT_R8G8B8A8_SNORM, 0 }
},
{
- { GL_RGB_SNORM, GL_RGB8_SNORM, GL_RGBA_SNORM, GL_RGBA8_SNORM, 0 },
+ { GL_RGB_SNORM, GL_RGB8_SNORM, 0 },
+ { PIPE_FORMAT_R8G8B8X8_SNORM, PIPE_FORMAT_R8G8B8A8_SNORM, 0 }
+ },
+ {
+ { GL_RGBA_SNORM, GL_RGBA8_SNORM, 0 },
{ PIPE_FORMAT_R8G8B8A8_SNORM, 0 }
},
{
- { GL_RGB16_SNORM, GL_RGBA16_SNORM, 0 },
+ { GL_RGB16_SNORM, 0 },
+ { PIPE_FORMAT_R16G16B16X16_SNORM, PIPE_FORMAT_R16G16B16A16_SNORM,
+ PIPE_FORMAT_R8G8B8A8_SNORM, 0 }
+ },
+ {
+ { GL_RGBA16_SNORM, 0 },
{ PIPE_FORMAT_R16G16B16A16_SNORM, PIPE_FORMAT_R8G8B8A8_SNORM, 0 }
},
{