diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-06-05 20:50:22 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-06-08 12:15:39 +0300 |
commit | 27ed75271c1948abe5a420d881686406bf8e0ce8 (patch) | |
tree | 1b83ef7fd69f9c65a05f479f3eb6ed5924848381 /intern/cycles/device/device_opencl.cpp | |
parent | 267c7b098d1312b6a0d71eed877f6d27b182c0b1 (diff) |
Cycles: Make hair, object and motion blur selective compiled into OpenCL
This features are now based on the scene settings, so scenes without those features
used are rendered even faster.
This gives about 30% speedup on the AMD A10 APU here, but at the same time it does
not mean such an improvement will happen on all the hardware. That being said, the
Tonga device here seems to have no measurable difference.
In any case it seems handy to have for the future, when we'll want to support SSS
in the kernel or to port selective compilation/split kernel to CUDA devices.
Diffstat (limited to 'intern/cycles/device/device_opencl.cpp')
-rw-r--r-- | intern/cycles/device/device_opencl.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp index 6cda617e43a..7873d70c65c 100644 --- a/intern/cycles/device/device_opencl.cpp +++ b/intern/cycles/device/device_opencl.cpp @@ -1977,6 +1977,10 @@ public: #ifdef __WORK_STEALING__ build_options += " -D__WORK_STEALING__"; #endif + + /* TODO(sergey): Make it a separate function to convert requested + * features to build flags in order to make code a bit cleaner. + */ if(requested_features.experimental) { build_options += " -D__KERNEL_EXPERIMENTAL__"; } @@ -1985,6 +1989,15 @@ public: build_options += " -D__NODES_FEATURES__=" + string_printf("%d", requested_features.nodes_features); build_options += string_printf(" -D__MAX_CLOSURE__=%d", max_closure); + if(!requested_features.use_hair) { + build_options += " -D__NO_HAIR__"; + } + if(!requested_features.use_object_motion) { + build_options += " -D__NO_OBJECT_MOTION__"; + } + if(!requested_features.use_camera_motion) { + build_options += " -D__NO_CAMERA_MOTION__"; + } /* Set compute device build option. */ cl_device_type device_type; |