I have been looking at the WebGPU spec and the wgpu crate for a possible WebGPU implementation which arose from a discussion on the discord server.
Problem is, how would we handle the window on which the user would draw to? Adding a window manager to deno would definitively not be a viable solution. wgpu-rs does actually allow to have a windowless setup, but i think most end users would actually want a way to have some sort of window. A window is also required for usage of swap chains; which, once again, many users would want.
Glad you're looking into this. I was imagining we would start with a windowless setup. The goal is to run tensorflow.js's WebGPU backend.
https://github.com/tensorflow/tfjs/tree/master/tfjs-backend-webgpu
i think most end users would actually want a way to have some sort of window
[citation needed]
I think the more useful use-case would be ML (TF with WebGPU backend), server side image processing, and other GPU compute tasks. I'm not sure how much sense it would make to write a UI in raw wgpu when you're writing JS/TS. Seems like a questionable pairing, and people probably should just host a PWA on the localhost and render in their browser if they want a GUI.
@0kku good point, didnt really think about that
Ref #5701, #1629
I came up with a solution for adding window support for webgpu without adding any other deps.
This would require plugins to have access to the resourcetable tho.
The community (or we in std) would create plugins for rust window handlers. The surface which you pass to wgpu is created with a param that needs to be a raw_window_handle::HasRawWindowHandle (which is a standarized way to get a raw window handle by the different rust window managers). We would have a deno property on the descriptor for GPU.requestAdapter (like on workers) where you could pass a rid for such a HasRawWindowHandle.
@crowlKats Considering the open PR, shall I formally abandon chances/deno-wgpu, i.e. archive the repo and link back here?
@chances would make sense
Most helpful comment
Glad you're looking into this. I was imagining we would start with a windowless setup. The goal is to run tensorflow.js's WebGPU backend.
https://github.com/tensorflow/tfjs/tree/master/tfjs-backend-webgpu