From b9ed30c25c703c479dddab1ad6fec2adba558335 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Thu, 29 Aug 2019 12:32:27 +0200 Subject: 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 --- intern/cycles/blender/CMakeLists.txt | 2 +- intern/cycles/blender/blender_python.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'intern/cycles/blender') diff --git a/intern/cycles/blender/CMakeLists.txt b/intern/cycles/blender/CMakeLists.txt index 7354b1e615e..9658c7b4a62 100644 --- a/intern/cycles/blender/CMakeLists.txt +++ b/intern/cycles/blender/CMakeLists.txt @@ -68,7 +68,7 @@ set(ADDON_FILES add_definitions(${GL_DEFINITIONS}) if(WITH_CYCLES_DEVICE_OPENCL) - add_definitions(-DWITH_OPENCL) + add_definitions(-DWITH_OPENCL) endif() if(WITH_CYCLES_NETWORK) diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp index 80c6fee9723..9753da71eb4 100644 --- a/intern/cycles/blender/blender_python.cpp +++ b/intern/cycles/blender/blender_python.cpp @@ -177,6 +177,8 @@ static PyObject *init_func(PyObject * /*self*/, PyObject *args) BlenderSession::headless = headless; + DebugFlags().running_inside_blender = true; + VLOG(2) << "Debug flags initialized to:\n" << DebugFlags(); Py_RETURN_NONE; -- cgit v1.2.3