WebGPU API is not supported in the plugin

The navigator.gpu is undefined when accessed in ui.html. Is this intentional? I tried running navigator.gpu.requestAdapter() in the developer console and it worked fine.

I’m trying to use WebGPU to accelerate the rendering in my plugin https://www.figma.com/community/plugin/1264600219316901594/

Hi there,

Thanks for the post! I’m asking internally, so I’ll get back to you if there is any information that I can share with you.

Thanks for your patience.

Toku

1 Like

tl;dr If you navigate your plugin to a hosted iframe, this will work!

I don’t see this immediately documented in the WebGPU spec, but it looks like undefined navigator.gpu for null origin (window.location.origin) frames. I’ve tested with a hosted iframe, and everything works fine.

Let me know if this helps!

Great! Thank you so much for the answer! Glad to see that there is a solution. I will embed a hosted iframe to run the WebGPU ray tracer.