Dieter N�tzel wrote:

"bufferSize.diff" is bigger:

Index: xf86glx.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/GL/mesa/src/X/xf86glx.c,v
retrieving revision 1.20
diff -u -r1.20 xf86glx.c
--- xf86glx.c   7 May 2003 17:47:59 -0000       1.20
+++ xf86glx.c   7 May 2003 22:27:30 -0000
@@ -135,10 +135,9 @@

 /*
  * In the case the driver defines no GLX visuals we'll use these.
- * One thing is funny here: the bufferSize field doesn't always include
- * the alpha bits.  That is, bufferSize may be 24 when we have 8 bits
- * of red, green, blue and alpha.  If set set bufferSize to 32 we may
- * foul-up the visual matching code below (search for bufferSize).
+ * Note that for TrueColor and DirectColor visuals, bufferSize is the
+ * sum of redSize, greenSize, blueSize and alphaSize, which may be larger
+ * than the nplanes/rootDepth of the server's X11 visuals
  */
 #define NUM_FALLBACK_CONFIGS 5
 static __GLXvisualConfig FallbackConfigs[NUM_FALLBACK_CONFIGS] = {
@@ -405,7 +404,14 @@
                glXVisualPtr[j].greenMask  = pVisual[i].greenMask;
                glXVisualPtr[j].blueMask   = pVisual[i].blueMask;
                glXVisualPtr[j].alphaMask  = glXVisualPtr[j].alphaMask;
-               glXVisualPtr[j].bufferSize = rootDepth;
+               if (is_rgb) {
+                   glXVisualPtr[j].bufferSize = glXVisualPtr[j].redSize +
+                                                glXVisualPtr[j].greenSize +
+                                                glXVisualPtr[j].blueSize +
+                                                glXVisualPtr[j].alphaSize;
+               } else {
+                   glXVisualPtr[j].bufferSize = rootDepth;
+               }
            }

            /* Save the device-dependent private for this visual */
@@ -505,7 +511,7 @@
        /* Find a visual that matches the GLX visual's class and size */
        for (j = 0; j < pScreen->numVisuals; j++, pVis++) {
            if (pVis->class == pGLXVis->class &&
-               pVis->nplanes == pGLXVis->bufferSize) {
+               pVis->nplanes == (pGLXVis->bufferSize - pGLXVis->alphaSize)) {

                /* Fixup the masks */
                pGLXVis->redMask   = pVis->redMask;
@@ -545,7 +551,7 @@
        for (j = 0; j < pScreen->numVisuals; j++, pVis++) {

            if (pVis->class == pGLXVis->class &&
-               pVis->nplanes == pGLXVis->bufferSize &&
+               pVis->nplanes == (pGLXVis->bufferSize - pGLXVis->alphaSize) &&
                !used[j]) {

if (pVis->redMask == pGLXVis->redMask &&

This should be fine, but I do have one question. Are we sure that alphaSize will be zero if is_rgb is false? If that's not the case, then the (pGLXVis->buferSize - pGLXVis->alphaSize) values will not be correct.





------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to