Mesa (master): radeon: Use _mesa_get_format_base_format for winsys renderbuffer setup.

Eric Anholt anholt at kemper.freedesktop.org
Fri Oct 28 11:19:22 PDT 2011


Module: Mesa
Branch: master
Commit: 8d9c5167accbc7d46838d3179b13a5a4ea60119c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8d9c5167accbc7d46838d3179b13a5a4ea60119c

Author: Eric Anholt <eric at anholt.net>
Date:   Thu Oct 13 17:17:04 2011 -0700

radeon: Use _mesa_get_format_base_format for winsys renderbuffer setup.

---

 src/mesa/drivers/dri/radeon/radeon_fbo.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c
index a98c62d..4b64cac 100644
--- a/src/mesa/drivers/dri/radeon/radeon_fbo.c
+++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c
@@ -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);



More information about the mesa-commit mailing list