From 1788293a0125e178cf7cbea60113ae7d81749cbe Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 23 Jul 2015 12:08:19 +0200 Subject: Fix T45381: Crash Blender 2.75 in Win7 x64 AMD card Previous fix didn't work well enough because on Windows Python has different environment than Blender ans setting variables in there made no effect from Blender point of view. --- intern/cycles/device/device_opencl.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'intern/cycles/device/device_opencl.cpp') diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp index 2a596a288bf..0cc49e846cc 100644 --- a/intern/cycles/device/device_opencl.cpp +++ b/intern/cycles/device/device_opencl.cpp @@ -3610,16 +3610,22 @@ bool device_opencl_init(void) initialized = true; - int clew_result = clewInit(); - if(clew_result == CLEW_SUCCESS) { - VLOG(1) << "CLEW initialization succeeded."; - result = true; + if(opencl_device_type() != 0) { + int clew_result = clewInit(); + if(clew_result == CLEW_SUCCESS) { + VLOG(1) << "CLEW initialization succeeded."; + result = true; + } + else { + VLOG(1) << "CLEW initialization failed: " + << ((clew_result == CLEW_ERROR_ATEXIT_FAILED) + ? "Error setting up atexit() handler" + : "Error opening the library"); + } } else { - VLOG(1) << "CLEW initialization failed: " - << ((clew_result == CLEW_ERROR_ATEXIT_FAILED) - ? "Error setting up atexit() handler" - : "Error opening the library"); + VLOG(1) << "Skip initializing CLEW, platform is force disabled."; + result = false; } return result; -- cgit v1.2.3