Summary: | OpenGL screensavers "back to front" | ||
---|---|---|---|
Product: | [Unmaintained] kscreensaver | Reporter: | Nick Battle <nick.battle> |
Component: | general | Assignee: | kscreensaver bugs tracking <kscreensaver-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | apfaller, l.lunak, rdieter |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
Output of glxinfo
Output of xdpyinfo Output of xscreensaver-gl-helper |
Description
Nick Battle
2006-01-26 13:55:39 UTC
I don't know whether this is relevant, but in the Desktop Configuration display, if the problem is exhibited in the small demo window, it *isn't* exhibited in the setup window, and vice versa. It almost as though every other execution gives the effect, but it's not as simple as that with the main display screen saver - this seems to consistently show the effect, or not, for a whole KDE session. I think I can see what's going wrong here. Kscreensaver isn't setting the right "visual" for OpenGL screen savers. You can reproduce the effect by running an OpenGL X screen saver directly and passing the "Default" X visual rather than the "GL" visual, though it seems to have to run full screen (-root) to show the effect. It looks like KDE doesn't pass the -visual argument to the screen savers (according to a ps -ef). There is a program called xscreensaver-gl-helper which returns the id of the OpenGL visual (0x25 on my machine), but I'm not clear whether that's something that the savers themselves call, or something that xscreensaver calls itself. The visual is recorded in $HOME/.xscreensaver, but it looks like KDE uses ~/.kde/share/config/<name>rc to hold settings for each saver, and "visual" isn't one of the options. Can anyone confirm whether does explain the problem? What version of xscreensaver are you using? I ask because xscreensaver <= 4.21 had bugs that kde triggered. SuSE 10.0 has xscreensaver 4.22. That's from Novell's website. I haven't confirmed it on the machine, but it is a clean SuSE installation. I had the following feedback on this from Brian Paul on the Mesa mail list (I thought it might be a bug in the Mesa libraries). Apparently this is a recognised phenomenon, to do with X visuals and Z Buffers: "A visual, specifically a GLX visual, describes a framebuffer's or window's pixel format in terms of number of bits of red,green,blue,alpha, size of the depth(Z) buffer, stencil buffer etc. For hidden surface removal you need a depth buffer. If the visual doesn't have a depth buffer, 3D rendering will appear strange as you described. The default visual, used by the root window, may or may not have a Z/depth buffer. Often it doesn't in an effort to reduce memory usage. The 'glxinfo' program lists the attributes for each visual. This issue has been around for a long time, I'm sure google would turn up more background info. -Brian" Just to follow up on this, I recently installed SuSE 10.1, which has KDE 3.5.3, and the problem still exists. Oops! SuSE 10.1 is KDE 3.5.1, my apologies. :-) For me SuSEs 10.1 kdebase3-3.5.1-69.32 rpm (current from official update tree) works fine but kdebase3-3.5.5-89.2 (from SuSE factory tree for 10.1) shows the same problem. I compiled and installed (only) kcm_screensaver from the current 3.5 branch in my current 3.5.5 installation (factory tree) and the problem remained. If I install (again only) kcm_screensaver rev. r595222 everything works as expected. The changelog for r595223: ------------------------------------------------------------------------ r595223 | lunakl | 2006-10-13 17:19:30 +0200 (Fri, 13 Oct 2006) | 5 lines Changed paths: M /branches/KDE/3.5/kdebase/kcontrol/screensaver/kswidget.cpp M /branches/KDE/3.5/kdebase/kdesktop/lock/lockprocess.cc GLX_DEPTH_SIZE = size of the depth buffer (Z buffer) GLX_BUFFER_SIZE = size of the color buffer (color depth) BUG: 73813 ------------------------------------------------------------------------ In case it matters: Athlon 64 X2 3800 (64-bit install), Nvidia GeForce 6600, Nvidia Drivers Version 8776 Please attach(!) output of glxinfo, xdpyinfo and xscreensaver-gl-helper. Created attachment 18654 [details]
Output of glxinfo
Created attachment 18655 [details]
Output of xdpyinfo
Created attachment 18656 [details]
Output of xscreensaver-gl-helper
SVN commit 608489 by lunakl: Try to find a visual with as many OpenGL features as possible. Some screensavers don't look quite right without a Z-buffer. BUG: 120811 M +33 -7 kcontrol/screensaver/kswidget.cpp M +36 -10 kdesktop/lock/lockprocess.cc --- trunk/KDE/kdebase/workspace/kcontrol/screensaver/kswidget.cpp #608488:608489 @@ -19,14 +19,40 @@ int flags = 0; if( true /*mOpenGLVisual*/ ) { - int attribs[] = { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_BUFFER_SIZE, x11Depth(), None }; - if( XVisualInfo* i = glXChooseVisual( x11Display(), x11Screen(), attribs )) + static int attribs[][ 15 ] = { - visual = i->visual; - colormap = XCreateColormap( x11Display(), RootWindow( x11Display(), x11Screen()), visual, AllocNone ); - attrs.colormap = colormap; - flags |= CWColormap; - XFree( i ); + #define R GLX_RED_SIZE + #define G GLX_GREEN_SIZE + #define B GLX_BLUE_SIZE + { GLX_RGBA, R, 8, G, 8, B, 8, GLX_DEPTH_SIZE, 8, GLX_DOUBLEBUFFER, GLX_STENCIL_SIZE, 1, None }, + { GLX_RGBA, R, 4, G, 4, B, 4, GLX_DEPTH_SIZE, 4, GLX_DOUBLEBUFFER, GLX_STENCIL_SIZE, 1, None }, + { GLX_RGBA, R, 8, G, 8, B, 8, GLX_DEPTH_SIZE, 8, GLX_DOUBLEBUFFER, None }, + { GLX_RGBA, R, 4, G, 4, B, 4, GLX_DEPTH_SIZE, 4, GLX_DOUBLEBUFFER, None }, + { GLX_RGBA, R, 8, G, 8, B, 8, GLX_DEPTH_SIZE, 8, GLX_STENCIL_SIZE, 1, None }, + { GLX_RGBA, R, 4, G, 4, B, 4, GLX_DEPTH_SIZE, 4, GLX_STENCIL_SIZE, 1, None }, + { GLX_RGBA, R, 8, G, 8, B, 8, GLX_DEPTH_SIZE, 8, None }, + { GLX_RGBA, R, 4, G, 4, B, 4, GLX_DEPTH_SIZE, 4, None }, + { GLX_RGBA, GLX_DEPTH_SIZE, 8, GLX_DOUBLEBUFFER, GLX_STENCIL_SIZE, 1, None }, + { GLX_RGBA, GLX_DEPTH_SIZE, 8, GLX_DOUBLEBUFFER, None }, + { GLX_RGBA, GLX_DEPTH_SIZE, 8, GLX_STENCIL_SIZE, 1, None }, + { GLX_RGBA, GLX_DEPTH_SIZE, 8, None } + #undef R + #undef G + #undef B + }; + for( unsigned int i = 0; + i < sizeof( attribs ) / sizeof( attribs[ 0 ] ); + ++i ) + { + if( XVisualInfo* info = glXChooseVisual( x11Display(), x11Screen(), attribs[ i ] )) + { + visual = info->visual; + colormap = XCreateColormap( x11Display(), RootWindow( x11Display(), x11Screen()), visual, AllocNone ); + attrs.colormap = colormap; + flags |= CWColormap; + XFree( info ); + break; + } } } Window w = XCreateWindow( x11Display(), parentWidget() ? parentWidget()->winId() : RootWindow( x11Display(), x11Screen()), --- trunk/KDE/kdebase/workspace/kdesktop/lock/lockprocess.cc #608488:608489 @@ -416,17 +416,43 @@ #ifdef HAVE_GLXCHOOSEVISUAL if( mOpenGLVisual ) { - int attribs[] = { GLX_RGBA, GLX_DOUBLEBUFFER, GLX_BUFFER_SIZE, x11Depth(), None }; - if( XVisualInfo* i = glXChooseVisual( x11Display(), x11Screen(), attribs )) + static int attribs[][ 15 ] = { - visual = i->visual; - static Colormap colormap = 0; - if( colormap != 0 ) - XFreeColormap( x11Display(), colormap ); - colormap = XCreateColormap( x11Display(), RootWindow( x11Display(), x11Screen()), visual, AllocNone ); - attrs.colormap = colormap; - flags |= CWColormap; - XFree( i ); + #define R GLX_RED_SIZE + #define G GLX_GREEN_SIZE + #define B GLX_BLUE_SIZE + { GLX_RGBA, R, 8, G, 8, B, 8, GLX_DEPTH_SIZE, 8, GLX_DOUBLEBUFFER, GLX_STENCIL_SIZE, 1, None }, + { GLX_RGBA, R, 4, G, 4, B, 4, GLX_DEPTH_SIZE, 4, GLX_DOUBLEBUFFER, GLX_STENCIL_SIZE, 1, None }, + { GLX_RGBA, R, 8, G, 8, B, 8, GLX_DEPTH_SIZE, 8, GLX_DOUBLEBUFFER, None }, + { GLX_RGBA, R, 4, G, 4, B, 4, GLX_DEPTH_SIZE, 4, GLX_DOUBLEBUFFER, None }, + { GLX_RGBA, R, 8, G, 8, B, 8, GLX_DEPTH_SIZE, 8, GLX_STENCIL_SIZE, 1, None }, + { GLX_RGBA, R, 4, G, 4, B, 4, GLX_DEPTH_SIZE, 4, GLX_STENCIL_SIZE, 1, None }, + { GLX_RGBA, R, 8, G, 8, B, 8, GLX_DEPTH_SIZE, 8, None }, + { GLX_RGBA, R, 4, G, 4, B, 4, GLX_DEPTH_SIZE, 4, None }, + { GLX_RGBA, GLX_DEPTH_SIZE, 8, GLX_DOUBLEBUFFER, GLX_STENCIL_SIZE, 1, None }, + { GLX_RGBA, GLX_DEPTH_SIZE, 8, GLX_DOUBLEBUFFER, None }, + { GLX_RGBA, GLX_DEPTH_SIZE, 8, GLX_STENCIL_SIZE, 1, None }, + { GLX_RGBA, GLX_DEPTH_SIZE, 8, None } + #undef R + #undef G + #undef B + }; + for( unsigned int i = 0; + i < sizeof( attribs ) / sizeof( attribs[ 0 ] ); + ++i ) + { + if( XVisualInfo* info = glXChooseVisual( x11Display(), x11Screen(), attribs[ i ] )) + { + visual = info->visual; + static Colormap colormap = 0; + if( colormap != 0 ) + XFreeColormap( x11Display(), colormap ); + colormap = XCreateColormap( x11Display(), RootWindow( x11Display(), x11Screen()), visual, AllocNone ); + attrs.colormap = colormap; + flags |= CWColormap; + XFree( info ); + break; + } } } #endif This seems to be related: I (and others http://www.thisishull.net/showthread.php?t=234364) still see similar bugs in KDE 3.5.5 release 45.4 on OpenSUSE 10.2 Is the above fix included in the current distributed version? |