diff options
Diffstat (limited to 'intern/opensubdiv/opensubdiv_utils_capi.cc')
-rw-r--r-- | intern/opensubdiv/opensubdiv_utils_capi.cc | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/intern/opensubdiv/opensubdiv_utils_capi.cc b/intern/opensubdiv/opensubdiv_utils_capi.cc index a3aff5327db..a945484ba61 100644 --- a/intern/opensubdiv/opensubdiv_utils_capi.cc +++ b/intern/opensubdiv/opensubdiv_utils_capi.cc @@ -78,13 +78,16 @@ int openSubdiv_getAvailableEvaluators(void) * hard time evaluating required shaders. */ if (!vendor_checked) { + vendor_checked = true; const char *vendor = (const char *)glGetString(GL_VENDOR); const char *renderer = (const char *)glGetString(GL_RENDERER); - if (strstr(vendor, "ATI") || - strstr(renderer, "Mesa DRI R") || - (strstr(renderer, "Gallium ") && strstr(renderer, " on ATI "))) - { - disable_glsl_compute = true; + if (vendor != NULL && renderer != NULL) { + if (strstr(vendor, "ATI") || + strstr(renderer, "Mesa DRI R") || + (strstr(renderer, "Gallium ") && strstr(renderer, " on ATI "))) + { + disable_glsl_compute = true; + } } } if (!disable_glsl_compute) { @@ -95,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(); |