·
79 commits
to VCK
since this release
The runtime-vkDeviceWaitIdle-is-gone release. Multi-queue, timeline-driven, fence-honest.
Merged via PR #4 (commit ee29ea6).
CI: green on the Windows runner (build.bat [A] — all 13 examples).
Added
- Dedicated compute + transfer queues.
VulkanDevice::FindQueueFamiliespicks compute-only and transfer-only families when the vendor exposes them (AMD / NVIDIA almost always; Intel iGPUs often don't). Fallback to graphics is logged viaVCKLog::Notice. - Timeline semaphore feature chain.
VulkanDevice::InitializeenablesVK_KHR_timeline_semaphorewhen the adapter supports it.VulkanDevice::HasTimelineSemaphores()reports the capability. FrameSchedulerowns one timeline.EndFramesignals a monotonic per-slot value;BeginFramewaits with onevkWaitSemaphores. Per-slot fences kept as a fallback.FrameScheduler::FrameTimeline()/SlotToken(slot)/DrainInFlight(). Public timeline accessors + scheduler-owned full drain that doesn't touch the device globally.- Scheduler-aware
HandleLiveResize. Drains viaDrainInFlight(), recreates the swapchain withdrainedExternally=true, leaves independent compute / transfer work alone during resize. - Secondary command buffer API.
VulkanCommand::AllocateSecondary/FreeSecondary/BeginSecondary(cb, inheritance)/EndSecondary/ExecuteSecondaries(primary, …). Caller serialises pool access (rule 18). - VMM cross-family staging. When the transfer family differs from graphics, VMM records a release barrier on transfer, waits on the per-submit fence, then records an acquire barrier on graphics (Vulkan §7.7.4).
VMMper-submit fence.SubmitStagingCmdno longer callsvkQueueWaitIdle.Config::DeviceCfgknobs.enableTimelineSemaphores,enableDedicatedComputeQueue,enableDedicatedTransferQueue(rule 19 — zero cost when off).- Example [13]
SecondaryCmdExample. Per-slot secondary re-recorded each frame; primary opens the render pass withVK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS. Uses scheduler-aware resize. - Example [12]
EasyCubeExample. Cube viaPrimitives::Cube()+VertexLayout+PushConstants+VCKMath(carried over from v0.2.1). docs/Overview.md. One-page tour: what VCK is / gives / never takes / modern v0.3 optimisations / why it's fresh / honest pick-vs-no-pick summary.- Rules 18–22. External synchronisation, zero-cost-for-unused, example parity, ABI stability (
VCK.his the surface), no ownership of user handles.
Changed
- Rule 4 allow-list. Only
Shutdown()paths may callvkDeviceWaitIdle. Concrete blocking sites:OneTimeCommand::End,VMM::SubmitStagingCmd,FrameScheduler::WaitInFlightFence(timeline or fence),DrainInFlight,BackpressureGovernor::WaitIfOverrun,Swapchain::Recreatedefault fallback (scheduler-aware path passesdrainedExternally=true). - Rule 14 tightened. Every failure returns an explicit
boolAND logs viaVCKLog::Error(\"<subsystem>\", …). Silentfalseis a bug. - Logging. All
LogVkcall sites migrated toVCKLog::{Info,Notice,Warn,Error}. build.bat/build.sh. Menus run[1]–[13],[A]builds all.VCK.h. Repository layout, class index, config knobs, and.cppfunction indexes synced to v0.3 surface (rule 21).
Fixed
VulkanOneTimeCommand::Endno longer hangs whenvkQueueSubmitfails (short-circuiting fence wait + warn-fallback path).- VMM staging cmd buffer now allocated from a transfer-family pool (was: graphics pool submitted to transfer queue, spec violation).
- VMM fallback path now wraps
vkQueueSubmit/vkQueueWaitIdleinVK_CHECK(rule 14). - VMM no longer records acquire barriers when the matching transfer submit failed (no more stale
oldLayout=TRANSFER_DST_OPTIMALonUNDEFINEDimages). VulkanDevice::Shutdownnullsm_ComputeQueue/m_TransferQueueso post-shutdown getters fall through to the nulled graphics queue.FrameScheduler::WaitInFlightFencetimeline path now resets the first-frameVK_FENCE_CREATE_SIGNALED_BITfence (avoidsVUID-vkQueueSubmit-fence-00064on first pass per slot).SecondaryCmdExample::Run()matches the established `if (window.IsMinimized()) { window.WaitEvents(); continue; }` pattern.
Compatibility
VulkanSwapchain::Recreategained an optionaldrainedExternally=falseparameter; existing call sites keep their behaviour.- Legacy
HandleLiveResizeoverloads kept (still callvkDeviceWaitIdle); the scheduler-aware overload is the recommended v0.3 path. - Dedicated compute / transfer queues default ON; opt out via
cfg.device.enableDedicated*Queue = false.
Where to start
- New? Read
docs/Overview.md(10 min), thenHello VCK. - Upgrading from v0.2.x? Migrate
LogVkcallers toVCKLog::*; switchHandleLiveResizecallers that own aFrameSchedulerto the scheduler-aware overload; opt into dedicated queues / timeline by leaving the newDeviceCfgknobs at their defaulttrue. - Auditing? All 22 rules in
docs/Design.md. Allow-list lives in rule 4; status / caveats / roadmap track shipped vs deferred.