a2xx: add support for a few 16-bit color rendering formats
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 25 Aug 2017 04:47:05 +0000 (00:47 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sun, 15 Oct 2017 16:09:21 +0000 (12:09 -0400)
The rest should be possible too, just needs some additional
investigation. Passes fbo-*-formats piglit tests.

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

index be3992b749a01445eb9c028a8454235edc86ae0e..0905ab6f653e9732c4ea72ebbe377084c15f8346 100644 (file)
@@ -47,6 +47,11 @@ static uint32_t fmt2swap(enum pipe_format format)
        switch (format) {
        case PIPE_FORMAT_B8G8R8A8_UNORM:
        case PIPE_FORMAT_B8G8R8X8_UNORM:
+       case PIPE_FORMAT_B5G6R5_UNORM:
+       case PIPE_FORMAT_B5G5R5A1_UNORM:
+       case PIPE_FORMAT_B5G5R5X1_UNORM:
+       case PIPE_FORMAT_B4G4R4A4_UNORM:
+       case PIPE_FORMAT_B4G4R4X4_UNORM:
        /* TODO probably some more.. */
                return 1;
        default:
index 2fd479483e21e2fb3041272320b4ecae0c0155c6..c2a60c683f86f4f34b021c9f8323c6b44bfbe74d 100644 (file)
@@ -52,7 +52,12 @@ fd2_screen_is_format_supported(struct pipe_screen *pscreen,
 
        /* TODO figure out how to render to other formats.. */
        if ((usage & PIPE_BIND_RENDER_TARGET) &&
-                       ((format != PIPE_FORMAT_B8G8R8A8_UNORM) &&
+                       ((format != PIPE_FORMAT_B5G6R5_UNORM) &&
+                        (format != PIPE_FORMAT_B5G5R5A1_UNORM) &&
+                        (format != PIPE_FORMAT_B5G5R5X1_UNORM) &&
+                        (format != PIPE_FORMAT_B4G4R4A4_UNORM) &&
+                        (format != PIPE_FORMAT_B4G4R4X4_UNORM) &&
+                        (format != PIPE_FORMAT_B8G8R8A8_UNORM) &&
                         (format != PIPE_FORMAT_B8G8R8X8_UNORM) &&
                         (format != PIPE_FORMAT_R8G8B8A8_UNORM) &&
                         (format != PIPE_FORMAT_R8G8B8X8_UNORM))) {