summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/mga
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/mga')
-rw-r--r--src/mesa/drivers/dri/mga/mga_xmesa.c14
-rw-r--r--src/mesa/drivers/dri/mga/mgaspan.c20
2 files changed, 16 insertions, 18 deletions
diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c
index 0dc76fea50..4ca71ca505 100644
--- a/src/mesa/drivers/dri/mga/mga_xmesa.c
+++ b/src/mesa/drivers/dri/mga/mga_xmesa.c
@@ -723,7 +723,7 @@ mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv,
{
driRenderbuffer *frontRb
- = driNewRenderbuffer(GL_RGBA,
+ = driNewRenderbuffer(MESA_FORMAT_ARGB8888,
NULL,
screen->cpp,
screen->frontOffset, screen->frontPitch,
@@ -734,7 +734,7 @@ mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv,
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
- = driNewRenderbuffer(GL_RGBA,
+ = driNewRenderbuffer(MESA_FORMAT_ARGB8888,
NULL,
screen->cpp,
screen->backOffset, screen->backPitch,
@@ -745,7 +745,7 @@ mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv,
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT16,
+ = driNewRenderbuffer(MESA_FORMAT_Z16,
NULL,
screen->cpp,
screen->depthOffset, screen->depthPitch,
@@ -757,7 +757,7 @@ mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv,
/* XXX is this right? */
if (mesaVis->stencilBits) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT24,
+ = driNewRenderbuffer(MESA_FORMAT_Z24_S8,
NULL,
screen->cpp,
screen->depthOffset, screen->depthPitch,
@@ -767,7 +767,7 @@ mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv,
}
else {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT32,
+ = driNewRenderbuffer(MESA_FORMAT_Z32,
NULL,
screen->cpp,
screen->depthOffset, screen->depthPitch,
@@ -778,7 +778,7 @@ mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv,
}
else if (mesaVis->depthBits == 32) {
driRenderbuffer *depthRb
- = driNewRenderbuffer(GL_DEPTH_COMPONENT32,
+ = driNewRenderbuffer(MESA_FORMAT_Z32,
NULL,
screen->cpp,
screen->depthOffset, screen->depthPitch,
@@ -789,7 +789,7 @@ mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv,
if (mesaVis->stencilBits > 0 && !swStencil) {
driRenderbuffer *stencilRb
- = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT,
+ = driNewRenderbuffer(MESA_FORMAT_S8,
NULL,
screen->cpp,
screen->depthOffset, screen->depthPitch,
diff --git a/src/mesa/drivers/dri/mga/mgaspan.c b/src/mesa/drivers/dri/mga/mgaspan.c
index 5b6d323ca9..2ff1cac8e2 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);
}
}