Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-09-16 20:23:07 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-09-16 20:25:13 +0300
commit89de6e9eac319232366d0909cb1c39a968088672 (patch)
tree9d42fc86aa4a4ebb8540bab2e47a6afa680187dc
parentf0023b0dbeab8388092b399c491ce6436cac5bfb (diff)
OpenSubdiv: Fix crash caused by accessing OpenGL vendor from non-main thread
-rw-r--r--intern/opensubdiv/opensubdiv_capi.h1
-rw-r--r--intern/opensubdiv/opensubdiv_utils_capi.cc6
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c4
3 files changed, 11 insertions, 0 deletions
diff --git a/intern/opensubdiv/opensubdiv_capi.h b/intern/opensubdiv/opensubdiv_capi.h
index ef6db92b1e8..8010c39647d 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 6bbe747634a..a945484ba61 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 724c779a007..a0ac945b647 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 {