summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/mga/mgaspan.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-10-22 19:49:21 -0600
committerBrian Paul <[email protected]>2009-10-22 19:57:32 -0600
commit1160acbfea986a821761d18f5f14d5d2cb0dea8c (patch)
tree81e14117fc5b73e2f53b2cc6deb35e416036f3bb /src/mesa/drivers/dri/mga/mgaspan.c
parentcf0e25d4c89b62f37ff8d1f11c50efcab6557c7f (diff)
dri/drivers: update driNewRenderbuffer() to take a gl_format
Now pass a specific MESA_FORMAT_x token to indicate the renderbuffer's format. This is better than passing a GLenum and having to guess the specific format. I'm unable to test all the drivers, but any issues should be easy to fix.
Diffstat (limited to 'src/mesa/drivers/dri/mga/mgaspan.c')
-rw-r--r--src/mesa/drivers/dri/mga/mgaspan.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/mga/mgaspan.c b/src/mesa/drivers/dri/mga/mgaspan.c
index 5b6d323ca98..2ff1cac8e24 100644
--- a/src/mesa/drivers/dri/mga/mgaspan.c
+++ b/src/mesa/drivers/dri/mga/mgaspan.c
@@ -206,24 +206,22 @@ void mgaDDInitSpanFuncs( GLcontext *ctx )
void
mgaSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
{
- if (drb->Base.InternalFormat == GL_RGBA) {
- if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) {
- mgaInitPointers_565(&drb->Base);
- }
- else {
- mgaInitPointers_8888(&drb->Base);
- }
+ if (drb->Base.Format == MESA_FORMAT_RGB565) {
+ mgaInitPointers_565(&drb->Base);
}
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
+ else if (drb->Base.Format == MESA_FORMAT_ARGB8888) {
+ mgaInitPointers_8888(&drb->Base);
+ }
+ else if (drb->Base.Format == MESA_FORMAT_Z16) {
mgaInitDepthPointers_z16(&drb->Base);
}
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
+ else if (drb->Base.Format == MESA_FORMAT_Z24_S8) {
mgaInitDepthPointers_z24_s8(&drb->Base);
}
- else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT32) {
+ else if (drb->Base.Format == MESA_FORMAT_Z32) {
mgaInitDepthPointers_z32(&drb->Base);
}
- else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) {
+ else if (drb->Base.Format == MESA_FORMAT_S8) {
mgaInitStencilPointers_z24_s8(&drb->Base);
}
}