Rust-GPU/rust-gpu

๐Ÿ‰ Making Rust a first-class language and ecosystem for GPU shaders ๐Ÿšง

What it solves

It replaces the need to write GPU graphics and compute shaders in niche, limited languages like HLSL or GLSL. By bringing Rust to the GPU, it provides developers with a modern language that includes a robust package and module system, built-in safety against memory access errors and race conditions, and high-performance execution.

How it works

The project implements a rustc compiler backend that generates SPIR-V, which is an open compiler target for Vulkan. This allows Rust code to be compiled directly into shaders. The ecosystem includes spirv-std for GPU-specific types and intrinsics, and spirv-builder to integrate GPU crate builds into the CPU build process via build.rs.

Who itโ€™s for

Graphics programmers and game developers who want to use a safe, high-level language for GPU programming instead of traditional shading languages.

Highlights

  • Rust Ecosystem: Enables the use of Cargo and crates.io for developing and publishing GPU crates.
  • Safety: Leverages Rust's safety guarantees to prevent out-of-bounds memory access and race conditions on the GPU.
  • SPIR-V Target: Specifically targets the SPIR-V intermediate representation for compatibility with Vulkan.
  • Integrated Tooling: Provides a dedicated builder to simplify the compilation of GPU code within standard Rust projects.

Related

  • Project
  • Project
  • Project
  • Dispatch
  • Project