radeon: initialize renderbuffer Format field in radeon_create_renderbuffer()
authorBrian Paul <brianp@vmware.com>
Wed, 14 Oct 2009 19:14:22 +0000 (13:14 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 14 Oct 2009 19:15:05 +0000 (13:15 -0600)
Plus, use MESA_FORMAT_S8_Z24 everywhere.

src/mesa/drivers/dri/radeon/radeon_fbo.c

index 796dd1b4237dbc397a84f9587a47d78eb484527a..21007d85c3d18d13e27d7da4adc096d8088377cf 100644 (file)
@@ -121,7 +121,7 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
    case GL_STENCIL_INDEX8_EXT:
    case GL_STENCIL_INDEX16_EXT:
       /* alloc a depth+stencil buffer */
-      rb->Format = MESA_FORMAT_Z24_S8;
+      rb->Format = MESA_FORMAT_S8_Z24;
       rb->DataType = GL_UNSIGNED_INT_24_8_EXT;
       cpp = 4;
       break;
@@ -139,7 +139,7 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
       break;
    case GL_DEPTH_STENCIL_EXT:
    case GL_DEPTH24_STENCIL8_EXT:
-      rb->Format = MESA_FORMAT_Z24_S8;
+      rb->Format = MESA_FORMAT_S8_Z24;
       rb->DataType = GL_UNSIGNED_INT_24_8_EXT;
       cpp = 4;
       break;
@@ -255,30 +255,37 @@ radeon_create_renderbuffer(GLenum format, __DRIdrawablePrivate *driDrawPriv)
     /* XXX format junk */
     switch (format) {
        case GL_RGB5:
+           rrb->base.Format = MESA_FORMAT_RGB565;
            rrb->base.DataType = GL_UNSIGNED_BYTE;
             rrb->base._BaseFormat = GL_RGB;
            break;
        case GL_RGB8:
+           rrb->base.Format = MESA_FORMAT_ARGB8888;
            rrb->base.DataType = GL_UNSIGNED_BYTE;
             rrb->base._BaseFormat = GL_RGB;
            break;
        case GL_RGBA8:
+           rrb->base.Format = MESA_FORMAT_ARGB8888;
            rrb->base.DataType = GL_UNSIGNED_BYTE;
             rrb->base._BaseFormat = GL_RGBA;
            break;
        case GL_STENCIL_INDEX8_EXT:
+           rrb->base.Format = MESA_FORMAT_S8;
            rrb->base.DataType = GL_UNSIGNED_BYTE;
             rrb->base._BaseFormat = GL_STENCIL_INDEX;
            break;
        case GL_DEPTH_COMPONENT16:
+           rrb->base.Format = MESA_FORMAT_Z16;
            rrb->base.DataType = GL_UNSIGNED_SHORT;
             rrb->base._BaseFormat = GL_DEPTH_COMPONENT;
            break;
        case GL_DEPTH_COMPONENT24:
+           rrb->base.Format = MESA_FORMAT_Z32;
            rrb->base.DataType = GL_UNSIGNED_INT;
             rrb->base._BaseFormat = GL_DEPTH_COMPONENT;
            break;
        case GL_DEPTH24_STENCIL8_EXT:
+           rrb->base.Format = MESA_FORMAT_S8_Z24;
            rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT;
             rrb->base._BaseFormat = GL_STENCIL_INDEX;
            break;