Gangafintie Posted May 27, 2021 Share Posted May 27, 2021 (edited) When trying to run PIXI.autoDetectRenderer in Safari 14.1 we get the following error [Error] Unhandled Promise Rejection: TypeError: gl.getInternalformatParameter is not a function. (In 'gl.getInternalformatParameter(gl.RENDERBUFFER, gl.RGBA8, gl.SAMPLES)', 'gl.getInternalformatParameter' is undefined) (anonymous function) (main.c39d6dcf.js:27763) (anonymous function) (main.c39d6dcf.js:21272) (anonymous function) (main.c39d6dcf.js:27454) (anonymous function) (main.c39d6dcf.js:27467) Renderer (main.c39d6dcf.js:33069) (anonymous function)) (main.c39d6dcf.js:33104) PixiWorld (main.c39d6dcf.js:92750) init (main.c39d6dcf.js:94076) init active (main.c39d6dcf.js:56402) K (main.c39d6dcf.js:56314:675) na (main.c39d6dcf.js:56317:376) (anonymous function) (main.c39d6dcf.js:56316:788) (anonymous function) (anonymous function)) (main.c39d6dcf.js:56314:1641) promiseReactionJob Here is the code we used this.renderer = PIXI.autoDetectRenderer( {width: App.WIDTH, height: App.HEIGHT, backgroundColor: 0x0b3a21, view:document.getElementsByTagName("canvas")[0] as HTMLCanvasElement | undefined} ); This used to work fine but broke with the latest safari update. How can we fix this? We used pixi 5.3.3 Edited May 27, 2021 by Gangafintie Quote Link to comment Share on other sites More sharing options...
Exca Posted May 27, 2021 Share Posted May 27, 2021 Safari doesn't offer complete support to webgl2 . At least looks like that function is missing: https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/getInternalformatParameter You could try forcing webgl1 into use when on Safari (settings.PREFER_ENV). Do you have webgl2 enabled on experimental features? Or could it be that Safari finally has added support for webgl2. Quote Link to comment Share on other sites More sharing options...
Gangafintie Posted May 27, 2021 Author Share Posted May 27, 2021 (edited) That did the trick. Thanks so much! const isSafari = window.safari !== undefined; if(isSafari){ PIXI.settings.PREFER_ENV = PIXI.ENV.WEBGL; } Edited May 27, 2021 by Gangafintie Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.