Skip to content

v0.2.1 — Ergonomic shader API

Pre-release
Pre-release

Choose a tag to compare

@devin-ai-integration devin-ai-integration released this 27 Apr 08:43
· 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; JobGraph is 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.h must be exercised by at least one example under example/.
    • R21 VCK.h is the API surface — layer headers are implementation detail; breaking changes to VCK.h bump the minor version until v1.0.0.
    • R22 VCK never owns user handles — completes rule 9; VCK destroys only handles it created.
  • VCKMath.hVec2 / Vec3 / Vec4 / Mat4 POD structs, free-function Translate / Rotate / Scale / Perspective / LookAt / Radians / Degrees. No templates, no SIMD, row-major.
  • VertexLayout — fluent Add(name, VertexAttrType)Binding(0) + Attributes() builder; returns plain VkVertexInput* structs the caller hands to VulkanModelPipeline (rule 22, no ownership).
  • PushConstantsDeclare(name, type) cold path, Set(name, value) + Apply(cb, layout, stages) hot path. Name → offset resolved at Declare; no hashing / std::any / std::variant in the hot path.
  • Primitives::Cube / Plane / Sphere / Quad / Line — return-by-value Mesh { 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 in chrome://tracing or ui.perfetto.dev. No viewer bundled.
  • New example [10] DebugShowcaseExample — guided tour of every VCKLog level, cfg.debug gating, dedup, VK_CHECK fail-loud path, GPU / driver / memory / surface dump. No draw loop.
  • New example [11] AAShowcaseExampleDetectRecommendedAA decision matrix across forwardRenderer × supportsMotionVectors, live swapchain auto-pick echoed via GetAATechnique() + GetMSAASamples(), RGB triangle drawn with the picked AA.
  • New example [12] EasyCubeExamplePrimitives::Cube() + VertexLayout + PushConstants + VCKMath in 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::Error with a subsystem tag on every failure; a return false without a matching Error is a bug.
  • VulkanModelPipeline::Initialize (4-arg overload) emits VCKLog::Warn when called; the hardcoded VK_SAMPLE_COUNT_1_BIT is hazardous when the render pass uses MSAA. Use the 5-arg overload and pass swapchain.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 pass swapchain.GetMSAASamples() to the 5-arg VulkanModelPipeline::Initialize.
  • Windows ANSI colour outputVCKLog::Init() now calls SetConsoleMode with ENABLE_VIRTUAL_TERMINAL_PROCESSING once on startup so Windows CMD renders colours instead of ←[96m literals.
  • build.bat line endings.gitattributes forces CRLF on *.bat so Windows CMD stops fragmenting comment lines into garbage tokens.
  • EasyCubeExample sizeof bugVulkanMesh::Upload takes total byte count, not per-vertex stride; was uploading 1 of 24 vertices.
  • DebugTimeline::DumpChromeTracing underflow guardendUs - startUs now matches Dump()'s endUs > startUs ? endUs - startUs : 0 pattern.