Attributes: Integrate implicit sharing with the attribute API #107059

Merged
Jacques Lucke merged 8 commits from HooglyBoogly/blender:implicit-sharing-attribute-api into main 2023-04-19 11:21:21 +02:00

8 Commits

Author SHA1 Message Date
Hans Goudey 21ef74bbb3 Check for .is_span() and don't assume attributes are shared in two places
buildbot/vexp-code-patch-coordinator Build done. Details
2023-04-18 17:20:06 -04:00
Hans Goudey 3d6813823d Merge branch 'main' into implicit-sharing-attribute-api 2023-04-18 17:12:45 -04:00
Hans Goudey 39314fe9d8 Merge branch 'main' into implicit-sharing-attribute-api 2023-04-18 15:06:56 -04:00
Hans Goudey 3321664220 Fix missing check for empty virtual array 2023-04-18 11:57:48 -04:00
Hans Goudey 80f09db120 Merge branch 'main' into implicit-sharing-attribute-api 2023-04-18 11:18:45 -04:00
Hans Goudey 5c578d29e1 Separate a new AttributeInit type 2023-04-18 08:44:35 -04:00
Hans Goudey 54e9190669 Merge branch 'main' into implicit-sharing-attribute-api 2023-04-18 07:28:57 -04:00
Hans Goudey ed151b09c9 WIP: Attributes: Integrate implicit sharing with the attribute API
Add the ability to retrieve implicit sharing info directly from the
C++ attribute API, which simplifies memory usage and performance
optimizations making use of it. This commit uses the additions to
the API to avoid copies in a few places:
- The "rest_position" attribute in the mesh modifier stack
- Instance on Points node
- Instances to points node
- Mesh to points node
- Points to vertices node

Many files are affected because in order to include the new information
in the API's returned data, I had to switch a bunch of types from
`VArray` to `AttributeReader`. This generally makes sense anyway, since
it allows retrieving the domain, which wasn't possible before in some
cases. I overloaded the `*` deference operator for some syntactic sugar
to avoid the (very ugly) `.varray` that would be necessary otherwise.

TODO:
- [ ] Fix tests
    - [ ] cycles_pointcloud_cpu (Failed)
    - [ ] geo_node_attributes_test_attribute_curve_map (Failed)
    - [ ] geo_node_attributes_test_attribute_map_range (Failed)
    - [ ] geo_node_attributes_test_attribute_proximity (Failed)
    - [ ] geo_node_curves_test_handle_type_selection (Failed)
    - [ ] geo_node_curves_test_spline_parameter (Failed)
    - [ ] geo_node_geometry_test_delete_geometry (SEGFAULT)
    - [ ] geo_node_geometry_test_realize_instances_materials (Subprocess aborted)
    - [ ] geo_node_instance_test_instance_on_points (Subprocess aborted)
    - [ ] geo_node_instance_test_instance_to_points (Subprocess aborted)
    - [ ] geo_node_instance_test_instance_transforms (Subprocess aborted)
    - [ ] geo_node_mesh_test_set_position_normals_update (Subprocess aborted)
    - [ ] geo_node_points_test_point_instance (Subprocess aborted)
    - [ ] geo_node_utilities_test_accumulate_field_column_grid (Subprocess aborted)
    - [ ] geo_node_vector_test_vector_map_range (Subprocess aborted)
2023-04-17 23:46:12 -04:00