Hacker News new | ask | show | jobs
by salsa_catsup 80 days ago
Does this mean I can write shaders in Rust for use with WGPU or Vulkan?
4 comments

WGPU/Vulkan don't work with PTX shaders by default, additional translation would be needed.

On a side note, Vulkan has extension to launch CUDA kernels: https://docs.vulkan.org/refpages/latest/refpages/source/VK_N...

You have been able to for a while with rust-gpu https://github.com/Rust-GPU/rust-gpu.
For compute shaders, you can already do this with CubeCL: https://github.com/tracel-ai/cubecl

You write kernels in a Rust DSL using #[cube], it supports WebGPU through WGSL and Vulkan through SPIR-V, along with CUDA, AMD via ROCm, and Metal. (disclosure: I am a contributor)

The way I understood it, rust would become an option next to Vulkan, WGPU (and opengl etc?).

But only for compute tasks. So, practically an alternative language to write compute shaders in.