Bug 43128 - Software Rasterizer Alpha buffer transparent when window does not request an alpha buffer.
Summary: Software Rasterizer Alpha buffer transparent when window does not request an ...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/X11 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium major
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-20 23:45 UTC by Campbell Barton
Modified: 2019-09-18 16:00 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
screenshot of blender with strange alpha problem (176.01 KB, image/png)
2011-11-20 23:45 UTC, Campbell Barton
Details

Description Campbell Barton 2011-11-20 23:45:18 UTC
Created attachment 53733 [details]
screenshot of blender with strange alpha problem

Hi there is a big which many blender 3d users experience where the window its self becomes transparent, this is not desired under _any_ circumstances, the window should _always_ be opaque.

This happens with the following configuration, I managed to redo this bug too both with last stable Mesa and with git mesa.

So this i a long standing bug in mesa but tested in commit:
03df791c6f0881e45a65106c22ccd28f77018fb3 to make sure its not fixed recently.


The problem happens when running a compositing window manager (Unity or GnomeShell 3.2), In my case on an NVidia hardware accelerated drivers.

And within this, running blender with SWRAST mesa, in my case I built mesa with only swrast driver and opened blender with my mesa build:

LD_PRELOAD=/opt/mesa/lib/libGL.so ./blender

If you want to try this quickly, get the latest stable blender build and run:
 "blender-softwaregl", this preloads mesa library too


I installed gnome shell 3.2 recently and attempted to fix the bug on blenders side.

I found that by adding the GLX_ALPHA_SIZE attribute to glXChooseVisual(...), then ensuring that alpha was set to 1.0 when calling glClearColor this mostly fixes the problem, but not totally because in some cases we intentionally draw without full alpha, those areas became transparent again.

However we don't want to use the alpha buffer at all, and seeing as this works with most other configurations - ATI/NVidia at least, I think the bug is in mesa's SWRAST or software GLX.

Patch on blender which works around the problem.
http://codereview.appspot.com/5415058

---

Logically - if you don't ask for an alpha buffer, it should assume the buffer is solid, not transparent.


Attach an example, the blender splash screen should be visible and the window should be a mostly a uniform gray, but you can see firefox is open behind blender.
Comment 1 Michel Dänzer 2011-12-06 09:30:08 UTC
Presumably running blender with the environment variable XLIB_SKIP_ARGB_VISUALS=1 works around this. Some Mesa X11 code needs to learn to properly handle the depth 32 visual created by the Composite extension.
Comment 2 Adam Jackson 2019-09-18 16:00:56 UTC
Recent Xorgs will punish the alpha-ful visual by hiding it in a lower-priority select group, so you won't get alpha unless you ask for it.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.