Repository navigation
R-7: read buffer view addresses by view heap slot (CS_TraceShadowRays_*) - #67
Conversation
|
This needs a rebase on
Could you post full |
|
Rebased on On the full counts: the description already has a census over every program,
No program that validated before is refused, and no refused program changes its message, so the On memory: the 16 MiB is in the slot table's upload heap, not dedicated video memory, and every run logged here shows a single host view heap. If you would rather not pay it for every view heap, I can allocate the address half only when a pipeline reads a view by its address. |
dd31651 to
5f7d402
Compare
|
CI fails on |
5f7d402 to
a5a79d8
Compare
The host table of element strides by heap slot (SLOT_STRIDES) goes on with two dwords per slot: the title address of its buffer view (SLOT_VIEW_ADDRESSES), written with the stride. view_address reads it for a descriptor picked from the heap at a computed index. A join of a lane mask with a dword from a scalar memory load is no lane mask. The 5 CS_TraceShadowRays_* programs translate and validate.
a5a79d8 to
1c6bf53
Compare
What changed
R-7 (untranslated shaders): the 5
CS_TraceShadowRays_*compute programs ("emit: a descriptor read only as data") load a buffer descriptor from the view heap at an index they compute and only take its address. The host's table of element strides by heap slot (SLOT_STRIDES) now goes on with two dwords per slot, the title address of the slot's buffer view (SLOT_VIEW_ADDRESSES, 0 when the slot holds no buffer view), written whenever the stride is.view_addressinemit/lower.rsreads it for a descriptor picked from the heap.CS_TraceShadowRays_FullAdaptivethen hit a second cause: the compiler reuses an SGPR holding a compare's mask on one path and a dword froms_buffer_loadon the other, then uses the join as a number. Instructure.rs, a join with an argument read by a scalar memory load is no longer a lane mask.No change to
draw.rsor the pipeline: the addresses share the existingSLOT_STRIDESroot SRV.Independent of #56, #64 and #66. It meets #56 in
emit/lower.rs(both add code near the descriptor helpers) and all of them at the top ofdocs/fork-notes.md; whichever merges later needs a small rebase.How it was tested
translate --list --validateand unit tests; no game run was made with this branch.Checks run on this branch:
cargo test --workspace --locked: no new failure compared withmaincargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo xtask policyNew unit tests, each failing before the change:
emit::lower::tests::a_view_picked_from_the_heap_for_its_address_reads_it_from_the_hoststructure::tests::a_register_joining_a_mask_with_loaded_data_is_no_maskdescriptor::host::tests::the_slot_table_holds_each_buffer_views_address(the address follows slot writes and goes back to 0)Full census,
translate --list --validate --jobs 2in release,main(f3c94ca) against this branch, compared program by program over 25,953 programs:mainThe 5
CS_TraceShadowRays_*programs go from failing to validated. No program that passed now fails, and no failing program changes its cause, so the new join rule instructure.rschanges nothing else.Memory cost: the table is one upload buffer per host view heap, in upload (shared system) memory, not dedicated video memory. It grows from 8 MiB to 24 MiB per view heap. A host view heap is made only for a shader-visible view heap the title draws with. Each of the 29 runs logged on 2026-11-26/27 shows one, the title's 1,245,184-view heap capped at 1,000,000, so the cost is 16 MiB more. A smaller extra view heap would only show at debug level; each would add another 16 MiB.
AI