[Freedreno] [PATCH 3/3] a5xx: enable formats newly added to the headers

Ilia Mirkin imirkin at alum.mit.edu
Tue Jul 4 13:39:40 UTC 2017


This enables S3TC, BPTC, ETC2, and ASTC texture decoding. Additionally
this enables RGB32 texture buffer objects, as well as 11_11_10_FLOAT and
10_10_10_2 vertex formats (and related extensions).

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 src/gallium/drivers/freedreno/a5xx/fd5_format.c | 138 ++++++++++++------------
 1 file changed, 69 insertions(+), 69 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_format.c b/src/gallium/drivers/freedreno/a5xx/fd5_format.c
index 2255b1f7396..0c72ec0d13c 100644
--- a/src/gallium/drivers/freedreno/a5xx/fd5_format.c
+++ b/src/gallium/drivers/freedreno/a5xx/fd5_format.c
@@ -194,19 +194,19 @@ static struct fd5_format formats[PIPE_FORMAT_COUNT] = {
 	_T(A8R8G8B8_SRGB,    8_8_8_8_UNORM, R8G8B8A8_UNORM, ZYXW),
 	_T(X8R8G8B8_SRGB,    8_8_8_8_UNORM, R8G8B8A8_UNORM, ZYXW),
 
-	_T(R10G10B10A2_UNORM,   10_10_10_2_UNORM, NONE,              WZYX),
-	_T(B10G10R10A2_UNORM,   10_10_10_2_UNORM, NONE,              WXYZ),
+	VT(R10G10B10A2_UNORM,   10_10_10_2_UNORM, NONE,              WZYX),
+	VT(B10G10R10A2_UNORM,   10_10_10_2_UNORM, NONE,              WXYZ),
 	_T(B10G10R10X2_UNORM,   10_10_10_2_UNORM, NONE,              WXYZ),
-//	V_(R10G10B10A2_SNORM,   10_10_10_2_SNORM, NONE,              WZYX),
-//	V_(B10G10R10A2_SNORM,   10_10_10_2_SNORM, NONE,              WXYZ),
-	_T(R10G10B10A2_UINT,    10_10_10_2_UINT,  R10G10B10A2_UINT,  WZYX),
-	_T(B10G10R10A2_UINT,    10_10_10_2_UINT,  R10G10B10A2_UINT,  WXYZ),
-//	V_(R10G10B10A2_USCALED, 10_10_10_2_UINT,  NONE,              WZYX),
-//	V_(B10G10R10A2_USCALED, 10_10_10_2_UINT,  NONE,              WXYZ),
-//	V_(R10G10B10A2_SSCALED, 10_10_10_2_SINT,  NONE,              WZYX),
-//	V_(B10G10R10A2_SSCALED, 10_10_10_2_SINT,  NONE,              WXYZ),
-
-	_T(R11G11B10_FLOAT, 11_11_10_FLOAT, R11G11B10_FLOAT, WZYX),
+	V_(R10G10B10A2_SNORM,   10_10_10_2_SNORM, NONE,              WZYX),
+	V_(B10G10R10A2_SNORM,   10_10_10_2_SNORM, NONE,              WXYZ),
+	VT(R10G10B10A2_UINT,    10_10_10_2_UINT,  R10G10B10A2_UINT,  WZYX),
+	VT(B10G10R10A2_UINT,    10_10_10_2_UINT,  R10G10B10A2_UINT,  WXYZ),
+	V_(R10G10B10A2_USCALED, 10_10_10_2_UINT,  NONE,              WZYX),
+	V_(B10G10R10A2_USCALED, 10_10_10_2_UINT,  NONE,              WXYZ),
+	V_(R10G10B10A2_SSCALED, 10_10_10_2_SINT,  NONE,              WZYX),
+	V_(B10G10R10A2_SSCALED, 10_10_10_2_SINT,  NONE,              WXYZ),
+
+	VT(R11G11B10_FLOAT, 11_11_10_FLOAT, R11G11B10_FLOAT, WZYX),
 	_T(R9G9B9E5_FLOAT,  9_9_9_E5_FLOAT, NONE,            WZYX),
 
 	_T(Z24X8_UNORM,       X8Z24_UNORM, R8G8B8A8_UNORM, WZYX),
@@ -248,11 +248,11 @@ static struct fd5_format formats[PIPE_FORMAT_COUNT] = {
 	_T(L32A32_SINT,    32_32_SINT,  NONE,        WZYX),
 
 	/* 96-bit */
-	V_(R32G32B32_UINT,    32_32_32_UINT,  NONE, WZYX),
-	V_(R32G32B32_SINT,    32_32_32_SINT,  NONE, WZYX),
+	VT(R32G32B32_UINT,    32_32_32_UINT,  NONE, WZYX),
+	VT(R32G32B32_SINT,    32_32_32_SINT,  NONE, WZYX),
 	V_(R32G32B32_USCALED, 32_32_32_UINT,  NONE, WZYX),
 	V_(R32G32B32_SSCALED, 32_32_32_SINT,  NONE, WZYX),
-	V_(R32G32B32_FLOAT,   32_32_32_FLOAT, NONE, WZYX),
+	VT(R32G32B32_FLOAT,   32_32_32_FLOAT, NONE, WZYX),
 	V_(R32G32B32_FIXED,   32_32_32_FIXED, NONE, WZYX),
 
 	/* 128-bit */
@@ -267,31 +267,31 @@ static struct fd5_format formats[PIPE_FORMAT_COUNT] = {
 	V_(R32G32B32A32_FIXED,   32_32_32_32_FIXED, NONE,               WZYX),
 
 	/* compressed */
-//	_T(ETC1_RGB8, ETC1, NONE, WZYX),
-//	_T(ETC2_RGB8, ETC2_RGB8, NONE, WZYX),
-//	_T(ETC2_SRGB8, ETC2_RGB8, NONE, WZYX),
-//	_T(ETC2_RGB8A1, ETC2_RGB8A1, NONE, WZYX),
-//	_T(ETC2_SRGB8A1, ETC2_RGB8A1, NONE, WZYX),
-//	_T(ETC2_RGBA8, ETC2_RGBA8, NONE, WZYX),
-//	_T(ETC2_SRGBA8, ETC2_RGBA8, NONE, WZYX),
-//	_T(ETC2_R11_UNORM, ETC2_R11_UNORM, NONE, WZYX),
-//	_T(ETC2_R11_SNORM, ETC2_R11_SNORM, NONE, WZYX),
-//	_T(ETC2_RG11_UNORM, ETC2_RG11_UNORM, NONE, WZYX),
-//	_T(ETC2_RG11_SNORM, ETC2_RG11_SNORM, NONE, WZYX),
-
-//	_T(DXT1_RGB,   DXT1, NONE, WZYX),
-//	_T(DXT1_SRGB,  DXT1, NONE, WZYX),
-//	_T(DXT1_RGBA,  DXT1, NONE, WZYX),
-//	_T(DXT1_SRGBA, DXT1, NONE, WZYX),
-//	_T(DXT3_RGBA,  DXT3, NONE, WZYX),
-//	_T(DXT3_SRGBA, DXT3, NONE, WZYX),
-//	_T(DXT5_RGBA,  DXT5, NONE, WZYX),
-//	_T(DXT5_SRGBA, DXT5, NONE, WZYX),
-
-//	_T(BPTC_RGBA_UNORM, BPTC,        NONE, WZYX),
-//	_T(BPTC_SRGBA,      BPTC,        NONE, WZYX),
-//	_T(BPTC_RGB_FLOAT,  BPTC_FLOAT,  NONE, WZYX),
-//	_T(BPTC_RGB_UFLOAT, BPTC_UFLOAT, NONE, WZYX),
+	_T(ETC1_RGB8, ETC1, NONE, WZYX),
+	_T(ETC2_RGB8, ETC2_RGB8, NONE, WZYX),
+	_T(ETC2_SRGB8, ETC2_RGB8, NONE, WZYX),
+	_T(ETC2_RGB8A1, ETC2_RGB8A1, NONE, WZYX),
+	_T(ETC2_SRGB8A1, ETC2_RGB8A1, NONE, WZYX),
+	_T(ETC2_RGBA8, ETC2_RGBA8, NONE, WZYX),
+	_T(ETC2_SRGBA8, ETC2_RGBA8, NONE, WZYX),
+	_T(ETC2_R11_UNORM, ETC2_R11_UNORM, NONE, WZYX),
+	_T(ETC2_R11_SNORM, ETC2_R11_SNORM, NONE, WZYX),
+	_T(ETC2_RG11_UNORM, ETC2_RG11_UNORM, NONE, WZYX),
+	_T(ETC2_RG11_SNORM, ETC2_RG11_SNORM, NONE, WZYX),
+
+	_T(DXT1_RGB,   DXT1, NONE, WZYX),
+	_T(DXT1_SRGB,  DXT1, NONE, WZYX),
+	_T(DXT1_RGBA,  DXT1, NONE, WZYX),
+	_T(DXT1_SRGBA, DXT1, NONE, WZYX),
+	_T(DXT3_RGBA,  DXT3, NONE, WZYX),
+	_T(DXT3_SRGBA, DXT3, NONE, WZYX),
+	_T(DXT5_RGBA,  DXT5, NONE, WZYX),
+	_T(DXT5_SRGBA, DXT5, NONE, WZYX),
+
+	_T(BPTC_RGBA_UNORM, BPTC,        NONE, WZYX),
+	_T(BPTC_SRGBA,      BPTC,        NONE, WZYX),
+	_T(BPTC_RGB_FLOAT,  BPTC_FLOAT,  NONE, WZYX),
+	_T(BPTC_RGB_UFLOAT, BPTC_UFLOAT, NONE, WZYX),
 
 	_T(RGTC1_UNORM, RGTC1_UNORM, NONE, WZYX),
 	_T(RGTC1_SNORM, RGTC1_SNORM, NONE, WZYX),
@@ -302,35 +302,35 @@ static struct fd5_format formats[PIPE_FORMAT_COUNT] = {
 	_T(LATC2_UNORM, RGTC2_UNORM, NONE, WZYX),
 	_T(LATC2_SNORM, RGTC2_SNORM, NONE, WZYX),
 
-//	_T(ASTC_4x4,   ASTC_4x4,   NONE, WZYX),
-//	_T(ASTC_5x4,   ASTC_5x4,   NONE, WZYX),
-//	_T(ASTC_5x5,   ASTC_5x5,   NONE, WZYX),
-//	_T(ASTC_6x5,   ASTC_6x5,   NONE, WZYX),
-//	_T(ASTC_6x6,   ASTC_6x6,   NONE, WZYX),
-//	_T(ASTC_8x5,   ASTC_8x5,   NONE, WZYX),
-//	_T(ASTC_8x6,   ASTC_8x6,   NONE, WZYX),
-//	_T(ASTC_8x8,   ASTC_8x8,   NONE, WZYX),
-//	_T(ASTC_10x5,  ASTC_10x5,  NONE, WZYX),
-//	_T(ASTC_10x6,  ASTC_10x6,  NONE, WZYX),
-//	_T(ASTC_10x8,  ASTC_10x8,  NONE, WZYX),
-//	_T(ASTC_10x10, ASTC_10x10, NONE, WZYX),
-//	_T(ASTC_12x10, ASTC_12x10, NONE, WZYX),
-//	_T(ASTC_12x12, ASTC_12x12, NONE, WZYX),
-
-//	_T(ASTC_4x4_SRGB,   ASTC_4x4,   NONE, WZYX),
-//	_T(ASTC_5x4_SRGB,   ASTC_5x4,   NONE, WZYX),
-//	_T(ASTC_5x5_SRGB,   ASTC_5x5,   NONE, WZYX),
-//	_T(ASTC_6x5_SRGB,   ASTC_6x5,   NONE, WZYX),
-//	_T(ASTC_6x6_SRGB,   ASTC_6x6,   NONE, WZYX),
-//	_T(ASTC_8x5_SRGB,   ASTC_8x5,   NONE, WZYX),
-//	_T(ASTC_8x6_SRGB,   ASTC_8x6,   NONE, WZYX),
-//	_T(ASTC_8x8_SRGB,   ASTC_8x8,   NONE, WZYX),
-//	_T(ASTC_10x5_SRGB,  ASTC_10x5,  NONE, WZYX),
-//	_T(ASTC_10x6_SRGB,  ASTC_10x6,  NONE, WZYX),
-//	_T(ASTC_10x8_SRGB,  ASTC_10x8,  NONE, WZYX),
-//	_T(ASTC_10x10_SRGB, ASTC_10x10, NONE, WZYX),
-//	_T(ASTC_12x10_SRGB, ASTC_12x10, NONE, WZYX),
-//	_T(ASTC_12x12_SRGB, ASTC_12x12, NONE, WZYX),
+	_T(ASTC_4x4,   ASTC_4x4,   NONE, WZYX),
+	_T(ASTC_5x4,   ASTC_5x4,   NONE, WZYX),
+	_T(ASTC_5x5,   ASTC_5x5,   NONE, WZYX),
+	_T(ASTC_6x5,   ASTC_6x5,   NONE, WZYX),
+	_T(ASTC_6x6,   ASTC_6x6,   NONE, WZYX),
+	_T(ASTC_8x5,   ASTC_8x5,   NONE, WZYX),
+	_T(ASTC_8x6,   ASTC_8x6,   NONE, WZYX),
+	_T(ASTC_8x8,   ASTC_8x8,   NONE, WZYX),
+	_T(ASTC_10x5,  ASTC_10x5,  NONE, WZYX),
+	_T(ASTC_10x6,  ASTC_10x6,  NONE, WZYX),
+	_T(ASTC_10x8,  ASTC_10x8,  NONE, WZYX),
+	_T(ASTC_10x10, ASTC_10x10, NONE, WZYX),
+	_T(ASTC_12x10, ASTC_12x10, NONE, WZYX),
+	_T(ASTC_12x12, ASTC_12x12, NONE, WZYX),
+
+	_T(ASTC_4x4_SRGB,   ASTC_4x4,   NONE, WZYX),
+	_T(ASTC_5x4_SRGB,   ASTC_5x4,   NONE, WZYX),
+	_T(ASTC_5x5_SRGB,   ASTC_5x5,   NONE, WZYX),
+	_T(ASTC_6x5_SRGB,   ASTC_6x5,   NONE, WZYX),
+	_T(ASTC_6x6_SRGB,   ASTC_6x6,   NONE, WZYX),
+	_T(ASTC_8x5_SRGB,   ASTC_8x5,   NONE, WZYX),
+	_T(ASTC_8x6_SRGB,   ASTC_8x6,   NONE, WZYX),
+	_T(ASTC_8x8_SRGB,   ASTC_8x8,   NONE, WZYX),
+	_T(ASTC_10x5_SRGB,  ASTC_10x5,  NONE, WZYX),
+	_T(ASTC_10x6_SRGB,  ASTC_10x6,  NONE, WZYX),
+	_T(ASTC_10x8_SRGB,  ASTC_10x8,  NONE, WZYX),
+	_T(ASTC_10x10_SRGB, ASTC_10x10, NONE, WZYX),
+	_T(ASTC_12x10_SRGB, ASTC_12x10, NONE, WZYX),
+	_T(ASTC_12x12_SRGB, ASTC_12x12, NONE, WZYX),
 };
 
 /* convert pipe format to vertex buffer format: */
-- 
2.13.0



More information about the Freedreno mailing list