[prev in list] [next in list] [prev in thread] [next in thread]
List: kwin
Subject: TFP test
From: Lubos Lunak <l.lunak () suse ! cz>
Date: 2007-06-19 13:31:11
Message-ID: 200706191531.12140.l.lunak () suse ! cz
[Download RAW message or body]
Hello,
could people who _don't_ have nvidia and can run KWin in TFP mode please run
the attached testapp and give me the output (plus what card etc.)? Thanks
--
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o. e-mail: l.lunak@suse.cz , l.lunak@kde.org
Lihovarska 1060/12 tel: +420 284 028 972
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http//www.suse.cz
["g.cpp" (text/x-c++src)]
#include <X11/Xlib.h>
#include <GL/glx.h>
#include <limits.h>
#include <kdebug.h>
bool tfp_mode = true;
Display* dpy;
Display* display()
{
return dpy;
}
int main()
{
dpy = XOpenDisplay( NULL );
int cnt;
GLXFBConfig *fbconfigs = glXGetFBConfigs( display(), DefaultScreen( display() ), \
&cnt );
for( int i = 0; i <= 32; i++ )
{
int back, stencil, depth, caveat, alpha, mipmap, rgba;
back = INT_MAX;
stencil = INT_MAX;
depth = INT_MAX;
caveat = INT_MAX;
mipmap = 0;
rgba = 0;
for( int j = 0; j < cnt; j++ )
{
XVisualInfo *vi;
int visual_depth;
vi = glXGetVisualFromFBConfig( display(), fbconfigs[ j ] );
if( vi == NULL )
continue;
visual_depth = vi->depth;
XFree( vi );
if( visual_depth != i )
continue;
int value;
glXGetFBConfigAttrib( display(), fbconfigs[ j ],
GLX_ALPHA_SIZE, &alpha );
glXGetFBConfigAttrib( display(), fbconfigs[ j ],
GLX_BUFFER_SIZE, &value );
if( value != i && ( value - alpha ) != i )
continue;
if( tfp_mode )
{
value = 0;
if( i == 32 )
{
glXGetFBConfigAttrib( display(), fbconfigs[ j ],
GLX_BIND_TO_TEXTURE_RGBA_EXT, &value );
if( value )
{
rgba = 1;
// fbcdrawableinfo[ i ].bind_texture_format = \
GLX_TEXTURE_FORMAT_RGBA_EXT; }
}
if( !value )
{
if( rgba )
continue;
glXGetFBConfigAttrib( display(), fbconfigs[ j ],
GLX_BIND_TO_TEXTURE_RGB_EXT, &value );
if( !value )
continue;
// fbcdrawableinfo[ i ].bind_texture_format = \
GLX_TEXTURE_FORMAT_RGB_EXT; }
}
int back_value;
glXGetFBConfigAttrib( display(), fbconfigs[ j ],
GLX_DOUBLEBUFFER, &back_value );
if( back_value > back )
continue;
int stencil_value;
glXGetFBConfigAttrib( display(), fbconfigs[ j ],
GLX_STENCIL_SIZE, &stencil_value );
if( stencil_value > stencil )
continue;
int depth_value;
glXGetFBConfigAttrib( display(), fbconfigs[ j ],
GLX_DEPTH_SIZE, &depth_value );
if( depth_value > depth )
continue;
int mipmap_value;
#if 0
if( tfp_mode && GLTexture::framebufferObjectSupported())
{
glXGetFBConfigAttrib( display(), fbconfigs[ j ],
GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &mipmap_value \
); if( mipmap_value < mipmap )
continue;
}
#endif
int caveat_value;
glXGetFBConfigAttrib( display(), fbconfigs[ j ],
GLX_CONFIG_CAVEAT, &caveat_value );
if( caveat_value > caveat )
continue;
// ok, config passed all tests, it's the best one so far
caveat = caveat_value;
back = back_value;
stencil = stencil_value;
depth = depth_value;
mipmap = mipmap_value;
glXGetFBConfigAttrib( display(), fbconfigs[ j ],
GLX_Y_INVERTED_EXT, &value );
// fbcdrawableinfo[ i ].y_inverted = value;
// fbcdrawableinfo[ i ].mipmap = mipmap;
glXGetFBConfigAttrib( display(), fbconfigs[ j ], \
GLX_BIND_TO_TEXTURE_TARGETS_EXT, &value );
kdDebug() << "XXX:" << i << ":" << QString::number( value, 16 ) << ":" << \
(value & GLX_TEXTURE_2D_BIT_EXT) << endl; }
}
if( cnt )
XFree( fbconfigs );
return true;
}
_______________________________________________
Kwin mailing list
Kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic