Skip to content

Q: Where to find docs for emscripten_webgpu_import_device et.al ? #24235

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

Closed
JCash opened this issue May 1, 2025 · 3 comments
Closed

Q: Where to find docs for emscripten_webgpu_import_device et.al ? #24235

JCash opened this issue May 1, 2025 · 3 comments
Labels

Comments

@JCash
Copy link
Contributor

JCash commented May 1, 2025

Hi!

I'm wondering where I can read up on emscripten_webgpu_import_device and the related functions?
My searches keep turning up empty 🤔

Regards,
Mathias

@sbc100
Copy link
Collaborator

sbc100 commented May 1, 2025

@kainino0x

@sbc100 sbc100 added the webgpu label May 1, 2025
@kainino0x
Copy link
Collaborator

There isn't really any documentation, the best I can point you at is the test:

wgpu::Device device = wgpu::Device::Acquire(emscripten_webgpu_import_device(deviceHandle.Get()));

HOWEVER, please note that Emscripten's built-in bindings are being deprecated (#24265) in favor of the external fork "emdawnwebgpu" which no longer has emscripten_webgpu_import_device exposed in C, instead it only has WebGPU.importJsDevice in JS. You would call this from JS to import it into the bindings, then pass the handle from JS to C and cast it to WGPUDevice.

Sorry I don't have any examples of this to point at either. I have filed https://crbug.com/416377157 about it.

@kainino0x kainino0x closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2025
@JCash
Copy link
Contributor Author

JCash commented May 8, 2025

Thanks Kai for the info!

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

No branches or pull requests

3 participants