Webgpu init issues

I’m testing WebGPU with Babylon on Electron and running into these issues:

after some browsing the warnings could be due to mime type not being registered in webpackdevserver, but I’m not sure what the file server could have to do with rendering wasm…

Another thing: when I try to test it in regular Chrome (stable or beta) with the chrome://flags/#enable-unsafe-webgpu enabled Babylon still says ‘WebGPU is not supported by your browser’. Am I missing something?

This is not a webgpu issue but an issue within your build where BABYLON namespace was not found (eg it is not referenced from your code somehow)

I thought the error might be solved if the warnings were solved.

this is the only diff between it working and not working

well this is super weird because the system error is about a missing ref to BABYLON

I just resolved my second question: I should have used Chrome Canary and not Chrome Beta.
Now at least I got the playground working in Chrome and it gives the same warnings, so those are not the problem.

1 Like

this is where the error is (while calling engine.initAsync())
(I’m using the latest alpha, and nowhere do I reference BABYLON. directly)

let me add @syntheticmagus

Are you using ES6? We need BABYLON to exist in the global namespace because of some initialization code for the TintWASM module. So, in ES6, you have to do something like:

import * as BABYLON from "@babylon/core";
(window as any).BABYLON = BABYLON;

We will need to get rid of that, but for the time being it’s required.

1 Like

we need to make sure we track the need to get rid of it to not forget :wink:

ah, that is a simple solution. For now that probably means the bundle will contain all of Babylon, but that is manageable.

Not getting any errors anymore, but not seeing any meshes either. Only an all white screen (which is not the clear color) so I have some work to do :slight_smile:.
Thanks for now.

Is there an issue number for this? I’d like to track this one if possible :slightly_smiling_face:

I have created an issue:

1 Like