Hacker News new | ask | show | jobs
by kvark 2244 days ago
We are exposing writable storage buffers and textures in all shader stages (there is a caveat discussion [1] on the topic though), which means you can write data out directly. Sharing data between shader threads can be efficiently in the compute shaders (via the shared group memory), which are included in the core of WebGPU.

P.S. vange-rs [2] is written on wgpu-rs and uses ray-tracing in fragment shaders for the terrain. I hope to run it in the browser one day!

  [1] https://github.com/gpuweb/gpuweb/issues/639
  [2] https://github.com/kvark/vange-rs
1 comments

> writable storage buffers and and textures in all shader stages

Beware the behaviour of writes will not be consistent between vendors or shader stages, and may be surprising.

Yes, we are fully aware of that. There must be a line drawn somewhere between work that we can make portable, and the work that is platform-dependent. Enforcing any ordering on storage writes is completely unfeasible.