-
Notifications
You must be signed in to change notification settings - Fork 12
Some questions about future plans for RLSL #64
Description
I've already professed my excitement for RLSL in #40, but here I'd like to get a stronger idea about the kind of future you envisage for the project and the ways in which it might be able to inter-operate with regular Rust code.
Also, I apologise ahead of time if any of the following questions seem silly - I'm still new to SPIR-V and have a very limited understanding of what's possible and what is not!
cargo
In the README you mention that one of the goals is to support cargo - could you elaborate on your plans for this? In particular, I'm curious where the boundaries lie. For example, could I write a crate that may be depended upon downstream by both RLSL and rust code? I can imagine it would be particularly useful to be able to use a math crate (something like cgmath) both in regular cpu code and in RLSL.
Further, is it necessary to have separate, specific files for RLSL code? E.g. could I one day write my RLSL shaders within my regular .rs rust modules, perhaps using a decorator of some sort to indicate entry/exit points?
compute shaders
I would love to be able to use something like RLSL for doing general compute - is this something you would like to see at some point?
I think one of the things I love about the idea of RLSL is the reduction of friction between programming for the CPU and programming for the GPU. I've had a dream for a little while that one day we might be able to do something like pass a closure to a function which executes the closure in parallel on the GPU, returning either a Future or the result directly. I realise it is not possible to execute arbitrary Rust code on the GPU, but perhaps there would be some way to constrain the kinds of functions that could be executed on the GPU using a trait of some sort that extended Fn? I guess a similar/easier alternative might be to pass an instance of some type that implements some GpuFn trait?
RLSL & Rust
I wonder if at some point down the track yourself and the rust-lang team might be interested in including (lower tier) support for something like RLSL out of the box, treating SPIR-V as an alternative target to LLVM or something along these lines? I realise I'm getting way ahead of myself here, but it can be fun to theorize and plant seeds :)
Anyway, thanks again for all your work on this - looking forward to watching (and hopefully taking-part-in one day) RLSL progress!