Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/scene/geometry.cpp
| Show First 20 Lines • Show All 996 Lines • ▼ Show 20 Lines | void GeometryManager::device_update_attributes(Device *device, | ||||
| dscene->attributes_float4.copy_to_device_if_modified(); | dscene->attributes_float4.copy_to_device_if_modified(); | ||||
| dscene->attributes_uchar4.copy_to_device_if_modified(); | dscene->attributes_uchar4.copy_to_device_if_modified(); | ||||
| if (progress.get_cancel()) | if (progress.get_cancel()) | ||||
| return; | return; | ||||
| /* After mesh attributes and patch tables have been copied to device memory, | /* After mesh attributes and patch tables have been copied to device memory, | ||||
| * we need to update offsets in the objects. */ | * we need to update offsets in the objects. */ | ||||
| scene->object_manager->device_update_mesh_offsets(device, dscene, scene); | scene->object_manager->device_update_geom_offsets(device, dscene, scene); | ||||
| } | } | ||||
| void GeometryManager::mesh_calc_offset(Scene *scene, BVHLayout bvh_layout) | void GeometryManager::geom_calc_offset(Scene *scene, BVHLayout bvh_layout) | ||||
| { | { | ||||
| size_t vert_size = 0; | size_t vert_size = 0; | ||||
| size_t tri_size = 0; | size_t tri_size = 0; | ||||
| size_t curve_size = 0; | size_t curve_size = 0; | ||||
| size_t curve_key_size = 0; | size_t curve_key_size = 0; | ||||
| size_t curve_segment_size = 0; | size_t curve_segment_size = 0; | ||||
| ▲ Show 20 Lines • Show All 900 Lines • ▼ Show 20 Lines | if (true_displacement_used || curve_shadow_transparency_used) { | ||||
| scene->object_manager->device_update_flags(device, dscene, scene, progress, false); | scene->object_manager->device_update_flags(device, dscene, scene, progress, false); | ||||
| } | } | ||||
| /* Device update. */ | /* Device update. */ | ||||
| device_free(device, dscene, false); | device_free(device, dscene, false); | ||||
| const BVHLayout bvh_layout = BVHParams::best_bvh_layout(scene->params.bvh_layout, | const BVHLayout bvh_layout = BVHParams::best_bvh_layout(scene->params.bvh_layout, | ||||
| device->get_bvh_layout_mask()); | device->get_bvh_layout_mask()); | ||||
| mesh_calc_offset(scene, bvh_layout); | geom_calc_offset(scene, bvh_layout); | ||||
| if (true_displacement_used || curve_shadow_transparency_used) { | if (true_displacement_used || curve_shadow_transparency_used) { | ||||
| scoped_callback_timer timer([scene](double time) { | scoped_callback_timer timer([scene](double time) { | ||||
| if (scene->update_stats) { | if (scene->update_stats) { | ||||
| scene->update_stats->geometry.times.add_entry( | scene->update_stats->geometry.times.add_entry( | ||||
| {"device_update (displacement: copy meshes to device)", time}); | {"device_update (displacement: copy meshes to device)", time}); | ||||
| } | } | ||||
| }); | }); | ||||
| device_update_mesh(device, dscene, scene, progress); | device_update_mesh(device, dscene, scene, progress); | ||||
| ▲ Show 20 Lines • Show All 288 Lines • Show Last 20 Lines | |||||