Mesa (master): dri: Don't tie the accum buffer's alpha-ness to the color buffer's

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 8 22:23:51 UTC 2021


Module: Mesa
Branch: master
Commit: 40afef67e2be73be4b414843e3cfff10b836bffb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=40afef67e2be73be4b414843e3cfff10b836bffb

Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Apr  6 15:20:29 2021 -0400

dri: Don't tie the accum buffer's alpha-ness to the color buffer's

Let's preface this all by noting that the accum buffer is unused even by
legacy feature standards, and that anybody needing it to be performant
is probably not using Mesa to begin with since we've never accelerated
it. This fix is really about making drisw work under hostile GLX
environments, since it doesn't have any control over what's running on
the server side.

NVIDIA's driver simply lists RGBA16 accumulation buffers for every
fbconfig, and the accum buffer's alpha channel is always non-zero even
if the color buffer is RGBX. If we try to point llvmpipe at such a
screen, then _none_ of the depth-24 fbconfigs will find a matching DRI
config, since DRI's accumful config will have 0 accum alpha bits. This
is somewhat limiting since most X applications are expecting an RGBX
config and will be accidentally translucent at depth 32.

Due to the somewhat ugly nature of how xserver constructs fbconfigs, if
you run a driver with this fix against a server from before this fix (or
vice versa), you will find the opposite result: none of your RGBX
fbconfigs will have an accum buffer, though the RGBA ones still will.
That's a pretty acceptable tradeoff to me since what we're gaining is
the ability to use llvmpipe at all.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1648>

---

 src/mesa/drivers/dri/common/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index a42f7fdc81a..a3f2bc57f46 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -340,7 +340,7 @@ driCreateConfigs(mesa_format format,
 		    modes->accumRedBits   = 16 * j;
 		    modes->accumGreenBits = 16 * j;
 		    modes->accumBlueBits  = 16 * j;
-		    modes->accumAlphaBits = (masks[3] != 0) ? 16 * j : 0;
+		    modes->accumAlphaBits = 16 * j;
 
 		    modes->stencilBits = stencil_bits[k];
 		    modes->depthBits = depth_bits[k];



More information about the mesa-commit mailing list