Initial implicit sharing docs #1
@ -19,3 +19,7 @@ graph
|
|||||||
meshB -->|read-access| data
|
meshB -->|read-access| data
|
||||||
sharing -->|owns| data
|
sharing -->|owns| data
|
||||||
```
|
```
|
||||||
|
|
||||||
|
APIs that support implement sharing typically have two methods to access the same piece of data. One that gives read-only access (e.g. `Mesh.vert_positions() -> Span<float3>`) and one that gives write access and typically has `_for_write` in the name (e.g. `Mesh.vert_positions_for_write() -> MutableSpan<float3>`).
|
||||||
|
|
||||||
|
For raw data, the sharing info and the actual data are often separate allocations. However, in some cases it's benefitial to put both into the same allocation. For example, this is done for `GeometryComponent`. Here the entire geometry component can be implicitly shared between multiple geometry sets.
|
||||||
|
Loading…
Reference in New Issue
Block a user