Rust-GPU is a compiler and toolchain that translates Rust source code into SPIR-V bytecode for execution on graphics and compute hardware. It provides a development environment for writing parallel compute kernels and graphics shaders using a custom LLVM backend that maps high-level language constructs to GPU-compatible memory layouts and instructions.
The project enables cross-platform shader development, allowing the same Rust code to run across different GPU hardware and graphics APIs via the SPIR-V intermediate representation. It specifically supports the creation of general-purpose compute kernels and various stages of the graphics pipeline, such as vertex and fragment shaders.
The toolchain includes capabilities for translating high-level control flow and types into hardware-compatible layouts without runtime overhead. It exposes GPU-specific operations, including texture sampling and barriers, as native intrinsic functions and uses attribute-driven detection to identify shader entry points.
Compilation of shader binaries can be integrated directly into Rust build scripts.