[perf][LOW] Resize path: dead present-mode queries + presentModes vector #45
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics#45
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 (resize path)
Location:
implementations/Crafter.Graphics-Window.cpp:458, 820-829, 897-903Impact: LOW · Effort: Small · Not hot path (transient drag-resize only)
Problem
During an interactive Wayland drag-resize, every configure fires
Resize()->vkQueueWaitIdle+CreateSwapchain, which re-queries present modes (vkGetPhysicalDeviceSurfacePresentModesKHRtwice) and heap-allocates per call.Proposed fix
The
presentModesvector is dead code —swapchainPresentModeis unconditionallyVK_PRESENT_MODE_FIFO_KHR. Delete both queries and the vector outright. SelectcompositeAlphaonce at construction. Optionally coalesce rapid configures (the real drag-hitch win, but harder).Correctness caveat
Keep the
vkQueueWaitIdle(required before swapchain recreation). The dominant per-configure cost is the wait-idle + swapchain recreate, which these fixes do not touch.