Notes from my first weeks reading and building Mesa. Mostly for myself, but maybe useful if you're in the same position.
AMD-specific code lives under src/amd/. RADV is in
src/amd/vulkan/, ACO in src/amd/compiler/.
NIR (Mesa's shared compiler IR) is in src/compiler/nir/.
I didn't really need to touch anything else at the start.
meson setup build -Dvulkan-drivers=amd -Dgallium-drivers= -Dbuildtype=debug ninja -C build
Skip Gallium if you're only working on RADV/ACO. Debug builds are slower but you get assertions, which catch bugs early.
To use your build without installing system-wide:
export VK_ICD_FILENAMES=/path/to/build/src/amd/vulkan/radeon_icd.x86_64.json export LD_LIBRARY_PATH=/path/to/build/src/amd/vulkan:$LD_LIBRARY_PATH
I traced vkCreateGraphicsPipelines end to end.
radv_pipeline.c → radv_shader.c → aco_interface.cpp →
instruction selection, register allocation, scheduling → binary embedded in the pipeline object.
It's a much better way to understand the codebase than just reading docs honestly.
RADV_DEBUG=shaders — dumps shader assemblyRADV_DEBUG=checkir — validates NIR after each passACO_DEBUG=validateir — validates ACO IRNIR_PRINT=1 — prints NIR before compilationWhen something breaks I diff the shader dumps before and after the change, that usually shows what went wrong.
My first kernel patch was just removing some unused code that was generating warnings. Nothing special but it helped me understand the patch submission process and what review looks like.
For Mesa: make changes, meson test, format commit message (match existing style),
push to GitLab, open MR, wait for CI and review.
IRC on OFTC. #dri-devel for general Mesa, #radeon for AMD.