RayMarch / shame

A shader EDSL for writing render and compute pipelines in rust
Apache License 2.0
243 stars 5 forks source link

Support for wgsl? #3

Open brandon-reinhart opened 2 years ago

brandon-reinhart commented 2 years ago

I see this is planned, but it's also clearly a lot of work. What would be the limiting factors in considering wgsl support as a first class output language?

Great job on this project, by the way. Its potential is immense.

RayMarch commented 2 years ago

Thank you for taking a closer look! I appreciate it! I am already on the edge of switching to wgsl as the primary output language. The fact that references exist in wgsl is a big deal wrt. shame's edsl "graph-recording" paradigm. Array element lvalues are a bit of a hack right now in the expression graph, that could be eliminated.

This project started with glsl because that was the only shader language i was really familiar with at the time. Since then i learned a lot, and am considering directly depending on naga and using their IR, or using wgsl. I am open to suggestions in what direction i should move this project, as i don't have many opinions on different shader langs, and very little knowledge about anything non-glsl.

Directly outputting wgsl is probably cool for wasm + webgpu apps.