summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/radeon/radeon_texture.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2019-09-05 14:42:15 -0700
committerEric Anholt <eric@anholt.net>2019-10-20 04:39:48 +0000
commit6a819cabe8d8f445ccb44dcb172e0922dbe016db (patch)
tree7f0a8a587c84f16c2333feb29a5e06c9eb3d1c32 /src/mesa/drivers/dri/radeon/radeon_texture.c
parent236b478b2ec0d65ef5dfe1165ae8ab027dde0a42 (diff)
mesa: Replace MESA_FORMAT_L8A8/A8L8 UNORM/SNORM/SRGB with an array format.
The array format is what the GL API wants (fixing texbos on big-endian), and matches directly to gallium's corresponding array format. The only driver exposing A8L8 was radeon/r200 in big-endian, where the HW's underlying format was trying to read as array and we needed to flip things around to make our packed format come out right (note that while the radeon format tables had both AL and LA, ChooseTextureFormat would only pick one of them based on endianness). v2: Don't make r200/radeon use endian swaps. v3: Rebase on dropping the r200 _be/_le format table removal patch v4: reword commit message to explain why we can drop both formats from radeon. Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_texture.c')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texture.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index f2d435a375f..bd03b9110d2 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -359,7 +359,7 @@ mesa_format radeonChooseTextureFormat(struct gl_context * ctx,
#if defined(RADEON_R200)
/* r200: can't use a8 format since interpreting hw I8 as a8 would result
in wrong rgb values (same as alpha value instead of 0). */
- return _radeon_texformat_al88;
+ return MESA_FORMAT_LA_UNORM8;
#else
return MESA_FORMAT_A_UNORM8;
#endif
@@ -381,7 +381,7 @@ mesa_format radeonChooseTextureFormat(struct gl_context * ctx,
case GL_LUMINANCE12_ALPHA12:
case GL_LUMINANCE16_ALPHA16:
case GL_COMPRESSED_LUMINANCE_ALPHA:
- return _radeon_texformat_al88;
+ return MESA_FORMAT_LA_UNORM8;
case GL_INTENSITY:
case GL_INTENSITY4:
@@ -464,7 +464,7 @@ mesa_format radeonChooseTextureFormat(struct gl_context * ctx,
case GL_SLUMINANCE_ALPHA:
case GL_SLUMINANCE8_ALPHA8:
case GL_COMPRESSED_SLUMINANCE_ALPHA:
- return MESA_FORMAT_L8A8_SRGB;
+ return MESA_FORMAT_LA_SRGB8;
case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
return MESA_FORMAT_SRGB_DXT1;
@@ -596,7 +596,6 @@ mesa_format _radeon_texformat_argb8888 = MESA_FORMAT_NONE;
mesa_format _radeon_texformat_rgb565 = MESA_FORMAT_NONE;
mesa_format _radeon_texformat_argb4444 = MESA_FORMAT_NONE;
mesa_format _radeon_texformat_argb1555 = MESA_FORMAT_NONE;
-mesa_format _radeon_texformat_al88 = MESA_FORMAT_NONE;
/*@}*/
@@ -609,7 +608,6 @@ radeonInitTextureFormats(void)
_radeon_texformat_rgb565 = MESA_FORMAT_B5G6R5_UNORM;
_radeon_texformat_argb4444 = MESA_FORMAT_B4G4R4A4_UNORM;
_radeon_texformat_argb1555 = MESA_FORMAT_B5G5R5A1_UNORM;
- _radeon_texformat_al88 = MESA_FORMAT_L8A8_UNORM;
}
else {
_radeon_texformat_rgba8888 = MESA_FORMAT_R8G8B8A8_UNORM;
@@ -617,7 +615,6 @@ radeonInitTextureFormats(void)
_radeon_texformat_rgb565 = MESA_FORMAT_R5G6B5_UNORM;
_radeon_texformat_argb4444 = MESA_FORMAT_A4R4G4B4_UNORM;
_radeon_texformat_argb1555 = MESA_FORMAT_A1R5G5B5_UNORM;
- _radeon_texformat_al88 = MESA_FORMAT_A8L8_UNORM;
}
}