Starting decoupling requests

This commit is contained in:
2026-11-08 21:25:40 +01:00
parent 82c952c6d8
commit d44da4520c
23 changed files with 2386 additions and 306 deletions
+8 -5
View File
@@ -397,8 +397,9 @@ Structure-table shaders use a simpler concatenation:
`common.wgsl` + pass file.
`common.wgsl` starts with `enable wgpu_binding_array;` and defines the shared
`CacheIndex`, `RequestInformation`, `RequestMeta`, `AttributeArray`,
`LocationPage`, and child-pointer helpers so the Rust and WGSL sides share names.
`CacheIndex`, `RequestInformation`, `RequestMeta`, `InsertionParent`,
`AttributeArray`, `LocationPage`, and child-pointer helpers so the Rust and WGSL
sides share names.
### 9.2 WGSL modules and entry points
@@ -407,11 +408,12 @@ Structure-table shaders use a simpler concatenation:
| `shaders/requests.wgsl` | `reset_requests` | Zero all per-child request counters. |
| `shaders/gather_requests.wgsl` | `gather_requests` | Copy selected top-K counts/indices into radix key/value buffers. |
| `shaders/write_requests.wgsl` | `write_requests` | Convert sorted flat indices into `RequestInformation`/`RequestMeta`. |
| `shaders/insertion.wgsl` | `insertion`, `consume` | Recycle pages, write pointer/location/depth/attributes, advance consumed count. |
| `shaders/insertion.wgsl` | `validate_internal`, `insertion`, `consume` | Validate/compact internal entries, recycle pages, write pointer/location/depth/attributes, advance consumed count. |
| `shaders/invalidation.wgsl` | `invalidation` | Clear cache pointers that reference pages recycled this insert. |
| `shaders/write_pointers.wgsl` | `write_pointers` | Link internal insertion results into parent pages. |
| `shaders/write_pointers.wgsl` | `write_pointers` | Link internal insertion results into parent pages using the batch's `InsertionParent`. |
| `shaders/eviction.wgsl` | `reset_lru_list`, `indirect_copy` | Build the eviction candidate list: descending depth sort, then gather timestamps for the stable timestamp sort. |
| `fixed_table/write_requests.wgsl` | `write_requests` | Emit root requests for table slots. |
| `fixed_table/validate_insertion.wgsl` | `validate_external` | Keep only root entries whose slot still waits for a page. |
| `fixed_table/insertion.wgsl` | `insertion` | Point table slots at inserted root pages. |
| `fixed_table/invalidation.wgsl` | `invalidation` | Clear table slots pointing at recycled pages. |
| `terrain/shaders/toroidal_structure.wgsl` | `invalidate_new` | Reset table slots whose world position changed. |
@@ -425,7 +427,8 @@ Cache shaders consistently bind:
- group 0 — cache structure (pointer, location, depth pages), except
`insertion.wgsl` where group 0 is attributes and group 1 is structure;
- group 1 — request handler, evictor, or request buffer depending on the pass;
- group 1 — request handler, evictor, insertion data, or request buffer
depending on the pass;
- group 2 — request buffer, insertion data, or scratch buffer;
- group 3 — evictor or insertion data;
- group 4 — inserted-count atomic.