From: Brian Paul Date: Sun, 9 Mar 2014 01:19:21 +0000 (-0700) Subject: mesa: reorder MESA_FORMAT enums X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9b5fff2dd70fcc971f342a7dd31e390f0447978b;p=mesa.git mesa: reorder MESA_FORMAT enums The MESA_FORMAT_x enums in formats.h weren't declared in any sort of reasonable order. Now it should be a little more logical. This also required reordering tables in formats.c and s_texfetch.c Reviewed-by: Michel Dänzer Acked-by: Eric Anholt --- diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 0cf97fa316b..a61064b901f 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -78,6 +78,7 @@ struct gl_format_info */ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = { + /* Packed unorm formats */ { MESA_FORMAT_NONE, /* Name */ "MESA_FORMAT_NONE", /* StrName */ @@ -88,8 +89,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_A8B8G8R8_UNORM, /* Name */ - "MESA_FORMAT_A8B8G8R8_UNORM", /* StrName */ + MESA_FORMAT_A8B8G8R8_UNORM, /* Name */ + "MESA_FORMAT_A8B8G8R8_UNORM",/* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ @@ -97,17 +98,17 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_R8G8B8A8_UNORM, /* Name */ - "MESA_FORMAT_R8G8B8A8_UNORM", /* StrName */ - GL_RGBA, /* BaseFormat */ + MESA_FORMAT_X8B8G8R8_UNORM, /* Name */ + "MESA_FORMAT_X8B8G8R8_UNORM",/* StrName */ + GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ - 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ + 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_B8G8R8A8_UNORM, /* Name */ - "MESA_FORMAT_B8G8R8A8_UNORM", /* StrName */ + MESA_FORMAT_R8G8B8A8_UNORM, /* Name */ + "MESA_FORMAT_R8G8B8A8_UNORM",/* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ @@ -115,26 +116,26 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_A8R8G8B8_UNORM, /* Name */ - "MESA_FORMAT_A8R8G8B8_UNORM", /* StrName */ - GL_RGBA, /* BaseFormat */ + MESA_FORMAT_R8G8B8X8_UNORM, /* Name */ + "MESA_FORMAT_R8G8B8X8_UNORM",/* StrName */ + GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ - 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ + 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_X8B8G8R8_UNORM, /* Name */ - "MESA_FORMAT_X8B8G8R8_UNORM", /* StrName */ - GL_RGB, /* BaseFormat */ + MESA_FORMAT_B8G8R8A8_UNORM, /* Name */ + "MESA_FORMAT_B8G8R8A8_UNORM",/* StrName */ + GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ - 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ + 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_R8G8B8X8_UNORM, /* Name */ - "MESA_FORMAT_R8G8B8X8_UNORM", /* StrName */ + MESA_FORMAT_B8G8R8X8_UNORM, /* Name */ + "MESA_FORMAT_B8G8R8X8_UNORM",/* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ @@ -142,17 +143,17 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_B8G8R8X8_UNORM, /* Name */ - "MESA_FORMAT_B8G8R8X8_UNORM", /* StrName */ - GL_RGB, /* BaseFormat */ + MESA_FORMAT_A8R8G8B8_UNORM, /* Name */ + "MESA_FORMAT_A8R8G8B8_UNORM",/* StrName */ + GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ - 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ + 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_X8R8G8B8_UNORM, /* Name */ - "MESA_FORMAT_X8R8G8B8_UNORM", /* StrName */ + MESA_FORMAT_X8R8G8B8_UNORM, /* Name */ + "MESA_FORMAT_X8R8G8B8_UNORM",/* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ @@ -160,26 +161,26 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_BGR_UNORM8, /* Name */ - "MESA_FORMAT_BGR_UNORM8", /* StrName */ - GL_RGB, /* BaseFormat */ + MESA_FORMAT_L16A16_UNORM, /* Name */ + "MESA_FORMAT_L16A16_UNORM", /* StrName */ + GL_LUMINANCE_ALPHA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ - 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ - 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ - 1, 1, 3 /* BlockWidth/Height,Bytes */ + 0, 0, 0, 16, /* Red/Green/Blue/AlphaBits */ + 16, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_RGB_UNORM8, /* Name */ - "MESA_FORMAT_RGB_UNORM8", /* StrName */ - GL_RGB, /* BaseFormat */ + MESA_FORMAT_A16L16_UNORM, /* Name */ + "MESA_FORMAT_A16L16_UNORM", /* StrName */ + GL_LUMINANCE_ALPHA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ - 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ - 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ - 1, 1, 3 /* BlockWidth/Height,Bytes */ + 0, 0, 0, 16, /* Red/Green/Blue/AlphaBits */ + 16, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_B5G6R5_UNORM, /* Name */ - "MESA_FORMAT_B5G6R5_UNORM", /* StrName */ + MESA_FORMAT_B5G6R5_UNORM, /* Name */ + "MESA_FORMAT_B5G6R5_UNORM", /* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 5, 6, 5, 0, /* Red/Green/Blue/AlphaBits */ @@ -187,8 +188,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_R5G6B5_UNORM, /* Name */ - "MESA_FORMAT_R5G6B5_UNORM", /* StrName */ + MESA_FORMAT_R5G6B5_UNORM, /* Name */ + "MESA_FORMAT_R5G6B5_UNORM", /* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 5, 6, 5, 0, /* Red/Green/Blue/AlphaBits */ @@ -196,8 +197,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_B4G4R4A4_UNORM, /* Name */ - "MESA_FORMAT_B4G4R4A4_UNORM", /* StrName */ + MESA_FORMAT_B4G4R4A4_UNORM, /* Name */ + "MESA_FORMAT_B4G4R4A4_UNORM",/* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */ @@ -205,8 +206,17 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_A4R4G4B4_UNORM, /* Name */ - "MESA_FORMAT_A4R4G4B4_UNORM", /* StrName */ + MESA_FORMAT_B4G4R4X4_UNORM, + "MESA_FORMAT_B4G4R4X4_UNORM", + GL_RGB, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 0, + 0, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_A4R4G4B4_UNORM, /* Name */ + "MESA_FORMAT_A4R4G4B4_UNORM",/* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */ @@ -214,8 +224,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_A1B5G5R5_UNORM, /* Name */ - "MESA_FORMAT_A1B5G5R5_UNORM", /* StrName */ + MESA_FORMAT_A1B5G5R5_UNORM, /* Name */ + "MESA_FORMAT_A1B5G5R5_UNORM",/* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */ @@ -223,8 +233,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_B5G5R5A1_UNORM, /* Name */ - "MESA_FORMAT_B5G5R5A1_UNORM", /* StrName */ + MESA_FORMAT_B5G5R5A1_UNORM, /* Name */ + "MESA_FORMAT_B5G5R5A1_UNORM",/* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */ @@ -232,8 +242,17 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_A1R5G5B5_UNORM, /* Name */ - "MESA_FORMAT_A1R5G5B5_UNORM", /* StrName */ + MESA_FORMAT_B5G5R5X1_UNORM, + "MESA_FORMAT_B5G5R5X1_UNORM", + GL_RGB, + GL_UNSIGNED_NORMALIZED, + 5, 5, 5, 0, + 0, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_A1R5G5B5_UNORM, /* Name */ + "MESA_FORMAT_A1R5G5B5_UNORM",/* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */ @@ -241,17 +260,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_L4A4_UNORM, /* Name */ - "MESA_FORMAT_L4A4_UNORM", /* StrName */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED, /* DataType */ - 0, 0, 0, 4, /* Red/Green/Blue/AlphaBits */ - 4, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ - 1, 1, 1 /* BlockWidth/Height,Bytes */ - }, - { - MESA_FORMAT_L8A8_UNORM, /* Name */ - "MESA_FORMAT_L8A8_UNORM", /* StrName */ + MESA_FORMAT_L8A8_UNORM, /* Name */ + "MESA_FORMAT_L8A8_UNORM", /* StrName */ GL_LUMINANCE_ALPHA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 8, /* Red/Green/Blue/AlphaBits */ @@ -259,8 +269,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_A8L8_UNORM, /* Name */ - "MESA_FORMAT_A8L8_UNORM", /* StrName */ + MESA_FORMAT_A8L8_UNORM, /* Name */ + "MESA_FORMAT_A8L8_UNORM", /* StrName */ GL_LUMINANCE_ALPHA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 8, /* Red/Green/Blue/AlphaBits */ @@ -268,26 +278,35 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_L16A16_UNORM, /* Name */ - "MESA_FORMAT_L16A16_UNORM", /* StrName */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED, /* DataType */ - 0, 0, 0, 16, /* Red/Green/Blue/AlphaBits */ - 16, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ - 1, 1, 4 /* BlockWidth/Height,Bytes */ + MESA_FORMAT_R8G8_UNORM, + "MESA_FORMAT_R8G8_UNORM", + GL_RG, + GL_UNSIGNED_NORMALIZED, + 8, 8, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_G8R8_UNORM, + "MESA_FORMAT_G8R8_UNORM", + GL_RG, + GL_UNSIGNED_NORMALIZED, + 8, 8, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 2 }, { - MESA_FORMAT_A16L16_UNORM, /* Name */ - "MESA_FORMAT_A16L16_UNORM", /* StrName */ + MESA_FORMAT_L4A4_UNORM, /* Name */ + "MESA_FORMAT_L4A4_UNORM", /* StrName */ GL_LUMINANCE_ALPHA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ - 0, 0, 0, 16, /* Red/Green/Blue/AlphaBits */ - 16, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ - 1, 1, 4 /* BlockWidth/Height,Bytes */ + 0, 0, 0, 4, /* Red/Green/Blue/AlphaBits */ + 4, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 1 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_B2G3R3_UNORM, /* Name */ - "MESA_FORMAT_B2G3R3_UNORM", /* StrName */ + MESA_FORMAT_B2G3R3_UNORM, /* Name */ + "MESA_FORMAT_B2G3R3_UNORM", /* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 3, 3, 2, 0, /* Red/Green/Blue/AlphaBits */ @@ -295,8 +314,118 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_A_UNORM8, /* Name */ - "MESA_FORMAT_A_UNORM8", /* StrName */ + MESA_FORMAT_R16G16_UNORM, + "MESA_FORMAT_R16G16_UNORM", + GL_RG, + GL_UNSIGNED_NORMALIZED, + 16, 16, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_G16R16_UNORM, + "MESA_FORMAT_G16R16_UNORM", + GL_RG, + GL_UNSIGNED_NORMALIZED, + 16, 16, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_B10G10R10A2_UNORM, + "MESA_FORMAT_B10G10R10A2_UNORM", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 10, 10, 10, 2, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_B10G10R10X2_UNORM, + "MESA_FORMAT_B10G10R10X2_UNORM", + GL_RGB, + GL_UNSIGNED_NORMALIZED, + 10, 10, 10, 0, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_R10G10B10A2_UNORM, + "MESA_FORMAT_R10G10B10A2_UNORM", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 10, 10, 10, 2, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_S8_UINT_Z24_UNORM, /* Name */ + "MESA_FORMAT_S8_UINT_Z24_UNORM", /* StrName */ + GL_DEPTH_STENCIL, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 24, 8, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_X8Z24_UNORM, /* Name */ + "MESA_FORMAT_X8Z24_UNORM", /* StrName */ + GL_DEPTH_COMPONENT, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 24, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_Z24_UNORM_S8_UINT, /* Name */ + "MESA_FORMAT_Z24_UNORM_S8_UINT", /* StrName */ + GL_DEPTH_STENCIL, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 24, 8, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_Z24_UNORM_X8_UINT, /* Name */ + "MESA_FORMAT_Z24_UNORM_X8_UINT", /* StrName */ + GL_DEPTH_COMPONENT, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 24, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_YCBCR, /* Name */ + "MESA_FORMAT_YCBCR", /* StrName */ + GL_YCBCR_MESA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_YCBCR_REV, /* Name */ + "MESA_FORMAT_YCBCR_REV", /* StrName */ + GL_YCBCR_MESA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + + /* Array unorm formats */ + { + MESA_FORMAT_DUDV8, + "MESA_FORMAT_DUDV8", + GL_DUDV_ATI, + GL_SIGNED_NORMALIZED, + 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 2 + }, + { + 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 */ @@ -304,8 +433,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_A_UNORM16, /* Name */ - "MESA_FORMAT_A_UNORM16", /* 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 */ @@ -313,8 +442,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_L_UNORM8, /* Name */ - "MESA_FORMAT_L_UNORM8", /* 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 */ @@ -322,8 +451,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_L_UNORM16, /* Name */ - "MESA_FORMAT_L_UNORM16", /* 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 */ @@ -331,8 +460,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_I_UNORM8, /* Name */ - "MESA_FORMAT_I_UNORM8", /* 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 */ @@ -340,32 +469,14 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_I_UNORM16, /* Name */ - "MESA_FORMAT_I_UNORM16", /* 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 */ 0, 16, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ 1, 1, 2 /* BlockWidth/Height,Bytes */ }, - { - MESA_FORMAT_YCBCR, /* Name */ - "MESA_FORMAT_YCBCR", /* StrName */ - GL_YCBCR_MESA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED, /* DataType */ - 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ - 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ - 1, 1, 2 /* BlockWidth/Height,Bytes */ - }, - { - MESA_FORMAT_YCBCR_REV, /* Name */ - "MESA_FORMAT_YCBCR_REV", /* StrName */ - GL_YCBCR_MESA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED, /* DataType */ - 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ - 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ - 1, 1, 2 /* BlockWidth/Height,Bytes */ - }, { MESA_FORMAT_R_UNORM8, "MESA_FORMAT_R_UNORM8", @@ -375,24 +486,6 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 0, 1, 1, 1 }, - { - MESA_FORMAT_R8G8_UNORM, - "MESA_FORMAT_R8G8_UNORM", - GL_RG, - GL_UNSIGNED_NORMALIZED, - 8, 8, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 2 - }, - { - MESA_FORMAT_G8R8_UNORM, - "MESA_FORMAT_G8R8_UNORM", - GL_RG, - GL_UNSIGNED_NORMALIZED, - 8, 8, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 2 - }, { MESA_FORMAT_R_UNORM16, "MESA_FORMAT_R_UNORM16", @@ -403,53 +496,44 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 }, { - MESA_FORMAT_R16G16_UNORM, - "MESA_FORMAT_R16G16_UNORM", - GL_RG, - GL_UNSIGNED_NORMALIZED, - 16, 16, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 4 + 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 */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 3 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_G16R16_UNORM, - "MESA_FORMAT_G16R16_UNORM", - GL_RG, - GL_UNSIGNED_NORMALIZED, - 16, 16, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 4 + 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 */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 3 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_B10G10R10A2_UNORM, - "MESA_FORMAT_B10G10R10A2_UNORM", + MESA_FORMAT_RGBA_UNORM16, + "MESA_FORMAT_RGBA_UNORM16", GL_RGBA, GL_UNSIGNED_NORMALIZED, - 10, 10, 10, 2, + 16, 16, 16, 16, 0, 0, 0, 0, 0, - 1, 1, 4 - }, - { - MESA_FORMAT_S8_UINT_Z24_UNORM, /* Name */ - "MESA_FORMAT_S8_UINT_Z24_UNORM", /* StrName */ - GL_DEPTH_STENCIL, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED, /* DataType */ - 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ - 0, 0, 0, 24, 8, /* Lum/Int/Index/Depth/StencilBits */ - 1, 1, 4 /* BlockWidth/Height,Bytes */ + 1, 1, 8 }, { - MESA_FORMAT_Z24_UNORM_S8_UINT, /* Name */ - "MESA_FORMAT_Z24_UNORM_S8_UINT", /* StrName */ - GL_DEPTH_STENCIL, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED, /* DataType */ - 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ - 0, 0, 0, 24, 8, /* Lum/Int/Index/Depth/StencilBits */ - 1, 1, 4 /* BlockWidth/Height,Bytes */ + MESA_FORMAT_RGBX_UNORM16, + "MESA_FORMAT_RGBX_UNORM16", + GL_RGB, + GL_UNSIGNED_NORMALIZED, + 16, 16, 16, 0, + 0, 0, 0, 0, 0, + 1, 1, 8 }, { - MESA_FORMAT_Z_UNORM16, /* Name */ - "MESA_FORMAT_Z_UNORM16", /* 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 */ @@ -457,232 +541,326 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_Z24_UNORM_X8_UINT, /* Name */ - "MESA_FORMAT_Z24_UNORM_X8_UINT", /* 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 */ - 0, 0, 0, 24, 0, /* Lum/Int/Index/Depth/StencilBits */ + 0, 0, 0, 32, 0, /* Lum/Int/Index/Depth/StencilBits */ 1, 1, 4 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_X8Z24_UNORM, /* Name */ - "MESA_FORMAT_X8Z24_UNORM", /* StrName */ - GL_DEPTH_COMPONENT, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED, /* DataType */ + 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 */ - 0, 0, 0, 24, 0, /* Lum/Int/Index/Depth/StencilBits */ - 1, 1, 4 /* BlockWidth/Height,Bytes */ - }, - { - 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 */ - 0, 0, 0, 32, 0, /* Lum/Int/Index/Depth/StencilBits */ - 1, 1, 4 /* BlockWidth/Height,Bytes */ + 0, 0, 0, 0, 8, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 1 /* BlockWidth/Height,Bytes */ }, + + /* Packed signed/normalized formats */ { - 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 */ - 0, 0, 0, 0, 8, /* Lum/Int/Index/Depth/StencilBits */ - 1, 1, 1 /* BlockWidth/Height,Bytes */ + MESA_FORMAT_A8B8G8R8_SNORM, + "MESA_FORMAT_A8B8G8R8_SNORM", + GL_RGBA, + GL_SIGNED_NORMALIZED, + 8, 8, 8, 8, + 0, 0, 0, 0, 0, + 1, 1, 4 }, { - MESA_FORMAT_BGR_SRGB8, - "MESA_FORMAT_BGR_SRGB8", + MESA_FORMAT_X8B8G8R8_SNORM, + "MESA_FORMAT_X8B8G8R8_SNORM", GL_RGB, - GL_UNSIGNED_NORMALIZED, + GL_SIGNED_NORMALIZED, 8, 8, 8, 0, 0, 0, 0, 0, 0, - 1, 1, 3 + 1, 1, 4 /* 4 bpp, but no alpha */ }, { - MESA_FORMAT_A8B8G8R8_SRGB, - "MESA_FORMAT_A8B8G8R8_SRGB", + MESA_FORMAT_R8G8B8A8_SNORM, + "MESA_FORMAT_R8G8B8A8_SNORM", GL_RGBA, - GL_UNSIGNED_NORMALIZED, + GL_SIGNED_NORMALIZED, 8, 8, 8, 8, 0, 0, 0, 0, 0, 1, 1, 4 }, { - MESA_FORMAT_B8G8R8A8_SRGB, - "MESA_FORMAT_B8G8R8A8_SRGB", - GL_RGBA, - GL_UNSIGNED_NORMALIZED, - 8, 8, 8, 8, + MESA_FORMAT_R8G8B8X8_SNORM, + "MESA_FORMAT_R8G8B8X8_SNORM", + GL_RGB, + GL_SIGNED_NORMALIZED, + 8, 8, 8, 0, 0, 0, 0, 0, 0, 1, 1, 4 }, { - MESA_FORMAT_R8G8B8A8_SRGB, - "MESA_FORMAT_R8G8B8A8_SRGB", - GL_RGBA, - GL_UNSIGNED_NORMALIZED, - 8, 8, 8, 8, + MESA_FORMAT_R16G16_SNORM, + "MESA_FORMAT_R16G16_SNORM", + GL_RG, + GL_SIGNED_NORMALIZED, + 16, 16, 0, 0, 0, 0, 0, 0, 0, 1, 1, 4 }, { - MESA_FORMAT_L_SRGB8, - "MESA_FORMAT_L_SRGB8", - GL_LUMINANCE, - GL_UNSIGNED_NORMALIZED, - 0, 0, 0, 0, - 8, 0, 0, 0, 0, - 1, 1, 1 + MESA_FORMAT_G16R16_SNORM, + "MESA_FORMAT_G16R16_SNORM", + GL_RG, + GL_SIGNED_NORMALIZED, + 16, 16, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 4 }, { - MESA_FORMAT_L8A8_SRGB, - "MESA_FORMAT_L8A8_SRGB", + MESA_FORMAT_R8G8_SNORM, + "MESA_FORMAT_R8G8_SNORM", + GL_RG, + GL_SIGNED_NORMALIZED, + 8, 8, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_G8R8_SNORM, + "MESA_FORMAT_G8R8_SNORM", + GL_RG, + GL_SIGNED_NORMALIZED, + 8, 8, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_L8A8_SNORM, + "MESA_FORMAT_L8A8_SNORM", GL_LUMINANCE_ALPHA, - GL_UNSIGNED_NORMALIZED, + GL_SIGNED_NORMALIZED, 0, 0, 0, 8, 8, 0, 0, 0, 0, 1, 1, 2 }, + + /* Array signed/normalized formats */ { - MESA_FORMAT_SRGB_DXT1, /* Name */ - "MESA_FORMAT_SRGB_DXT1", /* StrName */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED, /* DataType */ - 4, 4, 4, 0, /* approx Red/Green/Blue/AlphaBits */ - 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ - 4, 4, 8 /* 8 bytes per 4x4 block */ - }, - { - MESA_FORMAT_SRGBA_DXT1, - "MESA_FORMAT_SRGBA_DXT1", - GL_RGBA, - GL_UNSIGNED_NORMALIZED, - 4, 4, 4, 4, + MESA_FORMAT_A_SNORM8, + "MESA_FORMAT_A_SNORM8", + GL_ALPHA, + GL_SIGNED_NORMALIZED, + 0, 0, 0, 8, 0, 0, 0, 0, 0, - 4, 4, 8 /* 8 bytes per 4x4 block */ + 1, 1, 1 }, { - MESA_FORMAT_SRGBA_DXT3, - "MESA_FORMAT_SRGBA_DXT3", - GL_RGBA, - GL_UNSIGNED_NORMALIZED, - 4, 4, 4, 4, + MESA_FORMAT_A_SNORM16, + "MESA_FORMAT_A_SNORM16", + GL_ALPHA, + GL_SIGNED_NORMALIZED, + 0, 0, 0, 16, 0, 0, 0, 0, 0, - 4, 4, 16 /* 16 bytes per 4x4 block */ + 1, 1, 2 }, { - MESA_FORMAT_SRGBA_DXT5, - "MESA_FORMAT_SRGBA_DXT5", - GL_RGBA, - GL_UNSIGNED_NORMALIZED, - 4, 4, 4, 4, - 0, 0, 0, 0, 0, - 4, 4, 16 /* 16 bytes per 4x4 block */ + MESA_FORMAT_L_SNORM8, + "MESA_FORMAT_L_SNORM8", + GL_LUMINANCE, + GL_SIGNED_NORMALIZED, + 0, 0, 0, 0, + 8, 0, 0, 0, 0, + 1, 1, 1 }, - { - MESA_FORMAT_RGB_FXT1, - "MESA_FORMAT_RGB_FXT1", - GL_RGB, - GL_UNSIGNED_NORMALIZED, - 4, 4, 4, 0, /* approx Red/Green/BlueBits */ - 0, 0, 0, 0, 0, - 8, 4, 16 /* 16 bytes per 8x4 block */ + MESA_FORMAT_L_SNORM16, + "MESA_FORMAT_L_SNORM16", + GL_LUMINANCE, + GL_SIGNED_NORMALIZED, + 0, 0, 0, 0, + 16, 0, 0, 0, 0, + 1, 1, 2 }, { - MESA_FORMAT_RGBA_FXT1, - "MESA_FORMAT_RGBA_FXT1", - GL_RGBA, - GL_UNSIGNED_NORMALIZED, - 4, 4, 4, 1, /* approx Red/Green/Blue/AlphaBits */ - 0, 0, 0, 0, 0, - 8, 4, 16 /* 16 bytes per 8x4 block */ + MESA_FORMAT_I_SNORM8, + "MESA_FORMAT_I_SNORM8", + GL_INTENSITY, + GL_SIGNED_NORMALIZED, + 0, 0, 0, 0, + 0, 8, 0, 0, 0, + 1, 1, 1 }, - { - MESA_FORMAT_RGB_DXT1, /* Name */ - "MESA_FORMAT_RGB_DXT1", /* StrName */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED, /* DataType */ - 4, 4, 4, 0, /* approx Red/Green/Blue/AlphaBits */ - 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ - 4, 4, 8 /* 8 bytes per 4x4 block */ + MESA_FORMAT_I_SNORM16, + "MESA_FORMAT_I_SNORM16", + GL_INTENSITY, + GL_SIGNED_NORMALIZED, + 0, 0, 0, 0, + 0, 16, 0, 0, 0, + 1, 1, 2 }, { - MESA_FORMAT_RGBA_DXT1, - "MESA_FORMAT_RGBA_DXT1", - GL_RGBA, - GL_UNSIGNED_NORMALIZED, - 4, 4, 4, 4, - 0, 0, 0, 0, 0, - 4, 4, 8 /* 8 bytes per 4x4 block */ + MESA_FORMAT_R_SNORM8, /* Name */ + "MESA_FORMAT_R_SNORM8", /* StrName */ + GL_RED, /* BaseFormat */ + GL_SIGNED_NORMALIZED, /* DataType */ + 8, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 1 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_RGBA_DXT3, - "MESA_FORMAT_RGBA_DXT3", - GL_RGBA, - GL_UNSIGNED_NORMALIZED, - 4, 4, 4, 4, + MESA_FORMAT_R_SNORM16, + "MESA_FORMAT_R_SNORM16", + GL_RED, + GL_SIGNED_NORMALIZED, + 16, 0, 0, 0, 0, 0, 0, 0, 0, - 4, 4, 16 /* 16 bytes per 4x4 block */ + 1, 1, 2 }, { - MESA_FORMAT_RGBA_DXT5, - "MESA_FORMAT_RGBA_DXT5", - GL_RGBA, - GL_UNSIGNED_NORMALIZED, - 4, 4, 4, 4, - 0, 0, 0, 0, 0, - 4, 4, 16 /* 16 bytes per 4x4 block */ + MESA_FORMAT_LA_SNORM16, + "MESA_FORMAT_LA_SNORM16", + GL_LUMINANCE_ALPHA, + GL_SIGNED_NORMALIZED, + 0, 0, 0, 16, + 16, 0, 0, 0, 0, + 1, 1, 4 }, { - MESA_FORMAT_RGBA_FLOAT32, - "MESA_FORMAT_RGBA_FLOAT32", - GL_RGBA, - GL_FLOAT, - 32, 32, 32, 32, + MESA_FORMAT_RGB_SNORM16, + "MESA_FORMAT_RGB_SNORM16", + GL_RGB, + GL_SIGNED_NORMALIZED, + 16, 16, 16, 0, 0, 0, 0, 0, 0, - 1, 1, 16 + 1, 1, 6 }, { - MESA_FORMAT_RGBA_FLOAT16, - "MESA_FORMAT_RGBA_FLOAT16", + MESA_FORMAT_RGBA_SNORM16, + "MESA_FORMAT_RGBA_SNORM16", GL_RGBA, - GL_FLOAT, + GL_SIGNED_NORMALIZED, 16, 16, 16, 16, 0, 0, 0, 0, 0, 1, 1, 8 }, { - MESA_FORMAT_RGB_FLOAT32, - "MESA_FORMAT_RGB_FLOAT32", + MESA_FORMAT_RGBX_SNORM16, + "MESA_FORMAT_RGBX_SNORM16", GL_RGB, - GL_FLOAT, - 32, 32, 32, 0, + GL_SIGNED_NORMALIZED, + 16, 16, 16, 0, 0, 0, 0, 0, 0, - 1, 1, 12 + 1, 1, 8 }, + + /* Packed sRGB formats */ { - MESA_FORMAT_RGB_FLOAT16, - "MESA_FORMAT_RGB_FLOAT16", - GL_RGB, - GL_FLOAT, - 16, 16, 16, 0, + MESA_FORMAT_A8B8G8R8_SRGB, + "MESA_FORMAT_A8B8G8R8_SRGB", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 8, 0, 0, 0, 0, 0, - 1, 1, 6 + 1, 1, 4 }, { - MESA_FORMAT_A_FLOAT32, - "MESA_FORMAT_A_FLOAT32", - GL_ALPHA, + MESA_FORMAT_B8G8R8A8_SRGB, + "MESA_FORMAT_B8G8R8A8_SRGB", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 8, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_B8G8R8X8_SRGB, + "MESA_FORMAT_B8G8R8X8_SRGB", + GL_RGB, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 0, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_R8G8B8A8_SRGB, + "MESA_FORMAT_R8G8B8A8_SRGB", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 8, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_R8G8B8X8_SRGB, + "MESA_FORMAT_R8G8B8X8_SRGB", + GL_RGB, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 0, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_L8A8_SRGB, + "MESA_FORMAT_L8A8_SRGB", + GL_LUMINANCE_ALPHA, + GL_UNSIGNED_NORMALIZED, + 0, 0, 0, 8, + 8, 0, 0, 0, 0, + 1, 1, 2 + }, + + /* Array sRGB formats */ + { + MESA_FORMAT_L_SRGB8, + "MESA_FORMAT_L_SRGB8", + GL_LUMINANCE, + GL_UNSIGNED_NORMALIZED, + 0, 0, 0, 0, + 8, 0, 0, 0, 0, + 1, 1, 1 + }, + { + MESA_FORMAT_BGR_SRGB8, + "MESA_FORMAT_BGR_SRGB8", + GL_RGB, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 0, + 0, 0, 0, 0, 0, + 1, 1, 3 + }, + + /* Packed float formats */ + { + MESA_FORMAT_R9G9B9E5_FLOAT, + "MESA_FORMAT_RGB9_E5", + GL_RGB, GL_FLOAT, - 0, 0, 0, 32, + 9, 9, 9, 0, 0, 0, 0, 0, 0, 1, 1, 4 }, + { + MESA_FORMAT_R11G11B10_FLOAT, + "MESA_FORMAT_R11G11B10_FLOAT", + GL_RGB, + GL_FLOAT, + 11, 11, 10, 0, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_Z32_FLOAT_S8X24_UINT, /* Name */ + "MESA_FORMAT_Z32_FLOAT_S8X24_UINT", /* StrName */ + GL_DEPTH_STENCIL, /* BaseFormat */ + /* DataType here is used to answer GL_TEXTURE_DEPTH_TYPE queries, and is + * never used for stencil because stencil is always GL_UNSIGNED_INT. + */ + GL_FLOAT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 32, 8, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 8 /* BlockWidth/Height,Bytes */ + }, + + /* Array float formats */ { MESA_FORMAT_A_FLOAT16, "MESA_FORMAT_A_FLOAT16", @@ -693,12 +871,12 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 }, { - MESA_FORMAT_L_FLOAT32, - "MESA_FORMAT_L_FLOAT32", - GL_LUMINANCE, + MESA_FORMAT_A_FLOAT32, + "MESA_FORMAT_A_FLOAT32", + GL_ALPHA, GL_FLOAT, - 0, 0, 0, 0, - 32, 0, 0, 0, 0, + 0, 0, 0, 32, + 0, 0, 0, 0, 0, 1, 1, 4 }, { @@ -711,13 +889,13 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 }, { - MESA_FORMAT_LA_FLOAT32, - "MESA_FORMAT_LA_FLOAT32", - GL_LUMINANCE_ALPHA, + MESA_FORMAT_L_FLOAT32, + "MESA_FORMAT_L_FLOAT32", + GL_LUMINANCE, GL_FLOAT, - 0, 0, 0, 32, + 0, 0, 0, 0, 32, 0, 0, 0, 0, - 1, 1, 8 + 1, 1, 4 }, { MESA_FORMAT_LA_FLOAT16, @@ -728,6 +906,24 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 16, 0, 0, 0, 0, 1, 1, 4 }, + { + MESA_FORMAT_LA_FLOAT32, + "MESA_FORMAT_LA_FLOAT32", + GL_LUMINANCE_ALPHA, + GL_FLOAT, + 0, 0, 0, 32, + 32, 0, 0, 0, 0, + 1, 1, 8 + }, + { + MESA_FORMAT_I_FLOAT16, + "MESA_FORMAT_I_FLOAT16", + GL_INTENSITY, + GL_FLOAT, + 0, 0, 0, 0, + 0, 16, 0, 0, 0, + 1, 1, 2 + }, { MESA_FORMAT_I_FLOAT32, "MESA_FORMAT_I_FLOAT32", @@ -738,12 +934,12 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_I_FLOAT16, - "MESA_FORMAT_I_FLOAT16", - GL_INTENSITY, + MESA_FORMAT_R_FLOAT16, + "MESA_FORMAT_R_FLOAT16", + GL_RED, GL_FLOAT, - 0, 0, 0, 0, - 0, 16, 0, 0, 0, + 16, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 1, 2 }, { @@ -756,13 +952,13 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_R_FLOAT16, - "MESA_FORMAT_R_FLOAT16", - GL_RED, + MESA_FORMAT_RG_FLOAT16, + "MESA_FORMAT_RG_FLOAT16", + GL_RG, GL_FLOAT, - 16, 0, 0, 0, + 16, 16, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 2 + 1, 1, 4 }, { MESA_FORMAT_RG_FLOAT32, @@ -774,17 +970,90 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 8 }, { - MESA_FORMAT_RG_FLOAT16, - "MESA_FORMAT_RG_FLOAT16", - GL_RG, + MESA_FORMAT_RGB_FLOAT16, + "MESA_FORMAT_RGB_FLOAT16", + GL_RGB, GL_FLOAT, - 16, 16, 0, 0, + 16, 16, 16, 0, + 0, 0, 0, 0, 0, + 1, 1, 6 + }, + { + MESA_FORMAT_RGB_FLOAT32, + "MESA_FORMAT_RGB_FLOAT32", + GL_RGB, + GL_FLOAT, + 32, 32, 32, 0, + 0, 0, 0, 0, 0, + 1, 1, 12 + }, + { + MESA_FORMAT_RGBA_FLOAT16, + "MESA_FORMAT_RGBA_FLOAT16", + GL_RGBA, + GL_FLOAT, + 16, 16, 16, 16, + 0, 0, 0, 0, 0, + 1, 1, 8 + }, + { + MESA_FORMAT_RGBA_FLOAT32, + "MESA_FORMAT_RGBA_FLOAT32", + GL_RGBA, + GL_FLOAT, + 32, 32, 32, 32, + 0, 0, 0, 0, 0, + 1, 1, 16 + }, + { + MESA_FORMAT_RGBX_FLOAT16, + "MESA_FORMAT_RGBX_FLOAT16", + GL_RGB, + GL_FLOAT, + 16, 16, 16, 0, + 0, 0, 0, 0, 0, + 1, 1, 8 + }, + { + MESA_FORMAT_RGBX_FLOAT32, + "MESA_FORMAT_RGBX_FLOAT32", + GL_RGB, + GL_FLOAT, + 32, 32, 32, 0, + 0, 0, 0, 0, 0, + 1, 1, 16 + }, + { + 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 */ + 0, 0, 0, 32, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + + /* Packed signed/unsigned non-normalized integer formats */ + { + MESA_FORMAT_B10G10R10A2_UINT, + "MESA_FORMAT_B10G10R10A2_UINT", + GL_RGBA, + GL_UNSIGNED_INT, + 10, 10, 10, 2, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_R10G10B10A2_UINT, + "MESA_FORMAT_R10G10B10A2_UINT", + GL_RGBA, + GL_UNSIGNED_INT, + 10, 10, 10, 2, 0, 0, 0, 0, 0, 1, 1, 4 }, - /* unnormalized signed int formats */ - /* unnormalized unsigned int formats */ + /* Array signed/unsigned non-normalized integer formats */ { MESA_FORMAT_A_UINT8, "MESA_FORMAT_A_UINT8", @@ -1001,42 +1270,41 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 32, 0, 0, 0, 0, 1, 1, 8 }, - { - MESA_FORMAT_R_SINT8, - "MESA_FORMAT_R_SINT8", + MESA_FORMAT_R_UINT8, + "MESA_FORMAT_R_UINT8", GL_RED, - GL_INT, + GL_UNSIGNED_INT, 8, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1 }, { - MESA_FORMAT_RG_SINT8, - "MESA_FORMAT_RG_SINT8", - GL_RG, - GL_INT, - 8, 8, 0, 0, + MESA_FORMAT_R_UINT16, + "MESA_FORMAT_R_UINT16", + GL_RED, + GL_UNSIGNED_INT, + 16, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2 }, { - MESA_FORMAT_RGB_SINT8, - "MESA_FORMAT_RGB_SINT8", - GL_RGB, - GL_INT, - 8, 8, 8, 0, + MESA_FORMAT_R_UINT32, + "MESA_FORMAT_R_UINT32", + GL_RED, + GL_UNSIGNED_INT, + 32, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 3 + 1, 1, 4 }, { - MESA_FORMAT_RGBA_SINT8, - "MESA_FORMAT_RGBA_SINT8", - GL_RGBA, + MESA_FORMAT_R_SINT8, + "MESA_FORMAT_R_SINT8", + GL_RED, GL_INT, - 8, 8, 8, 8, + 8, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 4 + 1, 1, 1 }, { MESA_FORMAT_R_SINT16, @@ -1048,85 +1316,67 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 }, { - MESA_FORMAT_RG_SINT16, - "MESA_FORMAT_RG_SINT16", - GL_RG, + MESA_FORMAT_R_SINT32, + "MESA_FORMAT_R_SINT32", + GL_RED, GL_INT, - 16, 16, 0, 0, + 32, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 4 }, { - MESA_FORMAT_RGB_SINT16, - "MESA_FORMAT_RGB_SINT16", - GL_RGB, - GL_INT, - 16, 16, 16, 0, - 0, 0, 0, 0, 0, - 1, 1, 6 - }, - { - MESA_FORMAT_RGBA_SINT16, - "MESA_FORMAT_RGBA_SINT16", - GL_RGBA, - GL_INT, - 16, 16, 16, 16, + MESA_FORMAT_RG_UINT8, + "MESA_FORMAT_RG_UINT8", + GL_RG, + GL_UNSIGNED_INT, + 8, 8, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 8 + 1, 1, 2 }, { - MESA_FORMAT_R_SINT32, - "MESA_FORMAT_R_SINT32", - GL_RED, - GL_INT, - 32, 0, 0, 0, + MESA_FORMAT_RG_UINT16, + "MESA_FORMAT_RG_UINT16", + GL_RG, + GL_UNSIGNED_INT, + 16, 16, 0, 0, 0, 0, 0, 0, 0, 1, 1, 4 }, { - MESA_FORMAT_RG_SINT32, - "MESA_FORMAT_RG_SINT32", + MESA_FORMAT_RG_UINT32, + "MESA_FORMAT_RG_UINT32", GL_RG, - GL_INT, + GL_UNSIGNED_INT, 32, 32, 0, 0, 0, 0, 0, 0, 0, 1, 1, 8 }, { - MESA_FORMAT_RGB_SINT32, - "MESA_FORMAT_RGB_SINT32", - GL_RGB, + MESA_FORMAT_RG_SINT8, + "MESA_FORMAT_RG_SINT8", + GL_RG, GL_INT, - 32, 32, 32, 0, + 8, 8, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 12 + 1, 1, 2 }, { - MESA_FORMAT_RGBA_SINT32, - "MESA_FORMAT_RGBA_SINT32", - GL_RGBA, + MESA_FORMAT_RG_SINT16, + "MESA_FORMAT_RG_SINT16", + GL_RG, GL_INT, - 32, 32, 32, 32, - 0, 0, 0, 0, 0, - 1, 1, 16 - }, - { - MESA_FORMAT_R_UINT8, - "MESA_FORMAT_R_UINT8", - GL_RED, - GL_UNSIGNED_INT, - 8, 0, 0, 0, + 16, 16, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1 + 1, 1, 4 }, { - MESA_FORMAT_RG_UINT8, - "MESA_FORMAT_RG_UINT8", + MESA_FORMAT_RG_SINT32, + "MESA_FORMAT_RG_SINT32", GL_RG, - GL_UNSIGNED_INT, - 8, 8, 0, 0, + GL_INT, + 32, 32, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 2 + 1, 1, 8 }, { MESA_FORMAT_RGB_UINT8, @@ -1138,77 +1388,68 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 3 }, { - MESA_FORMAT_RGBA_UINT8, - "MESA_FORMAT_RGBA_UINT8", - GL_RGBA, + MESA_FORMAT_RGB_UINT16, + "MESA_FORMAT_RGB_UINT16", + GL_RGB, GL_UNSIGNED_INT, - 8, 8, 8, 8, + 16, 16, 16, 0, 0, 0, 0, 0, 0, - 1, 1, 4 + 1, 1, 6 }, { - MESA_FORMAT_R_UINT16, - "MESA_FORMAT_R_UINT16", - GL_RED, + MESA_FORMAT_RGB_UINT32, + "MESA_FORMAT_RGB_UINT32", + GL_RGB, GL_UNSIGNED_INT, - 16, 0, 0, 0, + 32, 32, 32, 0, 0, 0, 0, 0, 0, - 1, 1, 2 + 1, 1, 12 }, { - MESA_FORMAT_RG_UINT16, - "MESA_FORMAT_RG_UINT16", - GL_RG, - GL_UNSIGNED_INT, - 16, 16, 0, 0, + MESA_FORMAT_RGB_SINT8, + "MESA_FORMAT_RGB_SINT8", + GL_RGB, + GL_INT, + 8, 8, 8, 0, 0, 0, 0, 0, 0, - 1, 1, 4 + 1, 1, 3 }, { - MESA_FORMAT_RGB_UINT16, - "MESA_FORMAT_RGB_UINT16", + MESA_FORMAT_RGB_SINT16, + "MESA_FORMAT_RGB_SINT16", GL_RGB, - GL_UNSIGNED_INT, + GL_INT, 16, 16, 16, 0, 0, 0, 0, 0, 0, 1, 1, 6 }, { - MESA_FORMAT_RGBA_UINT16, - "MESA_FORMAT_RGBA_UINT16", - GL_RGBA, - GL_UNSIGNED_INT, - 16, 16, 16, 16, + MESA_FORMAT_RGB_SINT32, + "MESA_FORMAT_RGB_SINT32", + GL_RGB, + GL_INT, + 32, 32, 32, 0, 0, 0, 0, 0, 0, - 1, 1, 8 + 1, 1, 12 }, { - MESA_FORMAT_R_UINT32, - "MESA_FORMAT_R_UINT32", - GL_RED, + MESA_FORMAT_RGBA_UINT8, + "MESA_FORMAT_RGBA_UINT8", + GL_RGBA, GL_UNSIGNED_INT, - 32, 0, 0, 0, + 8, 8, 8, 8, 0, 0, 0, 0, 0, 1, 1, 4 }, { - MESA_FORMAT_RG_UINT32, - "MESA_FORMAT_RG_UINT32", - GL_RG, + MESA_FORMAT_RGBA_UINT16, + "MESA_FORMAT_RGBA_UINT16", + GL_RGBA, GL_UNSIGNED_INT, - 32, 32, 0, 0, + 16, 16, 16, 16, 0, 0, 0, 0, 0, 1, 1, 8 }, - { - MESA_FORMAT_RGB_UINT32, - "MESA_FORMAT_RGB_UINT32", - GL_RGB, - GL_UNSIGNED_INT, - 32, 32, 32, 0, - 0, 0, 0, 0, 0, - 1, 1, 12 - }, { MESA_FORMAT_RGBA_UINT32, "MESA_FORMAT_RGBA_UINT32", @@ -1218,595 +1459,359 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 0, 1, 1, 16 }, - - { - MESA_FORMAT_DUDV8, - "MESA_FORMAT_DUDV8", - GL_DUDV_ATI, - GL_SIGNED_NORMALIZED, - 0, 0, 0, 0, + MESA_FORMAT_RGBA_SINT8, + "MESA_FORMAT_RGBA_SINT8", + GL_RGBA, + GL_INT, + 8, 8, 8, 8, 0, 0, 0, 0, 0, - 1, 1, 2 + 1, 1, 4 }, - - /* Signed 8 bits / channel */ { - MESA_FORMAT_R_SNORM8, /* Name */ - "MESA_FORMAT_R_SNORM8", /* StrName */ - GL_RED, /* BaseFormat */ - GL_SIGNED_NORMALIZED, /* DataType */ - 8, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ - 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ - 1, 1, 1 /* BlockWidth/Height,Bytes */ + MESA_FORMAT_RGBA_SINT16, + "MESA_FORMAT_RGBA_SINT16", + GL_RGBA, + GL_INT, + 16, 16, 16, 16, + 0, 0, 0, 0, 0, + 1, 1, 8 }, { - MESA_FORMAT_R8G8_SNORM, - "MESA_FORMAT_R8G8_SNORM", - GL_RG, - GL_SIGNED_NORMALIZED, - 8, 8, 0, 0, + MESA_FORMAT_RGBA_SINT32, + "MESA_FORMAT_RGBA_SINT32", + GL_RGBA, + GL_INT, + 32, 32, 32, 32, 0, 0, 0, 0, 0, - 1, 1, 2 + 1, 1, 16 }, { - MESA_FORMAT_X8B8G8R8_SNORM, - "MESA_FORMAT_X8B8G8R8_SNORM", + MESA_FORMAT_RGBX_UINT8, + "MESA_FORMAT_RGBX_UINT8", GL_RGB, - GL_SIGNED_NORMALIZED, + GL_UNSIGNED_INT, 8, 8, 8, 0, 0, 0, 0, 0, 0, - 1, 1, 4 /* 4 bpp, but no alpha */ + 1, 1, 4 }, { - MESA_FORMAT_A8B8G8R8_SNORM, - "MESA_FORMAT_A8B8G8R8_SNORM", - GL_RGBA, - GL_SIGNED_NORMALIZED, - 8, 8, 8, 8, + MESA_FORMAT_RGBX_UINT16, + "MESA_FORMAT_RGBX_UINT16", + GL_RGB, + GL_UNSIGNED_INT, + 16, 16, 16, 0, 0, 0, 0, 0, 0, - 1, 1, 4 + 1, 1, 8 }, { - MESA_FORMAT_R8G8B8A8_SNORM, - "MESA_FORMAT_R8G8B8A8_SNORM", - GL_RGBA, - GL_SIGNED_NORMALIZED, - 8, 8, 8, 8, + MESA_FORMAT_RGBX_UINT32, + "MESA_FORMAT_RGBX_UINT32", + GL_RGB, + GL_UNSIGNED_INT, + 32, 32, 32, 0, 0, 0, 0, 0, 0, - 1, 1, 4 + 1, 1, 16 }, - - /* Signed 16 bits / channel */ { - MESA_FORMAT_R_SNORM16, - "MESA_FORMAT_R_SNORM16", - GL_RED, - GL_SIGNED_NORMALIZED, - 16, 0, 0, 0, - 0, 0, 0, 0, 0, - 1, 1, 2 - }, - { - MESA_FORMAT_R16G16_SNORM, - "MESA_FORMAT_R16G16_SNORM", - GL_RG, - GL_SIGNED_NORMALIZED, - 16, 16, 0, 0, + MESA_FORMAT_RGBX_SINT8, + "MESA_FORMAT_RGBX_SINT8", + GL_RGB, + GL_INT, + 8, 8, 8, 0, 0, 0, 0, 0, 0, 1, 1, 4 }, { - MESA_FORMAT_RGB_SNORM16, - "MESA_FORMAT_RGB_SNORM16", + MESA_FORMAT_RGBX_SINT16, + "MESA_FORMAT_RGBX_SINT16", GL_RGB, - GL_SIGNED_NORMALIZED, + GL_INT, 16, 16, 16, 0, 0, 0, 0, 0, 0, - 1, 1, 6 - }, - { - MESA_FORMAT_RGBA_SNORM16, - "MESA_FORMAT_RGBA_SNORM16", - GL_RGBA, - GL_SIGNED_NORMALIZED, - 16, 16, 16, 16, - 0, 0, 0, 0, 0, - 1, 1, 8 - }, - { - MESA_FORMAT_RGBA_UNORM16, - "MESA_FORMAT_RGBA_UNORM16", - GL_RGBA, - GL_UNSIGNED_NORMALIZED, - 16, 16, 16, 16, - 0, 0, 0, 0, 0, 1, 1, 8 }, { - MESA_FORMAT_R_RGTC1_UNORM, - "MESA_FORMAT_R_RGTC1_UNORM", - GL_RED, - GL_UNSIGNED_NORMALIZED, - 8, 0, 0, 0, - 0, 0, 0, 0, 0, - 4, 4, 8 /* 8 bytes per 4x4 block */ - }, - { - MESA_FORMAT_R_RGTC1_SNORM, - "MESA_FORMAT_R_RGTC1_SNORM", - GL_RED, - GL_SIGNED_NORMALIZED, - 8, 0, 0, 0, - 0, 0, 0, 0, 0, - 4, 4, 8 /* 8 bytes per 4x4 block */ - }, - { - MESA_FORMAT_RG_RGTC2_UNORM, - "MESA_FORMAT_RG_RGTC2_UNORM", - GL_RG, - GL_UNSIGNED_NORMALIZED, - 8, 8, 0, 0, - 0, 0, 0, 0, 0, - 4, 4, 16 /* 16 bytes per 4x4 block */ - }, - { - MESA_FORMAT_RG_RGTC2_SNORM, - "MESA_FORMAT_RG_RGTC2_SNORM", - GL_RG, - GL_SIGNED_NORMALIZED, - 8, 8, 0, 0, - 0, 0, 0, 0, 0, - 4, 4, 16 /* 16 bytes per 4x4 block */ - }, - { - MESA_FORMAT_L_LATC1_UNORM, - "MESA_FORMAT_L_LATC1_UNORM", - GL_LUMINANCE, - GL_UNSIGNED_NORMALIZED, - 0, 0, 0, 0, - 4, 0, 0, 0, 0, - 4, 4, 8 /* 8 bytes per 4x4 block */ - }, - { - MESA_FORMAT_L_LATC1_SNORM, - "MESA_FORMAT_L_LATC1_SNORM", - GL_LUMINANCE, - GL_SIGNED_NORMALIZED, - 0, 0, 0, 0, - 4, 0, 0, 0, 0, - 4, 4, 8 /* 8 bytes per 4x4 block */ - }, - { - MESA_FORMAT_LA_LATC2_UNORM, - "MESA_FORMAT_LA_LATC2_UNORM", - GL_LUMINANCE_ALPHA, - GL_UNSIGNED_NORMALIZED, - 0, 0, 0, 4, - 4, 0, 0, 0, 0, - 4, 4, 16 /* 16 bytes per 4x4 block */ - }, - { - MESA_FORMAT_LA_LATC2_SNORM, - "MESA_FORMAT_LA_LATC2_SNORM", - GL_LUMINANCE_ALPHA, - GL_SIGNED_NORMALIZED, - 0, 0, 0, 4, - 4, 0, 0, 0, 0, - 4, 4, 16 /* 16 bytes per 4x4 block */ - }, - - { - MESA_FORMAT_ETC1_RGB8, - "MESA_FORMAT_ETC1_RGB8", - GL_RGB, - GL_UNSIGNED_NORMALIZED, - 8, 8, 8, 0, - 0, 0, 0, 0, 0, - 4, 4, 8 /* 8 bytes per 4x4 block */ - }, - - { - MESA_FORMAT_ETC2_RGB8, - "MESA_FORMAT_ETC2_RGB8", + MESA_FORMAT_RGBX_SINT32, + "MESA_FORMAT_RGBX_SINT32", GL_RGB, - GL_UNSIGNED_NORMALIZED, - 8, 8, 8, 0, + GL_INT, + 32, 32, 32, 0, 0, 0, 0, 0, 0, - 4, 4, 8 /* 8 bytes per 4x4 block */ + 1, 1, 16 }, + /* DXT compressed formats */ { - MESA_FORMAT_ETC2_SRGB8, - "MESA_FORMAT_ETC2_SRGB8", - GL_RGB, - GL_UNSIGNED_NORMALIZED, - 8, 8, 8, 0, - 0, 0, 0, 0, 0, - 4, 4, 8 /* 8 bytes per 4x4 block */ + MESA_FORMAT_RGB_DXT1, /* Name */ + "MESA_FORMAT_RGB_DXT1", /* StrName */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 4, 4, 4, 0, /* approx Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 4, 4, 8 /* 8 bytes per 4x4 block */ }, - { - MESA_FORMAT_ETC2_RGBA8_EAC, - "MESA_FORMAT_ETC2_RGBA8_EAC", + MESA_FORMAT_RGBA_DXT1, + "MESA_FORMAT_RGBA_DXT1", GL_RGBA, - GL_UNSIGNED_NORMALIZED, - 8, 8, 8, 8, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, 0, 0, 0, 0, 0, - 4, 4, 16 /* 16 bytes per 4x4 block */ + 4, 4, 8 /* 8 bytes per 4x4 block */ }, - { - MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC, - "MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC", + MESA_FORMAT_RGBA_DXT3, + "MESA_FORMAT_RGBA_DXT3", GL_RGBA, - GL_UNSIGNED_NORMALIZED, - 8, 8, 8, 8, - 0, 0, 0, 0, 0, - 4, 4, 16 /* 16 bytes per 4x4 block */ - }, - - { - MESA_FORMAT_ETC2_R11_EAC, - "MESA_FORMAT_ETC2_R11_EAC", - GL_RED, - GL_UNSIGNED_NORMALIZED, - 11, 0, 0, 0, - 0, 0, 0, 0, 0, - 4, 4, 8 /* 8 bytes per 4x4 block */ - }, - - { - MESA_FORMAT_ETC2_RG11_EAC, - "MESA_FORMAT_ETC2_RG11_EAC", - GL_RG, - GL_UNSIGNED_NORMALIZED, - 11, 11, 0, 0, - 0, 0, 0, 0, 0, - 4, 4, 16 /* 16 bytes per 4x4 block */ - }, - - { - MESA_FORMAT_ETC2_SIGNED_R11_EAC, - "MESA_FORMAT_ETC2_SIGNED_R11_EAC", - GL_RED, - GL_SIGNED_NORMALIZED, - 11, 0, 0, 0, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, 0, 0, 0, 0, 0, - 4, 4, 8 /* 8 bytes per 4x4 block */ + 4, 4, 16 /* 16 bytes per 4x4 block */ }, - { - MESA_FORMAT_ETC2_SIGNED_RG11_EAC, - "MESA_FORMAT_ETC2_SIGNED_RG11_EAC", - GL_RG, - GL_SIGNED_NORMALIZED, - 11, 11, 0, 0, + MESA_FORMAT_RGBA_DXT5, + "MESA_FORMAT_RGBA_DXT5", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, 0, 0, 0, 0, 0, - 4, 4, 16 /* 16 bytes per 4x4 block */ + 4, 4, 16 /* 16 bytes per 4x4 block */ }, + /* DXT sRGB compressed formats */ { - MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1, - "MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1", - GL_RGBA, - GL_UNSIGNED_NORMALIZED, - 8, 8, 8, 1, - 0, 0, 0, 0, 0, - 4, 4, 8 /* 8 bytes per 4x4 block */ + MESA_FORMAT_SRGB_DXT1, /* Name */ + "MESA_FORMAT_SRGB_DXT1", /* StrName */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 4, 4, 4, 0, /* approx Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 4, 4, 8 /* 8 bytes per 4x4 block */ }, - { - MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1, - "MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1", + MESA_FORMAT_SRGBA_DXT1, + "MESA_FORMAT_SRGBA_DXT1", GL_RGBA, GL_UNSIGNED_NORMALIZED, - 8, 8, 8, 1, - 0, 0, 0, 0, 0, - 4, 4, 8 /* 8 bytes per 4x4 block */ - }, - - /* Signed formats from EXT_texture_snorm that are not in GL3.1 */ - { - MESA_FORMAT_A_SNORM8, - "MESA_FORMAT_A_SNORM8", - GL_ALPHA, - GL_SIGNED_NORMALIZED, - 0, 0, 0, 8, - 0, 0, 0, 0, 0, - 1, 1, 1 - }, - { - MESA_FORMAT_L_SNORM8, - "MESA_FORMAT_L_SNORM8", - GL_LUMINANCE, - GL_SIGNED_NORMALIZED, - 0, 0, 0, 0, - 8, 0, 0, 0, 0, - 1, 1, 1 - }, - { - MESA_FORMAT_L8A8_SNORM, - "MESA_FORMAT_L8A8_SNORM", - GL_LUMINANCE_ALPHA, - GL_SIGNED_NORMALIZED, - 0, 0, 0, 8, - 8, 0, 0, 0, 0, - 1, 1, 2 - }, - { - MESA_FORMAT_I_SNORM8, - "MESA_FORMAT_I_SNORM8", - GL_INTENSITY, - GL_SIGNED_NORMALIZED, - 0, 0, 0, 0, - 0, 8, 0, 0, 0, - 1, 1, 1 - }, - { - MESA_FORMAT_A_SNORM16, - "MESA_FORMAT_A_SNORM16", - GL_ALPHA, - GL_SIGNED_NORMALIZED, - 0, 0, 0, 16, - 0, 0, 0, 0, 0, - 1, 1, 2 - }, - { - MESA_FORMAT_L_SNORM16, - "MESA_FORMAT_L_SNORM16", - GL_LUMINANCE, - GL_SIGNED_NORMALIZED, - 0, 0, 0, 0, - 16, 0, 0, 0, 0, - 1, 1, 2 - }, - { - MESA_FORMAT_LA_SNORM16, - "MESA_FORMAT_LA_SNORM16", - GL_LUMINANCE_ALPHA, - GL_SIGNED_NORMALIZED, - 0, 0, 0, 16, - 16, 0, 0, 0, 0, - 1, 1, 4 - }, - { - MESA_FORMAT_I_SNORM16, - "MESA_FORMAT_I_SNORM16", - GL_INTENSITY, - GL_SIGNED_NORMALIZED, - 0, 0, 0, 0, - 0, 16, 0, 0, 0, - 1, 1, 2 - }, - { - MESA_FORMAT_R9G9B9E5_FLOAT, - "MESA_FORMAT_RGB9_E5", - GL_RGB, - GL_FLOAT, - 9, 9, 9, 0, - 0, 0, 0, 0, 0, - 1, 1, 4 - }, - { - MESA_FORMAT_R11G11B10_FLOAT, - "MESA_FORMAT_R11G11B10_FLOAT", - GL_RGB, - GL_FLOAT, - 11, 11, 10, 0, + 4, 4, 4, 4, 0, 0, 0, 0, 0, - 1, 1, 4 - }, - /* ARB_depth_buffer_float */ - { - 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 */ - 0, 0, 0, 32, 0, /* Lum/Int/Index/Depth/StencilBits */ - 1, 1, 4 /* BlockWidth/Height,Bytes */ - }, - { - MESA_FORMAT_Z32_FLOAT_S8X24_UINT, /* Name */ - "MESA_FORMAT_Z32_FLOAT_S8X24_UINT", /* StrName */ - GL_DEPTH_STENCIL, /* BaseFormat */ - /* DataType here is used to answer GL_TEXTURE_DEPTH_TYPE queries, and is - * never used for stencil because stencil is always GL_UNSIGNED_INT. - */ - GL_FLOAT, /* DataType */ - 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ - 0, 0, 0, 32, 8, /* Lum/Int/Index/Depth/StencilBits */ - 1, 1, 8 /* BlockWidth/Height,Bytes */ + 4, 4, 8 /* 8 bytes per 4x4 block */ }, { - MESA_FORMAT_B10G10R10A2_UINT, - "MESA_FORMAT_B10G10R10A2_UINT", + MESA_FORMAT_SRGBA_DXT3, + "MESA_FORMAT_SRGBA_DXT3", GL_RGBA, - GL_UNSIGNED_INT, - 10, 10, 10, 2, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, 0, 0, 0, 0, 0, - 1, 1, 4 + 4, 4, 16 /* 16 bytes per 4x4 block */ }, { - MESA_FORMAT_R10G10B10A2_UINT, - "MESA_FORMAT_R10G10B10A2_UINT", + MESA_FORMAT_SRGBA_DXT5, + "MESA_FORMAT_SRGBA_DXT5", GL_RGBA, - GL_UNSIGNED_INT, - 10, 10, 10, 2, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, 0, 0, 0, 0, 0, - 1, 1, 4 + 4, 4, 16 /* 16 bytes per 4x4 block */ }, + + /* FXT1 compressed formats */ { - MESA_FORMAT_B4G4R4X4_UNORM, - "MESA_FORMAT_B4G4R4X4_UNORM", + MESA_FORMAT_RGB_FXT1, + "MESA_FORMAT_RGB_FXT1", GL_RGB, GL_UNSIGNED_NORMALIZED, - 4, 4, 4, 0, + 4, 4, 4, 0, /* approx Red/Green/BlueBits */ 0, 0, 0, 0, 0, - 1, 1, 2 + 8, 4, 16 /* 16 bytes per 8x4 block */ }, { - MESA_FORMAT_B5G5R5X1_UNORM, - "MESA_FORMAT_B5G5R5X1_UNORM", - GL_RGB, + MESA_FORMAT_RGBA_FXT1, + "MESA_FORMAT_RGBA_FXT1", + GL_RGBA, GL_UNSIGNED_NORMALIZED, - 5, 5, 5, 0, + 4, 4, 4, 1, /* approx Red/Green/Blue/AlphaBits */ 0, 0, 0, 0, 0, - 1, 1, 2 + 8, 4, 16 /* 16 bytes per 8x4 block */ }, + + /* RGTC compressed formats */ { - MESA_FORMAT_R8G8B8X8_SNORM, - "MESA_FORMAT_R8G8B8X8_SNORM", - GL_RGB, - GL_SIGNED_NORMALIZED, - 8, 8, 8, 0, - 0, 0, 0, 0, 0, - 1, 1, 4 + MESA_FORMAT_R_RGTC1_UNORM, + "MESA_FORMAT_R_RGTC1_UNORM", + GL_RED, + GL_UNSIGNED_NORMALIZED, + 8, 0, 0, 0, + 0, 0, 0, 0, 0, + 4, 4, 8 /* 8 bytes per 4x4 block */ }, { - MESA_FORMAT_R8G8B8X8_SRGB, - "MESA_FORMAT_R8G8B8X8_SRGB", - GL_RGB, - GL_UNSIGNED_NORMALIZED, - 8, 8, 8, 0, - 0, 0, 0, 0, 0, - 1, 1, 4 + MESA_FORMAT_R_RGTC1_SNORM, + "MESA_FORMAT_R_RGTC1_SNORM", + GL_RED, + GL_SIGNED_NORMALIZED, + 8, 0, 0, 0, + 0, 0, 0, 0, 0, + 4, 4, 8 /* 8 bytes per 4x4 block */ }, { - MESA_FORMAT_RGBX_UINT8, - "MESA_FORMAT_RGBX_UINT8", - GL_RGB, - GL_UNSIGNED_INT, - 8, 8, 8, 0, - 0, 0, 0, 0, 0, - 1, 1, 4 + MESA_FORMAT_RG_RGTC2_UNORM, + "MESA_FORMAT_RG_RGTC2_UNORM", + GL_RG, + GL_UNSIGNED_NORMALIZED, + 8, 8, 0, 0, + 0, 0, 0, 0, 0, + 4, 4, 16 /* 16 bytes per 4x4 block */ }, { - MESA_FORMAT_RGBX_SINT8, - "MESA_FORMAT_RGBX_SINT8", - GL_RGB, - GL_INT, - 8, 8, 8, 0, - 0, 0, 0, 0, 0, - 1, 1, 4 + MESA_FORMAT_RG_RGTC2_SNORM, + "MESA_FORMAT_RG_RGTC2_SNORM", + GL_RG, + GL_SIGNED_NORMALIZED, + 8, 8, 0, 0, + 0, 0, 0, 0, 0, + 4, 4, 16 /* 16 bytes per 4x4 block */ }, + + /* LATC1/2 compressed formats */ { - MESA_FORMAT_B10G10R10X2_UNORM, - "MESA_FORMAT_B10G10R10X2_UNORM", - GL_RGB, - GL_UNSIGNED_NORMALIZED, - 10, 10, 10, 0, - 0, 0, 0, 0, 0, - 1, 1, 4 + MESA_FORMAT_L_LATC1_UNORM, + "MESA_FORMAT_L_LATC1_UNORM", + GL_LUMINANCE, + GL_UNSIGNED_NORMALIZED, + 0, 0, 0, 0, + 4, 0, 0, 0, 0, + 4, 4, 8 /* 8 bytes per 4x4 block */ }, { - MESA_FORMAT_RGBX_UNORM16, - "MESA_FORMAT_RGBX_UNORM16", - GL_RGB, - GL_UNSIGNED_NORMALIZED, - 16, 16, 16, 0, - 0, 0, 0, 0, 0, - 1, 1, 8 + MESA_FORMAT_L_LATC1_SNORM, + "MESA_FORMAT_L_LATC1_SNORM", + GL_LUMINANCE, + GL_SIGNED_NORMALIZED, + 0, 0, 0, 0, + 4, 0, 0, 0, 0, + 4, 4, 8 /* 8 bytes per 4x4 block */ }, { - MESA_FORMAT_RGBX_SNORM16, - "MESA_FORMAT_RGBX_SNORM16", - GL_RGB, - GL_SIGNED_NORMALIZED, - 16, 16, 16, 0, - 0, 0, 0, 0, 0, - 1, 1, 8 + MESA_FORMAT_LA_LATC2_UNORM, + "MESA_FORMAT_LA_LATC2_UNORM", + GL_LUMINANCE_ALPHA, + GL_UNSIGNED_NORMALIZED, + 0, 0, 0, 4, + 4, 0, 0, 0, 0, + 4, 4, 16 /* 16 bytes per 4x4 block */ }, { - MESA_FORMAT_RGBX_FLOAT16, - "MESA_FORMAT_RGBX_FLOAT16", - GL_RGB, - GL_FLOAT, - 16, 16, 16, 0, - 0, 0, 0, 0, 0, - 1, 1, 8 + MESA_FORMAT_LA_LATC2_SNORM, + "MESA_FORMAT_LA_LATC2_SNORM", + GL_LUMINANCE_ALPHA, + GL_SIGNED_NORMALIZED, + 0, 0, 0, 4, + 4, 0, 0, 0, 0, + 4, 4, 16 /* 16 bytes per 4x4 block */ }, + + /* ETC1/2 compressed formats */ { - MESA_FORMAT_RGBX_UINT16, - "MESA_FORMAT_RGBX_UINT16", + MESA_FORMAT_ETC1_RGB8, + "MESA_FORMAT_ETC1_RGB8", GL_RGB, - GL_UNSIGNED_INT, - 16, 16, 16, 0, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 0, 0, 0, 0, 0, 0, - 1, 1, 8 + 4, 4, 8 /* 8 bytes per 4x4 block */ }, { - MESA_FORMAT_RGBX_SINT16, - "MESA_FORMAT_RGBX_SINT16", + MESA_FORMAT_ETC2_RGB8, + "MESA_FORMAT_ETC2_RGB8", GL_RGB, - GL_INT, - 16, 16, 16, 0, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 0, 0, 0, 0, 0, 0, - 1, 1, 8 + 4, 4, 8 /* 8 bytes per 4x4 block */ }, { - MESA_FORMAT_RGBX_FLOAT32, - "MESA_FORMAT_RGBX_FLOAT32", + MESA_FORMAT_ETC2_SRGB8, + "MESA_FORMAT_ETC2_SRGB8", GL_RGB, - GL_FLOAT, - 32, 32, 32, 0, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 0, 0, 0, 0, 0, 0, - 1, 1, 16 + 4, 4, 8 /* 8 bytes per 4x4 block */ }, { - MESA_FORMAT_RGBX_UINT32, - "MESA_FORMAT_RGBX_UINT32", - GL_RGB, - GL_UNSIGNED_INT, - 32, 32, 32, 0, + MESA_FORMAT_ETC2_RGBA8_EAC, + "MESA_FORMAT_ETC2_RGBA8_EAC", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 8, 0, 0, 0, 0, 0, - 1, 1, 16 + 4, 4, 16 /* 16 bytes per 4x4 block */ }, { - MESA_FORMAT_RGBX_SINT32, - "MESA_FORMAT_RGBX_SINT32", - GL_RGB, - GL_INT, - 32, 32, 32, 0, + MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC, + "MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 8, 0, 0, 0, 0, 0, - 1, 1, 16 + 4, 4, 16 /* 16 bytes per 4x4 block */ }, { - MESA_FORMAT_R10G10B10A2_UNORM, - "MESA_FORMAT_R10G10B10A2_UNORM", - GL_RGBA, + MESA_FORMAT_ETC2_R11_EAC, + "MESA_FORMAT_ETC2_R11_EAC", + GL_RED, GL_UNSIGNED_NORMALIZED, - 10, 10, 10, 2, + 11, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 4 + 4, 4, 8 /* 8 bytes per 4x4 block */ }, { - MESA_FORMAT_G8R8_SNORM, - "MESA_FORMAT_G8R8_SNORM", + MESA_FORMAT_ETC2_RG11_EAC, + "MESA_FORMAT_ETC2_RG11_EAC", GL_RG, + GL_UNSIGNED_NORMALIZED, + 11, 11, 0, 0, + 0, 0, 0, 0, 0, + 4, 4, 16 /* 16 bytes per 4x4 block */ + }, + { + MESA_FORMAT_ETC2_SIGNED_R11_EAC, + "MESA_FORMAT_ETC2_SIGNED_R11_EAC", + GL_RED, GL_SIGNED_NORMALIZED, - 8, 8, 0, 0, + 11, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 2 + 4, 4, 8 /* 8 bytes per 4x4 block */ }, { - MESA_FORMAT_G16R16_SNORM, - "MESA_FORMAT_G16R16_SNORM", + MESA_FORMAT_ETC2_SIGNED_RG11_EAC, + "MESA_FORMAT_ETC2_SIGNED_RG11_EAC", GL_RG, GL_SIGNED_NORMALIZED, - 16, 16, 0, 0, + 11, 11, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 4 + 4, 4, 16 /* 16 bytes per 4x4 block */ }, { - MESA_FORMAT_B8G8R8X8_SRGB, - "MESA_FORMAT_B8G8R8X8_SRGB", - GL_RGB, + MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1, + "MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1", + GL_RGBA, GL_UNSIGNED_NORMALIZED, - 8, 8, 8, 0, + 8, 8, 8, 1, 0, 0, 0, 0, 0, - 1, 1, 4 + 4, 4, 8 /* 8 bytes per 4x4 block */ + }, + { + MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1, + "MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1", + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 1, + 0, 0, 0, 0, 0, + 4, 4, 8 /* 8 bytes per 4x4 block */ }, }; diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 89bb24f1db6..29609d1b04a 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -167,148 +167,139 @@ typedef enum * Alpha, if present is linear. * */ - /*@{*/ - /* Type P formats */ /* msb <------ TEXEL BITS -----------> lsb */ + /* Packed unorm formats */ /* msb <------ TEXEL BITS -----------> lsb */ /* ---- ---- ---- ---- ---- ---- ---- ---- */ MESA_FORMAT_A8B8G8R8_UNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */ - MESA_FORMAT_R8G8B8A8_UNORM, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */ - MESA_FORMAT_B8G8R8A8_UNORM, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */ - MESA_FORMAT_A8R8G8B8_UNORM, /* BBBB BBBB GGGG GGGG RRRR RRRR AAAA AAAA */ MESA_FORMAT_X8B8G8R8_UNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB xxxx xxxx */ + MESA_FORMAT_R8G8B8A8_UNORM, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */ MESA_FORMAT_R8G8B8X8_UNORM, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */ + MESA_FORMAT_B8G8R8A8_UNORM, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */ MESA_FORMAT_B8G8R8X8_UNORM, /* xxxx xxxx RRRR RRRR GGGG GGGG BBBB BBBB */ + MESA_FORMAT_A8R8G8B8_UNORM, /* BBBB BBBB GGGG GGGG RRRR RRRR AAAA AAAA */ MESA_FORMAT_X8R8G8B8_UNORM, /* BBBB BBBB GGGG GGGG RRRR RRRR xxxx xxxx */ - - /* 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_L16A16_UNORM, /* AAAA AAAA AAAA AAAA LLLL LLLL LLLL LLLL */ + MESA_FORMAT_A16L16_UNORM, /* LLLL LLLL LLLL LLLL AAAA AAAA AAAA AAAA */ MESA_FORMAT_B5G6R5_UNORM, /* RRRR RGGG GGGB BBBB */ MESA_FORMAT_R5G6B5_UNORM, /* BBBB BGGG GGGR RRRR */ MESA_FORMAT_B4G4R4A4_UNORM, /* AAAA RRRR GGGG BBBB */ + MESA_FORMAT_B4G4R4X4_UNORM, /* xxxx RRRR GGGG BBBB */ MESA_FORMAT_A4R4G4B4_UNORM, /* BBBB GGGG RRRR AAAA */ MESA_FORMAT_A1B5G5R5_UNORM, /* RRRR RGGG GGBB BBBA */ MESA_FORMAT_B5G5R5A1_UNORM, /* ARRR RRGG GGGB BBBB */ + MESA_FORMAT_B5G5R5X1_UNORM, /* xRRR RRGG GGGB BBBB */ MESA_FORMAT_A1R5G5B5_UNORM, /* BBBB BGGG GGRR RRRA */ - MESA_FORMAT_L4A4_UNORM, /* AAAA LLLL */ MESA_FORMAT_L8A8_UNORM, /* AAAA AAAA LLLL LLLL */ MESA_FORMAT_A8L8_UNORM, /* LLLL LLLL AAAA AAAA */ - MESA_FORMAT_L16A16_UNORM, /* AAAA AAAA AAAA AAAA LLLL LLLL LLLL LLLL */ - MESA_FORMAT_A16L16_UNORM, /* LLLL LLLL LLLL LLLL AAAA AAAA AAAA AAAA */ - MESA_FORMAT_B2G3R3_UNORM, /* RRRG GGBB */ - - /* 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 */ - - /* Type A format(s) */ - MESA_FORMAT_R_UNORM8, /* uchar[i] = R */ - - /* Type P formats */ MESA_FORMAT_R8G8_UNORM, /* GGGG GGGG RRRR RRRR */ MESA_FORMAT_G8R8_UNORM, /* RRRR RRRR GGGG GGGG */ + MESA_FORMAT_L4A4_UNORM, /* AAAA LLLL */ + MESA_FORMAT_B2G3R3_UNORM, /* RRRG GGBB */ - /* Type A format(s) */ - MESA_FORMAT_R_UNORM16, /* ushort[i] = R */ - - /* Type P formats */ MESA_FORMAT_R16G16_UNORM, /* GGGG GGGG GGGG GGGG RRRR RRRR RRRR RRRR */ MESA_FORMAT_G16R16_UNORM, /* RRRR RRRR RRRR RRRR GGGG GGGG GGGG GGGG */ MESA_FORMAT_B10G10R10A2_UNORM,/* AARR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */ + MESA_FORMAT_B10G10R10X2_UNORM,/* xxRR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */ + MESA_FORMAT_R10G10B10A2_UNORM,/* AABB BBBB BBBB GGGG GGGG GGRR RRRR RRRR */ + MESA_FORMAT_S8_UINT_Z24_UNORM,/* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ SSSS SSSS */ + MESA_FORMAT_X8Z24_UNORM, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ xxxx xxxx */ MESA_FORMAT_Z24_UNORM_S8_UINT,/* SSSS SSSS ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ + MESA_FORMAT_Z24_UNORM_X8_UINT,/* xxxx xxxx ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ - /* Type A format(s) */ - MESA_FORMAT_Z_UNORM16, /* ushort[i] = Z */ + MESA_FORMAT_YCBCR, /* YYYY YYYY UorV UorV */ + MESA_FORMAT_YCBCR_REV, /* UorV UorV YYYY YYYY */ - /* Type P formats */ - MESA_FORMAT_Z24_UNORM_X8_UINT,/* xxxx xxxx ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ - MESA_FORMAT_X8Z24_UNORM, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ xxxx xxxx */ + MESA_FORMAT_DUDV8, /* DUDU DUDU DVDV DVDV */ + + /* Array unorm formats */ + MESA_FORMAT_A_UNORM8, /* ubyte[i] = A */ + MESA_FORMAT_A_UNORM16, /* ushort[i] = A */ + MESA_FORMAT_L_UNORM8, /* ubyte[i] = L */ + MESA_FORMAT_L_UNORM16, /* ushort[i] = L */ + MESA_FORMAT_I_UNORM8, /* ubyte[i] = I */ + MESA_FORMAT_I_UNORM16, /* ushort[i] = I */ + MESA_FORMAT_R_UNORM8, /* ubyte[i] = R */ + MESA_FORMAT_R_UNORM16, /* ushort[i] = R */ + MESA_FORMAT_BGR_UNORM8, /* ubyte[i*3] = B, [i*3+1] = G, [i*3+2] = R */ + MESA_FORMAT_RGB_UNORM8, /* ubyte[i*3] = R, [i*3+1] = G, [i*3+2] = B */ + MESA_FORMAT_RGBA_UNORM16, /* ushort[i] = R, [1] = G, [2] = B, [3] = A */ + MESA_FORMAT_RGBX_UNORM16, - /* Type A formats */ + MESA_FORMAT_Z_UNORM16, /* ushort[i] = Z */ MESA_FORMAT_Z_UNORM32, /* uint[i] = Z */ - MESA_FORMAT_S_UINT8, /* uchar[i] = S */ - /*@}*/ + MESA_FORMAT_S_UINT8, /* ubyte[i] = S */ - /** - * \name 8-bit/channel sRGB formats - */ - /*@{*/ - /* Type A format(s) */ - MESA_FORMAT_BGR_SRGB8, /* uchar[i * 3] = B, [i * 3 + 1] = G, [i *3 + 2] = R */ + /* Packed signed/normalized formats */ + /* msb <------ TEXEL BITS -----------> lsb */ + /* ---- ---- ---- ---- ---- ---- ---- ---- */ + MESA_FORMAT_A8B8G8R8_SNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */ + MESA_FORMAT_X8B8G8R8_SNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB xxxx xxxx */ + MESA_FORMAT_R8G8B8A8_SNORM, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */ + MESA_FORMAT_R8G8B8X8_SNORM, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */ + MESA_FORMAT_R16G16_SNORM, /* GGGG GGGG GGGG GGGG RRRR RRRR RRRR RRRR */ + MESA_FORMAT_G16R16_SNORM, /* RRRR RRRR RRRR RRRR GGGG GGGG GGGG GGGG */ + MESA_FORMAT_R8G8_SNORM, /* GGGG GGGG RRRR RRRR */ + MESA_FORMAT_G8R8_SNORM, /* RRRR RRRR GGGG GGGG */ + MESA_FORMAT_L8A8_SNORM, /* AAAA AAAA LLLL LLLL */ + + /* Array signed/normalized formats */ + MESA_FORMAT_A_SNORM8, /* byte[i] = A */ + MESA_FORMAT_A_SNORM16, /* short[i] = A */ + MESA_FORMAT_L_SNORM8, /* byte[i] = L */ + MESA_FORMAT_L_SNORM16, /* short[i] = L */ + MESA_FORMAT_I_SNORM8, /* byte[i] = I */ + MESA_FORMAT_I_SNORM16, /* short[i] = I */ + MESA_FORMAT_R_SNORM8, /* byte[i] = R */ + MESA_FORMAT_R_SNORM16, /* short[i] = R */ + MESA_FORMAT_LA_SNORM16, /* short[i * 2] = L, [i * 2 + 1] = A */ + MESA_FORMAT_RGB_SNORM16, /* short[i*3] = R, [i*3+1] = G, [i*3+2] = B */ + MESA_FORMAT_RGBA_SNORM16, /* ... */ + MESA_FORMAT_RGBX_SNORM16, /* ... */ - /* Type P formats */ + /* Packed sRGB formats */ MESA_FORMAT_A8B8G8R8_SRGB, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */ MESA_FORMAT_B8G8R8A8_SRGB, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */ + MESA_FORMAT_B8G8R8X8_SRGB, /* xxxx xxxx RRRR RRRR GGGG GGGG BBBB BBBB */ MESA_FORMAT_R8G8B8A8_SRGB, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */ - - /* Type A format(s) */ - MESA_FORMAT_L_SRGB8, /* uchar[i] = L */ - - /* Type P formats */ + MESA_FORMAT_R8G8B8X8_SRGB, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */ MESA_FORMAT_L8A8_SRGB, /* AAAA AAAA LLLL LLLL */ - /* Type C formats */ - MESA_FORMAT_SRGB_DXT1, - MESA_FORMAT_SRGBA_DXT1, - MESA_FORMAT_SRGBA_DXT3, - MESA_FORMAT_SRGBA_DXT5, - /*@}*/ - - /** - * \name Compressed texture formats. - */ - /*@{*/ - /* Type C formats */ - MESA_FORMAT_RGB_FXT1, - MESA_FORMAT_RGBA_FXT1, - MESA_FORMAT_RGB_DXT1, - MESA_FORMAT_RGBA_DXT1, - MESA_FORMAT_RGBA_DXT3, - MESA_FORMAT_RGBA_DXT5, - /*@}*/ + /* Array sRGB formats */ + MESA_FORMAT_L_SRGB8, /* ubyte[i] = L */ + MESA_FORMAT_BGR_SRGB8, /* ubyte[i*3] = B, [i*3+1] = G, [i*3+2] = R */ - /** - * \name Floating point texture formats. - */ - /*@{*/ + /* Packed float formats */ + MESA_FORMAT_R9G9B9E5_FLOAT, + MESA_FORMAT_R11G11B10_FLOAT, /* BBBB BBBB BBGG GGGG GGGG GRRR RRRR RRRR */ + MESA_FORMAT_Z32_FLOAT_S8X24_UINT, /* (float, x24s8) */ - /* 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, - MESA_FORMAT_A_FLOAT32, + /* Array float formats */ MESA_FORMAT_A_FLOAT16, - MESA_FORMAT_L_FLOAT32, + MESA_FORMAT_A_FLOAT32, MESA_FORMAT_L_FLOAT16, - MESA_FORMAT_LA_FLOAT32, + MESA_FORMAT_L_FLOAT32, MESA_FORMAT_LA_FLOAT16, - MESA_FORMAT_I_FLOAT32, + MESA_FORMAT_LA_FLOAT32, MESA_FORMAT_I_FLOAT16, - MESA_FORMAT_R_FLOAT32, + MESA_FORMAT_I_FLOAT32, MESA_FORMAT_R_FLOAT16, - MESA_FORMAT_RG_FLOAT32, + MESA_FORMAT_R_FLOAT32, MESA_FORMAT_RG_FLOAT16, - /*@}*/ + MESA_FORMAT_RG_FLOAT32, + MESA_FORMAT_RGB_FLOAT16, + MESA_FORMAT_RGB_FLOAT32, + MESA_FORMAT_RGBA_FLOAT16, + MESA_FORMAT_RGBA_FLOAT32, /* float[0] = R, [1] = G, [2] = B, [3] = A */ + MESA_FORMAT_RGBX_FLOAT16, + MESA_FORMAT_RGBX_FLOAT32, + MESA_FORMAT_Z_FLOAT32, - /** - * \name Non-normalized signed integer formats. - * XXX Note: these are just stand-ins for some better hardware - * formats TBD such as BGRA or ARGB. - */ + /* Packed signed/unsigned non-normalized integer formats */ + MESA_FORMAT_B10G10R10A2_UINT, /* AARR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */ + MESA_FORMAT_R10G10B10A2_UINT, /* AABB BBBB BBBB GGGG GGGG GGRR RRRR RRRR */ - /* Type A formats */ + /* Array signed/unsigned non-normalized integer formats */ MESA_FORMAT_A_UINT8, MESA_FORMAT_A_UINT16, MESA_FORMAT_A_UINT32, @@ -329,6 +320,7 @@ typedef enum MESA_FORMAT_L_SINT8, MESA_FORMAT_L_SINT16, MESA_FORMAT_L_SINT32, + MESA_FORMAT_LA_UINT8, MESA_FORMAT_LA_UINT16, MESA_FORMAT_LA_UINT32, @@ -336,83 +328,70 @@ typedef enum MESA_FORMAT_LA_SINT16, MESA_FORMAT_LA_SINT32, + MESA_FORMAT_R_UINT8, + MESA_FORMAT_R_UINT16, + MESA_FORMAT_R_UINT32, MESA_FORMAT_R_SINT8, - MESA_FORMAT_RG_SINT8, - MESA_FORMAT_RGB_SINT8, - MESA_FORMAT_RGBA_SINT8, MESA_FORMAT_R_SINT16, - MESA_FORMAT_RG_SINT16, - MESA_FORMAT_RGB_SINT16, - MESA_FORMAT_RGBA_SINT16, - MESA_FORMAT_R_SINT32, - MESA_FORMAT_RG_SINT32, - MESA_FORMAT_RGB_SINT32, - MESA_FORMAT_RGBA_SINT32, - /** - * \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_RG_SINT8, + MESA_FORMAT_RG_SINT16, + MESA_FORMAT_RG_SINT32, + + MESA_FORMAT_RGB_UINT8, + MESA_FORMAT_RGB_UINT16, MESA_FORMAT_RGB_UINT32, - MESA_FORMAT_RGBA_UINT32, + MESA_FORMAT_RGB_SINT8, + MESA_FORMAT_RGB_SINT16, + MESA_FORMAT_RGB_SINT32, - /* msb <------ TEXEL BITS -----------> lsb */ - /* ---- ---- ---- ---- ---- ---- ---- ---- */ - /** - * \name Signed fixed point texture formats. - */ - /*@{*/ - MESA_FORMAT_DUDV8, /* DUDU DUDU DVDV DVDV */ + MESA_FORMAT_RGBA_UINT8, + MESA_FORMAT_RGBA_UINT16, + MESA_FORMAT_RGBA_UINT32, + MESA_FORMAT_RGBA_SINT8, + MESA_FORMAT_RGBA_SINT16, + MESA_FORMAT_RGBA_SINT32, - /* Type A format(s) */ - MESA_FORMAT_R_SNORM8, /* char[i] = R */ + MESA_FORMAT_RGBX_UINT8, + MESA_FORMAT_RGBX_UINT16, + MESA_FORMAT_RGBX_UINT32, + MESA_FORMAT_RGBX_SINT8, + MESA_FORMAT_RGBX_SINT16, + MESA_FORMAT_RGBX_SINT32, - /* Type P formats */ - MESA_FORMAT_R8G8_SNORM, /* GGGG GGGG RRRR RRRR */ - MESA_FORMAT_X8B8G8R8_SNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB xxxx xxxx */ - MESA_FORMAT_A8B8G8R8_SNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */ - MESA_FORMAT_R8G8B8A8_SNORM, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */ - - /* Type A format(s) */ - MESA_FORMAT_R_SNORM16, /* short[i] = R */ + /* DXT compressed formats */ + MESA_FORMAT_RGB_DXT1, + MESA_FORMAT_RGBA_DXT1, + MESA_FORMAT_RGBA_DXT3, + MESA_FORMAT_RGBA_DXT5, - /* Type P format(s) */ - MESA_FORMAT_R16G16_SNORM, /* GGGG GGGG GGGG GGGG RRRR RRRR RRRR RRRR */ + /* DXT sRGB compressed formats */ + MESA_FORMAT_SRGB_DXT1, + MESA_FORMAT_SRGBA_DXT1, + MESA_FORMAT_SRGBA_DXT3, + MESA_FORMAT_SRGBA_DXT5, - /* Type A format(s) */ - MESA_FORMAT_RGB_SNORM16, /* short[i * 3] = R, [i * 3 + 1] = G, [i *3 + 2] = B */ - MESA_FORMAT_RGBA_SNORM16, /* ... */ - MESA_FORMAT_RGBA_UNORM16, /* ... */ - /*@}*/ + /* FXT1 compressed formats */ + MESA_FORMAT_RGB_FXT1, + MESA_FORMAT_RGBA_FXT1, - /*@{*/ - /* Type C formats */ + /* RGTC compressed formats */ MESA_FORMAT_R_RGTC1_UNORM, MESA_FORMAT_R_RGTC1_SNORM, MESA_FORMAT_RG_RGTC2_UNORM, MESA_FORMAT_RG_RGTC2_SNORM, - /*@}*/ - /*@{*/ + /* LATC1/2 compressed formats */ MESA_FORMAT_L_LATC1_UNORM, MESA_FORMAT_L_LATC1_SNORM, MESA_FORMAT_LA_LATC2_UNORM, MESA_FORMAT_LA_LATC2_SNORM, - /*@}*/ + /* ETC1/2 compressed formats */ MESA_FORMAT_ETC1_RGB8, MESA_FORMAT_ETC2_RGB8, MESA_FORMAT_ETC2_SRGB8, @@ -425,63 +404,6 @@ typedef enum MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1, MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1, - /* Type A format(s) */ - MESA_FORMAT_A_SNORM8, /* char[i] = A */ - MESA_FORMAT_L_SNORM8, /* char[i] = L */ - - /* Type P format(s) */ - MESA_FORMAT_L8A8_SNORM, /* AAAA AAAA LLLL LLLL */ - - /* Type A format(s) */ - MESA_FORMAT_I_SNORM8, /* char[i] = I */ - MESA_FORMAT_A_SNORM16, /* short[i] = A */ - MESA_FORMAT_L_SNORM16, /* short[i] = L */ - MESA_FORMAT_LA_SNORM16, /* short[i * 2] = L, [i * 2 + 1] = A */ - MESA_FORMAT_I_SNORM16, /* short[i] = I */ - - /* Type P format(s) */ - MESA_FORMAT_R9G9B9E5_FLOAT, - MESA_FORMAT_R11G11B10_FLOAT, /* BBBB BBBB BBGG GGGG GGGG GRRR RRRR RRRR */ - - /* Type A format(s) */ - MESA_FORMAT_Z_FLOAT32, - - /* Type P formats */ - MESA_FORMAT_Z32_FLOAT_S8X24_UINT, /* (float, x24s8) */ - - MESA_FORMAT_B10G10R10A2_UINT, /* AARR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */ - MESA_FORMAT_R10G10B10A2_UINT, /* AABB BBBB BBBB GGGG GGGG GGRR RRRR RRRR */ - - MESA_FORMAT_B4G4R4X4_UNORM, /* xxxx RRRR GGGG BBBB */ - MESA_FORMAT_B5G5R5X1_UNORM, /* xRRR RRGG GGGB BBBB */ - MESA_FORMAT_R8G8B8X8_SNORM, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */ - MESA_FORMAT_R8G8B8X8_SRGB, /* 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_B10G10R10X2_UNORM,/* xxRR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */ - - /* Type A formats */ - 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_R10G10B10A2_UNORM, /* AABB BBBB BBBB GGGG GGGG GGRR RRRR RRRR */ - MESA_FORMAT_G8R8_SNORM, /* RRRR RRRR GGGG GGGG */ - MESA_FORMAT_G16R16_SNORM, /* RRRR RRRR RRRR RRRR GGGG GGGG GGGG GGGG */ - - MESA_FORMAT_B8G8R8X8_SRGB, /* xxxx xxxx RRRR RRRR GGGG GGGG BBBB BBBB */ - MESA_FORMAT_COUNT } mesa_format; diff --git a/src/mesa/swrast/s_texfetch.c b/src/mesa/swrast/s_texfetch.c index 8ba75348ff7..dc22838cbd0 100644 --- a/src/mesa/swrast/s_texfetch.c +++ b/src/mesa/swrast/s_texfetch.c @@ -148,48 +148,49 @@ texfetch_funcs[] = fetch_null_texelf }, + /* Packed unorm formats */ { MESA_FORMAT_A8B8G8R8_UNORM, fetch_texel_1d_f_rgba8888, fetch_texel_2d_f_rgba8888, fetch_texel_3d_f_rgba8888 }, - { - MESA_FORMAT_R8G8B8A8_UNORM, - fetch_texel_1d_f_rgba8888_rev, - fetch_texel_2d_f_rgba8888_rev, - fetch_texel_3d_f_rgba8888_rev - }, - { - MESA_FORMAT_B8G8R8A8_UNORM, - fetch_texel_1d_f_argb8888, - fetch_texel_2d_f_argb8888, - fetch_texel_3d_f_argb8888 - }, - { - MESA_FORMAT_A8R8G8B8_UNORM, - fetch_texel_1d_f_argb8888_rev, - fetch_texel_2d_f_argb8888_rev, - fetch_texel_3d_f_argb8888_rev - }, { MESA_FORMAT_X8B8G8R8_UNORM, fetch_texel_1d_f_rgbx8888, fetch_texel_2d_f_rgbx8888, fetch_texel_3d_f_rgbx8888 }, + { + MESA_FORMAT_R8G8B8A8_UNORM, + fetch_texel_1d_f_rgba8888_rev, + fetch_texel_2d_f_rgba8888_rev, + fetch_texel_3d_f_rgba8888_rev + }, { MESA_FORMAT_R8G8B8X8_UNORM, fetch_texel_1d_f_rgbx8888_rev, fetch_texel_2d_f_rgbx8888_rev, fetch_texel_3d_f_rgbx8888_rev }, + { + MESA_FORMAT_B8G8R8A8_UNORM, + fetch_texel_1d_f_argb8888, + fetch_texel_2d_f_argb8888, + fetch_texel_3d_f_argb8888 + }, { MESA_FORMAT_B8G8R8X8_UNORM, fetch_texel_1d_f_xrgb8888, fetch_texel_2d_f_xrgb8888, fetch_texel_3d_f_xrgb8888 }, + { + MESA_FORMAT_A8R8G8B8_UNORM, + fetch_texel_1d_f_argb8888_rev, + fetch_texel_2d_f_argb8888_rev, + fetch_texel_3d_f_argb8888_rev + }, { MESA_FORMAT_X8R8G8B8_UNORM, fetch_texel_1d_f_xrgb8888_rev, @@ -197,16 +198,16 @@ texfetch_funcs[] = fetch_texel_3d_f_xrgb8888_rev }, { - MESA_FORMAT_BGR_UNORM8, - fetch_texel_1d_f_rgb888, - fetch_texel_2d_f_rgb888, - fetch_texel_3d_f_rgb888 + MESA_FORMAT_L16A16_UNORM, + fetch_texel_1d_f_al1616, + fetch_texel_2d_f_al1616, + fetch_texel_3d_f_al1616 }, { - MESA_FORMAT_RGB_UNORM8, - fetch_texel_1d_f_bgr888, - fetch_texel_2d_f_bgr888, - fetch_texel_3d_f_bgr888 + MESA_FORMAT_A16L16_UNORM, + fetch_texel_1d_f_al1616_rev, + fetch_texel_2d_f_al1616_rev, + fetch_texel_3d_f_al1616_rev }, { MESA_FORMAT_B5G6R5_UNORM, @@ -226,6 +227,12 @@ texfetch_funcs[] = fetch_texel_2d_f_argb4444, fetch_texel_3d_f_argb4444 }, + { + MESA_FORMAT_B4G4R4X4_UNORM, + NULL, + NULL, + NULL + }, { MESA_FORMAT_A4R4G4B4_UNORM, fetch_texel_1d_f_argb4444_rev, @@ -244,18 +251,18 @@ texfetch_funcs[] = fetch_texel_2d_f_argb1555, fetch_texel_3d_f_argb1555 }, + { + MESA_FORMAT_B5G5R5X1_UNORM, + NULL, + NULL, + NULL + }, { MESA_FORMAT_A1R5G5B5_UNORM, fetch_texel_1d_f_argb1555_rev, fetch_texel_2d_f_argb1555_rev, fetch_texel_3d_f_argb1555_rev }, - { - MESA_FORMAT_L4A4_UNORM, - fetch_texel_1d_f_al44, - fetch_texel_2d_f_al44, - fetch_texel_3d_f_al44 - }, { MESA_FORMAT_L8A8_UNORM, fetch_texel_1d_f_al88, @@ -269,16 +276,22 @@ texfetch_funcs[] = fetch_texel_3d_f_al88_rev }, { - MESA_FORMAT_L16A16_UNORM, - fetch_texel_1d_f_al1616, - fetch_texel_2d_f_al1616, - fetch_texel_3d_f_al1616 + MESA_FORMAT_R8G8_UNORM, + fetch_texel_1d_f_gr88, + fetch_texel_2d_f_gr88, + fetch_texel_3d_f_gr88 }, { - MESA_FORMAT_A16L16_UNORM, - fetch_texel_1d_f_al1616_rev, - fetch_texel_2d_f_al1616_rev, - fetch_texel_3d_f_al1616_rev + MESA_FORMAT_G8R8_UNORM, + fetch_texel_1d_f_rg88, + fetch_texel_2d_f_rg88, + fetch_texel_3d_f_rg88 + }, + { + MESA_FORMAT_L4A4_UNORM, + fetch_texel_1d_f_al44, + fetch_texel_2d_f_al44, + fetch_texel_3d_f_al44 }, { MESA_FORMAT_B2G3R3_UNORM, @@ -286,6 +299,80 @@ texfetch_funcs[] = fetch_texel_2d_f_rgb332, fetch_texel_3d_f_rgb332 }, + { + MESA_FORMAT_R16G16_UNORM, + fetch_texel_1d_f_rg1616, + fetch_texel_2d_f_rg1616, + fetch_texel_3d_f_rg1616 + }, + { + MESA_FORMAT_G16R16_UNORM, + fetch_texel_1d_f_rg1616_rev, + fetch_texel_2d_f_rg1616_rev, + fetch_texel_3d_f_rg1616_rev + }, + { + MESA_FORMAT_B10G10R10A2_UNORM, + fetch_texel_1d_f_argb2101010, + fetch_texel_2d_f_argb2101010, + fetch_texel_3d_f_argb2101010 + }, + { + MESA_FORMAT_B10G10R10X2_UNORM, + NULL, + NULL, + NULL + }, + { + MESA_FORMAT_R10G10B10A2_UNORM, + NULL, + NULL, + NULL + }, + { + MESA_FORMAT_S8_UINT_Z24_UNORM, + fetch_texel_1d_f_z24_s8, + fetch_texel_2d_f_z24_s8, + fetch_texel_3d_f_z24_s8 + }, + { + MESA_FORMAT_X8Z24_UNORM, + fetch_texel_1d_f_z24_s8, + fetch_texel_2d_f_z24_s8, + fetch_texel_3d_f_z24_s8 + }, + { + MESA_FORMAT_Z24_UNORM_S8_UINT, + fetch_texel_1d_f_s8_z24, + fetch_texel_2d_f_s8_z24, + fetch_texel_3d_f_s8_z24 + }, + { + MESA_FORMAT_Z24_UNORM_X8_UINT, + fetch_texel_1d_f_s8_z24, + fetch_texel_2d_f_s8_z24, + fetch_texel_3d_f_s8_z24 + }, + { + MESA_FORMAT_YCBCR, + fetch_texel_1d_f_ycbcr, + fetch_texel_2d_f_ycbcr, + fetch_texel_3d_f_ycbcr + }, + { + MESA_FORMAT_YCBCR_REV, + fetch_texel_1d_f_ycbcr_rev, + fetch_texel_2d_f_ycbcr_rev, + fetch_texel_3d_f_ycbcr_rev + }, + { + MESA_FORMAT_DUDV8, + fetch_texel_1d_dudv8, + fetch_texel_2d_dudv8, + fetch_texel_3d_dudv8 + }, + + /* Array unorm formats */ { MESA_FORMAT_A_UNORM8, fetch_texel_1d_f_a8, @@ -322,36 +409,12 @@ texfetch_funcs[] = fetch_texel_2d_f_i16, fetch_texel_3d_f_i16 }, - { - MESA_FORMAT_YCBCR, - fetch_texel_1d_f_ycbcr, - fetch_texel_2d_f_ycbcr, - fetch_texel_3d_f_ycbcr - }, - { - MESA_FORMAT_YCBCR_REV, - fetch_texel_1d_f_ycbcr_rev, - fetch_texel_2d_f_ycbcr_rev, - fetch_texel_3d_f_ycbcr_rev - }, { MESA_FORMAT_R_UNORM8, fetch_texel_1d_f_r8, fetch_texel_2d_f_r8, fetch_texel_3d_f_r8 }, - { - MESA_FORMAT_R8G8_UNORM, - fetch_texel_1d_f_gr88, - fetch_texel_2d_f_gr88, - fetch_texel_3d_f_gr88 - }, - { - MESA_FORMAT_G8R8_UNORM, - fetch_texel_1d_f_rg88, - fetch_texel_2d_f_rg88, - fetch_texel_3d_f_rg88 - }, { MESA_FORMAT_R_UNORM16, fetch_texel_1d_f_r16, @@ -359,34 +422,28 @@ texfetch_funcs[] = fetch_texel_3d_f_r16 }, { - MESA_FORMAT_R16G16_UNORM, - fetch_texel_1d_f_rg1616, - fetch_texel_2d_f_rg1616, - fetch_texel_3d_f_rg1616 - }, - { - MESA_FORMAT_G16R16_UNORM, - fetch_texel_1d_f_rg1616_rev, - fetch_texel_2d_f_rg1616_rev, - fetch_texel_3d_f_rg1616_rev + MESA_FORMAT_BGR_UNORM8, + fetch_texel_1d_f_rgb888, + fetch_texel_2d_f_rgb888, + fetch_texel_3d_f_rgb888 }, { - MESA_FORMAT_B10G10R10A2_UNORM, - fetch_texel_1d_f_argb2101010, - fetch_texel_2d_f_argb2101010, - fetch_texel_3d_f_argb2101010 + MESA_FORMAT_RGB_UNORM8, + fetch_texel_1d_f_bgr888, + fetch_texel_2d_f_bgr888, + fetch_texel_3d_f_bgr888 }, { - MESA_FORMAT_S8_UINT_Z24_UNORM, - fetch_texel_1d_f_z24_s8, - fetch_texel_2d_f_z24_s8, - fetch_texel_3d_f_z24_s8 + MESA_FORMAT_RGBA_UNORM16, + fetch_texel_1d_rgba_16, + fetch_texel_2d_rgba_16, + fetch_texel_3d_rgba_16 }, { - MESA_FORMAT_Z24_UNORM_S8_UINT, - fetch_texel_1d_f_s8_z24, - fetch_texel_2d_f_s8_z24, - fetch_texel_3d_f_s8_z24 + MESA_FORMAT_RGBX_UNORM16, + fetch_texel_1d_xbgr16161616_unorm, + fetch_texel_2d_xbgr16161616_unorm, + fetch_texel_3d_xbgr16161616_unorm }, { MESA_FORMAT_Z_UNORM16, @@ -394,18 +451,6 @@ texfetch_funcs[] = fetch_texel_2d_f_z16, fetch_texel_3d_f_z16 }, - { - MESA_FORMAT_Z24_UNORM_X8_UINT, - fetch_texel_1d_f_s8_z24, - fetch_texel_2d_f_s8_z24, - fetch_texel_3d_f_s8_z24 - }, - { - MESA_FORMAT_X8Z24_UNORM, - fetch_texel_1d_f_z24_s8, - fetch_texel_2d_f_z24_s8, - fetch_texel_3d_f_z24_s8 - }, { MESA_FORMAT_Z_UNORM32, fetch_texel_1d_f_z32, @@ -418,133 +463,210 @@ texfetch_funcs[] = NULL, NULL }, + + /* Packed signed/normalized formats */ { - MESA_FORMAT_BGR_SRGB8, - fetch_texel_1d_srgb8, - fetch_texel_2d_srgb8, - fetch_texel_3d_srgb8 + MESA_FORMAT_A8B8G8R8_SNORM, + fetch_texel_1d_signed_rgba8888, + fetch_texel_2d_signed_rgba8888, + fetch_texel_3d_signed_rgba8888 }, { - MESA_FORMAT_A8B8G8R8_SRGB, - fetch_texel_1d_srgba8, - fetch_texel_2d_srgba8, - fetch_texel_3d_srgba8 + MESA_FORMAT_X8B8G8R8_SNORM, + fetch_texel_1d_signed_rgbx8888, + fetch_texel_2d_signed_rgbx8888, + fetch_texel_3d_signed_rgbx8888 }, { - MESA_FORMAT_B8G8R8A8_SRGB, - fetch_texel_1d_sargb8, - fetch_texel_2d_sargb8, - fetch_texel_3d_sargb8 + MESA_FORMAT_R8G8B8A8_SNORM, + fetch_texel_1d_signed_rgba8888_rev, + fetch_texel_2d_signed_rgba8888_rev, + fetch_texel_3d_signed_rgba8888_rev }, { - MESA_FORMAT_R8G8B8A8_SRGB, - fetch_texel_1d_sabgr8, - fetch_texel_2d_sabgr8, - fetch_texel_3d_sabgr8 + MESA_FORMAT_R8G8B8X8_SNORM, + NULL, + NULL, + NULL }, { - MESA_FORMAT_L_SRGB8, - fetch_texel_1d_sl8, - fetch_texel_2d_sl8, - fetch_texel_3d_sl8 + MESA_FORMAT_R16G16_SNORM, + fetch_texel_1d_signed_rg1616, + fetch_texel_2d_signed_rg1616, + fetch_texel_3d_signed_rg1616 }, { - MESA_FORMAT_L8A8_SRGB, - fetch_texel_1d_sla8, - fetch_texel_2d_sla8, - fetch_texel_3d_sla8 + MESA_FORMAT_G16R16_SNORM, + NULL, + NULL, + NULL }, { - MESA_FORMAT_SRGB_DXT1, - fetch_compressed, - fetch_compressed, - fetch_compressed + MESA_FORMAT_R8G8_SNORM, + fetch_texel_1d_signed_rg88_rev, + fetch_texel_2d_signed_rg88_rev, + fetch_texel_3d_signed_rg88_rev }, { - MESA_FORMAT_SRGBA_DXT1, - fetch_compressed, - fetch_compressed, - fetch_compressed + MESA_FORMAT_G8R8_SNORM, + NULL, + NULL, + NULL }, { - MESA_FORMAT_SRGBA_DXT3, - fetch_compressed, - fetch_compressed, - fetch_compressed + MESA_FORMAT_L8A8_SNORM, + fetch_texel_1d_signed_al88, + fetch_texel_2d_signed_al88, + fetch_texel_3d_signed_al88 }, + + /* Array signed/normalized formats */ { - MESA_FORMAT_SRGBA_DXT5, - fetch_compressed, - fetch_compressed, - fetch_compressed + MESA_FORMAT_A_SNORM8, + fetch_texel_1d_signed_a8, + fetch_texel_2d_signed_a8, + fetch_texel_3d_signed_a8 + }, + { + MESA_FORMAT_A_SNORM16, + fetch_texel_1d_signed_a16, + fetch_texel_2d_signed_a16, + fetch_texel_3d_signed_a16 + }, + { + MESA_FORMAT_L_SNORM8, + fetch_texel_1d_signed_l8, + fetch_texel_2d_signed_l8, + fetch_texel_3d_signed_l8 + }, + { + MESA_FORMAT_L_SNORM16, + fetch_texel_1d_signed_l16, + fetch_texel_2d_signed_l16, + fetch_texel_3d_signed_l16 + }, + { + MESA_FORMAT_I_SNORM8, + fetch_texel_1d_signed_i8, + fetch_texel_2d_signed_i8, + fetch_texel_3d_signed_i8 + }, + { + MESA_FORMAT_I_SNORM16, + fetch_texel_1d_signed_i16, + fetch_texel_2d_signed_i16, + fetch_texel_3d_signed_i16 + }, + { + MESA_FORMAT_R_SNORM8, + fetch_texel_1d_signed_r8, + fetch_texel_2d_signed_r8, + fetch_texel_3d_signed_r8 + }, + { + MESA_FORMAT_R_SNORM16, + fetch_texel_1d_signed_r16, + fetch_texel_2d_signed_r16, + fetch_texel_3d_signed_r16 + }, + { + MESA_FORMAT_LA_SNORM16, + fetch_texel_1d_signed_al1616, + fetch_texel_2d_signed_al1616, + fetch_texel_3d_signed_al1616 + }, + { + MESA_FORMAT_RGB_SNORM16, + fetch_texel_1d_signed_rgb_16, + fetch_texel_2d_signed_rgb_16, + fetch_texel_3d_signed_rgb_16 + }, + { + MESA_FORMAT_RGBA_SNORM16, + fetch_texel_1d_signed_rgba_16, + fetch_texel_2d_signed_rgba_16, + fetch_texel_3d_signed_rgba_16 + }, + { + MESA_FORMAT_RGBX_SNORM16, + NULL, + NULL, + NULL }, + /* Packed sRGB formats */ { - MESA_FORMAT_RGB_FXT1, - fetch_compressed, - fetch_compressed, - fetch_compressed + MESA_FORMAT_A8B8G8R8_SRGB, + fetch_texel_1d_srgba8, + fetch_texel_2d_srgba8, + fetch_texel_3d_srgba8 }, { - MESA_FORMAT_RGBA_FXT1, - fetch_compressed, - fetch_compressed, - fetch_compressed + MESA_FORMAT_B8G8R8A8_SRGB, + fetch_texel_1d_sargb8, + fetch_texel_2d_sargb8, + fetch_texel_3d_sargb8 }, { - MESA_FORMAT_RGB_DXT1, - fetch_compressed, - fetch_compressed, - fetch_compressed + MESA_FORMAT_B8G8R8X8_SRGB, + NULL, + NULL, + NULL }, { - MESA_FORMAT_RGBA_DXT1, - fetch_compressed, - fetch_compressed, - fetch_compressed + MESA_FORMAT_R8G8B8A8_SRGB, + fetch_texel_1d_sabgr8, + fetch_texel_2d_sabgr8, + fetch_texel_3d_sabgr8 }, { - MESA_FORMAT_RGBA_DXT3, - fetch_compressed, - fetch_compressed, - fetch_compressed + MESA_FORMAT_R8G8B8X8_SRGB, + fetch_texel_1d_sxbgr8, + fetch_texel_2d_sxbgr8, + fetch_texel_3d_sxbgr8 }, { - MESA_FORMAT_RGBA_DXT5, - fetch_compressed, - fetch_compressed, - fetch_compressed + MESA_FORMAT_L8A8_SRGB, + fetch_texel_1d_sla8, + fetch_texel_2d_sla8, + fetch_texel_3d_sla8 }, + + /* Array sRGB formats */ { - MESA_FORMAT_RGBA_FLOAT32, - fetch_texel_1d_f_rgba_f32, - fetch_texel_2d_f_rgba_f32, - fetch_texel_3d_f_rgba_f32 + MESA_FORMAT_L_SRGB8, + fetch_texel_1d_sl8, + fetch_texel_2d_sl8, + fetch_texel_3d_sl8 }, { - MESA_FORMAT_RGBA_FLOAT16, - fetch_texel_1d_f_rgba_f16, - fetch_texel_2d_f_rgba_f16, - fetch_texel_3d_f_rgba_f16 + MESA_FORMAT_BGR_SRGB8, + fetch_texel_1d_srgb8, + fetch_texel_2d_srgb8, + fetch_texel_3d_srgb8 }, + + /* Packed float formats */ { - MESA_FORMAT_RGB_FLOAT32, - fetch_texel_1d_f_rgb_f32, - fetch_texel_2d_f_rgb_f32, - fetch_texel_3d_f_rgb_f32 + MESA_FORMAT_R9G9B9E5_FLOAT, + fetch_texel_1d_rgb9_e5, + fetch_texel_2d_rgb9_e5, + fetch_texel_3d_rgb9_e5 }, { - MESA_FORMAT_RGB_FLOAT16, - fetch_texel_1d_f_rgb_f16, - fetch_texel_2d_f_rgb_f16, - fetch_texel_3d_f_rgb_f16 + MESA_FORMAT_R11G11B10_FLOAT, + fetch_texel_1d_r11_g11_b10f, + fetch_texel_2d_r11_g11_b10f, + fetch_texel_3d_r11_g11_b10f }, { - MESA_FORMAT_A_FLOAT32, - fetch_texel_1d_f_alpha_f32, - fetch_texel_2d_f_alpha_f32, - fetch_texel_3d_f_alpha_f32 + MESA_FORMAT_Z32_FLOAT_S8X24_UINT, + fetch_texel_1d_z32f_x24s8, + fetch_texel_2d_z32f_x24s8, + fetch_texel_3d_z32f_x24s8 }, + + /* Array float formats */ { MESA_FORMAT_A_FLOAT16, fetch_texel_1d_f_alpha_f16, @@ -552,10 +674,10 @@ texfetch_funcs[] = fetch_texel_3d_f_alpha_f16 }, { - MESA_FORMAT_L_FLOAT32, - fetch_texel_1d_f_luminance_f32, - fetch_texel_2d_f_luminance_f32, - fetch_texel_3d_f_luminance_f32 + MESA_FORMAT_A_FLOAT32, + fetch_texel_1d_f_alpha_f32, + fetch_texel_2d_f_alpha_f32, + fetch_texel_3d_f_alpha_f32 }, { MESA_FORMAT_L_FLOAT16, @@ -564,10 +686,10 @@ texfetch_funcs[] = fetch_texel_3d_f_luminance_f16 }, { - MESA_FORMAT_LA_FLOAT32, - fetch_texel_1d_f_luminance_alpha_f32, - fetch_texel_2d_f_luminance_alpha_f32, - fetch_texel_3d_f_luminance_alpha_f32 + MESA_FORMAT_L_FLOAT32, + fetch_texel_1d_f_luminance_f32, + fetch_texel_2d_f_luminance_f32, + fetch_texel_3d_f_luminance_f32 }, { MESA_FORMAT_LA_FLOAT16, @@ -576,10 +698,10 @@ texfetch_funcs[] = fetch_texel_3d_f_luminance_alpha_f16 }, { - MESA_FORMAT_I_FLOAT32, - fetch_texel_1d_f_intensity_f32, - fetch_texel_2d_f_intensity_f32, - fetch_texel_3d_f_intensity_f32 + MESA_FORMAT_LA_FLOAT32, + fetch_texel_1d_f_luminance_alpha_f32, + fetch_texel_2d_f_luminance_alpha_f32, + fetch_texel_3d_f_luminance_alpha_f32 }, { MESA_FORMAT_I_FLOAT16, @@ -588,10 +710,10 @@ texfetch_funcs[] = fetch_texel_3d_f_intensity_f16 }, { - MESA_FORMAT_R_FLOAT32, - fetch_texel_1d_f_r_f32, - fetch_texel_2d_f_r_f32, - fetch_texel_3d_f_r_f32 + MESA_FORMAT_I_FLOAT32, + fetch_texel_1d_f_intensity_f32, + fetch_texel_2d_f_intensity_f32, + fetch_texel_3d_f_intensity_f32 }, { MESA_FORMAT_R_FLOAT16, @@ -600,10 +722,10 @@ texfetch_funcs[] = fetch_texel_3d_f_r_f16 }, { - MESA_FORMAT_RG_FLOAT32, - fetch_texel_1d_f_rg_f32, - fetch_texel_2d_f_rg_f32, - fetch_texel_3d_f_rg_f32 + MESA_FORMAT_R_FLOAT32, + fetch_texel_1d_f_r_f32, + fetch_texel_2d_f_r_f32, + fetch_texel_3d_f_r_f32 }, { MESA_FORMAT_RG_FLOAT16, @@ -611,206 +733,237 @@ texfetch_funcs[] = fetch_texel_2d_f_rg_f16, fetch_texel_3d_f_rg_f16 }, + { + MESA_FORMAT_RG_FLOAT32, + fetch_texel_1d_f_rg_f32, + fetch_texel_2d_f_rg_f32, + fetch_texel_3d_f_rg_f32 + }, + { + MESA_FORMAT_RGB_FLOAT16, + fetch_texel_1d_f_rgb_f16, + fetch_texel_2d_f_rgb_f16, + fetch_texel_3d_f_rgb_f16 + }, + { + MESA_FORMAT_RGB_FLOAT32, + fetch_texel_1d_f_rgb_f32, + fetch_texel_2d_f_rgb_f32, + fetch_texel_3d_f_rgb_f32 + }, + { + MESA_FORMAT_RGBA_FLOAT16, + fetch_texel_1d_f_rgba_f16, + fetch_texel_2d_f_rgba_f16, + fetch_texel_3d_f_rgba_f16 + }, + { + MESA_FORMAT_RGBA_FLOAT32, + fetch_texel_1d_f_rgba_f32, + fetch_texel_2d_f_rgba_f32, + fetch_texel_3d_f_rgba_f32 + }, + { + MESA_FORMAT_RGBX_FLOAT16, + fetch_texel_1d_xbgr16161616_float, + fetch_texel_2d_xbgr16161616_float, + fetch_texel_3d_xbgr16161616_float + }, + { + MESA_FORMAT_RGBX_FLOAT32, + fetch_texel_1d_xbgr32323232_float, + fetch_texel_2d_xbgr32323232_float, + fetch_texel_3d_xbgr32323232_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 + }, + /* Packed signed/unsigned non-normalized integer formats */ { - MESA_FORMAT_A_UINT8, + MESA_FORMAT_B10G10R10A2_UINT, + NULL, + NULL, + NULL + }, + { + MESA_FORMAT_R10G10B10A2_UINT, NULL, NULL, NULL }, + /* Array signed/unsigned non-normalized integer formats */ + { + MESA_FORMAT_A_UINT8, + NULL, + NULL, + NULL + }, { MESA_FORMAT_A_UINT16, NULL, NULL, NULL }, - { MESA_FORMAT_A_UINT32, NULL, NULL, NULL }, - { MESA_FORMAT_A_SINT8, NULL, NULL, NULL }, - { MESA_FORMAT_A_SINT16, NULL, NULL, NULL }, - { MESA_FORMAT_A_SINT32, NULL, NULL, NULL }, - - { MESA_FORMAT_I_UINT8, NULL, NULL, NULL }, - { MESA_FORMAT_I_UINT16, NULL, NULL, NULL }, - { MESA_FORMAT_I_UINT32, NULL, NULL, NULL }, - { MESA_FORMAT_I_SINT8, NULL, NULL, NULL }, - { MESA_FORMAT_I_SINT16, NULL, NULL, NULL }, - { MESA_FORMAT_I_SINT32, NULL, NULL, NULL }, - - { MESA_FORMAT_L_UINT8, NULL, NULL, NULL }, - { MESA_FORMAT_L_UINT16, NULL, NULL, NULL }, - { MESA_FORMAT_L_UINT32, NULL, NULL, NULL }, - { MESA_FORMAT_L_SINT8, NULL, NULL, NULL }, - { MESA_FORMAT_L_SINT16, NULL, NULL, NULL }, - { MESA_FORMAT_L_SINT32, NULL, NULL, NULL }, - - { MESA_FORMAT_LA_UINT8, NULL, NULL, NULL }, - { MESA_FORMAT_LA_UINT16, NULL, NULL, NULL }, - { MESA_FORMAT_LA_UINT32, NULL, NULL, NULL }, - { MESA_FORMAT_LA_SINT8, NULL, NULL, NULL }, - { MESA_FORMAT_LA_SINT16, NULL, NULL, NULL }, - { MESA_FORMAT_LA_SINT32, NULL, NULL, NULL }, - - { - MESA_FORMAT_R_SINT8, + MESA_FORMAT_R_UINT8, NULL, NULL, NULL }, - { - MESA_FORMAT_RG_SINT8, + MESA_FORMAT_R_UINT16, NULL, NULL, NULL }, - { - MESA_FORMAT_RGB_SINT8, + MESA_FORMAT_R_UINT32, NULL, NULL, NULL }, - - /* non-normalized, signed int */ { - MESA_FORMAT_RGBA_SINT8, - fetch_texel_1d_rgba_int8, - fetch_texel_2d_rgba_int8, - fetch_texel_3d_rgba_int8 + MESA_FORMAT_R_SINT8, + NULL, + NULL, + NULL }, { MESA_FORMAT_R_SINT16, @@ -819,91 +972,89 @@ texfetch_funcs[] = NULL }, { - MESA_FORMAT_RG_SINT16, + MESA_FORMAT_R_SINT32, NULL, NULL, NULL }, { - MESA_FORMAT_RGB_SINT16, + MESA_FORMAT_RG_UINT8, NULL, NULL, NULL }, { - MESA_FORMAT_RGBA_SINT16, - fetch_texel_1d_rgba_int16, - fetch_texel_2d_rgba_int16, - fetch_texel_3d_rgba_int16 - }, - { - MESA_FORMAT_R_SINT32, + MESA_FORMAT_RG_UINT16, NULL, NULL, NULL }, { - MESA_FORMAT_RG_SINT32, + MESA_FORMAT_RG_UINT32, NULL, NULL, NULL }, { - MESA_FORMAT_RGB_SINT32, + MESA_FORMAT_RG_SINT8, NULL, NULL, NULL }, { - MESA_FORMAT_RGBA_SINT32, - fetch_texel_1d_rgba_int32, - fetch_texel_2d_rgba_int32, - fetch_texel_3d_rgba_int32 + MESA_FORMAT_RG_SINT16, + NULL, + NULL, + NULL }, - - /* non-normalized, unsigned int */ { - MESA_FORMAT_R_UINT8, + MESA_FORMAT_RG_SINT32, NULL, NULL, NULL }, { - MESA_FORMAT_RG_UINT8, + MESA_FORMAT_RGB_UINT8, NULL, NULL, NULL }, { - MESA_FORMAT_RGB_UINT8, + MESA_FORMAT_RGB_UINT16, NULL, NULL, NULL }, { - MESA_FORMAT_RGBA_UINT8, - fetch_texel_1d_rgba_uint8, - fetch_texel_2d_rgba_uint8, - fetch_texel_3d_rgba_uint8 + MESA_FORMAT_RGB_UINT32, + NULL, + NULL, + NULL }, { - MESA_FORMAT_R_UINT16, + MESA_FORMAT_RGB_SINT8, NULL, NULL, NULL }, { - MESA_FORMAT_RG_UINT16, + MESA_FORMAT_RGB_SINT16, NULL, NULL, NULL }, { - MESA_FORMAT_RGB_UINT16, + MESA_FORMAT_RGB_SINT32, NULL, NULL, NULL }, + { + MESA_FORMAT_RGBA_UINT8, + fetch_texel_1d_rgba_uint8, + fetch_texel_2d_rgba_uint8, + fetch_texel_3d_rgba_uint8 + }, { MESA_FORMAT_RGBA_UINT16, fetch_texel_1d_rgba_uint16, @@ -911,99 +1062,133 @@ texfetch_funcs[] = fetch_texel_3d_rgba_uint16 }, { - MESA_FORMAT_R_UINT32, + MESA_FORMAT_RGBA_UINT32, + fetch_texel_1d_rgba_uint32, + fetch_texel_2d_rgba_uint32, + fetch_texel_3d_rgba_uint32 + }, + { + MESA_FORMAT_RGBA_SINT8, + fetch_texel_1d_rgba_int8, + fetch_texel_2d_rgba_int8, + fetch_texel_3d_rgba_int8 + }, + { + MESA_FORMAT_RGBA_SINT16, + fetch_texel_1d_rgba_int16, + fetch_texel_2d_rgba_int16, + fetch_texel_3d_rgba_int16 + }, + { + MESA_FORMAT_RGBA_SINT32, + fetch_texel_1d_rgba_int32, + fetch_texel_2d_rgba_int32, + fetch_texel_3d_rgba_int32 + }, + { + MESA_FORMAT_RGBX_UINT8, NULL, NULL, NULL }, { - MESA_FORMAT_RG_UINT32, + MESA_FORMAT_RGBX_UINT16, NULL, NULL, NULL }, { - MESA_FORMAT_RGB_UINT32, + MESA_FORMAT_RGBX_UINT32, NULL, NULL, NULL }, { - MESA_FORMAT_RGBA_UINT32, - fetch_texel_1d_rgba_uint32, - fetch_texel_2d_rgba_uint32, - fetch_texel_3d_rgba_uint32 + MESA_FORMAT_RGBX_SINT8, + NULL, + NULL, + NULL }, - - /* dudv */ { - MESA_FORMAT_DUDV8, - fetch_texel_1d_dudv8, - fetch_texel_2d_dudv8, - fetch_texel_3d_dudv8 + MESA_FORMAT_RGBX_SINT16, + NULL, + NULL, + NULL + }, + { + MESA_FORMAT_RGBX_SINT32, + NULL, + NULL, + NULL }, - /* signed, normalized */ + /* DXT compressed formats */ { - MESA_FORMAT_R_SNORM8, - fetch_texel_1d_signed_r8, - fetch_texel_2d_signed_r8, - fetch_texel_3d_signed_r8 + MESA_FORMAT_RGB_DXT1, + fetch_compressed, + fetch_compressed, + fetch_compressed }, { - MESA_FORMAT_R8G8_SNORM, - fetch_texel_1d_signed_rg88_rev, - fetch_texel_2d_signed_rg88_rev, - fetch_texel_3d_signed_rg88_rev + MESA_FORMAT_RGBA_DXT1, + fetch_compressed, + fetch_compressed, + fetch_compressed }, { - MESA_FORMAT_X8B8G8R8_SNORM, - fetch_texel_1d_signed_rgbx8888, - fetch_texel_2d_signed_rgbx8888, - fetch_texel_3d_signed_rgbx8888 + MESA_FORMAT_RGBA_DXT3, + fetch_compressed, + fetch_compressed, + fetch_compressed }, { - MESA_FORMAT_A8B8G8R8_SNORM, - fetch_texel_1d_signed_rgba8888, - fetch_texel_2d_signed_rgba8888, - fetch_texel_3d_signed_rgba8888 + MESA_FORMAT_RGBA_DXT5, + fetch_compressed, + fetch_compressed, + fetch_compressed }, + + /* DXT sRGB compressed formats */ { - MESA_FORMAT_R8G8B8A8_SNORM, - fetch_texel_1d_signed_rgba8888_rev, - fetch_texel_2d_signed_rgba8888_rev, - fetch_texel_3d_signed_rgba8888_rev + MESA_FORMAT_SRGB_DXT1, + fetch_compressed, + fetch_compressed, + fetch_compressed }, { - MESA_FORMAT_R_SNORM16, - fetch_texel_1d_signed_r16, - fetch_texel_2d_signed_r16, - fetch_texel_3d_signed_r16 + MESA_FORMAT_SRGBA_DXT1, + fetch_compressed, + fetch_compressed, + fetch_compressed }, { - MESA_FORMAT_R16G16_SNORM, - fetch_texel_1d_signed_rg1616, - fetch_texel_2d_signed_rg1616, - fetch_texel_3d_signed_rg1616 + MESA_FORMAT_SRGBA_DXT3, + fetch_compressed, + fetch_compressed, + fetch_compressed }, { - MESA_FORMAT_RGB_SNORM16, - fetch_texel_1d_signed_rgb_16, - fetch_texel_2d_signed_rgb_16, - fetch_texel_3d_signed_rgb_16 + MESA_FORMAT_SRGBA_DXT5, + fetch_compressed, + fetch_compressed, + fetch_compressed }, + + /* FXT1 compressed formats */ { - MESA_FORMAT_RGBA_SNORM16, - fetch_texel_1d_signed_rgba_16, - fetch_texel_2d_signed_rgba_16, - fetch_texel_3d_signed_rgba_16 + MESA_FORMAT_RGB_FXT1, + fetch_compressed, + fetch_compressed, + fetch_compressed }, { - MESA_FORMAT_RGBA_UNORM16, - fetch_texel_1d_rgba_16, - fetch_texel_2d_rgba_16, - fetch_texel_3d_rgba_16 + MESA_FORMAT_RGBA_FXT1, + fetch_compressed, + fetch_compressed, + fetch_compressed }, + + /* RGTC compressed formats */ { MESA_FORMAT_R_RGTC1_UNORM, fetch_compressed, @@ -1028,6 +1213,8 @@ texfetch_funcs[] = fetch_compressed, fetch_compressed }, + + /* LATC1/2 compressed formats */ { MESA_FORMAT_L_LATC1_UNORM, fetch_compressed, @@ -1052,6 +1239,8 @@ texfetch_funcs[] = fetch_compressed, fetch_compressed }, + + /* ETC1/2 compressed formats */ { MESA_FORMAT_ETC1_RGB8, fetch_compressed, @@ -1117,205 +1306,7 @@ texfetch_funcs[] = fetch_compressed, fetch_compressed, fetch_compressed - }, - { - MESA_FORMAT_A_SNORM8, - fetch_texel_1d_signed_a8, - fetch_texel_2d_signed_a8, - fetch_texel_3d_signed_a8 - }, - { - MESA_FORMAT_L_SNORM8, - fetch_texel_1d_signed_l8, - fetch_texel_2d_signed_l8, - fetch_texel_3d_signed_l8 - }, - { - MESA_FORMAT_L8A8_SNORM, - fetch_texel_1d_signed_al88, - fetch_texel_2d_signed_al88, - fetch_texel_3d_signed_al88 - }, - { - MESA_FORMAT_I_SNORM8, - fetch_texel_1d_signed_i8, - fetch_texel_2d_signed_i8, - fetch_texel_3d_signed_i8 - }, - { - MESA_FORMAT_A_SNORM16, - fetch_texel_1d_signed_a16, - fetch_texel_2d_signed_a16, - fetch_texel_3d_signed_a16 - }, - { - MESA_FORMAT_L_SNORM16, - fetch_texel_1d_signed_l16, - fetch_texel_2d_signed_l16, - fetch_texel_3d_signed_l16 - }, - { - MESA_FORMAT_LA_SNORM16, - fetch_texel_1d_signed_al1616, - fetch_texel_2d_signed_al1616, - fetch_texel_3d_signed_al1616 - }, - { - MESA_FORMAT_I_SNORM16, - fetch_texel_1d_signed_i16, - fetch_texel_2d_signed_i16, - fetch_texel_3d_signed_i16 - }, - { - MESA_FORMAT_R9G9B9E5_FLOAT, - fetch_texel_1d_rgb9_e5, - fetch_texel_2d_rgb9_e5, - fetch_texel_3d_rgb9_e5 - }, - { - MESA_FORMAT_R11G11B10_FLOAT, - fetch_texel_1d_r11_g11_b10f, - fetch_texel_2d_r11_g11_b10f, - fetch_texel_3d_r11_g11_b10f - }, - { - 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 - }, - { - MESA_FORMAT_Z32_FLOAT_S8X24_UINT, - fetch_texel_1d_z32f_x24s8, - fetch_texel_2d_z32f_x24s8, - fetch_texel_3d_z32f_x24s8 - }, - { - MESA_FORMAT_B10G10R10A2_UINT, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_R10G10B10A2_UINT, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_B4G4R4X4_UNORM, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_B5G5R5X1_UNORM, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_R8G8B8X8_SNORM, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_R8G8B8X8_SRGB, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_RGBX_UINT8, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_RGBX_SINT8, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_B10G10R10X2_UNORM, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_RGBX_UNORM16, - fetch_texel_1d_xbgr16161616_unorm, - fetch_texel_2d_xbgr16161616_unorm, - fetch_texel_3d_xbgr16161616_unorm - }, - { - MESA_FORMAT_RGBX_SNORM16, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_RGBX_FLOAT16, - fetch_texel_1d_xbgr16161616_float, - fetch_texel_2d_xbgr16161616_float, - fetch_texel_3d_xbgr16161616_float - }, - { - MESA_FORMAT_RGBX_UINT16, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_RGBX_SINT16, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_RGBX_FLOAT32, - fetch_texel_1d_xbgr32323232_float, - fetch_texel_2d_xbgr32323232_float, - fetch_texel_3d_xbgr32323232_float - }, - { - MESA_FORMAT_RGBX_UINT32, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_RGBX_SINT32, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_R10G10B10A2_UNORM, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_G8R8_SNORM, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_G16R16_SNORM, - NULL, - NULL, - NULL - }, - { - MESA_FORMAT_B8G8R8X8_SRGB, - NULL, - NULL, - NULL - }, + } }; diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h index 8821125a0e1..6e3eeb7d9d1 100644 --- a/src/mesa/swrast/s_texfetch_tmp.h +++ b/src/mesa/swrast/s_texfetch_tmp.h @@ -1027,6 +1027,17 @@ static void FETCH(sabgr8)(const struct swrast_texture_image *texImage, } +/* Fetch texel from 1D, 2D or 3D sabgr8 texture, return 4 GLfloats */ +static void FETCH(sxbgr8)(const struct swrast_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = nonlinear_to_linear( (s ) & 0xff ); + texel[GCOMP] = nonlinear_to_linear( (s >> 8) & 0xff ); + texel[BCOMP] = nonlinear_to_linear( (s >> 16) & 0xff ); + texel[ACOMP] = 1.0f; +} + /* Fetch texel from 1D, 2D or 3D sl8 texture, return 4 GLfloats */ static void FETCH(sl8)(const struct swrast_texture_image *texImage,