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
This commit is contained in:
Fredrik Höglund 2011-01-18 23:09:59 +00:00
parent 35dcccb847
commit e7d37dfbb3

View file

@ -66,6 +66,7 @@ Sources and other compositing managers:
*/
#include "scene_opengl.h"
#include "kwinglplatform.h"
#include <kxerrorhandler.h>
@ -1136,17 +1137,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