Cycles: Make shadow catcher an optional feature for OpenCL
Solves majority of speed regression on AMD OpenCL.
This commit is contained in:
@@ -121,6 +121,9 @@ public:
|
||||
/* Use Transparent shadows */
|
||||
bool use_transparent;
|
||||
|
||||
/* Use various shadow tricks, such as shadow catcher. */
|
||||
bool use_shadow_tricks;
|
||||
|
||||
DeviceRequestedFeatures()
|
||||
{
|
||||
/* TODO(sergey): Find more meaningful defaults. */
|
||||
@@ -137,6 +140,7 @@ public:
|
||||
use_integrator_branched = false;
|
||||
use_patch_evaluation = false;
|
||||
use_transparent = false;
|
||||
use_shadow_tricks = false;
|
||||
}
|
||||
|
||||
bool modified(const DeviceRequestedFeatures& requested_features)
|
||||
@@ -153,7 +157,8 @@ public:
|
||||
use_volume == requested_features.use_volume &&
|
||||
use_integrator_branched == requested_features.use_integrator_branched &&
|
||||
use_patch_evaluation == requested_features.use_patch_evaluation &&
|
||||
use_transparent == requested_features.use_transparent);
|
||||
use_transparent == requested_features.use_transparent &&
|
||||
use_shadow_tricks == requested_features.use_shadow_tricks);
|
||||
}
|
||||
|
||||
/* Convert the requested features structure to a build options,
|
||||
@@ -197,6 +202,9 @@ public:
|
||||
if(!use_transparent && !use_volume) {
|
||||
build_options += " -D__NO_TRANSPARENT__";
|
||||
}
|
||||
if(!use_shadow_tricks) {
|
||||
build_options += " -D__NO_SHADOW_TRICKS__";
|
||||
}
|
||||
return build_options;
|
||||
}
|
||||
};
|
||||
|
@@ -213,6 +213,9 @@ CCL_NAMESPACE_BEGIN
|
||||
#ifdef __NO_TRANSPARENT__
|
||||
# undef __TRANSPARENT_SHADOWS__
|
||||
#endif
|
||||
#ifdef __NO_SHADOW_TRICKS__
|
||||
#undef __SHADOW_TRICKS__
|
||||
#endif
|
||||
|
||||
/* Random Numbers */
|
||||
|
||||
|
@@ -637,6 +637,9 @@ DeviceRequestedFeatures Session::get_requested_device_features()
|
||||
requested_features.use_patch_evaluation = true;
|
||||
}
|
||||
#endif
|
||||
if(object->is_shadow_catcher) {
|
||||
requested_features.use_shadow_tricks = true;
|
||||
}
|
||||
}
|
||||
|
||||
BakeManager *bake_manager = scene->bake_manager;
|
||||
|
Reference in New Issue
Block a user