DescriptorHeapVulkan has no heap-mode descriptor writers, so every per-frame heap write is copied by hand #177
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#177
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
DescriptorHeapVulkanhas descriptor writers for descriptor-set mode (WriteImageSet,WriteImageSets,WriteBufferSets,WriteSamplerSets) but none for the heap. So every heap-mode write is spelled out by hand: copy the create-info per frame, addressresourceHeap[f].valueplusImageByteOffsetorBufferByteOffset(or the sampler heap plusSamplerByteOffset), callvkWriteResourceDescriptorsEXTorvkWriteSamplerDescriptorsEXT, flush. The sampler write alone exists in three places:UIRenderer::RegisterSampler(implementations/Crafter.Graphics-UI.cpp:435).tests/HeapDynamicIndexHit/main.cpp:332.examples/Sponza/main.cpp:254-268, copied from the test in6e94cc6.The image and buffer writes recur in VulkanTriangle, Sponza, SponzaBench, RTVolume, HeapASRead and RTPassPushData.
The copies already differ:
RegisterSamplerflushes only the range it wrote, while Sponza flushes the whole heap (:267), which the coherent memory both local drivers use hides. If the per-frame replication or the addressing changes, every copy has to change with it. That is the kind of drift #163 removed for the heap-bind structs.Line numbers refer to
6e94cc6.Suggested fix
Heap-mode writers on
DescriptorHeapVulkan, next to the descriptor-set-mode ones, that flush only what they write:WriteSampledImage,WriteStorageImage,WriteBufferandWriteSampler.UIRendererand the examples would use them, and Sponza's sampler write becomes one call. The manual's "writing a descriptor by hand" pattern changes with it.Found in a code review of the #163 change.