Compiling Vulkan shaders in the browser: A tale of control flow graphs and WebAssembly

Tony Wasserka

Playlists: 'xdc2021' videos starting here / audio

Ever wondered what happens when you mix Emscripten, Graphviz, and a Vulkan driver? I couldn’t help myself and tried: What started as a simple visualizer for shader control flow has since grown into a port of Mesa’s shader compiler ACO running in the browser, capable of compiling thousands of shaders on-the-fly. Don’t believe it? Demo included!

Putting this experiment into wider context reveals a landscape of powerful debugging tools rarely utilized in low-level programming: With robust and efficient code left at the core, external web-based tools benefit from quicker iteration cycles and easier UI prototyping.

This talk doesn’t present ground-breaking ideas: At worst, you’ll see a cool tool made with love. At best, you’ll walk away with new ideas for creating debuggable systems.