Initialising webgpu engine causes errors

BJS - [13:40:54]: Babylon.js v7.18.0 - WebGPU1 engine
chunk-SFU3E6AJ.js?v=e92887a0:47472 Uncaught TypeError: Cannot read properties of undefined (reading 'enabled')
    at get snapshotRendering (chunk-SFU3E6AJ.js?v=e92887a0:47472:40)
    at _WebGPUEngine.setSize (chunk-SFU3E6AJ.js?v=e92887a0:48232:18)
    at ResizeObserver.<anonymous> (Portal.tsx:94:44)
get snapshotRendering @ chunk-SFU3E6AJ.js?v=e92887a0:47472
setSize @ chunk-SFU3E6AJ.js?v=e92887a0:48232
(anonymous) @ Portal.tsx:94
Show 2 more frames
Show less
chunk-MZR46QHU.js?v=e92887a0:9766 BJS - [13:41:34]: A fatal error occurred during WebGPU creation/initialization.
_LogEnabled @ chunk-MZR46QHU.js?v=e92887a0:9766
(anonymous) @ chunk-SFU3E6AJ.js?v=e92887a0:47863
Show 2 more frames
Show less
chunk-SFU3E6AJ.js?v=e92887a0:47881 Uncaught (in promise) TypeError: self.glslang is not a function
    at chunk-SFU3E6AJ.js?v=e92887a0:47881:25
    at async Engine.createRenderer (Engine.ts:347:9)

here is my webgpu init code:

    private async createRenderer() {
        console.log('creating engine')
        WebGPUTintWASM.ShowWGSLShaderCode = true;
        const webGPUSupported = navigator.gpu;
        console.log(webGPUSupported);
        if(!webGPUSupported) return;
        this.core = new WebGPUEngine(this.container);
        await this.core.initAsync();
        this.createScene();
        this.createRenderingPipeline();
        this.cameras.setup(); 
    }

I can create an example github project but theres not really much special code here, just using yarn to install babylonjs via @babylonjs/core

and importing WebGPUEngine from @babylonjs/core

Right now I cant find a working example of the webgpu engine through a standard project, it works in the playground but that i cant see the initialisation code.

Thanks

Here is the example of WebGPU engine initialization - babylonjs-webpack-es6/src/index.ts at master · RaananW/babylonjs-webpack-es6 · GitHub

1 Like

A repro would be great as I do not see how it fails as it looks like it should be protected in the code.

1 Like

I have made progress on this but still see the error from time to time on specific types of scenes. I am now creating a repo with all the nda stuff taken out and just the basic project and webgpu to show you guys the error.

I will post that now

1 Like