81 ccl::Film::add_default(
this);
82 ccl::ShaderManager::add_default(
this);
183 bool kernels_reloaded =
false;
192 update_stats->scene.times.add_entry({
"device_update", time});
204 light_manager->tag_update(
this, ccl::LightManager::LIGHT_MODIFIED);
205 object_manager->tag_update(
this, ccl::ObjectManager::OBJECT_MODIFIED);
208 if (
film->exposure_is_modified()) {
274 progress.
set_status(
"Updating Scene Attribute");
302 progress.
set_status(
"Updating Particle Systems");
318 progress.
set_status(
"Updating Objects Flags");
326 progress.
set_status(
"Updating Primitive Offsets");
350 progress.
set_status(
"Updating Camera Volume");
357 progress.
set_status(
"Updating Lookup Tables");
387 progress.
set_status(
"Updating Lookup Tables");
404 progress.
set_status(
"Updating Device",
"Writing constant memory");
421 LOG_INFO <<
"System memory statistics after full device sync:\n"
436 const bool denoiser_motion = (
integrator->get_use_denoise()) &&
437 (
integrator->get_denoiser_passes() & denoiser_motion_passes) != 0;
452 return camera->get_shuttertime();
478 attributes.
add(shader->global_attributes);
556 size_t kernel_max_prim_count = 0;
561 bool has_caustics_receiver =
false;
562 bool has_caustics_caster =
false;
563 bool has_caustics_light =
false;
566 if (object->get_is_caustics_caster()) {
567 has_caustics_caster =
true;
569 else if (object->get_is_caustics_receiver()) {
570 has_caustics_receiver =
true;
572 Geometry *geom =
object->get_geometry();
574 if (object->use_motion() || geom->get_use_motion_blur()) {
578 if (object->get_is_shadow_catcher() && !geom->
is_light()) {
582 const Hair *hair =
static_cast<const Hair *
>(geom);
585 kernel_max_prim_count =
max(kernel_max_prim_count, hair->
num_segments());
593 kernel_max_prim_count =
max(kernel_max_prim_count, pointcloud->
num_points());
596 kernel_max_prim_count =
max(kernel_max_prim_count,
597 static_cast<Mesh *
>(geom)->num_triangles());
600 const Light *light =
static_cast<const Light *
>(
object->get_geometry());
601 if (light->get_use_caustics()) {
602 has_caustics_light =
true;
605 if (object->has_light_linking()) {
608 if (object->has_shadow_linking()) {
633 dscene.
data.kernel_features = kernel_features;
646 geom->need_update_rebuild =
true;
647 geom->tag_modified();
667 bool update_data =
false;
682 progress.
set_status(
"Updating Device",
"Writing constant memory");
716 progress.
set_status(
"Loading render kernels (may take a few minutes the first time)");
724 if (message.empty()) {
725 message =
"Failed loading render kernel, see console for errors";
747 int max_closures = 0;
751 const int num_closures = shader->
graph->get_num_closures();
752 max_closures =
max(max_closures, num_closures);
773 int volume_stack_size = 0;
780 volume_stack_size += 2;
784 bool has_volume_object =
false;
786 if (!object->get_geometry()->has_volume) {
790 if (object->intersects_volume) {
799 else if (!has_volume_object) {
804 has_volume_object =
true;
813 LOG_DEBUG <<
"Detected required volume stack size " << volume_stack_size;
815 return volume_stack_size;
826 if (object->get_is_shadow_catcher() && !object->get_geometry()->is_light()) {
862 if (!object->get_geometry()->is_light()) {
866 const Light *light =
static_cast<const Light *
>(
object->get_geometry());
867 if (light->get_is_enabled() && light->get_use_mis() && light->
is_traceable()) {
878 T *node_ptr =
node.get();
879 node->set_owner(
this);
914 node->set_owner(
this);
924 node->set_owner(
this);
934 node->set_owner(
this);
944 node->set_owner(
this);
954 node->set_owner(
this);
964 node->set_owner(
this);
974 node->set_owner(
this);
984 node->set_owner(
this);
994 node->set_owner(
this);
1003 node->set_owner(
this);
1012 node->set_owner(
this);
1021 node->set_owner(
this);
1030 node->set_owner(
this);
1075 if (
node->is_hair()) {
1080 if (
node->has_volume) {
1094 if (
node->get_geometry()->has_volume) {
1113 node->clear_reference_count();
1136 for (
const T *
node : nodes) {
1169 for (
Shader *shader : nodes) {
1170 shader->clear_reference_count();
unsigned long long int uint64_t
void device_update(Device *device, DeviceScene *dscene, Scene *scene)
void device_free(Device *device, DeviceScene *dscene)
void tag_update(Scene *scene)
void update_interactive_motion()
void device_update_volume(Device *device, DeviceScene *dscene, Scene *scene)
bool set_screen_size(int width, int height)
void device_free(Device *device, DeviceScene *dscene, Scene *scene)
void device_update(Device *device, DeviceScene *dscene, Scene *scene)
uint64_t get_kernel_features() const
virtual void optimize_for_scene(Scene *)
virtual const string & error_message()
virtual void const_copy_to(const char *name, void *host, const size_t size)=0
virtual bool set_bvh_limits(size_t, size_t)
virtual bool load_kernels(const uint64_t)
uint64_t get_kernel_features(const Scene *scene) const
void update_passes(Scene *scene)
void device_free(Device *device, DeviceScene *dscene, Scene *scene)
void device_update(Device *device, DeviceScene *dscene, Scene *scene)
bool update_lightgroups(Scene *scene)
bool is_pointcloud() const
size_t num_segments() const
CurveShapeType curve_shape
void tag_update(Scene *scene, const uint32_t flag)
void device_update(Device *device, DeviceScene *dscene, Scene *scene)
uint64_t get_kernel_features() const
void device_free(Device *device, DeviceScene *dscene, bool force_free=false)
GuidingParams get_guiding_params(const Device *device) const
virtual bool is_traceable() const =0
static bool contains(const unique_ptr_vector< Pass > &passes, PassType type)
size_t num_points() const
PrimitiveType primitive_type() const override
void set_status(const string &status_, const string &substatus_="")
void set_error(const string &error_message_)
void device_free(Device *device, DeviceScene *dscene, bool force_free=false)
void device_update(Device *device, DeviceScene *dscene, Scene *scene)
void tag_update(Scene *scene, const uint32_t flag)
ShadingSystem shadingsystem
bool has_volume_modified() const
unique_ptr_vector< Procedural > procedurals
unique_ptr< ObjectManager > object_manager
bool need_global_attribute(AttributeStandard std) const
MotionType need_motion() const
void need_global_attributes(AttributeRequestSet &attributes)
bool update(Progress &progress)
unique_ptr< LightManager > light_manager
unique_ptr< ParticleSystemManager > particle_system_manager
int get_max_closure_count()
bool scene_updated_while_loading_kernels
unique_ptr_vector< Geometry > geometry
unique_ptr< SceneUpdateStats > update_stats
bool has_volume_modified_
void tag_shadow_catcher_modified()
void free_memory(bool final)
unique_ptr_vector< Camera > cameras
unique_ptr_vector< SceneAttributes > scene_attributes
unique_ptr_vector< Background > backgrounds
void enable_update_stats()
Shader * default_background
T * create_node(Args &&...)=delete
unique_ptr< BakeManager > bake_manager
bool shadow_catcher_modified_
void tag_has_volume_modified()
unique_ptr_vector< Shader > shaders
PointLight * create_node()
@ MOTION_PASS_INTERACTIVE
void update_kernel_features()
unique_ptr< ShaderManager > shader_manager
void delete_nodes(const set< T * > &nodes)
unique_ptr_vector< ParticleSystem > particle_systems
bool has_shadow_catcher()
unique_ptr< GeometryManager > geometry_manager
void delete_node(T *node)=delete
bool use_light_mis() const
unique_ptr< OSLManager > osl_manager
unique_ptr_vector< Integrator > integrators
bool load_kernels(Progress &progress)
unique_ptr_vector< Object > objects
uint64_t loaded_kernel_features
int get_volume_stack_size() const
unique_ptr< ImageManager > image_manager
unique_ptr< ProceduralManager > procedural_manager
bool need_reset(const bool check_camera=true)
SceneAttributes * scene_attribute
bool update_camera_resolution(Progress &progress, int width, int height)
void collect_statistics(RenderStats *stats)
unique_ptr_vector< Pass > passes
unique_ptr_vector< Film > films
float motion_shutter_time()
unique_ptr< VolumeManager > volume_manager
unique_ptr< LookupTables > lookup_tables
void device_update(Device *device, Progress &progress)
static unique_ptr< ShaderManager > create(const int shadingsystem)
static void add_default(Scene *scene)
NODE_DECLARE unique_ptr< ShaderGraph > graph
void push_back(unique_ptr< T > &&value)
void erase_by_swap(const size_t index)
void erase_in_set(const set< T * > &values)
@ DENOISER_PASS_BACKWARD_MOTION
@ DENOISER_PASS_SPECULAR_MOTION
#define KERNEL_FEATURE_VOLUME
#define KERNEL_FEATURE_HAIR_RIBBON
#define KERNEL_FEATURE_NODE_PORTAL
#define MAX_VOLUME_STACK_SIZE
#define KERNEL_FEATURE_SHADOW_CATCHER
#define KERNEL_FEATURE_OBJECT_MOTION
#define KERNEL_FEATURE_PATH_GUIDING
#define KERNEL_FEATURE_TRANSPARENT
#define KERNEL_FEATURE_SUBSURFACE
#define KERNEL_FEATURE_NODE_BSDF
#define KERNEL_FEATURE_HAIR_THICK
#define KERNEL_FEATURE_NODE_VORONOI_EXTRA
#define KERNEL_FEATURE_NODE_VOLUME
#define KERNEL_FEATURE_PATH_TRACING
#define KERNEL_FEATURE_GSPLATS
#define KERNEL_FEATURE_SHADOW_LINKING
#define KERNEL_FEATURE_DENOISING
#define KERNEL_FEATURE_LIGHT_LINKING
#define KERNEL_FEATURE_HAIR
#define KERNEL_FEATURE_NODE_RAYTRACE
#define KERNEL_FEATURE_BAKING
#define KERNEL_FEATURE_MNEE
#define KERNEL_FEATURE_POINTCLOUD
#define KERNEL_FEATURE_NODE_EMISSION
#define KERNEL_FEATURE_NODE_BUMP
#define CCL_NAMESPACE_END
#define assert(assertion)
size_t util_guarded_get_mem_used()
size_t util_guarded_get_mem_peak()
@ PASS_DENOISING_BACKWARD_MOTION
@ PASS_DENOISING_SPECULAR_MOTION
@ ATTR_STD_VOLUME_VELOCITY_Y
@ ATTR_STD_VOLUME_VELOCITY_Z
@ ATTR_STD_VOLUME_VELOCITY
@ ATTR_STD_VOLUME_VELOCITY_X
#define MEM_GUARDED_CALL(progress, func,...)
static void assert_same_owner(const set< T * > &nodes, const NodeOwner *owner)
static void log_kernel_features(const uint64_t features)
string string_from_bool(bool var)
string string_human_readable_size(size_t size)
string string_human_readable_number(size_t num)
int reference_count() const