Compilation of a functional shading language to a SPIR-V intermediate representation
A shader is a program run on a GPU that operates on graphics data to render an image. For years, shading languages like GLSL and HLSL have been modeling shaders as effectful imperative programs. However, one can think of a shader as a pure mathematical function — a point of view traditionally associated with functional programming. Acknowledging the limitations of GPU programming, we present a proof-of-concept compiler for a toy ML shading language targeting SPIR-V – an intermediate representation of shaders presented along with the Vulkan graphic API.