[Bf-blender-cvs] [4b0b1c8] opensubdiv-modifier: OpenSubdiv: hide OpenCL compute method if no devices found

Sergey Sharybin noreply at git.blender.org
Thu Jul 3 13:17:46 CEST 2014


Commit: 4b0b1c84e09ff35d00d4d4ec0d6a492b37469c85
Author: Sergey Sharybin
Date:   Thu Jul 3 17:17:15 2014 +0600
https://developer.blender.org/rB4b0b1c84e09ff35d00d4d4ec0d6a492b37469c85

OpenSubdiv: hide OpenCL compute method if no devices found

===================================================================

M	intern/opensubdiv/clInit.h

===================================================================

diff --git a/intern/opensubdiv/clInit.h b/intern/opensubdiv/clInit.h
index 2a4e131..37de12d 100644
--- a/intern/opensubdiv/clInit.h
+++ b/intern/opensubdiv/clInit.h
@@ -48,6 +48,12 @@ static bool HAS_CL_VERSION_1_1() {
 		if (!clewLoadSuccess) {
 			fprintf(stderr, "Loading OpenCL failed.\n");
 		}
+		else {
+			cl_uint num_platforms;
+			if (clGetPlatformIDs(0, NULL, &num_platforms) != CL_SUCCESS) {
+				clewLoadSuccess = false;
+			}
+		}
 	}
 	return clewLoadSuccess;
 #  endif




More information about the Bf-blender-cvs mailing list