refactor: Factoring out attribtues

This commit is contained in:
2026-11-22 16:28:52 +01:00
parent bbf9c4d0a8
commit 42f85757d5
20 changed files with 767 additions and 85 deletions
+12
View File
@@ -297,6 +297,18 @@ correctness requirement.
| `valid_count` | host writes `0`; the validation pass fills the amount of valid entries |
| attribute buffers | dense per-entry attribute payloads |
Build the layout from a producer payload with
`CacheLayout::from_attributes(&A::LAYOUT, &extras)`: producer attributes become
`CacheAttributeInit::External` and come first, `extras` are appended for
GPU-only data.
Upload producer voxels with `CacheInsertionData::write_attributes(&queue, voxels)`.
It accepts a slice in `[entry][child]` order (the child order is
`x + 4*y + 16*z`), validates that `A::LAYOUT` is an `External` prefix of the
cache layout with matching word counts and labels, and writes one buffer per
attribute. It returns the entry count to write to `page_count_buffer`. The
`DontTouch` attributes after the producer prefix are left untouched.
`InsertionInformation<N>` is just `children: [ChildInformation; 64]`, where each
`ChildInformation` uses the four-state encoding below.