From 89de6e9eac319232366d0909cb1c39a968088672 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 16 Sep 2015 22:23:07 +0500 Subject: OpenSubdiv: Fix crash caused by accessing OpenGL vendor from non-main thread --- intern/opensubdiv/opensubdiv_capi.h | 1 + intern/opensubdiv/opensubdiv_utils_capi.cc | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'intern') 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(); -- cgit v1.2.3