[Bf-blender-cvs] [cf4711b] master: OpenSubdiv: Attempt to solve crash in background mode
Sergey Sharybin
noreply at git.blender.org
Wed Sep 16 17:33:51 CEST 2015
Commit: cf4711bdf944f5a6d067352e071a476ba11579a0
Author: Sergey Sharybin
Date: Wed Sep 16 20:33:16 2015 +0500
Branches: master
https://developer.blender.org/rBcf4711bdf944f5a6d067352e071a476ba11579a0
OpenSubdiv: Attempt to solve crash in background mode
===================================================================
M intern/opensubdiv/opensubdiv_capi.cc
M intern/opensubdiv/opensubdiv_utils_capi.cc
===================================================================
diff --git a/intern/opensubdiv/opensubdiv_capi.cc b/intern/opensubdiv/opensubdiv_capi.cc
index 11cf170..6659894 100644
--- a/intern/opensubdiv/opensubdiv_capi.cc
+++ b/intern/opensubdiv/opensubdiv_capi.cc
@@ -306,7 +306,7 @@ int openSubdiv_supportGPUDisplay(void)
if (!vendor_checked) {
vendor_checked = true;
const char *vendor = (const char *)glGetString(GL_VENDOR);
- if (strstr(vendor, "Intel")) {
+ if (vendor != NULL && strstr(vendor, "Intel")) {
if(getenv("OPENSUBDIV_ALLOW_INTEL") == NULL) {
is_intel = true;
}
diff --git a/intern/opensubdiv/opensubdiv_utils_capi.cc b/intern/opensubdiv/opensubdiv_utils_capi.cc
index 8c5eefe..6bbe747 100644
--- a/intern/opensubdiv/opensubdiv_utils_capi.cc
+++ b/intern/opensubdiv/opensubdiv_utils_capi.cc
@@ -81,11 +81,13 @@ int openSubdiv_getAvailableEvaluators(void)
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) {
More information about the Bf-blender-cvs
mailing list