Master the fundamental concepts of modern graphics apis (low level) through this focused micro-challenge.
Vulkan shaders do not access textures or buffers by name. Resources bind through descriptor sets: collections of descriptors, each specifying a type (uniform buffer, combined image sampler, storage buffer) and a GPU memory handle.
A descriptor set layout defines the schema: which bindings exist, their types, and array sizes. Multiple sets bind simultaneously, typically split by update frequency.
cLoading…
For example, set 0 updates once per frame, set 1 changes on material switch, set 2 changes every draw call. This split minimizes expensive rebinding. Unreal's Vulkan RHI and id Tech 7 use this pattern verbatim.
VK_ERROR_OUT_OF_POOL_MEMORYUNIFORM_BUFFER, COMBINED_IMAGE_SAMPLER, STORAGE_BUFFERDescriptor pools require upfront sizing because the driver allocates from a fixed pool. Pipeline layouts must match shader-declared bindings exactly.
You will model a descriptor set layout and calculate pool requirements for a multi-material renderer. This task asks you to count descriptors per type and print total pool allocation. Descriptor set design is one of the most expensive CPU-side operations in a Vulkan frame.
Write a C program that models a Vulkan descriptor set layout and pool.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
Every task includes starter code, theory, and hidden tests so you can implement and verify locally in the browser.
How it works