From 4040e9be58a6ebc577928ec2437a99f9f930919f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Mon, 18 Jun 2007 21:14:18 +0000 Subject: [PATCH] Add a hack to make it work with XGL. svn path=/trunk/KDE/kdebase/workspace/; revision=677300 --- COMPOSITE_TODO | 27 +++++++++++++-------------- scene_opengl.cpp | 6 +++++- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/COMPOSITE_TODO b/COMPOSITE_TODO index e4d95b601d..fc4c04c6a3 100644 --- a/COMPOSITE_TODO +++ b/COMPOSITE_TODO @@ -85,20 +85,19 @@ OpenGL TODO / Check/make it work with other gfx cards -? Xgl support - - Compiz itself doesn't work when compiled with the libGL from nvidia, - it ships its own and links against it -? - might be worth trying to use that libGL as well - - it may be just because of the special libGL, but when testing with Xgl - it even seemed non-conformant - none of the provided configs had - GLX_RENDER_TYPE with GLX_RGBA_BIT even though required by GLX - and other funny things. Indeed, it may be just me being still pretty - clueless about these things. -? - is there a good reason to support Xgl? With the 9625 nvidia drivers - it seems to work fine without them and there's AIGLX - -+ AIGLX support - - kind of works, needs more work +% Xgl support + - should work + - in SceneGL::Texture::findTarget() there is a hack that makes KWin work with XGL + without requiring KWin to be built against the libGL version that Compiz is + built against +% - that may not be necessary somewhen later + - interesting observation: normally run glxgears performs somewhat poorly compared + to normal nvidia mode, changing glxgears to be override-redirect (i.e. no reparenting) + however makes glxgears to be even faster than without any compositing at all, + in this case however kwin's redrawing speed drops somewhat + +% AIGLX support + - should work + - it needs indirect rendering, should be autodetected and disabled somehow % - may require LIBGL_ALWAYS_INDIRECT set with older X.org (http://lists.kde.org/?l=kwin&m=116439615124838&w=2) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index 05195e4e0b..87ee8dce75 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -766,7 +766,11 @@ void SceneOpenGL::Texture::findTarget() unsigned int new_target = 0; if( tfp_mode && glXQueryDrawable && bound_glxpixmap != None ) glXQueryDrawable( display(), bound_glxpixmap, GLX_TEXTURE_TARGET_EXT, &new_target ); - else + // Hack for XGL - this should not be a fallback for glXQueryDrawable() but instead the case + // when glXQueryDrawable is not available. However this call fails with XGL, unless KWin + // is compiled statically with the libGL that Compiz is built against (without which neither + // Compiz works with XGL). Falling back to doing this manually makes this work. + if( new_target == 0 ) { if( NPOTTextureSupported() || ( isPowerOfTwo( mSize.width()) && isPowerOfTwo( mSize.height())))