freedreno/a3xx: fix depth/stencil restore format
authorRob Clark <robclark@freedesktop.org>
Tue, 21 Oct 2014 21:08:10 +0000 (17:08 -0400)
committerRob Clark <robclark@freedesktop.org>
Wed, 22 Oct 2014 00:08:49 +0000 (20:08 -0400)
Also fix z16 restore format which was completely wrong.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a3xx/fd3_util.c

index c83f65ae42192e933ee8d44a50a590a413c724c3..f4433490499c454e98f0a25aa5c102c264fed8fd 100644 (file)
@@ -264,6 +264,9 @@ fd3_pipe2tex(enum pipe_format format)
        case PIPE_FORMAT_I8_UNORM:
                return TFMT_NORM_UINT_8;
 
+       case PIPE_FORMAT_R8G8_UNORM:
+               return TFMT_NORM_UINT_8_8;
+
        case PIPE_FORMAT_B8G8R8A8_UNORM:
        case PIPE_FORMAT_B8G8R8X8_UNORM:
        case PIPE_FORMAT_R8G8B8A8_UNORM:
@@ -378,8 +381,9 @@ fd3_gmem_restore_format(enum pipe_format format)
        switch (format) {
        case PIPE_FORMAT_Z24X8_UNORM:
        case PIPE_FORMAT_Z24_UNORM_S8_UINT:
+               return PIPE_FORMAT_R8G8B8A8_UNORM;
        case PIPE_FORMAT_Z16_UNORM:
-               return PIPE_FORMAT_B8G8R8A8_UNORM;
+               return PIPE_FORMAT_R8G8_UNORM;
        default:
                return format;
        }