Work around ATI crashes.
svn path=/branches/work/kwin_composite/; revision=603713
This commit is contained in:
parent
1cc603cf75
commit
bcfc36c695
3 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
==============================
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue