[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/kwin
From:       Fredrik Höglund <fredrik () kde ! org>
Date:       2010-12-04 16:55:44
Message-ID: 20101204165544.4C2BEAC8A4 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1203578 by fredrik:

Revert to always calling glXBindTexImageEXT() before rendering.

The GLX implementation in the X server appears to have a hardcoded limit
to how many pixmaps can be bound to textures simultaneously when using
indirect rendering, which we can end up exceeding with the changes
introduced in r1182198.

BUG: 256359
FIXED-IN: 4.5.5


 M  +9 -10     scene_opengl.cpp  
 M  +0 -1      scene_opengl.h  


--- trunk/KDE/kdebase/workspace/kwin/scene_opengl.cpp #1203577:1203578
@@ -1006,7 +1006,6 @@
 
 void SceneOpenGL::Texture::init()
     {
-    damaged = true;
     glxpixmap = None;
     }
 
@@ -1026,6 +1025,7 @@
     {
     if( tfp_mode && glxpixmap != None )
         {
+        if ( !options->glStrictBinding )
         glXReleaseTexImageEXT( display(), glxpixmap, GLX_FRONT_LEFT_EXT );
         glXDestroyPixmap( display(), glxpixmap );
         glxpixmap = None;
@@ -1155,9 +1155,6 @@
             if( !options->glStrictBinding )
                 glXBindTexImageEXT( display(), glxpixmap, GLX_FRONT_LEFT_EXT, NULL );
             }
-        if( options->glStrictBinding )
-            // Mark the texture as damaged so it will be updated on the next call to bind()
-            damaged = true;
         }
     else if( shm_mode )
         { // copy pixmap contents to a texture via shared memory
@@ -1295,18 +1292,13 @@
     {
     glEnable( mTarget );
     glBindTexture( mTarget, mTexture );
-    if( tfp_mode )
+    if( tfp_mode && options->glStrictBinding )
         {
-        if ( options->glStrictBinding && damaged )
-            {
-            // Update the texture with the new pixmap contents
             assert( glxpixmap != None );
             glXReleaseTexImageEXT( display(), glxpixmap, GLX_FRONT_LEFT_EXT );
             glXBindTexImageEXT( display(), glxpixmap, GLX_FRONT_LEFT_EXT, NULL );
             setDirty(); // Mipmaps have to be regenerated after updating the texture 
             }
-        damaged = false;
-        }
     enableFilter();
     if( hasGLVersion( 1, 4, 0 ))
         {
@@ -1321,6 +1313,13 @@
         {
         glTexEnvf( GL_TEXTURE_FILTER_CONTROL, GL_TEXTURE_LOD_BIAS, 0.0f );
         }
+    if( tfp_mode && options->glStrictBinding )
+        {
+        assert( glxpixmap != None );
+        glBindTexture( mTarget, mTexture );
+        glXReleaseTexImageEXT( display(), glxpixmap, GLX_FRONT_LEFT_EXT );
+        }
+
     GLTexture::unbind();
     }
 
--- trunk/KDE/kdebase/workspace/kwin/scene_opengl.h #1203577:1203578
@@ -126,7 +126,6 @@
         void init();
 
         GLXPixmap glxpixmap; // the glx pixmap the texture is bound to, only for tfp_mode
-        bool damaged;
     };
 
 class SceneOpenGL::Window
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic