[Bf-blender-cvs] [95687f9] master: Fix T42349: Windows Render command line Cycles Crash

Sergey Sharybin noreply at git.blender.org
Fri Oct 31 18:53:09 CET 2014


Commit: 95687f9751cae08b14d815656261c069aec41238
Author: Sergey Sharybin
Date:   Fri Oct 31 22:28:39 2014 +0500
Branches: master
https://developer.blender.org/rB95687f9751cae08b14d815656261c069aec41238

Fix T42349: Windows Render command line Cycles Crash

The issue was caused by GLEW MX enabled in SCons by default so
basically previous commit already fixed the crash. But we need
to be safe here.

For now the fix is simple and not that clean, just check if
there's an OpenGL context available and if not we don't do any
GLSL magic.

This is to be cleaned up after some discussion with the viewport
project guys.

===================================================================

M	intern/cycles/blender/blender_sync.cpp

===================================================================

diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp
index 2ac90b3..bd3dc81 100644
--- a/intern/cycles/blender/blender_sync.cpp
+++ b/intern/cycles/blender/blender_sync.cpp
@@ -515,7 +515,17 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine, BL::Use
 		params.shadingsystem = SHADINGSYSTEM_OSL;
 	
 	/* color managagement */
-	params.display_buffer_linear = GLEW_ARB_half_float_pixel && b_engine.support_display_space_shader(b_scene);
+#ifdef GLEW_MX
+	/* When using GLEW MX we need to check whether we've got an OpenGL
+	 * context for crrent window. This is because command line rendering
+	 * doesn't have OpenGL context actually.
+	 */
+	if(glewGetContext() != NULL)
+#endif
+	{
+		params.display_buffer_linear = GLEW_ARB_half_float_pixel &&
+		                               b_engine.support_display_space_shader(b_scene);
+	}
 
 	return params;
 }




More information about the Bf-blender-cvs mailing list