Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/opensubdiv/opensubdiv_utils_capi.cc')
-rw-r--r--intern/opensubdiv/opensubdiv_utils_capi.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/intern/opensubdiv/opensubdiv_utils_capi.cc b/intern/opensubdiv/opensubdiv_utils_capi.cc
index 5a2d017ed26..a3aff5327db 100644
--- a/intern/opensubdiv/opensubdiv_utils_capi.cc
+++ b/intern/opensubdiv/opensubdiv_utils_capi.cc
@@ -26,6 +26,7 @@
#include "opensubdiv_capi.h"
+#include <cstring>
#include <GL/glew.h>
#ifdef _MSC_VER
@@ -71,7 +72,24 @@ int openSubdiv_getAvailableEvaluators(void)
#endif /* OPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK */
#ifdef OPENSUBDIV_HAS_GLSL_COMPUTE
- flags |= OPENSUBDIV_EVALUATOR_GLSL_COMPUTE;
+ static bool vendor_checked = false;
+ static bool disable_glsl_compute = false;
+ /* Force disable GLSL Compute on AMD hardware because it has really
+ * hard time evaluating required shaders.
+ */
+ if (!vendor_checked) {
+ 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 (!disable_glsl_compute) {
+ flags |= OPENSUBDIV_EVALUATOR_GLSL_COMPUTE;
+ }
#endif /* OPENSUBDIV_HAS_GLSL_COMPUTE */
return flags;