nouveau: return some supported zeta formats
authorBen Skeggs <bskeggs@redhat.com>
Tue, 30 Jun 2009 23:15:51 +0000 (09:15 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 30 Jun 2009 23:26:57 +0000 (09:26 +1000)
src/gallium/drivers/nv04/nv04_screen.c
src/gallium/drivers/nv10/nv10_screen.c
src/gallium/drivers/nv20/nv20_screen.c
src/gallium/drivers/nv30/nv30_screen.c
src/gallium/drivers/nv30/nv30_state_fb.c
src/gallium/drivers/nv40/nv40_screen.c
src/gallium/drivers/nv40/nv40_state_fb.c
src/gallium/drivers/nv50/nv50_miptree.c
src/gallium/drivers/nv50/nv50_screen.c
src/gallium/drivers/nv50/nv50_state_validate.c
src/gallium/drivers/nv50/nv50_surface.c

index 3c7100660785627c98757095b8e9ff4605ccdfd5..190ef62178ab64b6c5aee9a3f2809c55d1550c55 100644 (file)
@@ -81,6 +81,13 @@ nv04_screen_is_format_supported(struct pipe_screen *screen,
                switch (format) {
                case PIPE_FORMAT_A8R8G8B8_UNORM:
                case PIPE_FORMAT_R5G6B5_UNORM: 
+                       return TRUE;
+               default:
+                       break;
+               }
+       } else
+       if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) {
+               switch (format) {
                case PIPE_FORMAT_Z16_UNORM:
                        return TRUE;
                default:
index 731fe5572bbfe9bf810cec7f343f6ac8edefcda4..c64f78bc00a00d8a8f60cf635e47454be4444822 100644 (file)
@@ -76,7 +76,15 @@ nv10_screen_is_format_supported(struct pipe_screen *screen,
                switch (format) {
                case PIPE_FORMAT_A8R8G8B8_UNORM:
                case PIPE_FORMAT_R5G6B5_UNORM: 
+                        return TRUE;
+               default:
+                        break;
+               }
+       } else
+       if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) {
+               switch (format) {
                case PIPE_FORMAT_Z24S8_UNORM:
+               case PIPE_FORMAT_Z24X8_UNORM:
                case PIPE_FORMAT_Z16_UNORM:
                        return TRUE;
                default:
index 08fc1c03ad6d5a747dd5c37ea0a69d9dba7df594..52859a929c2fc0bf1b79a1afa13135b9d8e82129 100644 (file)
@@ -76,7 +76,15 @@ nv20_screen_is_format_supported(struct pipe_screen *screen,
                switch (format) {
                case PIPE_FORMAT_A8R8G8B8_UNORM:
                case PIPE_FORMAT_R5G6B5_UNORM: 
+                       return TRUE;
+               default:
+                        break;
+               }
+       } else
+       if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) {
+               switch (format) {
                case PIPE_FORMAT_Z24S8_UNORM:
+               case PIPE_FORMAT_Z24X8_UNORM:
                case PIPE_FORMAT_Z16_UNORM:
                        return TRUE;
                default:
index 3be67c182fab82f8ba5e60799e4d517235db08d1..328a5c91714c303f0ad728c3aefa3229fb617556 100644 (file)
@@ -87,7 +87,15 @@ nv30_screen_surface_format_supported(struct pipe_screen *pscreen,
                switch (format) {
                case PIPE_FORMAT_A8R8G8B8_UNORM:
                case PIPE_FORMAT_R5G6B5_UNORM:
+                       return TRUE;
+               default:
+                       break;
+               }
+       } else
+       if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) {
+               switch (tex_usage) {
                case PIPE_FORMAT_Z24S8_UNORM:
+               case PIPE_FORMAT_Z24X8_UNORM:
                case PIPE_FORMAT_Z16_UNORM:
                        return TRUE;
                default:
index cb1a260eaad652a3ba7896232941684e0bb37785..44b6a74715a79627c4d62908a487fa26eed96517 100644 (file)
@@ -65,6 +65,7 @@ nv30_state_framebuffer_validate(struct nv30_context *nv30)
                rt_format |= NV34TCL_RT_FORMAT_ZETA_Z16;
                break;
        case PIPE_FORMAT_Z24S8_UNORM:
+       case PIPE_FORMAT_Z24X8_UNORM:
        case 0:
                rt_format |= NV34TCL_RT_FORMAT_ZETA_Z24S8;
                break;
index 09f89e777690718983d1d5ed00b3a0ac3dd44a6d..8f070e2e0099468382a8432e42150dbc9d2c52ea 100644 (file)
@@ -88,7 +88,15 @@ nv40_screen_surface_format_supported(struct pipe_screen *pscreen,
                switch (format) {
                case PIPE_FORMAT_A8R8G8B8_UNORM:
                case PIPE_FORMAT_R5G6B5_UNORM: 
+                       return TRUE;
+               default:
+                       break;
+               }
+       } else
+       if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) {
+               switch (format) {
                case PIPE_FORMAT_Z24S8_UNORM:
+               case PIPE_FORMAT_Z24X8_UNORM:
                case PIPE_FORMAT_Z16_UNORM:
                        return TRUE;
                default:
index 273142f9e0fdf5bb7358955379d839a541bf8456..c2f739157ad5f7f9409bbc3f9ccf484c3dd893dc 100644 (file)
@@ -73,6 +73,7 @@ nv40_state_framebuffer_validate(struct nv40_context *nv40)
                rt_format |= NV40TCL_RT_FORMAT_ZETA_Z16;
                break;
        case PIPE_FORMAT_Z24S8_UNORM:
+       case PIPE_FORMAT_Z24X8_UNORM:
        case 0:
                rt_format |= NV40TCL_RT_FORMAT_ZETA_Z24S8;
                break;
index 6b605ba416caa12dd18349fc84cbbe9b1df45b90..22465e0227426cdb785591990fb72e15b128b44a 100644 (file)
@@ -42,6 +42,7 @@ 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_Z24S8_UNORM:
        case PIPE_FORMAT_Z16_UNORM:
                tile_flags = 0x2800;
index c59ae1c52a1e416b2ae01abb84514e7484fb1baa..bdd449db65505b2c4fa3d6569a44aee430f9bd1d 100644 (file)
@@ -37,7 +37,15 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen,
                switch (format) {
                case PIPE_FORMAT_A8R8G8B8_UNORM:
                case PIPE_FORMAT_R5G6B5_UNORM:
+                       return TRUE;
+               default:
+                       break;
+               }
+       } else
+       if (tex_usage & PIPE_TEXTURE_USAGE_DEPTH_STENCIL) {
+               switch (format) {
                case PIPE_FORMAT_Z24S8_UNORM:
+               case PIPE_FORMAT_Z24X8_UNORM:
                case PIPE_FORMAT_Z16_UNORM:
                        return TRUE;
                default:
index 0caf4b4e914dc901af7853c0aab1ba9ba725b346..d313e9de4fefd50b9d65ff38e197183b12db22a9 100644 (file)
@@ -93,6 +93,7 @@ nv50_state_validate_fb(struct nv50_context *nv50)
                              NOUVEAU_BO_LOW | NOUVEAU_BO_RDWR, 0, 0);
                switch (fb->zsbuf->format) {
                case PIPE_FORMAT_Z24S8_UNORM:
+               case PIPE_FORMAT_Z24X8_UNORM:
                        so_data(so, 0x16);
                        break;
                case PIPE_FORMAT_Z16_UNORM:
index 8db3b6d344dd804ba0ff73926b3b0fd7cb4a6e24..3da9d6e7285888a2ec9fa6fb3469ff6f84501f72 100644 (file)
@@ -35,7 +35,6 @@ nv50_format(enum pipe_format format)
 {
        switch (format) {
        case PIPE_FORMAT_A8R8G8B8_UNORM:
-       case PIPE_FORMAT_Z24S8_UNORM:
                return NV50_2D_DST_FORMAT_32BPP;
        case PIPE_FORMAT_X8R8G8B8_UNORM:
                return NV50_2D_DST_FORMAT_24BPP;