Cycles: Restructure kernel files organization

Since the kernel split work we're now having quite a few of new files, majority
of which are related on the kernel entry points. Keeping those files in the
root kernel folder will eventually make it really hard to follow which files are
actual implementation of Cycles kernel.

Those files are now moved to kernel/kernels/<device_type>. This way adding extra
entry points will be less noisy. It is also nice to have all device-specific
files grouped together.

Another change is in the way how split kernel invokes logic. Previously all the
logic was implemented directly in the .cl files, which makes it a bit tricky to
re-use the logic across other devices. Since we'll likely be looking into doing
same split work for CUDA devices eventually it makes sense to move logic from
.cl files to header files. Those files are stored in kernel/split. This does not
mean the header files will not give error messages when tried to be included
from other devices and their arguments will likely be changed, but having such
separation is a good start anyway.

There should be no functional changes.

Reviewers: juicyfruit, dingto

Differential Revision: https://developer.blender.org/D1314
This commit is contained in:
2015-05-21 17:40:04 +05:00
parent 7f4d5850fe
commit 2c503d8303
38 changed files with 1090 additions and 313 deletions

View File

@@ -748,7 +748,7 @@ public:
}
else {
string init_kernel_source = "#include \"kernel.cl\" // " + kernel_md5 + "\n";
string init_kernel_source = "#include \"kernels/opencl/kernel.cl\" // " + kernel_md5 + "\n";
/* if does not exist or loading binary failed, compile kernel */
if(!compile_kernel(kernel_path, init_kernel_source, "", &cpProgram, debug_src))
@@ -1322,7 +1322,7 @@ public:
/* Kernel loaded from binary, nothing to do. */
}
else {
string init_kernel_source = "#include \"kernel.cl\" // " +
string init_kernel_source = "#include \"kernels/opencl/kernel.cl\" // " +
kernel_md5 + "\n";
/* If does not exist or loading binary failed, compile kernel. */
if(!compile_kernel(kernel_path,
@@ -1996,7 +1996,7 @@ public:
#define GLUE(a, b) a ## b
#define LOAD_KERNEL(name) \
do { \
kernel_init_source = "#include \"kernel_" #name ".cl\" // " + \
kernel_init_source = "#include \"kernels/opencl/kernel_" #name ".cl\" // " + \
kernel_md5 + "\n"; \
device_md5 = device_md5_hash(build_options); \
clbin = string_printf("cycles_kernel_%s_%s_" #name ".clbin", \