From a0af3f7ffe7af861720187b2cad47a7623400376 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 19 Dec 2011 14:23:08 +0000 Subject: OS X: add BLENDER_SOFTWAREGL environment variable to force using software OpenGL renderer, for debugging OpenGL issues. --- intern/ghost/intern/GHOST_WindowCocoa.mm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'intern') 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 +#include /***** Multithreaded opengl code : uncomment for enabling #include */ @@ -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; -- cgit v1.2.3