summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/formats.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2017-05-01 11:21:27 -0700
committerEric Anholt <[email protected]>2017-10-10 09:31:29 -0700
commit30782962263d21e984826aef616e25f4ec82de2d (patch)
tree5042d804c08a42a12f6765b1f959677208d3badd /src/mesa/main/formats.c
parentfbcae1897be19203c95f3633dd38e3436768e3a8 (diff)
mesa: Add X1B5G5R5 along with A1B5G5R5.
For supporting RGB5 in hardware with A in the low bit (vc4), we need this format as well. v2: Add proper _mesa_format_matches_format_and_type() support (from Nicolai). Reviewed-by: Nicolai Hähnle <[email protected]> (v1)
Diffstat (limited to 'src/mesa/main/formats.c')
-rw-r--r--src/mesa/main/formats.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index ecdfd561035..34450003572 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -875,6 +875,7 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format,
case MESA_FORMAT_A1B5G5R5_UNORM:
case MESA_FORMAT_A1B5G5R5_UINT:
+ case MESA_FORMAT_X1B5G5R5_UNORM:
*datatype = GL_UNSIGNED_SHORT_5_5_5_1;
*comps = 4;
return;
@@ -1526,6 +1527,10 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format,
return format == GL_RGBA && type == GL_UNSIGNED_SHORT_5_5_5_1 &&
!swapBytes;
+ case MESA_FORMAT_X1B5G5R5_UNORM:
+ return format == GL_RGB && type == GL_UNSIGNED_SHORT_5_5_5_1 &&
+ !swapBytes;
+
case MESA_FORMAT_B5G5R5A1_UNORM:
return format == GL_BGRA && type == GL_UNSIGNED_SHORT_1_5_5_5_REV &&
!swapBytes;