GPU shader recompilation: from RDNA2 and DXBC to SPIR-V

10 steps · about 4 h 35 min · Intermediate

  1. SIMD in the GPU world (article, RasterGrid, 20 min)

    Start with how a GPU runs shaders (SIMD, waves, lanes), because every recompiler has to preserve that model.

  2. Occupancy explained (article, AMD GPUOpen, 20 min)

    This builds on waves with AMD's own account of how wavefronts are scheduled on SIMDs.

  3. Shader modules :: Vulkan Documentation Project (doc, Khronos Vulkan Documentation Project, 15 min)

    Shows what SPIR-V is and how Vulkan consumes it, which is the usual target of a shader recompiler.

  4. How to Vulkan in 2026 (guide, howtovulkan.com, 40 min)

    Puts shaders in context, from compiling to SPIR-V to creating shader modules in a modern Vulkan app.

  5. HLSL to SPIR-V Feature Mapping Manual (doc, Microsoft DirectXShaderCompiler, 30 min)

    A concrete map of how one shader language's features (resources, stages, semantics) become SPIR-V.

  6. AMD RDNA 2 Instruction Set Architecture reference guide is now available (reference, AMD GPUOpen, 25 min)

    Gives the official entry point to the RDNA2 ISA, plus linked talks on the path from shader source down to ISA.

  7. vkd3d/vkd3d: The vkd3d 3D graphics porting library (repo, vkd3d project (Codeberg), 30 min)

    A mature open-source shader translation library, so you can see how DXBC and DXIL are turned into SPIR-V and other targets.

  8. dxil-spirv: DXIL conversion to SPIR-V for D3D12 translation libraries (repo, HansKristian-Work (GitHub), 45 min)

    Studies a production recompiler, including its reference-shader regression testing approach.

  9. realdody/americas-recomp at xbox-series (repo, realdody (GitHub), 30 min)

    Apply the ideas to a live project that tests whether RDNA2 console shaders can be recompiled for PC.

  10. Recompiler failure classes · Issue #59 (article, realdody/americas-recomp (GitHub), 20 min)

    Finish by seeing real failure classes (interpolants, descriptor chains, location limits) that a recompiler has to solve.