vkback: size the descriptor layout to the slots the title uses #34
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/vktory6--VKtory!34
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-34"
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?
@TheRifai on GitHub · 2026-11-30 23:58 UTC · original
TheRifai:vkback-descriptor-counts→main· +56 −14 · 8 files · 3 commits · merged 2026-12-01 00:22 UTCWhat
The resource descriptor layout declared 2^21 slots for the five typed bindings and 2^22 for the two storage-buffer bindings (which also hold the raw twins at
index + RAW_TWIN). That is 20,971,520 descriptors; the device'smaxPerStageResourcesis 8,388,606. The storage-buffer pair alone was 8,388,608, two over the per-type limit.The arrays are now sized to the ranges the title actually addresses:
heap_slotsheap_slots + RAW_TWINEvidence
A
VKB_SLOT_CENSUSdiagnostic (separate, not in this PR) recorded the largest index every binding was asked for on the house scene:heap_slots - 1(1,245,182) for every typed binding, andRAW_TWIN + heap_slots - 1(3,342,334) for bindings 4/5. The census reaches the layout's end, so the sizes are the full ranges, not a truncation.Validation, house save, GE-Proton11-15, errors only, distinct VUIDs:
VkPipelineLayoutCreateInfo-descriptorType-03018,-03024,-03031,-pSetLayouts-03039(storage buffers 8,388,608), andVkGraphicsPipelineCreateInfo-layout-01688/VkComputePipelineCreateInfo-layout-01687/VkRayTracingPipelineCreateInfoKHR-layout-03428(20,971,520 resources per stage)Not in this PR
The seven ranges still sum to 12,910,592, 54% over
maxPerStageResources. Folding the raw twins and uniform buffers into one storage array would reach 8,322,048; that changes descriptor addressing and is a separate design. This PR only removes the over-declared slots (and the descriptor-buffer memory that went with them).@vktory6 on GitHub · 2026-12-01 00:22 UTC · original
Thanks, this is the right sizing: a slot at or past
heap_slotsis already refused when it is written (slotwrite.rs), so the arrays only ever needheap_slotsentries, plus the raw twins on bindings 4/5. That makes the size exact by construction; the census confirms it.I pushed two commits on top:
VKB_HEAP_SLOTSread in one place (layout::heap_slots(); the run, vk-replay and vk-xlcost used to each parse it, falling back to the default when the value was no number).layout::makerefuses 0 and anything aboveRAW_TWIN: 0 is an empty layout, and aboveRAW_TWINthe typed slots of bindings 4/5 would land on the raw twins. That replaces.max(1)(AGENTS.md rule 33: no path for a case that cannot happen). vk-xlcost passed 0, which this change would have turned into a 1-slot layout; it now builds the run's layout.desc_countsmoved tolayout.rs, next to its readers (lib.rs is over its size limit on current main). And since the layout exists before the title creates its descriptor heap,heap_slotsstays a constant, now checked against the title's own count: a shader-visible CBV/SRV/UAV heap larger than the layout is a rule-9 error at its creation.Our validation run (house, RADV): 15 -> 11 distinct VUIDs, the four
03018/03024/03031/03039gone, nothing new. The remaining per-stage total is now its own task: one descriptor array instead of seven typed ones (mutable descriptors orVK_EXT_descriptor_heap), indocs/TASKS.md.github-bot referenced this pull request2026-12-02 12:08:11 +00:00