diff --git a/COMPOSITE_TODO b/COMPOSITE_TODO index 7d7f12e395..072c5fd734 100644 --- a/COMPOSITE_TODO +++ b/COMPOSITE_TODO @@ -138,6 +138,12 @@ OpenGL TODO ? compiz checks that "GLX_SGIX_fbconfig" extension is present and requires it +? non-tfp mode creates context everytime it updates the texture in bindTexture() + - otherwise ATI crashes (http://lists.kde.org/?l=kwin&m=116304346330186&w=2, + http://lists.kde.org/?l=kwin&m=116310179311409&w=2) +? - it causes small performance decrease (5-10%), but non-tfp is bound to be slower anyway + - the commit is r603713, maybe it should be checked later and perhaps reverted + XRender TODO ============================== diff --git a/scene_opengl.cpp b/scene_opengl.cpp index f378299c92..d6405d56bd 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -71,7 +71,6 @@ namespace KWinInternal GLXFBConfig SceneOpenGL::fbcdrawable; // GLX content GLXContext SceneOpenGL::ctxbuffer; -GLXContext SceneOpenGL::ctxdrawable; // the destination drawable where the compositing is done GLXDrawable SceneOpenGL::glxbuffer; bool SceneOpenGL::tfp_mode; // using glXBindTexImageEXT (texture_from_pixmap) @@ -190,7 +189,6 @@ SceneOpenGL::SceneOpenGL( Workspace* ws ) kDebug() << "Buffer visual: 0x" << QString::number( vis_buffer, 16 ) << ", drawable visual: 0x" << QString::number( vis_drawable, 16 ) << endl; ctxbuffer = glXCreateNewContext( display(), fbcbuffer, GLX_RGBA_TYPE, NULL, GL_FALSE ); - ctxdrawable = glXCreateNewContext( display(), fbcdrawable, GLX_RGBA_TYPE, ctxbuffer, GL_FALSE ); if( !glXMakeContextCurrent( display(), glxbuffer, glxbuffer, ctxbuffer ) ) assert( false ); @@ -236,7 +234,6 @@ SceneOpenGL::~SceneOpenGL() XFreePixmap( display(), buffer ); } glXDestroyContext( display(), ctxbuffer ); - glXDestroyContext( display(), ctxdrawable ); checkGLError( "Cleanup" ); } @@ -545,6 +542,7 @@ void SceneOpenGL::Window::bindTexture() } else { // non-tfp case, copy pixmap contents to a texture + GLXContext ctxdrawable = glXCreateNewContext( display(), fbcdrawable, GLX_RGBA_TYPE, ctxbuffer, GL_FALSE ); GLXDrawable pixmap = glXCreatePixmap( display(), fbcdrawable, pix, NULL ); glXMakeContextCurrent( display(), pixmap, pixmap, ctxdrawable ); glReadBuffer( GL_FRONT ); @@ -580,6 +578,7 @@ void SceneOpenGL::Window::bindTexture() // the pixmap glXWaitGL(); glXDestroyPixmap( display(), pixmap ); + glXDestroyContext( display(), ctxdrawable ); XFreePixmap( display(), pix ); if( db ) glDrawBuffer( GL_BACK ); diff --git a/scene_opengl.h b/scene_opengl.h index fe3ef97934..5baa7e2ef5 100644 --- a/scene_opengl.h +++ b/scene_opengl.h @@ -46,7 +46,6 @@ class SceneOpenGL static GLXFBConfig fbcdrawable; static GLXDrawable glxbuffer; static GLXContext ctxbuffer; - static GLXContext ctxdrawable; static bool tfp_mode; static bool copy_buffer_hack; static bool supports_saturation;