st/mesa: fix glCopyPixels bugs/crashes when src region need clipping
[mesa.git] / src / gallium / drivers / nv30 / nv30_state_fb.c
index 6f6d1740d6ef821013c2343f8cf5584b0a912fdb..f7fe9833c7799889d6d0867a6a7774f2ede0a9e1 100644 (file)
@@ -10,7 +10,7 @@ nv30_state_framebuffer_validate(struct nv30_context *nv30)
        struct nv04_surface *rt[2], *zeta = NULL;
        uint32_t rt_enable = 0, rt_format = 0;
        int i, colour_format = 0, zeta_format = 0, depth_only = 0;
-       struct nouveau_stateobj *so = so_new(64, 10);
+       struct nouveau_stateobj *so = so_new(12, 18, 10);
        unsigned rt_flags = NOUVEAU_BO_RDWR | NOUVEAU_BO_VRAM;
        unsigned w = fb->width;
        unsigned h = fb->height;
@@ -66,14 +66,14 @@ nv30_state_framebuffer_validate(struct nv30_context *nv30)
        }
 
        switch (colour_format) {
-       case PIPE_FORMAT_X8R8G8B8_UNORM:
+       case PIPE_FORMAT_B8G8R8X8_UNORM:
                rt_format |= NV34TCL_RT_FORMAT_COLOR_X8R8G8B8;
                break;
-       case PIPE_FORMAT_A8R8G8B8_UNORM:
+       case PIPE_FORMAT_B8G8R8A8_UNORM:
        case 0:
                rt_format |= NV34TCL_RT_FORMAT_COLOR_A8R8G8B8;
                break;
-       case PIPE_FORMAT_R5G6B5_UNORM:
+       case PIPE_FORMAT_B5G6R5_UNORM:
                rt_format |= NV34TCL_RT_FORMAT_COLOR_R5G6B5;
                colour_bits = 16;
                break;
@@ -86,8 +86,8 @@ nv30_state_framebuffer_validate(struct nv30_context *nv30)
                rt_format |= NV34TCL_RT_FORMAT_ZETA_Z16;
                zeta_bits = 16;
                break;
-       case PIPE_FORMAT_Z24S8_UNORM:
-       case PIPE_FORMAT_Z24X8_UNORM:
+       case PIPE_FORMAT_S8Z24_UNORM:
+       case PIPE_FORMAT_X8Z24_UNORM:
        case 0:
                rt_format |= NV34TCL_RT_FORMAT_ZETA_Z24S8;
                break;