fix(vulkan): clear startup validation errors on native triangle #6
No reviewers
Labels
No labels
claude:done
claude:in-progress
claude:ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics!6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claude/issue-5"
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
Fixes the two Vulkan validation errors that fired on startup of the native Vulkan examples, reported in #5.
1. Device layers (
enabledLayerCountmust be 0)Device::Initializeenumerated device layers and, if found, passedVK_LAYER_KHRONOS_validationtovkCreateDevice. Device layers have been deprecated and ignored since Vulkan 1.0 — passing them violatesVUID-VkDeviceCreateInfo-enabledLayerCount-12384. The enumeration/match block is removed andenabledLayerCountis pinned to0. Layers are still enabled at the instance level (unchanged).2. Layout transition on an unacquired presentable image
StartInit()andRecreateSwapchainAndImages()eagerly transitioned every swapchain imageUNDEFINED → PRESENT_SRC_KHRon a submit issued before anyvkAcquireNextImageKHR. A presentable image may only be touched after it is acquired, so this trippedvkQueueSubmit(): ... layout transition on presentable VkImage ... but the image has not been acquired.Those pre-transitions are removed. Each image's first layout transition now happens lazily in
Render(), after acquire, fromUNDEFINED; every subsequent frame transitions fromPRESENT_SRC_KHR. A per-imageimageInitialisedflag (reset inCreateSwapchain()) picks the correctoldLayout. UsingUNDEFINEDon first use is correct because a freshly-acquired swapchain image's contents are undefined anyway.Testing
Ran under a headless
swaycompositor (GPU renderer) withVK_LAYER_KHRONOS_validationenabled.enabledLayerCount is 1 (not zero)/Device Layers have never worked, and repeatedlayout transition on presentable VkImage ... has not been acquired(once per swapchain, including on recreation).VulkanTriangleexample named in the issue — the two reported error signatures are gone.There is no
crafter-build testsuite (No tests matched), so verification was by exercising the app directly under the validation layer.Resolves #5
🤖 Generated with Claude Code