diff options
author | Richard Sandiford <[email protected]> | 2014-07-22 10:51:17 +0100 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2014-09-17 13:17:47 +1000 |
commit | df14091c5857dc398521aaa9ff43bbbaee2d6116 (patch) | |
tree | f4e07d9d59dbb70a1d5e2e999092072d479ab6ab /src/mesa/main/formats.c | |
parent | 234d194b49f392f9b5d55dc7f8a8b16eb8f07925 (diff) |
mesa: Add MESA_FORMAT_A8L8_{SNORM,SRGB}
The associated UNORM format already existed.
This means that each LnAn format has a reversed counterpart,
which is necessary for handling big-endian mesa<->gallium mappings.
[airlied: rebased onto current master]
Signed-off-by: Richard Sandiford <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/main/formats.c')
-rw-r--r-- | src/mesa/main/formats.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index db22a45c46d..8fd36a08209 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -360,6 +360,7 @@ _mesa_get_format_color_encoding(mesa_format format) case MESA_FORMAT_R8G8B8A8_SRGB: case MESA_FORMAT_L_SRGB8: case MESA_FORMAT_L8A8_SRGB: + case MESA_FORMAT_A8L8_SRGB: case MESA_FORMAT_SRGB_DXT1: case MESA_FORMAT_SRGBA_DXT1: case MESA_FORMAT_SRGBA_DXT3: @@ -428,6 +429,9 @@ _mesa_get_srgb_format_linear(mesa_format format) case MESA_FORMAT_L8A8_SRGB: format = MESA_FORMAT_L8A8_UNORM; break; + case MESA_FORMAT_A8L8_SRGB: + format = MESA_FORMAT_A8L8_UNORM; + break; case MESA_FORMAT_SRGB_DXT1: format = MESA_FORMAT_RGB_DXT1; break; @@ -919,6 +923,7 @@ _mesa_format_to_type_and_comps(mesa_format format, return; case MESA_FORMAT_R8G8_SNORM: case MESA_FORMAT_L8A8_SNORM: + case MESA_FORMAT_A8L8_SNORM: *datatype = GL_BYTE; *comps = 2; return; @@ -970,6 +975,7 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 1; return; case MESA_FORMAT_L8A8_SRGB: + case MESA_FORMAT_A8L8_SRGB: *datatype = GL_UNSIGNED_BYTE; *comps = 2; return; @@ -1475,6 +1481,7 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, case MESA_FORMAT_L8A8_SRGB: return format == GL_LUMINANCE_ALPHA && type == GL_UNSIGNED_BYTE && littleEndian; case MESA_FORMAT_A8L8_UNORM: + case MESA_FORMAT_A8L8_SRGB: return GL_FALSE; case MESA_FORMAT_L16A16_UNORM: @@ -1797,6 +1804,9 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, case MESA_FORMAT_L8A8_SNORM: return format == GL_LUMINANCE_ALPHA && type == GL_BYTE && littleEndian && !swapBytes; + case MESA_FORMAT_A8L8_SNORM: + return format == GL_LUMINANCE_ALPHA && type == GL_BYTE && + !littleEndian && !swapBytes; case MESA_FORMAT_I_SNORM8: return format == GL_RED && type == GL_BYTE; case MESA_FORMAT_A_SNORM16: |