Repository navigation
Conversation
…er caps A shader-visible view heap can be capped by the driver (NVIDIA refuses more than 1,000,000 descriptors, Marvisak#1760), and the host then makes a heap of exactly that size with its dynamic slots filling it to the end. Two things were sized for an uncapped heap: the emitted clamp and the null buffer views, at HEAP_VIEWS - 1 and HEAP_VIEWS - 2 with HEAP_VIEWS = 2^21. On a capped heap that put both of them outside it: 'no room for the null buffer views' in the log, and a computed descriptor index between the cap and the clamp reading a descriptor that was not there. HEAP_VIEWS is now 1,000,000, the smallest cap the host meets, and the capped creation keeps two slots free for the null views. Measured on the machine that caps: the warning is gone and the null slots exist, where before they did not.
|
Verified Verification
Code review note
|
|
On an NVIDIA host with the 1,000,000 cap: RTX 3070 8 GB, driver 616.56, Windows 11, debug,
That is exactly what #1779 gives here, also on AI-assisted (Claude Code). Synthetic tests only. |
|
Withdrawing in favour of #1779, which does more, and here is the measurement that says so I ran both on the machine that caps (integrated
So #1779 covers what this one does and the slots above the cap, which mine left in place (I said so in the body: remapping them was the bigger change I was not doing). Two pull requests for the same constant is exactly what should not be in the queue, so I am closing this one rather than asking a reviewer to compare them. What I would keep from here, if you want it in #1779 or in a follow-up: the fault I had written down — a capped heap is created with its dynamic slots filling it to the last descriptor, so the null views at Also, since it may be useful as a second data point: on this machine #1779's build still removes the device (twice, in the same window), and that is expected — the removal here is the id 599 in #1754 (a No game data is involved: counts and warnings only. Written with an AI assistant. |
catminou4
left a comment
There was a problem hiding this comment.
Mixed PR: victory-shader part macOS-tested in batch; victory-gpu part Windows-only static.
Heap indices and null views inside…: gpu+shader mixed — shader half in batch, GPU half Windows-only.
The null views did not exist on a capped heap, and that is now fixed and measured
Following the numbers in this issue: the emitted clamp bound and the null buffer views are
HEAP_VIEWS - 1andHEAP_VIEWS - 2withHEAP_VIEWS = 2^21 = 2,097,152, while the host heap is capped at 1,000,000 and its dynamic slots were set to fill it exactly. So on a capped heap the null views the clamp is supposed to fall back to were outside the heap, which is whatno room for the null buffer viewswas saying, and any computed index between the cap and the clamp read a descriptor that was not there.Two changes, both about fitting inside the heap the driver allows:
HEAP_VIEWSis now 1,000,000 — the smallest cap the host meets in practice — so the clamp and the null slots are inside any heap we can bind;Measured on the machine that caps (integrated
AMD Radeon(TM) Graphics, driver32.0.21045.29003, session 1, real window 3840×2160, empty cache), same scenario before and after:no room for the null buffer viewstitle slot past the host heapmain70564aeso the null views now exist and the shader's fallback has somewhere to land. Everything else in that log is unchanged, including the device removal — which is the chain in #1754 (the UAV description's id 599 and the sampler heap's id 1419), not this. This change is about the heap being consistent with itself, not about the removal.
Verification:
cargo test -p victory-shader209 passed,cargo test -p victory-gpu78 passed / 1 ignored,cargo clippy --workspace --all-targetswith and without--all-featuresclean,rustfmt --checkon both files at the same hunk counts asmain(2 and 33 before, 32 after because two were mine).What it does not do, and I would rather say than imply: it does not remap the 310,722 title slots above the cap. Those slots still have no host descriptor, so a shader that computes such an index still reads the null instead of its real descriptor — the design's stated behaviour for a slot that has none, and a real rendering loss on a title heap this large. Making them work needs the heap remapped (or the clamp given a runtime bound), which is a bigger change than this one.
Pull request: #1837
No game data is involved: counts and warnings only.
Written with an AI assistant.