cg-tuwien / Math2Model

Build the Shadertoy of Parametric Modeling
4 stars 1 forks source link

Demo sharing WebGPU device #35

Closed stefnotch closed 3 months ago

stefnotch commented 4 months ago

By overriding the global function that returns the WebGPU object, one can

  1. Start Rust backend
  2. Global function gets called. We save the device.
  3. We can now use that WebGPU device in our Javascript code. image

Which lets the worlds cooperate, side by side.

stefnotch commented 4 months ago

Do note that I didn't add cleaning up. So whenever the code changes, it'll hot reload, and create new objects without ever free-ing the old ones.

stefnotch commented 4 months ago

http://localhost:5173/#/webgpu