Shadertoys Ported to Rust GPU
Published on: 2025-04-30 18:27:28
We ported a few popular Shadertoy shaders over to Rust using Rust GPU. The process was straightforward and we want to share some highlights.
The code is available on GitHub.
Rust GPU is a project that allows you to write code for GPUs using the Rust programming language. GPUs are typically programmed using specialized languages like WGSL, GLSL, MSL, or HLSL. Rust GPU changes this by letting you use Rust to write GPU programs (often called "shaders" or "kernels").
These Rust GPU programs are then compiled into SPIR-V, a low-level format that most GPUs understand. Since SPIR-V is the format Vulkan uses, Rust GPU makes it possible to integrate Rust-based GPU programs into any Vulkan-compatible workflow.
For more details, check out the Rust GPU website or the GitHub repository.
Sharing data between the CPU and GPU is common in shader programming. This often requires special tooling or manual effort. Using Rust on both sides made this seamless:
#[repr(C)]
#[derive(Copy, Clone, Pod, Z
... Read full article.