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
icc-effect-5.14.5
Fredrik Höglund 2011-01-18 23:09:59 +00:00 committed by Martin Gräßlin
parent bfa2fc68e6
commit 8bc99e68c0
2 changed files with 16 additions and 10 deletions

View File

@ -66,6 +66,7 @@ Sources and other compositing managers:
*/
#include "scene_opengl.h"
#include "kwinglplatform.h"
#include <kxerrorhandler.h>

View File

@ -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