[Mesa-dev] [PATCH 1/6] mesa: Add X1B5G5R5 along with A1B5G5R5.

Eric Anholt eric at anholt.net
Mon Oct 9 19:31:56 UTC 2017


Nicolai Hähnle <nhaehnle at gmail.com> writes:

> On 17.08.2017 18:10, Eric Anholt wrote:
>> For supporting RGB5 in hardware with A in the low bit (vc4), we need this
>> format as well.
>> ---
>>   src/mesa/main/formats.c      | 2 ++
>>   src/mesa/main/formats.csv    | 1 +
>>   src/mesa/main/formats.h      | 1 +
>>   src/mesa/main/texformat.c    | 1 +
>>   src/mesa/swrast/s_texfetch.c | 1 +
>>   5 files changed, 6 insertions(+)
>> 
>> diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
>> index 5c29d37bb443..2fdf1c501aaf 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;
>> @@ -1999,6 +2000,7 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format,
>>   
>>      case MESA_FORMAT_B4G4R4X4_UNORM:
>>      case MESA_FORMAT_B5G5R5X1_UNORM:
>> +   case MESA_FORMAT_X1B5G5R5_UNORM:
>
> I believe this should probably match the case of
>
>    format == GL_RGB && type == GL_UNSIGNED_SHORT_5_5_5_1 && !swapBytees

Good catc!.  I've added this up next to the A1B5G5R5 case.  Once I can
get an Intel CI run, I'll push.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171009/687444cc/attachment.sig>


More information about the mesa-dev mailing list