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

This commit is contained in:
Sergey Sharybin 2015-09-16 22:23:07 +05:00
parent f0023b0dbe
commit 89de6e9eac
3 changed files with 11 additions and 0 deletions

View File

@ -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

View File

@ -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();

View File

@ -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 {