From 8bc99e68c09e1134b2c4c5bf728c0eceb33431f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Tue, 18 Jan 2011 23:09:59 +0000 Subject: [PATCH] Don't specify the texture target explicitly with r300g. This is reported to cause a performance regression. FIXED-IN: 4.6.0 BUG: 256654 svn path=/branches/KDE/4.6/kdebase/workspace/; revision=1215519 --- scene_opengl.cpp | 1 + scene_opengl_glx.cpp | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index ea74bea816..6ff9bf4c1b 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -66,6 +66,7 @@ Sources and other compositing managers: */ #include "scene_opengl.h" +#include "kwinglplatform.h" #include diff --git a/scene_opengl_glx.cpp b/scene_opengl_glx.cpp index 7e26cd305b..9bf28e355e 100644 --- a/scene_opengl_glx.cpp +++ b/scene_opengl_glx.cpp @@ -764,17 +764,22 @@ bool SceneOpenGL::Texture::load( const Pixmap& pix, const QSize& size, GLX_MIPMAP_TEXTURE_EXT, fbcdrawableinfo[ depth ].mipmap, None, None, None }; - if ( ( fbcdrawableinfo[ depth ].texture_targets & GLX_TEXTURE_2D_BIT_EXT ) && - ( GLTexture::NPOTTextureSupported() || - ( isPowerOfTwo(size.width()) && isPowerOfTwo(size.height()) ))) + // Specifying the texture target explicitly is reported to cause a performance + // regression with R300G (see bug #256654). + if ( GLPlatform::instance()->driver() != Driver_R300G ) { - attrs[ 4 ] = GLX_TEXTURE_TARGET_EXT; - attrs[ 5 ] = GLX_TEXTURE_2D_EXT; - } - else if ( fbcdrawableinfo[ depth ].texture_targets & GLX_TEXTURE_RECTANGLE_BIT_EXT ) - { - attrs[ 4 ] = GLX_TEXTURE_TARGET_EXT; - attrs[ 5 ] = GLX_TEXTURE_RECTANGLE_EXT; + if ( ( fbcdrawableinfo[ depth ].texture_targets & GLX_TEXTURE_2D_BIT_EXT ) && + ( GLTexture::NPOTTextureSupported() || + ( isPowerOfTwo(size.width()) && isPowerOfTwo(size.height()) ))) + { + attrs[ 4 ] = GLX_TEXTURE_TARGET_EXT; + attrs[ 5 ] = GLX_TEXTURE_2D_EXT; + } + else if ( fbcdrawableinfo[ depth ].texture_targets & GLX_TEXTURE_RECTANGLE_BIT_EXT ) + { + attrs[ 4 ] = GLX_TEXTURE_TARGET_EXT; + attrs[ 5 ] = GLX_TEXTURE_RECTANGLE_EXT; + } } glxpixmap = glXCreatePixmap( display(), fbcdrawableinfo[ depth ].fbconfig, pix, attrs ); #ifdef CHECK_GL_ERROR