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
path: root/intern
diff options
context:
space:
mode:
authorRay Molenkamp <github@lazydodo.com>2020-03-21 20:55:45 +0300
committerRay Molenkamp <github@lazydodo.com>2020-03-21 20:55:45 +0300
commit44c6b6615b7235b960cc0e70bf0b4ed5b240fad6 (patch)
tree52a54838b18de9ba8f8256d458dc636b940d5f49 /intern
parent3033b2a0442fad0af9a2f57054397fec4efba97b (diff)
OpenCL: Bring back CYCLES_OPENCL_TEST override
Back in 2.79 you could either use the debug panel or an environment variable to override using OpenCL for unsupported hardware. Which was rather useful for developers when testing on NVidia just to be sure the CL kernels at-least build properly. This broke in rB949ab753bb2 This diff restores testing though the CYCLES_OPENCL_TEST environment variable. Differential Revision: https://developer.blender.org/D7202 Reviewers: brecht
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/device/opencl/device_opencl.h3
-rw-r--r--intern/cycles/device/opencl/opencl_util.cpp8
2 files changed, 7 insertions, 4 deletions
diff --git a/intern/cycles/device/opencl/device_opencl.h b/intern/cycles/device/opencl/device_opencl.h
index 53017c34b2b..cee29aefcfd 100644
--- a/intern/cycles/device/opencl/device_opencl.h
+++ b/intern/cycles/device/opencl/device_opencl.h
@@ -89,8 +89,7 @@ class OpenCLInfo {
static bool platform_version_check(cl_platform_id platform, string *error = NULL);
static bool device_version_check(cl_device_id device, string *error = NULL);
static string get_hardware_id(const string &platform_name, cl_device_id device_id);
- static void get_usable_devices(vector<OpenCLPlatformDevice> *usable_devices,
- bool force_all = false);
+ static void get_usable_devices(vector<OpenCLPlatformDevice> *usable_devices);
/* ** Some handy shortcuts to low level cl*GetInfo() functions. ** */
diff --git a/intern/cycles/device/opencl/opencl_util.cpp b/intern/cycles/device/opencl/opencl_util.cpp
index 580a73f6e8b..aca4ccdde26 100644
--- a/intern/cycles/device/opencl/opencl_util.cpp
+++ b/intern/cycles/device/opencl/opencl_util.cpp
@@ -747,6 +747,10 @@ bool OpenCLInfo::device_supported(const string &platform_name, const cl_device_i
}
VLOG(3) << "OpenCL driver version " << driver_major << "." << driver_minor;
+ if (getenv("CYCLES_OPENCL_TEST")) {
+ return true;
+ }
+
/* It is possible to have Iris GPU on AMD/Apple OpenCL framework
* (aka, it will not be on Intel framework). This isn't supported
* and needs an explicit blacklist.
@@ -858,7 +862,7 @@ string OpenCLInfo::get_hardware_id(const string &platform_name, cl_device_id dev
return "";
}
-void OpenCLInfo::get_usable_devices(vector<OpenCLPlatformDevice> *usable_devices, bool force_all)
+void OpenCLInfo::get_usable_devices(vector<OpenCLPlatformDevice> *usable_devices)
{
const cl_device_type device_type = OpenCLInfo::device_type();
static bool first_time = true;
@@ -924,7 +928,7 @@ void OpenCLInfo::get_usable_devices(vector<OpenCLPlatformDevice> *usable_devices
FIRST_VLOG(2) << "Ignoring device " << device_name << " due to old compiler version.";
continue;
}
- if (force_all || device_supported(platform_name, device_id)) {
+ if (device_supported(platform_name, device_id)) {
cl_device_type device_type;
if (!get_device_type(device_id, &device_type, &error)) {
FIRST_VLOG(2) << "Ignoring device " << device_name