streamlink / streamlink-twitch-gui

A multi platform Twitch.tv browser for Streamlink
https://streamlink.github.io/streamlink-twitch-gui/
MIT License
2.65k stars 199 forks source link

Skia shader compilation error on Arch Linux after upgrading llvm-libs 17.0.6-4 -> 17.0.6-5 #1017

Open bastimeyer opened 2 months ago

bastimeyer commented 2 months ago

Edit: In order to fix the issue, please remove the Default/GPUCache directory inside the application's config directory:

rm -r "${XDG_CONFIG_HOME:-~/.config}"/streamlink-twitch-gui/Default/GPUCache

And another breaking issue with llvm-libs... :angry:

1004 started the recent mess with llvm-libs 17.0.6-4 (on Arch) while STG v2.4.1 was running on NW.js 0.78.1 (Chromium 115).

Now llvm-libs 17.0.6-5 causes shader compilation errors once again after NW.js got bumped to 0.83.0 (Chromium 120) in v2.5.2.


[9469:9469:0521/232751.993229:ERROR:shared_context_state.cc(100)] Skia shader compilation error
------------------------
// Vertex SKSL
#extension GL_NV_shader_noperspective_interpolation: require
uniform float4 sk_RTAdjust;in float2 position;in half4 color;flat out half4 vcolor_S0;void main() {// Primitive Processor QuadPerEdgeAAGeometryProcessor
vcolor_S0 = color;sk_Position = position.xy01;}
// Fragment SKSL
#extension GL_NV_shader_noperspective_interpolation: require
flat in half4 vcolor_S0;void main() {// Stage 0, QuadPerEdgeAAGeometryProcessor
half4 outputColor_S0;outputColor_S0 = vcolor_S0;const half4 outputCoverage_S0 = half4(1);{ // Xfer Processor: Porter Duff
sk_FragColor = outputColor_S0 * outputCoverage_S0;}}
// Vertex GLSL
#version 300 es

#extension GL_NV_shader_noperspective_interpolation : require
precision mediump float;
precision mediump sampler2D;
uniform highp vec4 sk_RTAdjust;
in highp vec2 position;
in mediump vec4 color;
flat out mediump vec4 vcolor_S0;
void main() {
    vcolor_S0 = color;
    gl_Position = vec4(position, 0.0, 1.0);
    gl_Position = vec4(gl_Position.xy * sk_RTAdjust.xz + gl_Position.ww * sk_RTAdjust.yw, 0.0, gl_Position.w);
}

// Fragment GLSL
#version 300 es

#extension GL_NV_shader_noperspective_interpolation : require
precision mediump float;
precision mediump sampler2D;
out mediump vec4 sk_FragColor;
flat in mediump vec4 vcolor_S0;
void main() {
    mediump vec4 outputColor_S0 = vcolor_S0;
    {
        sk_FragColor = outputColor_S0;
    }
}

Errors:
Location of variable sk_FragColor conflicts with another variable.
bastimeyer commented 2 months ago

Bumping NW.js to 0.84 seems to work from a quick test so far.

diff --git a/build/tasks/configs/nwjs.js b/build/tasks/configs/nwjs.js
index 4fedaa73..4d41de6d 100644
--- a/build/tasks/configs/nwjs.js
+++ b/build/tasks/configs/nwjs.js
@@ -60,7 +60,7 @@ module.exports = {
    linux32: {
        options: {
            platforms: [ "linux32" ],
-           version: "0.83.0",
+           version: "0.84.0",
            files: [
                ...files,
                ignoreBinWin32,
@@ -71,7 +71,7 @@ module.exports = {
    linux64: {
        options: {
            platforms: [ "linux64" ],
-           version: "0.83.0",
+           version: "0.84.0",
            files: [
                ...files,
                ignoreBinWin32,

I can't set NW.js to 0.84 on Windows though, because of other issues mentioned in #1015, which is why the version was set to 0.83 on all platforms in v2.5.2. Any version higher than 0.85 also causes issues on Linux systems with Intel or Nvidia GPUs. This is a dead end right now and 0.84 might be the last chance.

Before I'm continuing here with bumping NW.js and releasing a new version once again, I will have a look at the upstream changes and post a bug report.

bastimeyer commented 2 months ago

Hm...

https://gitlab.archlinux.org/archlinux/packaging/packages/llvm/-/commit/31fedbbb507eb5be41cf1e6f405153b6bc370df7

From 31fedbbb507eb5be41cf1e6f405153b6bc370df7 Mon Sep 17 00:00:00 2001
From: Evangelos Foutras <foutrelis@archlinux.org>
Date: Tue, 21 May 2024 21:42:51 +0300
Subject: [PATCH] upgpkg: 17.0.6-5: remove zstd CMake find module

It reportedly breaks if it gets out of sync with upstream zstd.
---
 .SRCINFO | 2 +-
 PKGBUILD | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/.SRCINFO b/.SRCINFO
index 8d77a61..a1bcefb 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
 pkgbase = llvm
    pkgver = 17.0.6
-   pkgrel = 4
+   pkgrel = 5
    url = https://llvm.org/
    arch = x86_64
    license = custom:Apache 2.0 with LLVM Exception
diff --git a/PKGBUILD b/PKGBUILD
index 61d87bb..a3c7e89 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@

 pkgname=('llvm' 'llvm-libs')
 pkgver=17.0.6
-pkgrel=4
+pkgrel=5
 arch=('x86_64')
 url="https://llvm.org/"
 license=('custom:Apache 2.0 with LLVM Exception')
@@ -59,6 +59,9 @@ prepare() {
   rename -v -- "-$pkgver.src" '' {cmake,third-party}-$pkgver.src
   cd llvm-$pkgver.src
   mkdir build
+
+  # Remove CMake find module for zstd; breaks if out of sync with upstream zstd
+  rm cmake/modules/Findzstd.cmake
 }

 build() {
-- 
GitLab
bastimeyer commented 2 months ago

I've updated the OP and deleted my previous comment.

bastimeyer commented 2 months ago

So what I believe is happening here is that this simple pkgrel bump in Arch's repos (no bump of the actual llvm version) is causing shader cache integrity issues on the side of NW.js / Chromium, which then causes the errors. I don't have any experience in this regard though, so this could of course be nonsense. A change of the used NW.js version then triggers a rebuild of the shaders, so the old cache gets ignored. This also further means that the actual NW.js version is irrelevant.

I will accept the solution which I've added to the OP for now without bumping NW.js and releasing yet another version. Please delete the old shader cache if you're running into this issue.