diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2019-02-26 10:53:47 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2019-02-26 14:45:26 +0300 |
commit | e6099c7e46f6ca90dff3dc62d06db7fcb276e790 (patch) | |
tree | 450189a561413fe8ed0730063d8f75b52505e1bb /intern/cycles/device/device_split_kernel.cpp | |
parent | 7e40a231a7c55a6745511221a74137317bd0aaec (diff) |
T61576: Do Not (Re-)Compile OpenCL kernels
The goal of this patch is to have limit the number of times
kernels needs to be compiled and are reused as kernels with
different compile directives can lead to identical same
binaries.
The implementation does this by stripping the compile directives.
and reshuffling kernels so the output is more likely to be the
same.
We focussed on the kernels where it was easy to detect and maintain
(bundle, bake, displace, do_volume and background). More optimizations
could be done but they are probably less obvious.
Merged the data_init and state_buffer_size kernels to split_bundle.
This patch will also remove empty kernels for do_volume and bake
when their features are not enabled.
When using the benchmark files there are less background, bake and
do_volume kernels compiled.
Fix: T61576, T61501, T61466
Reviewed By: brecht, #cycles
Differential Revision: https://developer.blender.org/D4390
Diffstat (limited to 'intern/cycles/device/device_split_kernel.cpp')
-rw-r--r-- | intern/cycles/device/device_split_kernel.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/intern/cycles/device/device_split_kernel.cpp b/intern/cycles/device/device_split_kernel.cpp index ab2c11e904d..ee566e57918 100644 --- a/intern/cycles/device/device_split_kernel.cpp +++ b/intern/cycles/device/device_split_kernel.cpp @@ -97,7 +97,9 @@ bool DeviceSplitKernel::load_kernels(const DeviceRequestedFeatures& requested_fe LOAD_KERNEL(path_init); LOAD_KERNEL(scene_intersect); LOAD_KERNEL(lamp_emission); - LOAD_KERNEL(do_volume); + if (requested_features.use_volume) { + LOAD_KERNEL(do_volume); + } LOAD_KERNEL(queue_enqueue); LOAD_KERNEL(indirect_background); LOAD_KERNEL(shader_setup); @@ -239,7 +241,9 @@ bool DeviceSplitKernel::path_trace(DeviceTask *task, for(int PathIter = 0; PathIter < 16; PathIter++) { ENQUEUE_SPLIT_KERNEL(scene_intersect, global_size, local_size); ENQUEUE_SPLIT_KERNEL(lamp_emission, global_size, local_size); - ENQUEUE_SPLIT_KERNEL(do_volume, global_size, local_size); + if (kernel_do_volume) { + ENQUEUE_SPLIT_KERNEL(do_volume, global_size, local_size); + } ENQUEUE_SPLIT_KERNEL(queue_enqueue, global_size, local_size); ENQUEUE_SPLIT_KERNEL(indirect_background, global_size, local_size); ENQUEUE_SPLIT_KERNEL(shader_setup, global_size, local_size); |