OpenSubdiv: Enable GLSL Compute for AMD devices

There was a bug in OpenSubdiv library which is now fixed by updating library in
the build environments.

Still requires testing, but now being at the beginning of release cycle is
should be safe to simply enable option and let everyone to test :)
This commit is contained in:
Sergey Sharybin 2015-11-10 12:14:50 +05:00
parent ee761ebda9
commit b3184640fe
1 changed files with 2 additions and 21 deletions

View File

@ -72,27 +72,8 @@ int openSubdiv_getAvailableEvaluators(void)
#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) {
flags |= OPENSUBDIV_EVALUATOR_GLSL_COMPUTE;
}
/* TODO(sergey): Do we need to check availble extensions here? */
flags |= OPENSUBDIV_EVALUATOR_GLSL_COMPUTE;
#endif /* OPENSUBDIV_HAS_GLSL_COMPUTE */
return flags;