diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-12-19 18:23:08 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-12-19 18:23:08 +0400 |
commit | a0af3f7ffe7af861720187b2cad47a7623400376 (patch) | |
tree | 794a1afefcb1b68d0319e3f42f4833badeb84778 | |
parent | 41c992ce852c9ffc83a52041cee73e8ce6b4ec04 (diff) |
OS X: add BLENDER_SOFTWAREGL environment variable to force using software OpenGL
renderer, for debugging OpenGL issues.
-rw-r--r-- | intern/ghost/intern/GHOST_WindowCocoa.mm | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 01217dfd17a..fbb474cb20a 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -34,6 +34,7 @@ #endif #include <OpenGL/gl.h> +#include <OpenGL/CGLRenderers.h> /***** Multithreaded opengl code : uncomment for enabling #include <OpenGL/OpenGL.h> */ @@ -485,7 +486,14 @@ GHOST_WindowCocoa::GHOST_WindowCocoa( // needed for 'Draw Overlap' drawing method pixelFormatAttrsWindow[i++] = NSOpenGLPFABackingStore; - pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated; + // Force software OpenGL, for debugging + if(getenv("BLENDER_SOFTWAREGL")) { + pixelFormatAttrsWindow[i++] = NSOpenGLPFARendererID; + pixelFormatAttrsWindow[i++] = kCGLRendererGenericID; + } + else + pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated; + //pixelFormatAttrsWindow[i++] = NSOpenGLPFAAllowOfflineRenderers,; // Removed to allow 10.4 builds, and 2 GPUs rendering is not used anyway pixelFormatAttrsWindow[i++] = NSOpenGLPFADepthSize; @@ -521,7 +529,14 @@ GHOST_WindowCocoa::GHOST_WindowCocoa( // needed for 'Draw Overlap' drawing method pixelFormatAttrsWindow[i++] = NSOpenGLPFABackingStore; - pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated; + // Force software OpenGL, for debugging + if(getenv("BLENDER_SOFTWAREGL")) { + pixelFormatAttrsWindow[i++] = NSOpenGLPFARendererID; + pixelFormatAttrsWindow[i++] = kCGLRendererGenericID; + } + else + pixelFormatAttrsWindow[i++] = NSOpenGLPFAAccelerated; + //pixelFormatAttrsWindow[i++] = NSOpenGLPFAAllowOfflineRenderers,; // Removed to allow 10.4 builds, and 2 GPUs rendering is not used anyway pixelFormatAttrsWindow[i++] = NSOpenGLPFADepthSize; |