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.

Plant memory deliberately

SKETCHBOOK / 03 Signal Garden · 2-week chapter

Page 1 of 3: A handle is not storage

Three layers of memory

A handle is not storage

A VkBuffer describes a size and intended usages. Device memory supplies backing storage. Binding connects the buffer to a compatible region of that allocation. These are separate operations because many resources can share a larger allocation. Query memory requirements, respect the returned size and alignment, and intersect the requirement bitmask with memory types that satisfy your policy. Do not interpret the first memory type as “normal RAM.”

Host-visible means the CPU can map the allocation. Host-coherent changes explicit cache-management requirements. Device-local describes a placement property, not a universal ban on CPU access. Your AMD laptop may expose several combinations; use its report rather than treating every discrete or integrated device alike. Keep a memory budget, validate count × stride before multiplication, and report an allocation failure without publishing a half-built mesh.

For the first implementation, understand one manually bound buffer. For a growing renderer, evaluate Vulkan Memory Allocator instead of accumulating an unreviewed general allocator. Suballocation reduces expensive allocation churn, but introduces alignment, lifetime, fragmentation, and aliasing responsibilities. A sophisticated allocator cannot infer that your GPU is finished with a range.

R.5Prefer scoped objects; do not heap-allocate unnecessarily
From the page to your own work

Your studio assignment.

Upload a small stem mesh with an explicit byte budget and a retirement record.

A finish line you can see

A mesh upload diagram, an alignment test, and a log showing when staging storage becomes reusable.

  1. Use compatible memoryTypeBits and queried requirements.
  2. Show coherent versus noncoherent handling without assuming either.
  3. Reject an oversized upload before allocation.
  4. Keep staging alive until the copy completion point.
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.

What does an upload allocator need beyond malloc-like allocation?
  • Device memory types and API alignment constraints.
  • Mapped cache visibility policy and bounded suballocation.
  • Retirement based on GPU use, not only CPU scope.

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

A small creative variation ↗

Pack two tiny meshes into one allocation and explain padding without adding aliasing.

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

Coming back after a break? ↩

Run signal-contracts, then trace a single 32-byte record through your upload diagram.

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