diff options
-rw-r--r-- | src/mesa/drivers/x11/xm_api.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 53ee56e46c..a402d608e0 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -340,6 +340,8 @@ alloc_xmesa_buffer(XMesaVisual vis, BufferType type, XMesaColormap cmap) { XMesaBuffer b = (XMesaBuffer) CALLOC_STRUCT(xmesa_buffer); if (b) { + GLboolean swAlpha; + b->display = vis->display; b->xm_visual = vis; b->type = type; @@ -369,12 +371,25 @@ alloc_xmesa_buffer(XMesaVisual vis, BufferType type, XMesaColormap cmap) &b->backxrb->Base); } + /* determine if we need software alpha planes */ + if (vis->mesa_visual.alphaBits > 0 + && vis->undithered_pf != PF_8A8B8G8R + && vis->undithered_pf != PF_8A8R8G8B) { + /* Visual has alpha, but pixel format doesn't support it. + * We'll use an alpha renderbuffer wrapper. + */ + swAlpha = GL_TRUE; + } + else { + swAlpha = GL_FALSE; + } + _mesa_add_soft_renderbuffers(&b->mesa_buffer, GL_FALSE, /* color */ vis->mesa_visual.haveDepthBuffer, vis->mesa_visual.haveStencilBuffer, vis->mesa_visual.haveAccumBuffer, - vis->mesa_visual.alphaBits > 0, + swAlpha, vis->mesa_visual.numAuxBuffers > 0 ); /* insert into linked list */ |