Theme Catppuccin
Make yourself at homeCatppuccin

A softer light for long learning sessions.

Appearance

Loading your preference…

Dark palette

Choose a dark palette to try it.

Light uses Latte. Your choices stay in this browser.

Make the shader agreement

SKETCHBOOK / 04 Signal Garden · 2-week chapter

Page 1 of 4: The pipeline is an agreement

State becomes deliberate

The pipeline is an agreement

A graphics pipeline combines shader stages with the state needed to interpret vertices, assemble primitives, rasterize them, and produce attachment values. A vertex attribute location is an interface number, not a C++ member name. Describe a vertex binding stride and each attribute offset from a deliberately laid-out record. Use fixed-width types, standard-layout checks, and offsetof where appropriate. Do not upload a class containing pointers, a vector, or a vtable as if it were shader data.

Compile GLSL to SPIR-V for the chosen Vulkan target, then run spirv-val with the same target environment. These checks need no GPU. Compilation checks the source; the separate validator checks structural and environment rules in the resulting module. Neither establishes compatibility with a host pipeline that has not been created. Preserve diagnostics and tool versions as build evidence. Check byte counts and word alignment before creating a shader module; arbitrary bytes from an input file are not automatically a valid program. Keep shader source, compiler target, and pipeline expectations together so a build artifact cannot silently drift away from its host layout.

Begin with a triangle or one stem and a constant fragment color. Pipeline creation can fail independently of module creation. Report which stage and format combination failed, keep the previous usable pipeline during a reload attempt, and release a replaced pipeline only after its last submission has completed.

From the page to your own work

Your studio assignment.

Build three luminous stems using a documented camera/material interface.

A finish line you can see

A small image, a host/shader layout table, and an explained diagnostic.

  1. Compile shaders for the chosen target and preserve diagnostics.
  2. Check vertex and uniform layout rather than assuming a math type ABI.
  3. Keep per-draw data stable until consumption.
  4. Show a controlled interface mismatch and its correction.
Keep the evidence in your weekly notebook ↗
Explain it like an engineer

Try answering aloud before opening the review notes. Use your own implementation as evidence.

Why can every draw use the last uploaded color even when each draw was recorded after a different CPU write?
  • The command stream usually records bindings, not a copy of arbitrary mapped bytes.
  • All draws can reference the same range consumed later.
  • Use distinct safe ranges, appropriate push constants, or a correct update strategy.

These prompts support practice; they are not an automatic assessment of your work.

A small creative variation ↗

Give each stem a different growth transform while keeping the same geometry buffer.

Optional. Save it for later if this chapter already feels full.

Coming back after a break? ↩

Render a constant-color triangle. Reintroduce only the camera block after it is stable.

Books & principles behind this study +

Original Parallax explanations and assignments, with these works for further reading.

YOUR MARGIN NOTES

Leave yourself a good question.

What changed your mind? What would you try next?

Notes are private to this browser and saved as you write.

A CHECKPOINT, NOT A SCORE

Can you explain the idea and try the exercise yourself?

Completion records your own assessment. It does not compile or test your C++.
Companion source 4 files