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.cc32
1 files changed, 11 insertions, 21 deletions
diff --git a/intern/opensubdiv/opensubdiv_utils_capi.cc b/intern/opensubdiv/opensubdiv_utils_capi.cc
index a945484ba61..ae5592367dd 100644
--- a/intern/opensubdiv/opensubdiv_utils_capi.cc
+++ b/intern/opensubdiv/opensubdiv_utils_capi.cc
@@ -41,6 +41,8 @@
# include "opensubdiv_device_context_cuda.h"
#endif /* OPENSUBDIV_HAS_CUDA */
+static bool gpu_legacy_support_global = false;
+
int openSubdiv_getAvailableEvaluators(void)
{
if (!openSubdiv_supportGPUDisplay()) {
@@ -66,31 +68,13 @@ int openSubdiv_getAvailableEvaluators(void)
#endif /* OPENSUBDIV_HAS_OPENCL */
#ifdef OPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK
- if (GLEW_ARB_texture_buffer_object) {
+ if (GLEW_VERSION_4_1) {
flags |= OPENSUBDIV_EVALUATOR_GLSL_TRANSFORM_FEEDBACK;
}
#endif /* OPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK */
#ifdef OPENSUBDIV_HAS_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) {
- vendor_checked = true;
- const char *vendor = (const char *)glGetString(GL_VENDOR);
- const char *renderer = (const char *)glGetString(GL_RENDERER);
- 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) {
+ if (GLEW_VERSION_4_3 || GLEW_ARB_compute_shader) {
flags |= OPENSUBDIV_EVALUATOR_GLSL_COMPUTE;
}
#endif /* OPENSUBDIV_HAS_GLSL_COMPUTE */
@@ -98,13 +82,19 @@ int openSubdiv_getAvailableEvaluators(void)
return flags;
}
-void openSubdiv_init(void)
+void openSubdiv_init(bool gpu_legacy_support)
{
/* Ensure all OpenGL strings are cached. */
(void)openSubdiv_getAvailableEvaluators();
+ gpu_legacy_support_global = gpu_legacy_support;
}
void openSubdiv_cleanup(void)
{
openSubdiv_osdGLDisplayDeinit();
}
+
+bool openSubdiv_gpu_legacy_support(void)
+{
+ return gpu_legacy_support_global;
+}