DescriptorHeapVulkan: the sampler heap is not checked against maxSamplerHeapSize #173
Labels
No labels
claude:blocked
claude:done
claude:failed
claude:in-progress
claude:ready
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Catcrafts/Crafter.Graphics#173
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Summary
Initializesizes the sampler heap from the sampler count without comparing it withVkPhysicalDeviceDescriptorHeapPropertiesEXT::maxSamplerHeapSize, so it accepts counts the device cannot bind.Window::Renderthen binds the heap every frame in violation of VUID-vkCmdBindSamplerHeapEXT-pBindInfo-11225, and nothing says so unless the validation layer is on.Line numbers refer to
6e94cc6: the size is computed atinterfaces/Crafter.Graphics-DescriptorHeapVulkan.cppm:134and bound atimplementations/Crafter.Graphics-Window.cpp:1366-1379.Numbers
NVIDIA 615.78.08 (RTX 4090):
maxSamplerHeapSizeis 0x20000,samplerDescriptorSize32 andminSamplerHeapReservedRange0x200, so at most 4080 sampler slots fit.Initialize(16, 16, 4081)builds a 131104-byte sampler heap.The resource heap has the same rule (VUID-vkCmdBindResourceHeapEXT-pBindInfo-11234,
maxResourceHeapSize). Slot counts within 16 bits cannot reach it on NVIDIA: the largest resource heap is about 2 MB of descriptors plus the reserved range, against a 32 MB limit.Suggested fix
Throw from the layout computation (
DescriptorHeapVulkan::ComputeLayoutonce #163 lands) when a heap would pass its maximum, naming the count and the limit, as the 16-bit check there does. TheDescriptorHeapLayouttest'sPropertieshelper then has to set the two max fields.Found in a code review of the #163 change.