mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-01 00:11:29 +00:00
06d5c8e72d
Instead of using uniforms for color used in multiple programs, pass it as vertex attributes. This will let us batch more draw calls, since we don't have to change uniforms so often. In particular, for syntax-highlighted text.
15 lines
258 B
GLSL
15 lines
258 B
GLSL
// VERTEX_SHADER:
|
|
|
|
void main() {
|
|
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
|
|
|
|
vUv = vec2(aUv.x, aUv.y);
|
|
}
|
|
|
|
// FRAGMENT_SHADER:
|
|
void main() {
|
|
vec4 diffuse = GskTexture(u_source, vUv);
|
|
|
|
gskSetOutputColor(diffuse * u_alpha);
|
|
}
|