Tutorials

Runnable, self-verifying tutorials for authoring GPU shaders in daslang and driving them through dasVulkan. Each shader is written in daslang and lowered to SPIR-V at compile time by dasSpirv (no GLSL, no glslang) – the same language as the host, compute and graphics alike.

The series builds graphics → compute → 3D scene → instancing → environment → GPU-driven scene → multi-pass → modern pipeline → mesh shaders → ray tracing: 01 - The Rotating Triangle is the canonical hello-triangle, 02 - The Mandelbrot Set (compute) and 03 - SDF raymarch (compute, no geometry) swap to the compute pipeline, 04 - The Synthwave Cube (graphics + depth) takes graphics into 3D with depth + UBO + push constant + texture, 05 - Instancing: A Thousand Cubes (one draw call) draws 1000 cubes in one call, 06 - Skybox: A Procedural Cubemap Sky wraps the scene in a cubemap, 07 - Particles: A Compute-Driven Swarm hands the vertex stream itself to a compute shader, 08 - Shadow Mapping: Two Passes, One Depth Image runs two render passes per frame sharing one depth image, 09 - MSAA + Dynamic Rendering: No Render Pass, Smooth Edges drops VkRenderPass entirely in favour of Vulkan 1.3 dynamic rendering plus 4× MSAA with auto-resolve, 10 - Deferred Shading: Putting It All Together brings everything together in a three-pass deferred renderer (sampled G-buffer) with SSAO + shadow + many lights, and 11 - HDR + Bloom: Karis Pyramid + ACES adds an HDR offscreen target + Karis-style five-level bloom pyramid + ACES tonemap composite for the post-process rail. 12 - GPU-driven: Hi-Z occlusion culling + indirect-count + bindless hands the draw decision to the GPU: a compute shader does Hi-Z occlusion culling, compacts survivors into an indirect-draw buffer with a GPU-written count, and cmd_draw_indexed_indirect_count draws them with bindless materials. Finally 13 - Mesh Shaders: GPU Cluster Culling and 14 - GPU Teapot: Mesh-Shader Tessellation drop the vertex buffer entirely for the GPU-driven mesh-shader pipeline – cluster culling, then on-GPU Bezier tessellation of the Utah teapot. Finally 15 - Hardware Ray Tracing leaves the rasterizer behind for hardware ray tracing: acceleration structures, a VK_KHR_ray_tracing_pipeline, and a traced shadow ray per hit – raygen, miss, and closest-hit shaders all authored in daslang. Each tutorial’s Next footer links to the one after.

Every tutorial lives in its own self-contained directory under tutorials/ in the repository: the shaders, the offscreen render, a pixel-oracle test that is the lavapipe CI regression gate, and a recording driver that renders the embedded .mp4. The render behind each video is pixel-checked every CI run by the tutorial’s oracle test; the .mp4 is the documentation figure of that same verified render, regenerated manually with the local recording driver (which needs stbimage + audio + ffmpeg, so it does not run in CI). The mesh-shader tutorials (13 - Mesh Shaders: GPU Cluster Culling, 14 - GPU Teapot: Mesh-Shader Tessellation) soft-skip on CI’s software renderer, which lacks VK_EXT_mesh_shader, and 15 - Hardware Ray Tracing soft-skips there too (no VK_KHR_ray_tracing_pipeline); 13_mesh’s figure is a still image rather than a video.