forked from bartvdbraak/blender
OpenSubdiv: Fix crash caused by accessing OpenGL vendor from non-main thread
This commit is contained in:
parent
f0023b0dbe
commit
89de6e9eac
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user