# embarkstudios/rust-gpu

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/embarkstudios-rust-gpu).**

7,572 stars · 248 forks · Rust · Apache-2.0 · archived

## Links

- GitHub: https://github.com/EmbarkStudios/rust-gpu
- Homepage: https://shader.rs
- awesome-repositories: https://awesome-repositories.com/repository/embarkstudios-rust-gpu.md

## Topics

`gpu-programming` `rust` `shaders`

## Description

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.

## Tags

### Programming Languages & Runtimes

- [SPIR-V Translators](https://awesome-repositories.com/f/programming-languages-runtimes/spir-v-translators.md) — Translates Rust intermediate representation into SPIR-V bytecode using a custom LLVM-based compiler backend.
- [GPU Compute Toolchains](https://awesome-repositories.com/f/programming-languages-runtimes/gpu-compute-toolchains.md) — Offers a complete development environment for writing parallel compute kernels and graphics shaders in Rust.
- [GPU Memory Layout Mappings](https://awesome-repositories.com/f/programming-languages-runtimes/language-interoperability/foreign-function-interfaces/ffi-type-definitions/rust-c-type-mappings/gpu-memory-layout-mappings.md) — Translates high-level Rust types into hardware-compatible memory layouts and GPU-specific address spaces.
- [LLVM-Based Compilers](https://awesome-repositories.com/f/programming-languages-runtimes/llvm-based-compilers.md) — Implements a custom compiler backend using LLVM to map Rust IR to GPU-compatible memory layouts.
- [Multi-Target Compilers](https://awesome-repositories.com/f/programming-languages-runtimes/source-code-compilers/multi-target-compilers.md) — Implements a compiler target model that translates Rust source into bytecode for non-CPU GPU execution environments.
- [Shader Entry Point Configurators](https://awesome-repositories.com/f/programming-languages-runtimes/program-entry-points/shader-entry-point-configurators.md) — Provides mechanisms to identify and configure specific Rust functions as entry points for various shader stages.

### Graphics & Multimedia

- [Compute Shader Programming](https://awesome-repositories.com/f/graphics-multimedia/compute-shader-programming.md) — Supports writing general-purpose GPU compute kernels in Rust for parallel data processing workloads. ([source](https://cdn.jsdelivr.net/gh/embarkstudios/rust-gpu@main/README.md))
- [Cross-Platform Shader Compilers](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/shaders/cross-platform-shader-compilers.md) — Provides a compilation target that enables Rust code to run across different GPU hardware via SPIR-V.
- [Real-Time Graphics Development](https://awesome-repositories.com/f/graphics-multimedia/real-time-graphics-development.md) — Enables the development of vertex, fragment, and other graphics shaders in Rust for real-time rendering.

### Development Tools & Productivity

- [GPU Intrinsics](https://awesome-repositories.com/f/development-tools-productivity/custom-task-functions/compiler-functions/intrinsic-function-declarations/gpu-intrinsics.md) — Exposes GPU-specific operations such as barriers and texture sampling as native Rust intrinsic functions.
- [Shader Intrinsic Mappings](https://awesome-repositories.com/f/development-tools-productivity/custom-task-functions/compiler-functions/intrinsic-function-declarations/shader-intrinsic-mappings.md) — Maps GPU-specific hardware operations like texture sampling and barriers to native Rust intrinsic functions.

### Software Engineering & Architecture

- [Zero-Cost Abstraction Patterns](https://awesome-repositories.com/f/software-engineering-architecture/zero-overhead-abstractions/zero-cost-abstraction-patterns.md) — Compiles high-level Rust loops and branches directly into SPIR-V instructions without runtime overhead.
