Cycles: Disable baking in mega kernel when not in use to improve build times

This commit is contained in:
Mai Lavelle 2017-06-29 22:50:00 -04:00
parent 9c2bbfb6ce
commit 56dcfcce05
1 changed files with 9 additions and 1 deletions

View File

@ -1226,7 +1226,7 @@ void OpenCLDeviceBase::store_cached_kernel(
}
string OpenCLDeviceBase::build_options_for_base_program(
const DeviceRequestedFeatures& /*requested_features*/)
const DeviceRequestedFeatures& requested_features)
{
/* TODO(sergey): By default we compile all features, meaning
* mega kernel is not getting feature-based optimizations.
@ -1234,6 +1234,14 @@ string OpenCLDeviceBase::build_options_for_base_program(
* Ideally we need always compile kernel with as less features
* enabled as possible to keep performance at it's max.
*/
/* For now disable baking when not in use as this has major
* impact on kernel build times.
*/
if(!requested_features.use_baking) {
return "-D__NO_BAKING__";
}
return "";
}