News for hackers. Stuff that matters.
Re:RLSL: a Rust to SPIR-V Compiler by mshockwave on Monday October 21, 2019 @04:05PM (#21316664)
I understand Rust's advantage in lots of use cases, but can someone elaborate the benefits of using Rust over other languages for shader?
Re:RLSL: a Rust to SPIR-V Compiler by skohan on Monday October 21, 2019 @04:19PM (#21316826)
Some advantages cited in the slides are:

1. consistency with their existing codebase

2. leveraging Rust tooling (i.e. code completion, error messages etc)

3. being able to compile the same code for CPU and GPU, for example to test and debug GPU code

None of these are Rust-specific, but it would make sense if you're already all-in on Rust. Should be an interesting experiment.

Re:RLSL: a Rust to SPIR-V Compiler by gpm on Monday October 21, 2019 @06:42PM (#21318364)
I'd also be curious to see some of the disadvantages?
Re:RLSL: a Rust to SPIR-V Compiler by maikklein_dev on Tuesday October 22, 2019 @02:41AM (#21320928)
The standard library is a bit awkward at places with its pointer usage. This is why I have a custom one.

From a language point of view, it fits really well. I am also constrained with syntax as I want rlsl to be a strict subset of rust.

Closures capture by references which means you always have to capture explicitly with move (No pointers in structs in SPIR-V). Although I am fairly confident that this can be fixed.

Also MIR optimization passes are pretty weak right now, and rlsl would require an optimizer in the future. like SPIR-V <-> LLVM. I am not sure how good spirv-opt is right now.