summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-08-29 16:05:20 -0700
committerEric Anholt <[email protected]>2019-10-20 04:39:48 +0000
commitd8741ad251d65b7cf2aa019ed5d0713a264bc941 (patch)
tree297dca9fb48f35e24510833fd643134704f1517b /src/mesa
parent4f384ddf5febb5005af3be0a2d51e244fb11a43b (diff)
mesa: Redefine the RG formats as array formats.
This is the layout used in the GL API, and maps directly to PIPE formats with no endianness trickery. As with the LA change, this fixes big-endian fetching from texbos. Also cleans up some endian shenanigans in shader images. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c8
-rw-r--r--src/mesa/drivers/dri/i965/brw_surface_formats.c8
-rw-r--r--src/mesa/drivers/dri/i965/intel_mipmap_tree.c4
-rw-r--r--src/mesa/main/formats.c26
-rw-r--r--src/mesa/main/formats.csv12
-rw-r--r--src/mesa/main/formats.h12
-rw-r--r--src/mesa/main/framebuffer.c3
-rw-r--r--src/mesa/main/shaderimage.c24
-rw-r--r--src/mesa/main/texcompress_rgtc.c3
-rw-r--r--src/mesa/main/texformat.c10
-rw-r--r--src/mesa/main/teximage.c4
-rw-r--r--src/mesa/state_tracker/st_cb_eglimage.c2
-rw-r--r--src/mesa/state_tracker/st_format.c48
-rw-r--r--src/mesa/swrast/s_texfetch.c10
-rw-r--r--src/mesa/swrast/s_texfetch_tmp.h10
15 files changed, 67 insertions, 117 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 28a01d33405..749b9a36fb5 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -932,11 +932,11 @@ static const struct {
.image_format = __DRI_IMAGE_FORMAT_R8,
.mesa_format = MESA_FORMAT_L_UNORM8,
},
+#ifdef PIPE_ARCH_LITTLE_ENDIAN
{
.image_format = __DRI_IMAGE_FORMAT_GR88,
- .mesa_format = MESA_FORMAT_R8G8_UNORM,
+ .mesa_format = MESA_FORMAT_RG_UNORM8,
},
-#ifdef PIPE_ARCH_LITTLE_ENDIAN
{
.image_format = __DRI_IMAGE_FORMAT_GR88,
.mesa_format = MESA_FORMAT_LA_UNORM8,
@@ -958,11 +958,11 @@ static const struct {
.image_format = __DRI_IMAGE_FORMAT_R16,
.mesa_format = MESA_FORMAT_L_UNORM16,
},
+#ifdef PIPE_ARCH_LITTLE_ENDIAN
{
.image_format = __DRI_IMAGE_FORMAT_GR1616,
- .mesa_format = MESA_FORMAT_R16G16_UNORM,
+ .mesa_format = MESA_FORMAT_RG_UNORM16,
},
-#ifdef PIPE_ARCH_LITTLE_ENDIAN
{
.image_format = __DRI_IMAGE_FORMAT_GR1616,
.mesa_format = MESA_FORMAT_LA_UNORM16,
diff --git a/src/mesa/drivers/dri/i965/brw_surface_formats.c b/src/mesa/drivers/dri/i965/brw_surface_formats.c
index 6127ed8a490..b42bbf870b6 100644
--- a/src/mesa/drivers/dri/i965/brw_surface_formats.c
+++ b/src/mesa/drivers/dri/i965/brw_surface_formats.c
@@ -58,9 +58,9 @@ brw_isl_format_for_mesa_format(mesa_format mesa_format)
[MESA_FORMAT_YCBCR_REV] = ISL_FORMAT_YCRCB_NORMAL,
[MESA_FORMAT_YCBCR] = ISL_FORMAT_YCRCB_SWAPUVY,
[MESA_FORMAT_R_UNORM8] = ISL_FORMAT_R8_UNORM,
- [MESA_FORMAT_R8G8_UNORM] = ISL_FORMAT_R8G8_UNORM,
+ [MESA_FORMAT_RG_UNORM8] = ISL_FORMAT_R8G8_UNORM,
[MESA_FORMAT_R_UNORM16] = ISL_FORMAT_R16_UNORM,
- [MESA_FORMAT_R16G16_UNORM] = ISL_FORMAT_R16G16_UNORM,
+ [MESA_FORMAT_RG_UNORM16] = ISL_FORMAT_R16G16_UNORM,
[MESA_FORMAT_B10G10R10A2_UNORM] = ISL_FORMAT_B10G10R10A2_UNORM,
[MESA_FORMAT_S_UINT8] = ISL_FORMAT_R8_UINT,
@@ -125,10 +125,10 @@ brw_isl_format_for_mesa_format(mesa_format mesa_format)
[MESA_FORMAT_RGBA_UINT32] = ISL_FORMAT_R32G32B32A32_UINT,
[MESA_FORMAT_R_SNORM8] = ISL_FORMAT_R8_SNORM,
- [MESA_FORMAT_R8G8_SNORM] = ISL_FORMAT_R8G8_SNORM,
+ [MESA_FORMAT_RG_SNORM8] = ISL_FORMAT_R8G8_SNORM,
[MESA_FORMAT_R8G8B8A8_SNORM] = ISL_FORMAT_R8G8B8A8_SNORM,
[MESA_FORMAT_R_SNORM16] = ISL_FORMAT_R16_SNORM,
- [MESA_FORMAT_R16G16_SNORM] = ISL_FORMAT_R16G16_SNORM,
+ [MESA_FORMAT_RG_SNORM16] = ISL_FORMAT_R16G16_SNORM,
[MESA_FORMAT_RGB_SNORM16] = ISL_FORMAT_R16G16B16_SNORM,
[MESA_FORMAT_RGBA_SNORM16] = ISL_FORMAT_R16G16B16A16_SNORM,
[MESA_FORMAT_RGBA_UNORM16] = ISL_FORMAT_R16G16B16A16_UNORM,
diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 5716c7f254c..d6fb3e8d97c 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -219,9 +219,9 @@ intel_lower_compressed_format(struct brw_context *brw, mesa_format format)
case MESA_FORMAT_ETC2_SIGNED_R11_EAC:
return MESA_FORMAT_R_SNORM16;
case MESA_FORMAT_ETC2_RG11_EAC:
- return MESA_FORMAT_R16G16_UNORM;
+ return MESA_FORMAT_RG_UNORM16;
case MESA_FORMAT_ETC2_SIGNED_RG11_EAC:
- return MESA_FORMAT_R16G16_SNORM;
+ return MESA_FORMAT_RG_SNORM16;
default:
/* Non ETC1 / ETC2 format */
return format;
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 80f3048e112..7767249c190 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -710,9 +710,9 @@ _mesa_get_uncompressed_format(mesa_format format)
case MESA_FORMAT_R_RGTC1_SNORM:
return MESA_FORMAT_R_SNORM8;
case MESA_FORMAT_RG_RGTC2_UNORM:
- return MESA_FORMAT_R8G8_UNORM;
+ return MESA_FORMAT_RG_UNORM8;
case MESA_FORMAT_RG_RGTC2_SNORM:
- return MESA_FORMAT_R8G8_SNORM;
+ return MESA_FORMAT_RG_SNORM8;
case MESA_FORMAT_L_LATC1_UNORM:
return MESA_FORMAT_L_UNORM8;
case MESA_FORMAT_L_LATC1_SNORM:
@@ -738,7 +738,7 @@ _mesa_get_uncompressed_format(mesa_format format)
return MESA_FORMAT_R_UNORM16;
case MESA_FORMAT_ETC2_RG11_EAC:
case MESA_FORMAT_ETC2_SIGNED_RG11_EAC:
- return MESA_FORMAT_R16G16_UNORM;
+ return MESA_FORMAT_RG_UNORM16;
case MESA_FORMAT_BPTC_RGBA_UNORM:
case MESA_FORMAT_BPTC_SRGB_ALPHA_UNORM:
return MESA_FORMAT_A8B8G8R8_UNORM;
@@ -947,15 +947,13 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format,
return;
case MESA_FORMAT_LA_UNORM8:
- case MESA_FORMAT_R8G8_UNORM:
- case MESA_FORMAT_G8R8_UNORM:
+ case MESA_FORMAT_RG_UNORM8:
*datatype = GL_UNSIGNED_BYTE;
*comps = 2;
return;
case MESA_FORMAT_LA_UNORM16:
- case MESA_FORMAT_R16G16_UNORM:
- case MESA_FORMAT_G16R16_UNORM:
+ case MESA_FORMAT_RG_UNORM16:
*datatype = GL_UNSIGNED_SHORT;
*comps = 2;
return;
@@ -1068,7 +1066,7 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format,
*datatype = GL_BYTE;
*comps = 1;
return;
- case MESA_FORMAT_R8G8_SNORM:
+ case MESA_FORMAT_RG_SNORM8:
case MESA_FORMAT_LA_SNORM8:
*datatype = GL_BYTE;
*comps = 2;
@@ -1092,7 +1090,7 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format,
*datatype = GL_SHORT;
*comps = 1;
return;
- case MESA_FORMAT_R16G16_SNORM:
+ case MESA_FORMAT_RG_SNORM16:
case MESA_FORMAT_LA_SNORM16:
*datatype = GL_SHORT;
*comps = 2;
@@ -1405,16 +1403,6 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format,
*comps = 4;
return;
- case MESA_FORMAT_G8R8_SNORM:
- *datatype = GL_BYTE;
- *comps = 2;
- return;
-
- case MESA_FORMAT_G16R16_SNORM:
- *datatype = GL_SHORT;
- *comps = 2;
- return;
-
case MESA_FORMAT_B8G8R8X8_SRGB:
case MESA_FORMAT_X8R8G8B8_SRGB:
*datatype = GL_UNSIGNED_BYTE;
diff --git a/src/mesa/main/formats.csv b/src/mesa/main/formats.csv
index 764134d25f5..bd0975a9192 100644
--- a/src/mesa/main/formats.csv
+++ b/src/mesa/main/formats.csv
@@ -70,13 +70,9 @@ MESA_FORMAT_X1B5G5R5_UNORM , packed, 1, 1, 1, x1 , un5 , un5 , u
MESA_FORMAT_B5G5R5A1_UNORM , packed, 1, 1, 1, un5 , un5 , un5 , un1 , zyxw, rgb
MESA_FORMAT_B5G5R5X1_UNORM , packed, 1, 1, 1, un5 , un5 , un5 , x1 , zyx1, rgb
MESA_FORMAT_A1R5G5B5_UNORM , packed, 1, 1, 1, un1 , un5 , un5 , un5 , yzwx, rgb
-MESA_FORMAT_R8G8_UNORM , packed, 1, 1, 1, un8 , un8 , , , xy01, rgb
-MESA_FORMAT_G8R8_UNORM , packed, 1, 1, 1, un8 , un8 , , , yx01, rgb
MESA_FORMAT_L4A4_UNORM , packed, 1, 1, 1, un4 , un4 , , , xxxy, rgb
MESA_FORMAT_B2G3R3_UNORM , packed, 1, 1, 1, un2 , un3 , un3 , , zyx1, rgb
-MESA_FORMAT_R16G16_UNORM , packed, 1, 1, 1, un16, un16, , , xy01, rgb
-MESA_FORMAT_G16R16_UNORM , packed, 1, 1, 1, un16, un16, , , yx01, rgb
MESA_FORMAT_B10G10R10A2_UNORM , packed, 1, 1, 1, un10, un10, un10, un2 , zyxw, rgb
MESA_FORMAT_B10G10R10X2_UNORM , packed, 1, 1, 1, un10, un10, un10, x2 , zyx1, rgb
MESA_FORMAT_R10G10B10A2_UNORM , packed, 1, 1, 1, un10, un10, un10, un2 , xyzw, rgb
@@ -108,6 +104,8 @@ MESA_FORMAT_I_UNORM8 , array , 1, 1, 1, un8 , , ,
MESA_FORMAT_I_UNORM16 , array , 1, 1, 1, un16, , , , xxxx, rgb
MESA_FORMAT_R_UNORM8 , array , 1, 1, 1, un8 , , , , x001, rgb
MESA_FORMAT_R_UNORM16 , array , 1, 1, 1, un16, , , , x001, rgb
+MESA_FORMAT_RG_UNORM8 , array , 1, 1, 1, un8 , un8 , , , xy01, rgb
+MESA_FORMAT_RG_UNORM16 , array , 1, 1, 1, un16, un16, , , xy01, rgb
MESA_FORMAT_BGR_UNORM8 , array , 1, 1, 1, un8 , un8 , un8 , , zyx1, rgb
MESA_FORMAT_RGB_UNORM8 , array , 1, 1, 1, un8 , un8 , un8 , , xyz1, rgb
MESA_FORMAT_RGBA_UNORM16 , array , 1, 1, 1, un16, un16, un16, un16, xyzw, rgb
@@ -122,10 +120,6 @@ MESA_FORMAT_A8B8G8R8_SNORM , packed, 1, 1, 1, sn8 , sn8 , sn8 , s
MESA_FORMAT_X8B8G8R8_SNORM , packed, 1, 1, 1, x8 , sn8 , sn8 , sn8 , wzy1, rgb
MESA_FORMAT_R8G8B8A8_SNORM , packed, 1, 1, 1, sn8 , sn8 , sn8 , sn8 , xyzw, rgb
MESA_FORMAT_R8G8B8X8_SNORM , packed, 1, 1, 1, sn8 , sn8 , sn8 , x8 , xyz1, rgb
-MESA_FORMAT_R16G16_SNORM , packed, 1, 1, 1, sn16, sn16, , , xy01, rgb
-MESA_FORMAT_G16R16_SNORM , packed, 1, 1, 1, sn16, sn16, , , yx01, rgb
-MESA_FORMAT_R8G8_SNORM , packed, 1, 1, 1, sn8 , sn8 , , , xy01, rgb
-MESA_FORMAT_G8R8_SNORM , packed, 1, 1, 1, sn8 , sn8 , , , yx01, rgb
# Array signed/normalized formats
MESA_FORMAT_A_SNORM8 , array , 1, 1, 1, sn8 , , , , 000x, rgb
@@ -138,6 +132,8 @@ MESA_FORMAT_R_SNORM8 , array , 1, 1, 1, sn8 , , ,
MESA_FORMAT_R_SNORM16 , array , 1, 1, 1, sn16, , , , x001, rgb
MESA_FORMAT_LA_SNORM8 , array , 1, 1, 1, sn8 , sn8 , , , xxxy, rgb
MESA_FORMAT_LA_SNORM16 , array , 1, 1, 1, sn16, sn16, , , xxxy, rgb
+MESA_FORMAT_RG_SNORM8 , array , 1, 1, 1, sn8 , sn8 , , , xy01, rgb
+MESA_FORMAT_RG_SNORM16 , array , 1, 1, 1, sn16, sn16, , , xy01, rgb
MESA_FORMAT_RGB_SNORM16 , array , 1, 1, 1, sn16, sn16, sn16, , xyz1, rgb
MESA_FORMAT_RGBA_SNORM16 , array , 1, 1, 1, sn16, sn16, sn16, sn16, xyzw, rgb
MESA_FORMAT_RGBX_SNORM16 , array , 1, 1, 1, sn16, sn16, sn16, x16 , xyz1, rgb
diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h
index 404447b7fc4..2f0768c0828 100644
--- a/src/mesa/main/formats.h
+++ b/src/mesa/main/formats.h
@@ -367,13 +367,9 @@ typedef enum
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_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 */
- 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 */
@@ -406,6 +402,8 @@ typedef enum
MESA_FORMAT_I_UNORM16, /* ushort[i] = I */
MESA_FORMAT_R_UNORM8, /* ubyte[i] = R */
MESA_FORMAT_R_UNORM16, /* ushort[i] = R */
+ MESA_FORMAT_RG_UNORM8, /* ubyte[i * 2] = R, [i * 2 + 1] = G */
+ MESA_FORMAT_RG_UNORM16, /* ushort[i * 2] = R, [i * 2 + 1] = G */
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 */
@@ -422,10 +420,6 @@ typedef enum
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 */
/* Array signed/normalized formats */
MESA_FORMAT_A_SNORM8, /* byte[i] = A */
@@ -438,6 +432,8 @@ typedef enum
MESA_FORMAT_R_SNORM16, /* short[i] = R */
MESA_FORMAT_LA_SNORM8, /* byte[i * 2] = L, [i * 2 + 1] = A */
MESA_FORMAT_LA_SNORM16, /* short[i * 2] = L, [i * 2 + 1] = A */
+ MESA_FORMAT_RG_SNORM8, /* byte[i * 2] = R, [i * 2 + 1] = G */
+ MESA_FORMAT_RG_SNORM16, /* short[i * 2] = R, [i * 2 + 1] = G */
MESA_FORMAT_RGB_SNORM16, /* short[i*3] = R, [i*3+1] = G, [i*3+2] = B */
MESA_FORMAT_RGBA_SNORM16, /* ... */
MESA_FORMAT_RGBX_SNORM16, /* ... */
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index 9246a0465a6..8e7778019f8 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -852,8 +852,7 @@ _mesa_get_color_read_format(struct gl_context *ctx,
return GL_RGB;
case MESA_FORMAT_RG_FLOAT32:
case MESA_FORMAT_RG_FLOAT16:
- case MESA_FORMAT_R8G8_UNORM:
- case MESA_FORMAT_R8G8_SNORM:
+ case MESA_FORMAT_RG_UNORM8:
return GL_RG;
case MESA_FORMAT_RG_SINT32:
case MESA_FORMAT_RG_UINT32:
diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c
index a5e85b02afc..3f5dc16f2ff 100644
--- a/src/mesa/main/shaderimage.c
+++ b/src/mesa/main/shaderimage.c
@@ -45,18 +45,10 @@
*/
#ifdef MESA_BIG_ENDIAN
# define MESA_FORMAT_RGBA_8 MESA_FORMAT_A8B8G8R8_UNORM
-# define MESA_FORMAT_RG_16 MESA_FORMAT_G16R16_UNORM
-# define MESA_FORMAT_RG_8 MESA_FORMAT_G8R8_UNORM
# define MESA_FORMAT_SIGNED_RGBA_8 MESA_FORMAT_A8B8G8R8_SNORM
-# define MESA_FORMAT_SIGNED_RG_16 MESA_FORMAT_G16R16_SNORM
-# define MESA_FORMAT_SIGNED_RG_8 MESA_FORMAT_G8R8_SNORM
#else
# define MESA_FORMAT_RGBA_8 MESA_FORMAT_R8G8B8A8_UNORM
-# define MESA_FORMAT_RG_16 MESA_FORMAT_R16G16_UNORM
-# define MESA_FORMAT_RG_8 MESA_FORMAT_R8G8_UNORM
# define MESA_FORMAT_SIGNED_RGBA_8 MESA_FORMAT_R8G8B8A8_SNORM
-# define MESA_FORMAT_SIGNED_RG_16 MESA_FORMAT_R16G16_SNORM
-# define MESA_FORMAT_SIGNED_RG_8 MESA_FORMAT_R8G8_SNORM
#endif
mesa_format
@@ -151,10 +143,10 @@ _mesa_get_shader_image_format(GLenum format)
return MESA_FORMAT_RGBA_8;
case GL_RG16:
- return MESA_FORMAT_RG_16;
+ return MESA_FORMAT_RG_UNORM16;
case GL_RG8:
- return MESA_FORMAT_RG_8;
+ return MESA_FORMAT_RG_UNORM8;
case GL_R16:
return MESA_FORMAT_R_UNORM16;
@@ -169,10 +161,10 @@ _mesa_get_shader_image_format(GLenum format)
return MESA_FORMAT_SIGNED_RGBA_8;
case GL_RG16_SNORM:
- return MESA_FORMAT_SIGNED_RG_16;
+ return MESA_FORMAT_RG_SNORM16;
case GL_RG8_SNORM:
- return MESA_FORMAT_SIGNED_RG_8;
+ return MESA_FORMAT_RG_SNORM8;
case GL_R16_SNORM:
return MESA_FORMAT_R_SNORM16;
@@ -297,10 +289,10 @@ get_image_format_class(mesa_format format)
case MESA_FORMAT_RGBA_8:
return IMAGE_FORMAT_CLASS_4X8;
- case MESA_FORMAT_RG_16:
+ case MESA_FORMAT_RG_UNORM16:
return IMAGE_FORMAT_CLASS_2X16;
- case MESA_FORMAT_RG_8:
+ case MESA_FORMAT_RG_UNORM8:
return IMAGE_FORMAT_CLASS_2X8;
case MESA_FORMAT_R_UNORM16:
@@ -315,10 +307,10 @@ get_image_format_class(mesa_format format)
case MESA_FORMAT_SIGNED_RGBA_8:
return IMAGE_FORMAT_CLASS_4X8;
- case MESA_FORMAT_SIGNED_RG_16:
+ case MESA_FORMAT_RG_SNORM16:
return IMAGE_FORMAT_CLASS_2X16;
- case MESA_FORMAT_SIGNED_RG_8:
+ case MESA_FORMAT_RG_SNORM8:
return IMAGE_FORMAT_CLASS_2X8;
case MESA_FORMAT_R_SNORM16:
diff --git a/src/mesa/main/texcompress_rgtc.c b/src/mesa/main/texcompress_rgtc.c
index 089646d4e9b..ef5c2bbfd8d 100644
--- a/src/mesa/main/texcompress_rgtc.c
+++ b/src/mesa/main/texcompress_rgtc.c
@@ -197,8 +197,7 @@ _mesa_texstore_rg_rgtc2(TEXSTORE_PARAMS)
dstFormat == MESA_FORMAT_LA_LATC2_UNORM);
if (baseInternalFormat == GL_RG)
- tempFormat = _mesa_little_endian() ? MESA_FORMAT_R8G8_UNORM
- : MESA_FORMAT_G8R8_UNORM;
+ tempFormat = MESA_FORMAT_RG_UNORM8;
else
tempFormat = MESA_FORMAT_LA_UNORM8;
diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index 0968832889d..c7765bcdb2f 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -379,7 +379,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
break;
case GL_RG_SNORM:
case GL_RG8_SNORM:
- RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8_SNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RG_SNORM8);
break;
case GL_RGB_SNORM:
case GL_RGB8_SNORM:
@@ -423,7 +423,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
RETURN_IF_SUPPORTED(MESA_FORMAT_R_SNORM16);
break;
case GL_RG16_SNORM:
- RETURN_IF_SUPPORTED(MESA_FORMAT_R16G16_SNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RG_SNORM16);
break;
case GL_RGB16_SNORM:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_SNORM16);
@@ -677,17 +677,17 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
case GL_RG:
case GL_RG8:
- RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RG_UNORM8);
break;
case GL_COMPRESSED_RG:
if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY)
RETURN_IF_SUPPORTED(MESA_FORMAT_RG_RGTC2_UNORM);
- RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RG_UNORM8);
break;
case GL_RG16:
- RETURN_IF_SUPPORTED(MESA_FORMAT_R16G16_UNORM);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_RG_UNORM16);
break;
case GL_R16F:
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 77e57e6d250..5e7f4f767fd 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -6089,11 +6089,11 @@ _mesa_get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat)
return MESA_FORMAT_RGBA_UINT32;
case GL_RG8:
- return MESA_FORMAT_R8G8_UNORM;
+ return MESA_FORMAT_RG_UNORM8;
case GL_RG16:
if (_mesa_is_gles(ctx) && !_mesa_has_EXT_texture_norm16(ctx))
return MESA_FORMAT_NONE;
- return MESA_FORMAT_R16G16_UNORM;
+ return MESA_FORMAT_RG_UNORM16;
case GL_RG16F:
return MESA_FORMAT_RG_FLOAT16;
case GL_RG32F:
diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c
index c4eac0ce44a..4a58f2f48df 100644
--- a/src/mesa/state_tracker/st_cb_eglimage.c
+++ b/src/mesa/state_tracker/st_cb_eglimage.c
@@ -253,7 +253,7 @@ st_bind_egl_image(struct gl_context *ctx,
break;
case PIPE_FORMAT_YUYV:
case PIPE_FORMAT_UYVY:
- texFormat = MESA_FORMAT_R8G8_UNORM;
+ texFormat = MESA_FORMAT_RG_UNORM8;
texObj->RequiredTextureImageUnits = 2;
break;
case PIPE_FORMAT_AYUV:
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index aa293ac5195..35d2e3bc915 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -212,14 +212,10 @@ st_mesa_format_to_pipe_format(const struct st_context *st,
return PIPE_FORMAT_R8_UNORM;
case MESA_FORMAT_R_UNORM16:
return PIPE_FORMAT_R16_UNORM;
- case MESA_FORMAT_R8G8_UNORM:
- return PIPE_FORMAT_RG88_UNORM;
- case MESA_FORMAT_G8R8_UNORM:
- return PIPE_FORMAT_GR88_UNORM;
- case MESA_FORMAT_R16G16_UNORM:
- return PIPE_FORMAT_RG1616_UNORM;
- case MESA_FORMAT_G16R16_UNORM:
- return PIPE_FORMAT_GR1616_UNORM;
+ case MESA_FORMAT_RG_UNORM8:
+ return PIPE_FORMAT_R8G8_UNORM;
+ case MESA_FORMAT_RG_UNORM16:
+ return PIPE_FORMAT_R16G16_UNORM;
case MESA_FORMAT_RGBA_UNORM16:
return PIPE_FORMAT_R16G16B16A16_UNORM;
@@ -366,10 +362,8 @@ st_mesa_format_to_pipe_format(const struct st_context *st,
/* signed normalized formats */
case MESA_FORMAT_R_SNORM8:
return PIPE_FORMAT_R8_SNORM;
- case MESA_FORMAT_R8G8_SNORM:
- return PIPE_FORMAT_RG88_SNORM;
- case MESA_FORMAT_G8R8_SNORM:
- return PIPE_FORMAT_GR88_SNORM;
+ case MESA_FORMAT_RG_SNORM8:
+ return PIPE_FORMAT_R8G8_SNORM;
case MESA_FORMAT_R8G8B8A8_SNORM:
return PIPE_FORMAT_RGBA8888_SNORM;
case MESA_FORMAT_A8B8G8R8_SNORM:
@@ -386,10 +380,8 @@ st_mesa_format_to_pipe_format(const struct st_context *st,
case MESA_FORMAT_R_SNORM16:
return PIPE_FORMAT_R16_SNORM;
- case MESA_FORMAT_R16G16_SNORM:
- return PIPE_FORMAT_RG1616_SNORM;
- case MESA_FORMAT_G16R16_SNORM:
- return PIPE_FORMAT_GR1616_SNORM;
+ case MESA_FORMAT_RG_SNORM16:
+ return PIPE_FORMAT_R16G16_SNORM;
case MESA_FORMAT_RGBA_SNORM16:
return PIPE_FORMAT_R16G16B16A16_SNORM;
@@ -804,14 +796,10 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
return MESA_FORMAT_R_UNORM8;
case PIPE_FORMAT_R16_UNORM:
return MESA_FORMAT_R_UNORM16;
- case PIPE_FORMAT_RG88_UNORM:
- return MESA_FORMAT_R8G8_UNORM;
- case PIPE_FORMAT_GR88_UNORM:
- return MESA_FORMAT_G8R8_UNORM;
- case PIPE_FORMAT_RG1616_UNORM:
- return MESA_FORMAT_R16G16_UNORM;
- case PIPE_FORMAT_GR1616_UNORM:
- return MESA_FORMAT_G16R16_UNORM;
+ case PIPE_FORMAT_R8G8_UNORM:
+ return MESA_FORMAT_RG_UNORM8;
+ case PIPE_FORMAT_R16G16_UNORM:
+ return MESA_FORMAT_RG_UNORM16;
case PIPE_FORMAT_A8_UINT:
return MESA_FORMAT_A_UINT8;
@@ -953,10 +941,8 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
/* signed normalized formats */
case PIPE_FORMAT_R8_SNORM:
return MESA_FORMAT_R_SNORM8;
- case PIPE_FORMAT_RG88_SNORM:
- return MESA_FORMAT_R8G8_SNORM;
- case PIPE_FORMAT_GR88_SNORM:
- return MESA_FORMAT_G8R8_SNORM;
+ case PIPE_FORMAT_R8G8_SNORM:
+ return MESA_FORMAT_RG_SNORM8;
case PIPE_FORMAT_RGBA8888_SNORM:
return MESA_FORMAT_R8G8B8A8_SNORM;
case PIPE_FORMAT_ABGR8888_SNORM:
@@ -973,10 +959,8 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
case PIPE_FORMAT_R16_SNORM:
return MESA_FORMAT_R_SNORM16;
- case PIPE_FORMAT_RG1616_SNORM:
- return MESA_FORMAT_R16G16_SNORM;
- case PIPE_FORMAT_GR1616_SNORM:
- return MESA_FORMAT_G16R16_SNORM;
+ case PIPE_FORMAT_R16G16_SNORM:
+ return MESA_FORMAT_RG_SNORM16;
case PIPE_FORMAT_R16G16B16A16_SNORM:
return MESA_FORMAT_RGBA_SNORM16;
diff --git a/src/mesa/swrast/s_texfetch.c b/src/mesa/swrast/s_texfetch.c
index db5a956ab28..61c87913467 100644
--- a/src/mesa/swrast/s_texfetch.c
+++ b/src/mesa/swrast/s_texfetch.c
@@ -141,12 +141,8 @@ texfetch_funcs[] =
FETCH_FUNCS(A1B5G5R5_UNORM),
FETCH_FUNCS(B5G5R5A1_UNORM),
FETCH_FUNCS(A1R5G5B5_UNORM),
- FETCH_FUNCS(R8G8_UNORM),
- FETCH_FUNCS(G8R8_UNORM),
FETCH_FUNCS(L4A4_UNORM),
FETCH_FUNCS(B2G3R3_UNORM),
- FETCH_FUNCS(R16G16_UNORM),
- FETCH_FUNCS(G16R16_UNORM),
FETCH_FUNCS(B10G10R10A2_UNORM),
FETCH_FUNCS(R10G10B10A2_UNORM),
@@ -177,6 +173,8 @@ texfetch_funcs[] =
FETCH_FUNCS(I_UNORM16),
FETCH_FUNCS(R_UNORM8),
FETCH_FUNCS(R_UNORM16),
+ FETCH_FUNCS(RG_UNORM8),
+ FETCH_FUNCS(RG_UNORM16),
FETCH_FUNCS(BGR_UNORM8),
FETCH_FUNCS(RGB_UNORM8),
FETCH_FUNCS(RGBA_UNORM16),
@@ -188,8 +186,6 @@ texfetch_funcs[] =
FETCH_FUNCS(A8B8G8R8_SNORM),
FETCH_FUNCS(X8B8G8R8_SNORM),
FETCH_FUNCS(R8G8B8A8_SNORM),
- FETCH_FUNCS(R16G16_SNORM),
- FETCH_FUNCS(R8G8_SNORM),
/* Array signed/normalized formats */
FETCH_FUNCS(A_SNORM8),
@@ -202,6 +198,8 @@ texfetch_funcs[] =
FETCH_FUNCS(I_SNORM16),
FETCH_FUNCS(R_SNORM8),
FETCH_FUNCS(R_SNORM16),
+ FETCH_FUNCS(RG_SNORM8),
+ FETCH_FUNCS(RG_SNORM16),
FETCH_FUNCS(RGB_SNORM16),
FETCH_FUNCS(RGBA_SNORM16),
diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h
index f31167a83e7..e0885da2f9c 100644
--- a/src/mesa/swrast/s_texfetch_tmp.h
+++ b/src/mesa/swrast/s_texfetch_tmp.h
@@ -128,14 +128,12 @@ FETCH_RGBA(B5G5R5A1_UNORM, GLushort, 1)
FETCH_RGBA(A1R5G5B5_UNORM, GLushort, 1)
FETCH_RGBA(B10G10R10A2_UNORM, GLuint, 1)
FETCH_RGBA(R10G10B10A2_UNORM, GLuint, 1)
-FETCH_RGBA(R8G8_UNORM, GLushort, 1)
-FETCH_RGBA(G8R8_UNORM, GLushort, 1)
+FETCH_RGBA(RG_UNORM8, GLubyte, 2)
FETCH_RGBA(L4A4_UNORM, GLubyte, 1)
FETCH_RGBA(R_UNORM8, GLubyte, 1)
FETCH_RGBA(R_UNORM16, GLushort, 1)
FETCH_RGBA(LA_UNORM8, GLubyte, 2)
-FETCH_RGBA(R16G16_UNORM, GLuint, 1)
-FETCH_RGBA(G16R16_UNORM, GLuint, 1)
+FETCH_RGBA(RG_UNORM16, GLushort, 2)
FETCH_RGBA(B2G3R3_UNORM, GLubyte, 1)
FETCH_RGBA(A_UNORM8, GLubyte, 1)
FETCH_RGBA(A_UNORM16, GLushort, 1)
@@ -164,8 +162,8 @@ FETCH_RGBA(R_SNORM8, GLbyte, 1)
FETCH_RGBA(A_SNORM8, GLbyte, 1)
FETCH_RGBA(L_SNORM8, GLbyte, 1)
FETCH_RGBA(I_SNORM8, GLbyte, 1)
-FETCH_RGBA(R8G8_SNORM, GLshort, 1)
FETCH_RGBA(LA_SNORM8, GLbyte, 2)
+FETCH_RGBA(RG_SNORM8, GLbyte, 2)
FETCH_RGBA(X8B8G8R8_SNORM, GLint, 1)
FETCH_RGBA(A8B8G8R8_SNORM, GLint, 1)
FETCH_RGBA(R8G8B8A8_SNORM, GLint, 1)
@@ -173,7 +171,7 @@ FETCH_RGBA(R_SNORM16, GLshort, 1)
FETCH_RGBA(A_SNORM16, GLshort, 1)
FETCH_RGBA(L_SNORM16, GLshort, 1)
FETCH_RGBA(I_SNORM16, GLshort, 1)
-FETCH_RGBA(R16G16_SNORM, GLshort, 2)
+FETCH_RGBA(RG_SNORM16, GLshort, 2)
FETCH_RGBA(LA_SNORM16, GLshort, 2)
FETCH_RGBA(RGB_SNORM16, GLshort, 3)
FETCH_RGBA(RGBA_SNORM16, GLshort, 4)