nouveau: nv30: Relax some limits. We can render to z24s8 buffer even if color buffer...
authorPatrice Mandin <patmandin@gmail.com>
Fri, 23 Oct 2009 16:42:21 +0000 (18:42 +0200)
committerPatrice Mandin <patmandin@gmail.com>
Fri, 23 Oct 2009 16:42:21 +0000 (18:42 +0200)
src/gallium/drivers/nv30/nv30_screen.c
src/gallium/drivers/nv30/nv30_state_fb.c

index bb40e1803d13d6190258804fbce30dc41cb010f6..221ae1b5f88eef502cc75d0dbe03c2393610a250 100644 (file)
@@ -102,13 +102,19 @@ nv30_screen_surface_format_supported(struct pipe_screen *pscreen,
        struct pipe_surface *front = ((struct nouveau_winsys *) pscreen->winsys)->front;
 
        if (tex_usage & PIPE_TEXTURE_USAGE_RENDER_TARGET) {
-               return (format == front->format);
+               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:
-                       return (front->format == PIPE_FORMAT_A8R8G8B8_UNORM);
+                       return TRUE;
                case PIPE_FORMAT_Z16_UNORM:
                        return (front->format == PIPE_FORMAT_R5G6B5_UNORM);
                default:
index f90681b0f9767dc681cc28cacedfbd43b5faeacd..4d6a67e56dfc5063c534c75b432d2f19333d83d6 100644 (file)
@@ -92,7 +92,7 @@ nv30_state_framebuffer_validate(struct nv30_context *nv30)
                assert(0);
        }
 
-       if (colour_bits != zeta_bits) {
+       if (colour_bits > zeta_bits) {
                return FALSE;
        }