diff --git a/gsk/ngl/resources/conic_gradient.glsl b/gsk/ngl/resources/conic_gradient.glsl index 3a26cf9563..3df33bcb11 100644 --- a/gsk/ngl/resources/conic_gradient.glsl +++ b/gsk/ngl/resources/conic_gradient.glsl @@ -32,7 +32,10 @@ uniform float u_color_stops[MAX_COLOR_STOPS * 5]; _NOPERSPECTIVE_ _IN_ vec2 coord; float get_offset(int index) { - return u_color_stops[5 * index]; + // u_color_stops[5 * index] makes Intel Windows driver crash. + // See https://gitlab.gnome.org/GNOME/gtk/-/issues/3783 + int base = 5 * index; + return u_color_stops[base]; } vec4 get_color(int index) { diff --git a/gsk/ngl/resources/linear_gradient.glsl b/gsk/ngl/resources/linear_gradient.glsl index c4dfb53722..153d7afc98 100644 --- a/gsk/ngl/resources/linear_gradient.glsl +++ b/gsk/ngl/resources/linear_gradient.glsl @@ -56,7 +56,10 @@ uniform bool u_repeat; _NOPERSPECTIVE_ _IN_ vec4 info; float get_offset(int index) { - return u_color_stops[5 * index]; + // u_color_stops[5 * index] makes Intel Windows driver crash. + // See https://gitlab.gnome.org/GNOME/gtk/-/issues/3783 + int base = 5 * index; + return u_color_stops[base]; } vec4 get_color(int index) { diff --git a/gsk/ngl/resources/radial_gradient.glsl b/gsk/ngl/resources/radial_gradient.glsl index 5990b39a84..4311fc5d63 100644 --- a/gsk/ngl/resources/radial_gradient.glsl +++ b/gsk/ngl/resources/radial_gradient.glsl @@ -35,7 +35,10 @@ uniform float u_color_stops[MAX_COLOR_STOPS * 5]; _NOPERSPECTIVE_ _IN_ vec2 coord; float get_offset(int index) { - return u_color_stops[5 * index]; + // u_color_stops[5 * index] makes Intel Windows driver crash. + // See https://gitlab.gnome.org/GNOME/gtk/-/issues/3783 + int base = 5 * index; + return u_color_stops[base]; } vec4 get_color(int index) {