diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-11-21 19:42:31 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-11-21 19:42:31 +0300 |
commit | a106da7f1dd92b7fc8559d7f83509e7f21758615 (patch) | |
tree | 218390ecd14a56fafa019b46fa2dd9a8d9e3c75a /intern/cycles/device/device.h | |
parent | 9aafec1ce1bfdb815c2ed6fe2da83f9451fde3e4 (diff) |
Cycles: Move build options constructions to DeviceRequestedFeatures
This way it's easier to re-use requested features logic across multiple
device implementations.
Diffstat (limited to 'intern/cycles/device/device.h')
-rw-r--r-- | intern/cycles/device/device.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h index 3c0fb880948..769fb3ccf9d 100644 --- a/intern/cycles/device/device.h +++ b/intern/cycles/device/device.h @@ -125,6 +125,34 @@ public: use_baking == requested_features.use_baking); } + /* Convert the requested features structure to a build options, + * which could then be passed to compilers. + */ + string get_build_options(void) const + { + string build_options = ""; + if(experimental) { + build_options += "-D__KERNEL_EXPERIMENTAL__ "; + } + build_options += "-D__NODES_MAX_GROUP__=" + + string_printf("%d", max_nodes_group); + build_options += " -D__NODES_FEATURES__=" + + string_printf("%d", nodes_features); + build_options += string_printf(" -D__MAX_CLOSURE__=%d", max_closure); + if(!use_hair) { + build_options += " -D__NO_HAIR__"; + } + if(!use_object_motion) { + build_options += " -D__NO_OBJECT_MOTION__"; + } + if(!use_camera_motion) { + build_options += " -D__NO_CAMERA_MOTION__"; + } + if(!use_baking) { + build_options += " -D__NO_BAKING__"; + } + return build_options; + } }; std::ostream& operator <<(std::ostream &os, |