[PATCH 4/3] etnaviv: Add support for ETC2 texture compression

Wladimir J. van der Laan laanwj at gmail.com
Tue May 16 15:55:13 UTC 2017


Add support for ETC2 compressed textures in the etnaviv driver.
These are available on GC2000+.

One step closer towards GL ES 3 support.
---
 src/gallium/drivers/etnaviv/etnaviv_format.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Mesa does not export the ETC2 formats without OpenGL ES 3, so to test, use: 

    export MESA_GLES_VERSION_OVERRIDE=3.0

Currently no distinction is being made between RGB and SRGB formats. I'm still
researching the state bits concerned with that.

diff --git a/src/gallium/drivers/etnaviv/etnaviv_format.c b/src/gallium/drivers/etnaviv/etnaviv_format.c
index dbedda3..7d110c8 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_format.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_format.c
@@ -257,6 +257,17 @@ static struct etna_format formats[PIPE_FORMAT_COUNT] = {
    _T(DXT3_RGBA, DXT2_DXT3, NONE),
    _T(DXT5_RGBA, DXT4_DXT5, NONE),
 
+   _TE(ETC2_RGB8,       NONE, NONE, SWIZ_XYZW), /* Extd. format NONE doubles as ETC2_RGB8 */
+   _TE(ETC2_SRGB8,      NONE, NONE, SWIZ_XYZW),
+   _TE(ETC2_RGB8A1,     RGB8_PUNCHTHROUGH_ALPHA1_ETC2, NONE, SWIZ_XYZW),
+   _TE(ETC2_SRGB8A1,    RGB8_PUNCHTHROUGH_ALPHA1_ETC2, NONE, SWIZ_XYZW),
+   _TE(ETC2_RGBA8,      RGBA8_ETC2_EAC, NONE, SWIZ_XYZW),
+   _TE(ETC2_SRGBA8,     RGBA8_ETC2_EAC, NONE, SWIZ_XYZW),
+   _TE(ETC2_R11_UNORM,  R11_EAC, NONE, SWIZ_XYZW),
+   _TE(ETC2_R11_SNORM,  SIGNED_R11_EAC, NONE, SWIZ_XYZW),
+   _TE(ETC2_RG11_UNORM, RG11_EAC, NONE, SWIZ_XYZW),
+   _TE(ETC2_RG11_SNORM, SIGNED_RG11_EAC, NONE, SWIZ_XYZW),
+
    /* YUV */
    _T(YUYV, YUY2, YUY2),
    _T(UYVY, UYVY, NONE),
-- 
2.7.4



More information about the etnaviv mailing list