summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-09-23 01:17:07 +0000
committerBrian Paul <[email protected]>2005-09-23 01:17:07 +0000
commite5fce1694cdfca615022bf7b987835384902aceb (patch)
tree566b22f0b770a54b0cbcd622b06d23e16b8b8889
parent7b01068a231f7a1c21b58f5191a6f5f11df79d3f (diff)
improve the test for using software alpha buffer
-rw-r--r--src/mesa/drivers/x11/xm_api.c17
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 53ee56e46cb..a402d608e04 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 */