nv50: correct zeta formats
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Tue, 28 Jul 2009 23:07:52 +0000 (01:07 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 28 Jul 2009 23:40:35 +0000 (09:40 +1000)
What was Z24S8 before is actually S8Z24, and what we had for Z16
is actually X8Z24. Now, we also have the REAL Z24S8 and I added
Z32_FLOAT as well; most of the formats need different tile_flags.

src/gallium/drivers/nv50/nv50_miptree.c
src/gallium/drivers/nv50/nv50_screen.c
src/gallium/drivers/nv50/nv50_state_validate.c

index 22465e0227426cdb785591990fb72e15b128b44a..c8392799ed8111cb156bde4038f5268c28f02f6f 100644 (file)
@@ -42,9 +42,14 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp)
        mt->base.screen = pscreen;
 
        switch (pt->format) {
-       case PIPE_FORMAT_Z24X8_UNORM:
+       case PIPE_FORMAT_Z32_FLOAT:
+               tile_flags = 0x4800;
+               break;
        case PIPE_FORMAT_Z24S8_UNORM:
-       case PIPE_FORMAT_Z16_UNORM:
+               tile_flags = 0x1800;
+               break;
+       case PIPE_FORMAT_X8Z24_UNORM:
+       case PIPE_FORMAT_S8Z24_UNORM:
                tile_flags = 0x2800;
                break;
        default:
index 349619db213ecc284c4b325c7df35b08bed708a7..0f6b1aed96c1af53d6a5792dffa4d185d546a419 100644 (file)
@@ -44,9 +44,10 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen,
        } else
        if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) {
                switch (format) {
+               case PIPE_FORMAT_Z32_FLOAT:
                case PIPE_FORMAT_Z24S8_UNORM:
-               case PIPE_FORMAT_Z24X8_UNORM:
-               case PIPE_FORMAT_Z16_UNORM:
+               case PIPE_FORMAT_X8Z24_UNORM:
+               case PIPE_FORMAT_S8Z24_UNORM:
                        return TRUE;
                default:
                        break;
index ce8e44fb0063b3ccd0b418aac171e773dcc72572..4a49b107a5c1089156606d73d26f732ce854fb4b 100644 (file)
@@ -92,17 +92,22 @@ nv50_state_validate_fb(struct nv50_context *nv50)
                so_reloc (so, bo, fb->zsbuf->offset, NOUVEAU_BO_VRAM |
                              NOUVEAU_BO_LOW | NOUVEAU_BO_RDWR, 0, 0);
                switch (fb->zsbuf->format) {
+               case PIPE_FORMAT_Z32_FLOAT:
+                       so_data(so, NV50TCL_ZETA_FORMAT_Z32_FLOAT);
+                       break;
                case PIPE_FORMAT_Z24S8_UNORM:
-               case PIPE_FORMAT_Z24X8_UNORM:
-                       so_data(so, 0x16);
+                       so_data(so, NV50TCL_ZETA_FORMAT_Z24S8_UNORM);
+                       break;
+               case PIPE_FORMAT_X8Z24_UNORM:
+                       so_data(so, NV50TCL_ZETA_FORMAT_X8Z24_UNORM);
                        break;
-               case PIPE_FORMAT_Z16_UNORM:
-                       so_data(so, 0x15);
+               case PIPE_FORMAT_S8Z24_UNORM:
+                       so_data(so, NV50TCL_ZETA_FORMAT_S8Z24_UNORM);
                        break;
                default:
                        NOUVEAU_ERR("AIIII unknown format %s\n",
                                    pf_name(fb->zsbuf->format));
-                       so_data(so, 0x16);
+                       so_data(so, NV50TCL_ZETA_FORMAT_S8Z24_UNORM);
                        break;
                }
                so_data(so, bo->tile_mode << 4);