[Bf-blender-cvs] [89de6e9] master: OpenSubdiv: Fix crash caused by accessing OpenGL vendor from non-main thread

Sergey Sharybin noreply at git.blender.org
Wed Sep 16 19:25:18 CEST 2015


Commit: 89de6e9eac319232366d0909cb1c39a968088672
Author: Sergey Sharybin
Date:   Wed Sep 16 22:23:07 2015 +0500
Branches: master
https://developer.blender.org/rB89de6e9eac319232366d0909cb1c39a968088672

OpenSubdiv: Fix crash caused by accessing OpenGL vendor from non-main thread

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

M	intern/opensubdiv/opensubdiv_capi.h
M	intern/opensubdiv/opensubdiv_utils_capi.cc
M	source/blender/windowmanager/intern/wm_init_exit.c

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

diff --git a/intern/opensubdiv/opensubdiv_capi.h b/intern/opensubdiv/opensubdiv_capi.h
index ef6db92..8010c39 100644
--- a/intern/opensubdiv/opensubdiv_capi.h
+++ b/intern/opensubdiv/opensubdiv_capi.h
@@ -141,6 +141,7 @@ void openSubdiv_osdGLMeshDisplay(OpenSubdiv_GLMesh *gl_mesh,
 /* ** Utility functions ** */
 int openSubdiv_supportGPUDisplay(void);
 int openSubdiv_getAvailableEvaluators(void);
+void openSubdiv_init(void);
 void openSubdiv_cleanup(void);
 
 #ifdef __cplusplus
diff --git a/intern/opensubdiv/opensubdiv_utils_capi.cc b/intern/opensubdiv/opensubdiv_utils_capi.cc
index 6bbe747..a945484 100644
--- a/intern/opensubdiv/opensubdiv_utils_capi.cc
+++ b/intern/opensubdiv/opensubdiv_utils_capi.cc
@@ -98,6 +98,12 @@ int openSubdiv_getAvailableEvaluators(void)
 	return flags;
 }
 
+void openSubdiv_init(void)
+{
+	/* Ensure all OpenGL strings are cached. */
+	(void)openSubdiv_getAvailableEvaluators();
+}
+
 void openSubdiv_cleanup(void)
 {
 	openSubdiv_osdGLDisplayDeinit();
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 724c779..a0ac945 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -191,6 +191,10 @@ void WM_init(bContext *C, int argc, const char **argv)
 		GPU_set_anisotropic(U.anisotropic_filter);
 		GPU_set_gpu_mipmapping(U.use_gpu_mipmap);
 
+#ifdef WITH_OPENSUBDIV
+		openSubdiv_init();
+#endif
+
 		UI_init();
 	}
 	else {




More information about the Bf-blender-cvs mailing list