mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-02 22:11:22 +00:00
GL_Init: on OS X, enable multi-threaded OpenGL mode.
This moves some of the OpenGL implementation to a background thread, and makes draw calls block for a shorter amount of time. AFAIK, this is the default mode on most other OS'es, not sure why you have to explicitly ask for it on OS X. N.B. the kCGLCEMPEngine constant is available on 10.4+ so I don't bother checking the OS X version. More info: https://developer.apple.com/library/mac/technotes/tn2085/_index.html git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1137 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
fce0215843
commit
2870be2bee
1 changed files with 14 additions and 0 deletions
|
@ -36,6 +36,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//ericw -- for putting the driver into multithreaded mode
|
||||||
|
#ifdef __APPLE__
|
||||||
|
#include <OpenGL/OpenGL.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MAX_MODE_LIST 600 //johnfitz -- was 30
|
#define MAX_MODE_LIST 600 //johnfitz -- was 30
|
||||||
#define MAX_BPPS_LIST 5
|
#define MAX_BPPS_LIST 5
|
||||||
#define WARP_WIDTH 320
|
#define WARP_WIDTH 320
|
||||||
|
@ -1043,6 +1048,15 @@ static void GL_Init (void)
|
||||||
|
|
||||||
GL_CheckExtensions (); //johnfitz
|
GL_CheckExtensions (); //johnfitz
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
// ericw -- enable multi-threaded OpenGL, gives a decent FPS boost.
|
||||||
|
// see: https://developer.apple.com/library/mac/technotes/tn2085/_index.html
|
||||||
|
if (kCGLNoError != CGLEnable( CGLGetCurrentContext(), kCGLCEMPEngine))
|
||||||
|
{
|
||||||
|
Con_Warning ("Couldn't enable multi-threaded OpenGL");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//johnfitz -- intel video workarounds from Baker
|
//johnfitz -- intel video workarounds from Baker
|
||||||
if (!strcmp(gl_vendor, "Intel"))
|
if (!strcmp(gl_vendor, "Intel"))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue