radeon: Use _mesa_get_format_base_format for winsys renderbuffer setup.
authorEric Anholt <eric@anholt.net>
Fri, 14 Oct 2011 00:17:04 +0000 (17:17 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 28 Oct 2011 18:19:14 +0000 (11:19 -0700)
src/mesa/drivers/dri/radeon/radeon_fbo.c

index a98c62d6b8df22a900c9c9ed70112d639942f13e..4b64cacddad21de7ef5ff98166d2207d1dd805e3 100644 (file)
@@ -324,48 +324,38 @@ radeon_create_renderbuffer(gl_format format, __DRIdrawable *driDrawPriv)
         case MESA_FORMAT_RGB565:
            assert(_mesa_little_endian());
            rrb->base.DataType = GL_UNSIGNED_BYTE;
-            rrb->base._BaseFormat = GL_RGB;
            break;
         case MESA_FORMAT_RGB565_REV:
            assert(!_mesa_little_endian());
            rrb->base.DataType = GL_UNSIGNED_BYTE;
-            rrb->base._BaseFormat = GL_RGB;
            break;
         case MESA_FORMAT_XRGB8888:
            assert(_mesa_little_endian());
            rrb->base.DataType = GL_UNSIGNED_BYTE;
-            rrb->base._BaseFormat = GL_RGB;
            break;
         case MESA_FORMAT_XRGB8888_REV:
            assert(!_mesa_little_endian());
            rrb->base.DataType = GL_UNSIGNED_BYTE;
-            rrb->base._BaseFormat = GL_RGB;
            break;
        case MESA_FORMAT_ARGB8888:
            assert(_mesa_little_endian());
            rrb->base.DataType = GL_UNSIGNED_BYTE;
-            rrb->base._BaseFormat = GL_RGBA;
            break;
        case MESA_FORMAT_ARGB8888_REV:
            assert(!_mesa_little_endian());
            rrb->base.DataType = GL_UNSIGNED_BYTE;
-            rrb->base._BaseFormat = GL_RGBA;
            break;
        case MESA_FORMAT_S8:
            rrb->base.DataType = GL_UNSIGNED_BYTE;
-            rrb->base._BaseFormat = GL_STENCIL_INDEX;
            break;
        case MESA_FORMAT_Z16:
            rrb->base.DataType = GL_UNSIGNED_SHORT;
-            rrb->base._BaseFormat = GL_DEPTH_COMPONENT;
            break;
        case MESA_FORMAT_X8_Z24:
            rrb->base.DataType = GL_UNSIGNED_INT;
-            rrb->base._BaseFormat = GL_DEPTH_COMPONENT;
            break;
        case MESA_FORMAT_S8_Z24:
            rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT;
-            rrb->base._BaseFormat = GL_DEPTH_STENCIL;
            break;
        default:
            fprintf(stderr, "%s: Unknown format %s\n",
@@ -373,6 +363,7 @@ radeon_create_renderbuffer(gl_format format, __DRIdrawable *driDrawPriv)
            _mesa_delete_renderbuffer(&rrb->base);
            return NULL;
     }
+    rrb->base._BaseFormat = _mesa_get_format_base_format(format);
 
     rrb->dPriv = driDrawPriv;
     rrb->base.InternalFormat = _mesa_get_format_base_format(format);