diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-03-28 21:39:14 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-03-29 14:41:11 +0300 |
commit | 0579eaae1f7afd2e40ad525fe97de7c4be2a9a1e (patch) | |
tree | 64b02d3bc235036aec5a2d1ac8328c7666b54817 /intern/cycles/device/opencl | |
parent | 61db9ee27a442f30248e6bf48468fee5cc999b6b (diff) |
Cycles: Make all #include statements relative to cycles source directory
The idea is to make include statements more explicit and obvious where the
file is coming from, additionally reducing chance of wrong header being
picked up.
For example, it was not obvious whether bvh.h was refferring to builder
or traversal, whenter node.h is a generic graph node or a shader node
and cases like that.
Surely this might look obvious for the active developers, but after some
time of not touching the code it becomes less obvious where file is coming
from.
This was briefly mentioned in T50824 and seems @brecht is fine with such
explicitness, but need to agree with all active developers before committing
this.
Please note that this patch is lacking changes related on GPU/OpenCL
support. This will be solved if/when we all agree this is a good idea to move
forward.
Reviewers: brecht, lukasstockner97, maiself, nirved, dingto, juicyfruit, swerner
Reviewed By: lukasstockner97, maiself, nirved, dingto
Subscribers: brecht
Differential Revision: https://developer.blender.org/D2586
Diffstat (limited to 'intern/cycles/device/opencl')
-rw-r--r-- | intern/cycles/device/opencl/opencl.h | 8 | ||||
-rw-r--r-- | intern/cycles/device/opencl/opencl_base.cpp | 18 | ||||
-rw-r--r-- | intern/cycles/device/opencl/opencl_mega.cpp | 14 | ||||
-rw-r--r-- | intern/cycles/device/opencl/opencl_split.cpp | 22 | ||||
-rw-r--r-- | intern/cycles/device/opencl/opencl_util.cpp | 18 |
5 files changed, 40 insertions, 40 deletions
diff --git a/intern/cycles/device/opencl/opencl.h b/intern/cycles/device/opencl/opencl.h index 59e61aad25c..764216d0dfa 100644 --- a/intern/cycles/device/opencl/opencl.h +++ b/intern/cycles/device/opencl/opencl.h @@ -16,11 +16,11 @@ #ifdef WITH_OPENCL -#include "device.h" +#include "device/device.h" -#include "util_map.h" -#include "util_param.h" -#include "util_string.h" +#include "util/util_map.h" +#include "util/util_param.h" +#include "util/util_string.h" #include "clew.h" diff --git a/intern/cycles/device/opencl/opencl_base.cpp b/intern/cycles/device/opencl/opencl_base.cpp index 0328dfed689..52d0662a8e3 100644 --- a/intern/cycles/device/opencl/opencl_base.cpp +++ b/intern/cycles/device/opencl/opencl_base.cpp @@ -16,15 +16,15 @@ #ifdef WITH_OPENCL -#include "opencl.h" +#include "device/opencl/opencl.h" -#include "kernel_types.h" +#include "kernel/kernel_types.h" -#include "util_foreach.h" -#include "util_logging.h" -#include "util_md5.h" -#include "util_path.h" -#include "util_time.h" +#include "util/util_foreach.h" +#include "util/util_logging.h" +#include "util/util_md5.h" +#include "util/util_path.h" +#include "util/util_time.h" CCL_NAMESPACE_BEGIN @@ -527,7 +527,7 @@ void OpenCLDeviceBase::film_convert(DeviceTask& task, device_ptr buffer, device_ #define KERNEL_TEX(type, ttype, name) \ set_kernel_arg_mem(ckFilmConvertKernel, &start_arg_index, #name); -#include "kernel_textures.h" +#include "kernel/kernel_textures.h" #undef KERNEL_TEX start_arg_index += kernel_set_args(ckFilmConvertKernel, @@ -578,7 +578,7 @@ void OpenCLDeviceBase::shader(DeviceTask& task) #define KERNEL_TEX(type, ttype, name) \ set_kernel_arg_mem(kernel, &start_arg_index, #name); -#include "kernel_textures.h" +#include "kernel/kernel_textures.h" #undef KERNEL_TEX start_arg_index += kernel_set_args(kernel, diff --git a/intern/cycles/device/opencl/opencl_mega.cpp b/intern/cycles/device/opencl/opencl_mega.cpp index 049e332272b..a2fd1d71156 100644 --- a/intern/cycles/device/opencl/opencl_mega.cpp +++ b/intern/cycles/device/opencl/opencl_mega.cpp @@ -16,15 +16,15 @@ #ifdef WITH_OPENCL -#include "opencl.h" +#include "device/opencl/opencl.h" -#include "buffers.h" +#include "render/buffers.h" -#include "kernel_types.h" +#include "kernel/kernel_types.h" -#include "util_md5.h" -#include "util_path.h" -#include "util_time.h" +#include "util/util_md5.h" +#include "util/util_path.h" +#include "util/util_time.h" CCL_NAMESPACE_BEGIN @@ -84,7 +84,7 @@ public: #define KERNEL_TEX(type, ttype, name) \ set_kernel_arg_mem(ckPathTraceKernel, &start_arg_index, #name); -#include "kernel_textures.h" +#include "kernel/kernel_textures.h" #undef KERNEL_TEX start_arg_index += kernel_set_args(ckPathTraceKernel, diff --git a/intern/cycles/device/opencl/opencl_split.cpp b/intern/cycles/device/opencl/opencl_split.cpp index d50ae585062..579dbc84f53 100644 --- a/intern/cycles/device/opencl/opencl_split.cpp +++ b/intern/cycles/device/opencl/opencl_split.cpp @@ -16,19 +16,19 @@ #ifdef WITH_OPENCL -#include "opencl.h" +#include "device/opencl/opencl.h" -#include "buffers.h" +#include "render/buffers.h" -#include "kernel_types.h" -#include "kernel_split_data_types.h" +#include "kernel/kernel_types.h" +#include "kernel/split/kernel_split_data_types.h" -#include "device_split_kernel.h" +#include "device/device_split_kernel.h" -#include "util_logging.h" -#include "util_md5.h" -#include "util_path.h" -#include "util_time.h" +#include "util/util_logging.h" +#include "util/util_md5.h" +#include "util/util_path.h" +#include "util/util_time.h" CCL_NAMESPACE_BEGIN @@ -110,7 +110,7 @@ public: ccl_constant KernelData *data; #define KERNEL_TEX(type, ttype, name) \ ccl_global type *name; -#include "kernel_textures.h" +#include "kernel/kernel_textures.h" #undef KERNEL_TEX SplitData split_data; SplitParams split_param_data; @@ -291,7 +291,7 @@ public: /* TODO(sergey): Avoid map lookup here. */ #define KERNEL_TEX(type, ttype, name) \ device->set_kernel_arg_mem(device->program_data_init(), &start_arg_index, #name); -#include "kernel_textures.h" +#include "kernel/kernel_textures.h" #undef KERNEL_TEX start_arg_index += diff --git a/intern/cycles/device/opencl/opencl_util.cpp b/intern/cycles/device/opencl/opencl_util.cpp index 1f5b9ee0896..44845c944bf 100644 --- a/intern/cycles/device/opencl/opencl_util.cpp +++ b/intern/cycles/device/opencl/opencl_util.cpp @@ -16,12 +16,12 @@ #ifdef WITH_OPENCL -#include "opencl.h" +#include "device/opencl/opencl.h" -#include "util_logging.h" -#include "util_md5.h" -#include "util_path.h" -#include "util_time.h" +#include "util/util_logging.h" +#include "util/util_md5.h" +#include "util/util_path.h" +#include "util/util_time.h" using std::cerr; using std::endl; @@ -235,7 +235,7 @@ string OpenCLCache::get_kernel_md5() thread_scoped_lock lock(self.kernel_md5_lock); if(self.kernel_md5.empty()) { - self.kernel_md5 = path_files_md5_hash(path_get("kernel")); + self.kernel_md5 = path_files_md5_hash(path_get("source/kernel")); } return self.kernel_md5; } @@ -339,12 +339,12 @@ bool OpenCLDeviceBase::OpenCLProgram::build_kernel(const string *debug_src) bool OpenCLDeviceBase::OpenCLProgram::compile_kernel(const string *debug_src) { - string source = "#include \"kernels/opencl/" + kernel_file + "\"\n"; + string source = "#include \"kernel/kernels/opencl/" + kernel_file + "\"\n"; /* We compile kernels consisting of many files. unfortunately OpenCL * kernel caches do not seem to recognize changes in included files. * so we force recompile on changes by adding the md5 hash of all files. */ - source = path_source_replace_includes(source, path_get("kernel")); + source = path_source_replace_includes(source, path_get("source")); source += "\n// " + util_md5_string(source) + "\n"; if(debug_src) { @@ -444,7 +444,7 @@ void OpenCLDeviceBase::OpenCLProgram::load() /* need to create source to get md5 */ string source = "#include \"kernels/opencl/" + kernel_file + "\"\n"; - source = path_source_replace_includes(source, path_get("kernel")); + source = path_source_replace_includes(source, path_get("source/kernel")); string basename = "cycles_kernel_" + program_name + "_" + device_md5 + "_" + util_md5_string(source); basename = path_cache_get(path_join("kernels", basename)); |