phaserjs / phaser

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
https://phaser.io
MIT License
36.91k stars 7.08k forks source link

'Link Shader failed' with Phaser 3.70.0 with a very small % of users #6689

Closed yaustar closed 6 months ago

yaustar commented 9 months ago

Version

Description

We've had an issue with a very small % of users that are getting the error 'Link Shader failed' on Chrome 119 and 120 on startup, Windows and Linux with Phaser 3.70.0. We can't repro locally but our stack trace comes back to compiling the PreFXPipeline shaders

    function FXPipeline (config)
    {
        //  This order is fixed to match with the FX_CONST. Do not adjust.
        config.shaders = [
            Utils.setGlowQuality(Shaders.FXGlowFrag, config.game),
            Shaders.FXShadowFrag,
            Shaders.FXPixelateFrag,
            Shaders.FXVignetteFrag,
            Shaders.FXShineFrag,
            Shaders.FXBlurLowFrag,
            Shaders.FXBlurMedFrag,
            Shaders.FXBlurHighFrag,
            Shaders.FXGradientFrag,
            Shaders.FXBloomFrag,
            Shaders.ColorMatrixFrag,
            Shaders.FXCircleFrag,
            Shaders.FXBarrelFrag,
            Shaders.FXDisplacementFrag,
            Shaders.FXWipeFrag,
            Shaders.FXBokehFrag
        ];

        PreFXPipeline.call(this, config); // This line

We are still investigating and working around this by disabling the both the pre and post pipelines via the config. Unfortunately, we can't narrow down which one of these is causing the issue.

All users reporting the issue are on different hardware/GPUs/OSs as well.

Example Test Code

We can't reproduce locally to give an example but the callstack is part of the startup of Phaser.

photonstorm commented 6 months ago

If you could find out what kind of device this happens on, that would be ideal - then we can check it on BrowserStack and debug from there. Feel free to comment on this issue if you can get that information, and we'll re-open it.

spoonpaw commented 5 months ago

Hello @photonstorm and the Phaser team,

I've encountered a 'Link Shader failed' error with Phaser version 3.80.1, which is consistently happening upon startup within an Electron application (version 29.1.5). This issue impacts the Electron app on Ubuntu 22.04.4 LTS, running on a Framework Laptop. The specifications of my development environment include:

CPU: 12th Gen Intel(R) Core(TM) i5-1240P Graphics: Intel Alder Lake-P Integrated Graphics Controller RAM: 40GiB System Memory The error message I'm receiving is as follows:

phaser.js:192255 Uncaught Error: Link Shader failed: ... The Chromium version used by Electron 29.1.5 is version 122, and the integrated Node.js version is 18.19, according to Electron's release documentation.

Despite my efforts to find a workaround or solution, the error persists, blocking progress on my project. I am open to providing further details, logs, or engaging in tests that might aid in diagnosing and resolving this issue.

Your assistance and any suggestions you might have are greatly appreciated.

Thank you for your support.

spoonpaw commented 5 months ago

Hello again @photonstorm and the Phaser community,

I wanted to provide an update on the 'Link Shader failed' error I previously reported when using Phaser v3.80.1 with Electron. After further investigation, I discovered the root cause was due to an oversight in my Electron packaging script for Ubuntu. The Electron version specified in the "package-ubuntu" script within my package.json was not updated to match the Electron version (29.1.5) I was actually using. The script erroneously specified version 25.0.1:

Incorrect version:

"package-ubuntu": "npm run build:prod && electron-packager . --overwrite --platform=linux --arch=x64 --electron-version=25.0.1 --prune=true --out=out --icon=icons/icons/png/256x256.png", After updating the Electron version in the script to the correct version (29.1.5), the error no longer occurs:

Corrected version:

"package-ubuntu": "npm run build:prod && electron-packager . --overwrite --platform=linux --arch=x64 --electron-version=29.1.5 --prune=true --out=out --icon=icons/icons/png/256x256.png", This adjustment resolved the 'Link Shader failed' error, and my application now starts up without any issues. I appreciate the community's willingness to help and wanted to share this resolution in case it may assist others encountering similar issues.

Thank you for your support and for the incredible work on Phaser!