v0.2.1 — Ergonomic shader API
Pre-release
Pre-release
·
93 commits
to VCK
since this release
Added
- Rules 18-22 in
docs/Design.md:- R18 External synchronisation — codifies Vulkan's per-handle external-sync requirement;
JobGraphis the one exception. - R19 Zero cost for unused features — un-
Initialized modules allocate nothing, spawn no thread, emit no log line. - R20 Every public API has an example — public classes in
VCK.hmust be exercised by at least one example underexample/. - R21
VCK.his the API surface — layer headers are implementation detail; breaking changes toVCK.hbump the minor version until v1.0.0. - R22 VCK never owns user handles — completes rule 9; VCK destroys only handles it created.
- R18 External synchronisation — codifies Vulkan's per-handle external-sync requirement;
VCKMath.h—Vec2/Vec3/Vec4/Mat4POD structs, free-functionTranslate/Rotate/Scale/Perspective/LookAt/Radians/Degrees. No templates, no SIMD, row-major.VertexLayout— fluentAdd(name, VertexAttrType)→Binding(0)+Attributes()builder; returns plainVkVertexInput*structs the caller hands toVulkanModelPipeline(rule 22, no ownership).PushConstants—Declare(name, type)cold path,Set(name, value)+Apply(cb, layout, stages)hot path. Name → offset resolved atDeclare; no hashing /std::any/std::variantin the hot path.Primitives::Cube/Plane/Sphere/Quad/Line— return-by-valueMesh { positions, normals, uvs, indices }. Shrinks cube setup from ~40 lines of vertex tables to one call.DebugTimeline::DumpChromeTracing(path)— emits a Chrome-tracing JSON array you can load inchrome://tracingorui.perfetto.dev. No viewer bundled.- New example
[10] DebugShowcaseExample— guided tour of everyVCKLoglevel,cfg.debuggating, dedup,VK_CHECKfail-loud path, GPU / driver / memory / surface dump. No draw loop. - New example
[11] AAShowcaseExample—DetectRecommendedAAdecision matrix acrossforwardRenderer×supportsMotionVectors, live swapchain auto-pick echoed viaGetAATechnique()+GetMSAASamples(), RGB triangle drawn with the picked AA. - New example
[12] EasyCubeExample—Primitives::Cube()+VertexLayout+PushConstants+VCKMathin one screen. Rule 20 parity for the v0.2.1 ergonomic API. - Wiki
Cookbook— one-stop recipe book: image / OBJ / cube / text / line / circle / FXAA / SMAA / TAA skeletons / ImGui bootstrap / offscreen PNG readback.
Changed
- Rule 14 tightened — now explicitly requires
VCKLog::Errorwith a subsystem tag on every failure; areturn falsewithout a matchingErroris a bug. VulkanModelPipeline::Initialize(4-arg overload) emitsVCKLog::Warnwhen called; the hardcodedVK_SAMPLE_COUNT_1_BITis hazardous when the render pass uses MSAA. Use the 5-arg overload and passswapchain.GetMSAASamples().build.bat/build.sh— menu grew to[1]-[12].
Fixed
- Top-left quadrant rendering in
MipmapExample+VMMExample— caused by pipeline-vs-render-pass sample-count mismatch (pipeline was 1x, render pass was MSAA 4x — undefined per spec, on NVIDIA confines rasterisation to the top-left quadrant). Both examples now passswapchain.GetMSAASamples()to the 5-argVulkanModelPipeline::Initialize. - Windows ANSI colour output —
VCKLog::Init()now callsSetConsoleModewithENABLE_VIRTUAL_TERMINAL_PROCESSINGonce on startup so Windows CMD renders colours instead of←[96mliterals. build.batline endings —.gitattributesforces CRLF on*.batso Windows CMD stops fragmenting comment lines into garbage tokens.EasyCubeExamplesizeofbug —VulkanMesh::Uploadtakes total byte count, not per-vertex stride; was uploading 1 of 24 vertices.DebugTimeline::DumpChromeTracingunderflow guard —endUs - startUsnow matchesDump()'sendUs > startUs ? endUs - startUs : 0pattern.