Possible fix for [#36086] Activating the opencl option in the compositor causes blend...
[blender.git] / intern / opencl / intern / clew.c
index d68eb17288f532e8d490b273f5a562ce42658f6a..1e31ebced0a042a083daf0b7433b904eed06949e 100644 (file)
@@ -227,6 +227,11 @@ int clewInit(const char* path)
     __oclEnqueueWaitForEvents          = (PFNCLENQUEUEWAITFOREVENTS        )CLCC_DYNLIB_IMPORT(module, "clEnqueueWaitForEvents");
     __oclEnqueueBarrier                = (PFNCLENQUEUEBARRIER              )CLCC_DYNLIB_IMPORT(module, "clEnqueueBarrier");
     __oclGetExtensionFunctionAddress   = (PFNCLGETEXTENSIONFUNCTIONADDRESS )CLCC_DYNLIB_IMPORT(module, "clGetExtensionFunctionAddress");
+       
+       if(__oclGetPlatformIDs == NULL) return CLEW_ERROR_OPEN_FAILED;
+       if(__oclGetPlatformInfo == NULL) return CLEW_ERROR_OPEN_FAILED;
+       if(__oclGetDeviceIDs == NULL) return CLEW_ERROR_OPEN_FAILED;
+       if(__oclGetDeviceInfo == NULL) return CLEW_ERROR_OPEN_FAILED;
 
     return CLEW_SUCCESS;
 }