Shader compilation error when launching mobile gtk app

I get this error when launching any of the gnome-* apps installed on my phone:

Gsk-Message: 19:49:29.525: Failed to realize renderer of type 'GskGLRenderer' for surface 'GdkWaylandToplevel': Compilation failure in shader.
Source Code: 1| #version 150
2| #define GSK_GL3 1
3| #define NO_CLIP 1
4| #ifndef GSK_LEGACY
5| precision highp float;
6| #endif
7|
8| #if defined(GSK_GLES) || defined(GSK_LEGACY)
9| #define OUT varying
10| #define IN varying
11| #define GSK_ROUNDED_RECT_UNIFORM vec4[3]
12| #else
13| #define OUT out
14| #define IN in
15| #define GSK_ROUNDED_RECT_UNIFORM GskRoundedRect
16| #endif
17|
18|
19| struct GskRoundedRect
20| {
21| vec4 bounds; // Top left and bottom right
22| // Look, arrays can't be in structs if you want to return the struct
23| // from a function in gles or whatever. Just kill me.
24| vec4 corner_points1; // xy = top left, zw = top right
25| vec4 corner_points2; // xy = bottom right, zw = bottom left
26| };
27|
28| // Transform from a C GskRoundedRect to what we need.
29| GskRoundedRect
30| gsk_create_rect(vec4[3] data)
31| {
32| vec4 bounds = vec4(data[0].xy, data[0].xy + data[0].zw);
33|
34| vec4 corner_points1 = vec4(bounds.xy + data[1].xy,
35| bounds.zy + vec2(data[1].zw * vec2(-1, 1)));
36| vec4 corner_points2 = vec4(bounds.zw + (data[2].xy * vec2(-1, -1)),
37| bounds.xw + vec2(data[2].zw * vec2(1, -1)));
38|
39| return GskRoundedRect(bounds, corner_points1, corner_points2);
40| }
41|
42| vec4
43| gsk_get_bounds(vec4[3] data)
44| {
45| return vec4(data[0].xy, data[0].xy + data[0].zw);
46| }
47|
48| vec4 gsk_premultiply(vec4 c) {
49| return vec4(c.rgb * c.a, c.a);
50| }
51|
52| vec4 gsk_scaled_premultiply(vec4 c, float s) {
53| // Fast version of gsk_premultiply(c) * s
54| // 4 muls instead of 7
55| float a = s * c.a;
56|
57| return vec4(c.rgb * a, a);
58| }
59| uniform mat4 u_projection;
60| uniform mat4 u_modelview;
61| uniform float u_alpha;
62|
63| #if defined(GSK_GLES) || defined(GSK_LEGACY)
64| attribute vec2 aPosition;
65| attribute vec2 aUv;
66| attribute vec4 aColor;
67| attribute vec4 aColor2;
68| OUT vec2 vUv;
69| #else
70| IN vec2 aPosition;
71| IN vec2 aUv;
72| IN vec4 aColor;
73| IN vec4 aColor2;
74| OUT vec2 vUv;
75| #endif
76|
77| // amount is: top, right, bottom, left
78| GskRoundedRect
79| gsk_rounded_rect_shrink (GskRoundedRect r, vec4 amount)
80| {
81| vec4 new_bounds = r.bounds + vec4(1.0,1.0,-1.0,-1.0) * amount.wxyz;
82| vec4 new_corner_points1 = r.corner_points1;
83| vec4 new_corner_points2 = r.corner_points2;
84|
85| if (r.corner_points1.xy == r.bounds.xy) new_corner_points1.xy = new_bounds.xy;
86| if (r.corner_points1.zw == r.bounds.zy) new_corner_points1.zw = new_bounds.zy;
87| if (r.corner_points2.xy == r.bounds.zw) new_corner_points2.xy = new_bounds.zw;
88| if (r.corner_points2.zw == r.bounds.xw) new_corner_points2.zw = new_bounds.xw;
89|
90| return GskRoundedRect (new_bounds, new_corner_points1, new_corner_points2);
91| }
92|
93| void
94| gsk_rounded_rect_offset(inout GskRoundedRect r, vec2 offset)
95| {
96| r.bounds.xy += offset;
97| r.bounds.zw += offset;
98| r.corner_points1.xy += offset;
99| r.corner_points1.zw += offset;
100| r.corner_points2.xy += offset;
101| r.corner_points2.zw += offset;
102| }
103|
104| void gsk_rounded_rect_transform(inout GskRoundedRect r, mat4 mat)
105| {
106| r.bounds.xy = (mat * vec4(r.bounds.xy, 0.0, 1.0)).xy;
107| r.bounds.zw = (mat * vec4(r.bounds.zw, 0.0, 1.0)).xy;
108|
109| r.corner_points1.xy = (mat * vec4(r.corner_points1.xy, 0.0, 1.0)).xy;
110| r.corner_points1.zw = (mat * vec4(r.corner_points1.zw, 0.0, 1.0)).xy;
111|
112| r.corner_points2.xy = (mat * vec4(r.corner_points2.xy, 0.0, 1.0)).xy;
113| r.corner_points2.zw = (mat * vec4(r.corner_points2.zw, 0.0, 1.0)).xy;
114| }
115|
116| #if defined(GSK_LEGACY)
117| // Can't have out or inout array parameters...
118| #define gsk_rounded_rect_encode(r, uni) uni[0] = r.bounds; uni[1] = r.corner_points1; uni[2] = r.corner_points2;
119| #else
120| void gsk_rounded_rect_encode(GskRoundedRect r, out GSK_ROUNDED_RECT_UNIFORM out_r)
121| {
122| #if defined(GSK_GLES)
123| out_r[0] = r.bounds;
124| out_r[1] = r.corner_points1;
125| out_r[2] = r.corner_points2;
126| #else
127| out_r = r;
128| #endif
129| }
130|
131| #endif
132|
133| // blend.glsl
134|
135| void main() {
136| gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
137|
138| vUv = vec2(aUv.x, aUv.y);
139| }
140|
141| // FRAGMENT_SHADER:

Error Message:
Compile failed.
ERROR: 0:1: Syntax error, version 150 not supported
1 compilation errors. No code generated.

I am using egl/gles on wayland display server.

Hi @darkc0der! GLSL version 150 corresponds to OpenGL 3.2, according to Core Language (GLSL) - OpenGL Wiki. Which GPU is present on the phone?

I am using gles 3.2 and powervr gpu on my phone, and display server is wayland with egl. Should i be using libadwaita instead of desktop gtk?

It is powervr ge8320 and i am using gles 3.2. I am not having that problem now…after setting the GDK_DEBUG env variable to gl-gles, which now causes a different issue; the app is glitching a lot. I have attached a short video below that better describes the problem. Thank you.

(Attachment problem.mp4 is missing)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.