upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/xma_decoder/tests/ffi_cpp_smoke.cpp
diff options
context:
space:
mode:
authorNotRexed <therealnothingfn@gmail.com>2026-11-27 16:27:18 -0500
committerNotRexed <therealnothingfn@gmail.com>2026-11-27 16:27:18 -0500
commit956a1fc94e2f0d4ff4feab3b0bba2750aca8b37d (patch)
tree6b2f83576a279aa9e0fbca9d0bfeacae957debe7 /runtime/xma_decoder/tests/ffi_cpp_smoke.cpp
parentcce11849ad2a7461cf2bd1b72d72c19a36773213 (diff)
Lists' scratch memory: a chunk's address on the card is asked once, when the chunk is made
`HostList::scratch` and `scratch_held` took a reference to the chunk's buffer and asked it for its GPU address every time a list took scratch memory: for every constant buffer of a table made afresh (`State::tables`), every root constant buffer copied because it is not on 256 bytes (`fill_scratch`), the rectangles' corners and the indirect tables. A buffer has one address for as long as it lives, so `Chunk` keeps it (`gpu`, asked in `take_chunk`), and a piece's address is the chunk's plus its offset. `scratch`, which hands no buffer out, takes no reference to it any more; `scratch_held` takes the one its descriptor slot keeps, as before. A piece bigger than a chunk has a buffer to itself and asks it once, as before. `scratch_at` (the copies at their place, `host/place.rs`) gives what it gave. Same addresses; a pure saving. What it is aimed at (CPU profile of 2026-11-27, Series X profile, about 9,500 draws a frame): `State::bind` on the threads that record lists, the part that makes tables afresh and binds root constant buffers. A small part of it: two calls into the buffer and a counted reference less for each piece. From maren-halv/VIctory-DXR e0e549a ("perf: sync 40+ FPS raster wins (9b958c9) ..."), GPL-3.0: the idea of its `State::scratch_base` (the scratch buffer's address kept per list). Here it is kept with the chunk instead, so that every list that takes the chunk from the spare ones has it and nothing has to be forgotten when a list moves to its next chunk. New test `host::scratch_address_tests` (on the host's card): the addresses `scratch` and `scratch_held` give are the buffer's own plus the pieces before them, and a piece bigger than a chunk is at its own buffer's. It compiles; it was NOT run, because the title was running on the card and tests on the card were not to be run meanwhile. Checked: `cargo check --profile diag -p leonida --features diagnostics,mimalloc` (the 10 warnings of leonida-gpu from before); `cargo test -p leonida-gpu --features diagnostics --lib --no-run` builds. Not run in the game. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Diffstat (limited to 'runtime/xma_decoder/tests/ffi_cpp_smoke.cpp')
0 files changed, 0 insertions, 0 deletions