[perf][LOW] Descriptor-heap bind recorded unconditionally every frame #42
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics#42
Loading…
Add table
Add a link
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?
Subsystem: Window / swapchain / frame loop
Location:
implementations/Crafter.Graphics-Window.cpp:736-758Impact: LOW · Effort: Small
Problem
Every frame rebuilds two
VkBindHeapInfoEXTstructs and recomputesreservedRangeOffsetvia a runtime subtract + bitmask againstDevice::descriptorHeapProperties. The heap address/size per slot are stable; onlycurrentBuffervaries.Proposed fix
Precompute
numFramesVkBindHeapInfoEXTstructs when the heap is assigned / swapchain recreated, and record the cached struct forcurrentBuffer.Correctness caveat
Invalidate the cache from the
descriptorHeapsetter (the safest hook), notonResize. The heaps never resize today, so this is correct.