From: Iago Toral Quiroga Date: Wed, 25 Mar 2020 13:17:57 +0000 (+0100) Subject: v3dv: fix a1r5g5b5 format X-Git-Tag: upstream/21.0.0~4047 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ca186f7291044c545b64e9d3c0714f9eb0377b65;p=platform%2Fupstream%2Fmesa.git v3dv: fix a1r5g5b5 format We were configuring the TLB to use ABGR1555, but that doesn't really give us what we want. There were two issues: * We were using the wrong Texture Data Format and Output Image Format. In fact those we need to use were not included on the packet file. * Even using the correct one, we need to do a RB swap to match the semantics of the Vulkan format. This patch fixes both issues. As we are here we keep the formats we were already used, that would provide support for r5g5b5a1. So this patch makes tests like the following going from skip to pass: dEQP-VK.texture.filtering.2d.formats.r5g5b5a1_unorm.nearest And the following test from fail to pass: dEQP-VK.texture.filtering.2d.formats.a1r5g5b5_unorm.nearest Note that the R5G5B5A1_UNORM_PACK16 is not mandatory, but as we already made the effort to understand them and get them working let's just keep it on the list Part-of: --- diff --git a/src/broadcom/cle/v3d_packet_v33.xml b/src/broadcom/cle/v3d_packet_v33.xml index e0955f8..ca2d772 100644 --- a/src/broadcom/cle/v3d_packet_v33.xml +++ b/src/broadcom/cle/v3d_packet_v33.xml @@ -269,6 +269,7 @@ + @@ -1775,6 +1776,7 @@ + diff --git a/src/broadcom/vulkan/v3dv_formats.c b/src/broadcom/vulkan/v3dv_formats.c index d48fe55..4ec743f 100644 --- a/src/broadcom/vulkan/v3dv_formats.c +++ b/src/broadcom/vulkan/v3dv_formats.c @@ -124,7 +124,8 @@ static const struct v3dv_format format_table[] = { /* Color, packed */ FORMAT(B4G4R4A4_UNORM_PACK16, ABGR4444, RGBA4, SWIZ_ZYXW, 16), /* Swap RB */ FORMAT(R5G6B5_UNORM_PACK16, BGR565, RGB565, SWIZ_XYZ1, 16), - FORMAT(A1R5G5B5_UNORM_PACK16, ABGR1555, RGB5_A1, SWIZ_WXYZ, 16), /* Swap RB + Reverse */ + FORMAT(R5G5B5A1_UNORM_PACK16, ABGR1555, RGB5_A1, SWIZ_XYZW, 16), + FORMAT(A1R5G5B5_UNORM_PACK16, RGBA5551, A1_RGB5, SWIZ_ZYXW, 16), /* Swap RB */ FORMAT(A8B8G8R8_UNORM_PACK32, RGBA8, RGBA8, SWIZ_XYZW, 16), /* RGBA8 UNORM */ FORMAT(A8B8G8R8_SNORM_PACK32, NO, RGBA8_SNORM, SWIZ_XYZW, 16), /* RGBA8 SNORM */ FORMAT(A8B8G8R8_UINT_PACK32, RGBA8UI, RGBA8UI, SWIZ_XYZW, 16), /* RGBA8 UINT */