Shader compilers can be easily confused for dragons — they devour innocent developers, and instead of optimal code, they spew fire. Only the toughest adventurers well versed in the arcane knowledge of how to tame them used to stand a chance.
Until today! Together, we will uncover the dark secrets of the shader compiler and tame this fiery beast. Our journey will take us from the original source code down to the RDNA ISA. We’ll leave no stone unturned when it comes to giving you a deep understanding of compilers. We will arm you with knowledge about control-flow, bindless resource access and scalarization which is directly applicable to problems you’re facing daily at work. At the frontend, we will look at DXC and how it produces intermediate representations. At the backend, we will discuss the arts of instruction selection, scheduling, and register allocation for the RDNA instruction set.
Throughout the whole trip, we will provide you with practical examples from real-world applications and look at them through the compiler’s eyes. At the end, you will have a solid understanding of your shader compiler and write performant shaders with ease.