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

Q: WebAssemble Target possible? #250

Open
nea opened this issue Aug 3, 2022 · 3 comments
Open

Q: WebAssemble Target possible? #250

nea opened this issue Aug 3, 2022 · 3 comments

Comments

@nea
Copy link

nea commented Aug 3, 2022

Ahoy

I am not firm with webgpu so far and am wondering if it is also possible to target Wasm and display in a canvas? Would it be possible to create such a surface? Would that be possible with gio? How would the surface work?

Thanks a lot and for any hint in advance

@rajveermalviya
Copy link
Owner

rajveermalviya commented Aug 3, 2022

wasm isn't supported currently but it is definitely possible but because Go doesn't support cgo for js/wasm target, wgpu-native can't be used there. the javascript webgpu api will need to be wrapped via syscall/js instead.

also that will mean wasm target will be limited in someways, for example wgpu-native supports glsl and spirv shaders and browsers only support wgsl

also not to mention current browser support for WebGPU api is lacking and behind the flags whereas wgpu-native can also run on top of WebGL2 while providing WebGPU api so it has wider support.

@gedw99
Copy link

gedw99 commented Mar 18, 2023

Regarding wrapping syscall/js there are 2 approaches to make life easier

https://github.com/hack-pad/safejs

https://github.com/inkeliz/go_inkwasm

I am using go_inkwasm, and yet to use safejs yet.

@gedw99
Copy link

gedw99 commented Mar 18, 2023

@rajveermalviya

https://caniuse.com/?search=webgpu might be good to add to the Reamme somewhere ? so people can see its there but not turned on.

I was thinking of hosting your demos on fly.io to show things off.

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

3 participants