Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential use case in webGPU #18

Open
bakkot opened this issue Feb 16, 2023 · 1 comment
Open

Potential use case in webGPU #18

bakkot opened this issue Feb 16, 2023 · 1 comment

Comments

@bakkot
Copy link

bakkot commented Feb 16, 2023

The WebGPU proposal has mentioned that they want something like this:

This should allow for example for GPUTextures created on one worker to be instantly visible to other workers.

The v1 of that proposal does not have multithreading, but it may become relevant to a future version.

@7ombie
Copy link

7ombie commented Nov 10, 2024

There's an interesting language called Shadeup that compiles to a mix of JavaScript and WGSL. It lets you write shaders inline, and "close over" the shader code from the CPU code to access data and types without having to explicitly set up buffers and descriptors etc. They have structs that can be defined on the CPU or GPU (which automatically map to array buffers via typed arrays on the JS-side). Having Shadeup-style structs in JavaScript would make working with WGSL much nicer.

Ideally, we should be able to pretty much copy and paste a WGSL struct into JS, instantiate it in JS (or Wasm), and pass it over to WGSL with all the bytes in the expected locations.

WebAssembly is important, but WGSL already has structs, so JS and WebAssembly should take their lead from WebGPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants