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
diff options
context:
space:
mode:
authorJeroen Bakker <j.bakker@atmind.nl>2019-08-29 13:32:27 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2019-08-30 14:53:23 +0300
commitb9ed30c25c703c479dddab1ad6fec2adba558335 (patch)
treec30d0ccaf61712caed269fe5a20dca00735e7982 /intern/cycles/device/opencl
parent040d075f17ede12b589b08b6fe13b9e667740487 (diff)
Cycles: OpenCL Separate Compilation Debug Flag
OpenCL Parallel compilation only works inside Blender. When using cycles in a different setup (standaline or other software) it failed compiling kernels as they don't have the appropriate Python API and command line arguments. This change introduces a `running_inside_blender` debug flag, that triggers out of process compilation of the kernels. Compilation still happens in subthread that enabled the preview kernels and compilation of the kernels during BVH building Reviewed By: brecht Differential Revision: https://developer.blender.org/D5439
Diffstat (limited to 'intern/cycles/device/opencl')
-rw-r--r--intern/cycles/device/opencl/opencl_split.cpp2
-rw-r--r--intern/cycles/device/opencl/opencl_util.cpp11
2 files changed, 7 insertions, 6 deletions
diff --git a/intern/cycles/device/opencl/opencl_split.cpp b/intern/cycles/device/opencl/opencl_split.cpp
index 79474fb0814..eea5cf2fb8a 100644
--- a/intern/cycles/device/opencl/opencl_split.cpp
+++ b/intern/cycles/device/opencl/opencl_split.cpp
@@ -676,7 +676,7 @@ OpenCLDevice::OpenCLDevice(DeviceInfo &info, Stats &stats, Profiler &profiler, b
device_initialized = true;
split_kernel = new OpenCLSplitKernel(this);
- if (!background) {
+ if (use_preview_kernels) {
load_preview_kernels();
}
}
diff --git a/intern/cycles/device/opencl/opencl_util.cpp b/intern/cycles/device/opencl/opencl_util.cpp
index dc9b4072841..3eeff31f8c2 100644
--- a/intern/cycles/device/opencl/opencl_util.cpp
+++ b/intern/cycles/device/opencl/opencl_util.cpp
@@ -619,15 +619,16 @@ void OpenCLDevice::OpenCLProgram::compile()
debug_src = &clsrc;
}
- /* If binary kernel exists already, try use it. */
- if (compile_separate(clbin)) {
+ if (DebugFlags().running_inside_blender && compile_separate(clbin)) {
add_log(string("Built and loaded program from ") + clbin + ".", true);
loaded = true;
}
else {
- add_log(string("Separate-process building of ") + clbin +
- " failed, will fall back to regular building.",
- true);
+ if (DebugFlags().running_inside_blender) {
+ add_log(string("Separate-process building of ") + clbin +
+ " failed, will fall back to regular building.",
+ true);
+ }
/* If does not exist or loading binary failed, compile kernel. */
if (!compile_kernel(debug_src)) {