Hacks for specific driver systems:
- setting LIBGL_ALWAYS_INDIRECT=1, as that seems to be required for texture_from_pixmap to work with AIGLX - setting __GL_YIELD=NOTHING to noticeably improve smoothness with nVidia svn path=/trunk/KDE/kdebase/workspace/; revision=749631
This commit is contained in:
parent
c222bdfff4
commit
bb97953656
4 changed files with 59 additions and 9 deletions
|
@ -69,6 +69,8 @@ if(OPENGL_FOUND)
|
|||
if (DL_LIBRARY)
|
||||
target_link_libraries(kdeinit_kwin ${DL_LIBRARY})
|
||||
endif(DL_LIBRARY)
|
||||
# must be after opengl, to be initialized first by the linker
|
||||
target_link_libraries(kdeinit_kwin kwinnvidiahack)
|
||||
endif(OPENGL_FOUND)
|
||||
if (X11_Xrandr_FOUND)
|
||||
target_link_libraries(kdeinit_kwin ${X11_Xrandr_LIB})
|
||||
|
@ -91,6 +93,18 @@ install(TARGETS kdeinit_kwin DESTINATION ${LIB_INSTALL_DIR} )
|
|||
target_link_libraries( kwin kdeinit_kwin )
|
||||
install(TARGETS kwin DESTINATION ${BIN_INSTALL_DIR})
|
||||
|
||||
|
||||
########### next target ###############
|
||||
|
||||
set( kwinnvidiahack_LIB_SRCS
|
||||
nvidiahack.cpp )
|
||||
|
||||
|
||||
kde4_add_library(kwinnvidiahack SHARED ${kwinnvidiahack_LIB_SRCS})
|
||||
|
||||
set_target_properties(kwinnvidiahack PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
|
||||
install(TARGETS kwinnvidiahack DESTINATION ${LIB_INSTALL_DIR} )
|
||||
|
||||
########### install files ###############
|
||||
|
||||
install( FILES kwin.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
|
||||
|
|
|
@ -56,9 +56,6 @@ KDE 4.0 TODO
|
|||
|
||||
- shm mode needs support for more data formats than GL_BGRA
|
||||
|
||||
? __GL_YIELD=NOTHING
|
||||
? LIBGL_ALWAYS_INDIRECT
|
||||
|
||||
- check what works with XRender
|
||||
|
||||
- should OpenGL fall back to XRender if OpenGL initialization fails?
|
||||
|
@ -151,10 +148,6 @@ OpenGL TODO
|
|||
|
||||
% AIGLX support
|
||||
- should work
|
||||
+ - it needs indirect rendering, should be autodetected and disabled somehow
|
||||
% - may require LIBGL_ALWAYS_INDIRECT set with older X.org
|
||||
(http://lists.kde.org/?l=kwin&m=116439615124838&w=2)
|
||||
(http://lists.freedesktop.org/archives/xorg/2006-December/020323.html)
|
||||
|
||||
/ GL_ARB_texture_rectangle vs GL_ARB_texture_non_power_of_two
|
||||
% - works; bugs in tfp_mode with power_of_two textures
|
||||
|
@ -181,8 +174,11 @@ OpenGL TODO
|
|||
- this now works for 16bpp, but maybe not 15bpp or less
|
||||
- endian issues?
|
||||
|
||||
% __GL_YIELD=NOTHING for NVidia reportedly improves perceived performance
|
||||
- it needs to be set somehow (http://lists.kde.org/?l=kwin&m=117794153720348&w=2)
|
||||
+ support for __GL_YIELD=NOTHING and LIBGL_ALWAYS_INDIRECT should be possibly less hacky
|
||||
- or at least not hardcoded (although, does that matter?)
|
||||
- (http://lists.kde.org/?l=kwin&m=116439615124838&w=2)
|
||||
- (http://lists.freedesktop.org/archives/xorg/2006-December/020323.html)
|
||||
|
||||
|
||||
XRender TODO
|
||||
==============================
|
||||
|
|
2
main.cpp
2
main.cpp
|
@ -407,6 +407,8 @@ KDE_EXPORT int kdemain( int argc, char * argv[] )
|
|||
signal(SIGINT, SIG_IGN);
|
||||
if (signal(SIGHUP, KWin::sighandler) == SIG_IGN)
|
||||
signal(SIGHUP, SIG_IGN);
|
||||
// HACK this is needed for AIGLX
|
||||
setenv( "LIBGL_ALWAYS_INDIRECT","1", true );
|
||||
KWin::Application a;
|
||||
KWin::SessionManager weAreIndeed;
|
||||
KWin::SessionSaveDoneHelper helper;
|
||||
|
|
38
nvidiahack.cpp
Normal file
38
nvidiahack.cpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
/********************************************************************
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
Copyright (C) 2007 Lubos Lunak <l.lunak@kde.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
|
||||
/*
|
||||
|
||||
The only purpose of this file is to be later in the link order than
|
||||
(nvidia's) libGL, thus being initialized by the dynamic linker before it,
|
||||
allowing it to set __GL_YIELD=NOTHING soon enough for libGL to notice it.
|
||||
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <kdefakes.h>
|
||||
|
||||
class kwinnvidiahack
|
||||
{
|
||||
public:
|
||||
kwinnvidiahack() { setenv( "__GL_YIELD", "NOTHING", true ); }
|
||||
};
|
||||
|
||||
kwinnvidiahack kwinnvidiahackinst;
|
Loading…
Reference in a new issue