Take texture upload memory from the list's scratch pool #30
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!30
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/30/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@romainhedouin on GitHub · 2026-11-25 12:32 UTC · original
romainhedouin:perf/upload-pool→main· +30 −20 · 2 files · 1 commits · merged 2026-11-25 17:09 UTCEach title copy from a buffer into a texture created a brand new D3D12 upload buffer, mapped it, and destroyed it at list reset (the code marked this as a shortcut to pool later). Now the bytes go into the list's scratch memory: pooled 512 KiB chunks that stay mapped and are reused once the GPU is done with them, at a 512-byte offset as D3D12 requires for texture copies. Copies over 512 KiB still get their own buffer, as before.
CreateCommittedResourceMapCounts from the code, not timings. Type-checked for Windows (
cargo clippy --target x86_64-pc-windows-msvc, with and without--all-features, no new warnings); not run.🤖 Generated with Claude Code
@ -2415,2 +2422,2 @@s.used += len;Some((gpu + at, (data + at as usize) as *mut u8))let (buffer, data, gpu) = &s.chunks[s.current];let at = s.used.next_multiple_of(align);@gut0to on GitHub · 2026-11-25 15:13 UTC · original
Could we add a Windows regression test that first allocates a 256-byte scratch span, then requests an upload span with 512-byte alignment and checks that the returned GPU offset is 512-byte aligned? This is the contract that makes the new pooled upload safe for placed footprints, and the mixed-alignment rollover path is currently untested. AI-assisted review.
@gut0to on GitHub · 2026-11-25 15:13 UTC · original · reviewed
AI-assisted review: I traced the scratch allocation alignment contract and the current test coverage.