freedreno: a2xx: Compressed textures support
authorWladimir J. van der Laan <laanwj@gmail.com>
Wed, 2 Aug 2017 15:31:51 +0000 (15:31 +0000)
committerWladimir J. van der Laan <laanwj@gmail.com>
Sat, 31 Mar 2018 06:17:59 +0000 (06:17 +0000)
Add support for:

- PIPE_FORMAT_ETC1_RGB8
- PIPE_FORMAT_DXT1_RGB
- PIPE_FORMAT_DXT1_RGBA
- PIPE_FORMAT_DXT3_RGBA
- PIPE_FORMAT_DXT5_RGBA

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/a2xx/fd2_util.c

index 25f2bf419cf8043394aaaad61bf481222668705b..ee4a4d60fb1f34fe20bb7b32ad214bf4fc2d2f3c 100644 (file)
@@ -183,6 +183,17 @@ fd2_pipe2surface(enum pipe_format format)
        case PIPE_FORMAT_R32G32B32A32_FLOAT:
                return FMT_32_32_32_32_FLOAT;
 
+       /* Compressed textures. */
+       case PIPE_FORMAT_ETC1_RGB8:
+               return FMT_ETC1_RGB;
+       case PIPE_FORMAT_DXT1_RGB:
+       case PIPE_FORMAT_DXT1_RGBA:
+               return FMT_DXT1;
+       case PIPE_FORMAT_DXT3_RGBA:
+               return FMT_DXT2_3;
+       case PIPE_FORMAT_DXT5_RGBA:
+               return FMT_DXT4_5;
+
        /* YUV buffers. */
        case PIPE_FORMAT_UYVY:
                return FMT_Cr_Y1_Cb_Y0;