nv04: Handle more Z formats.
authorYounes Manton <younes.m@gmail.com>
Thu, 27 Aug 2009 00:07:51 +0000 (20:07 -0400)
committerYounes Manton <younes.m@gmail.com>
Thu, 27 Aug 2009 00:07:51 +0000 (20:07 -0400)
Based on the patch from Luo Jinghua.

src/gallium/drivers/nv04/nv04_surface_2d.c

index bbbcb54c467d7951050774264876e0a222ce88d6..f88e138c79da21eb230041a309ef52887776ef9d 100644 (file)
@@ -15,11 +15,13 @@ nv04_surface_format(enum pipe_format format)
                return NV04_CONTEXT_SURFACES_2D_FORMAT_Y8;
        case PIPE_FORMAT_R16_SNORM:
        case PIPE_FORMAT_R5G6B5_UNORM:
+       case PIPE_FORMAT_Z16_UNORM:
                return NV04_CONTEXT_SURFACES_2D_FORMAT_R5G6B5;
        case PIPE_FORMAT_X8R8G8B8_UNORM:
        case PIPE_FORMAT_A8R8G8B8_UNORM:
                return NV04_CONTEXT_SURFACES_2D_FORMAT_A8R8G8B8;
        case PIPE_FORMAT_Z24S8_UNORM:
+       case PIPE_FORMAT_Z24X8_UNORM:
                return NV04_CONTEXT_SURFACES_2D_FORMAT_Y32;
        default:
                return -1;
@@ -33,9 +35,11 @@ nv04_rect_format(enum pipe_format format)
        case PIPE_FORMAT_A8_UNORM:
                return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8;
        case PIPE_FORMAT_R5G6B5_UNORM:
+       case PIPE_FORMAT_Z16_UNORM:
                return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A16R5G6B5;
        case PIPE_FORMAT_A8R8G8B8_UNORM:
        case PIPE_FORMAT_Z24S8_UNORM:
+       case PIPE_FORMAT_Z24X8_UNORM:
                return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8;
        default:
                return -1;