T61971: Compilation Displacement/Background Kernel

Displacement and Background kernels are selectively used, but always compiled. This patch will not compile these kernels when they are not needed.

Displacement kernel is only used for true displacement.
Background kernel is only used when there is a (Cycles)Light of type `LIGHT_BACKGROUND`.

Reviewed By: brecht, #cycles

Tags: #cycles

Maniphest Tasks: T61971

Differential Revision: https://developer.blender.org/D4412
This commit is contained in:
Jeroen Bakker
2019-02-26 14:05:54 +01:00
parent e6099c7e46
commit dabe5cd31a
4 changed files with 32 additions and 7 deletions

View File

@@ -22,6 +22,7 @@
#include "device/device.h"
#include "render/graph.h"
#include "render/integrator.h"
#include "render/light.h"
#include "render/mesh.h"
#include "render/object.h"
#include "render/scene.h"
@@ -687,8 +688,11 @@ DeviceRequestedFeatures Session::get_requested_device_features()
if(object->is_shadow_catcher) {
requested_features.use_shadow_tricks = true;
}
requested_features.use_true_displacement |= mesh->has_true_displacement();
}
requested_features.use_background_light = scene->light_manager->has_background_light(scene);
BakeManager *bake_manager = scene->bake_manager;
requested_features.use_baking = bake_manager->get_baking();
requested_features.use_integrator_branched = (scene->integrator->method == Integrator::BRANCHED_PATH);