mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 06:21:14 +00:00
ngl: Identify shaders
Add a comment with a name to each shader. That makes identifying the shaders in apitrace much easier.
This commit is contained in:
parent
0ee6868b7f
commit
ebe30d851b
@ -1,4 +1,5 @@
|
|||||||
// VERTEX_SHADER:
|
// VERTEX_SHADER:
|
||||||
|
// blend.glsl
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
|
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
|
||||||
@ -7,6 +8,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FRAGMENT_SHADER:
|
// FRAGMENT_SHADER:
|
||||||
|
// blend.glsl
|
||||||
|
|
||||||
uniform int u_mode;
|
uniform int u_mode;
|
||||||
uniform sampler2D u_source2;
|
uniform sampler2D u_source2;
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
// VERTEX_SHADER:
|
// VERTEX_SHADER:
|
||||||
|
// blit.glsl
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
|
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
|
||||||
@ -7,6 +8,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FRAGMENT_SHADER:
|
// FRAGMENT_SHADER:
|
||||||
|
// blit.glsl
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec4 diffuse = GskTexture(u_source, vUv);
|
vec4 diffuse = GskTexture(u_source, vUv);
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
// VERTEX_SHADER:
|
// VERTEX_SHADER:
|
||||||
|
// blur.glsl
|
||||||
|
|
||||||
uniform float u_blur_radius;
|
uniform float u_blur_radius;
|
||||||
uniform vec2 u_blur_size;
|
uniform vec2 u_blur_size;
|
||||||
uniform vec2 u_blur_dir;
|
uniform vec2 u_blur_dir;
|
||||||
@ -25,6 +27,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FRAGMENT_SHADER:
|
// FRAGMENT_SHADER:
|
||||||
|
// blur.glsl
|
||||||
|
|
||||||
_IN_ vec2 pixel_step;
|
_IN_ vec2 pixel_step;
|
||||||
_IN_ float pixels_per_side;
|
_IN_ float pixels_per_side;
|
||||||
_IN_ vec3 initial_gaussian;
|
_IN_ vec3 initial_gaussian;
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
// VERTEX_SHADER:
|
// VERTEX_SHADER:
|
||||||
|
// border.glsl
|
||||||
|
|
||||||
uniform vec4 u_widths;
|
uniform vec4 u_widths;
|
||||||
uniform vec4[3] u_outline_rect;
|
uniform vec4[3] u_outline_rect;
|
||||||
|
|
||||||
@ -22,6 +24,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FRAGMENT_SHADER:
|
// FRAGMENT_SHADER:
|
||||||
|
// border.glsl
|
||||||
|
|
||||||
uniform vec4[3] u_outline_rect;
|
uniform vec4[3] u_outline_rect;
|
||||||
|
|
||||||
_IN_ vec4 final_color;
|
_IN_ vec4 final_color;
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
// VERTEX_SHADER:
|
// VERTEX_SHADER:
|
||||||
|
// color.glsl
|
||||||
|
|
||||||
_OUT_ vec4 final_color;
|
_OUT_ vec4 final_color;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
@ -8,6 +10,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FRAGMENT_SHADER:
|
// FRAGMENT_SHADER:
|
||||||
|
// color.glsl
|
||||||
|
|
||||||
_IN_ vec4 final_color;
|
_IN_ vec4 final_color;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
// VERTEX_SHADER:
|
// VERTEX_SHADER:
|
||||||
|
// color_matrix.glsl
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
|
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
|
||||||
@ -7,6 +8,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FRAGMENT_SHADER:
|
// FRAGMENT_SHADER:
|
||||||
|
// color_matrix.glsl
|
||||||
|
|
||||||
uniform mat4 u_color_matrix;
|
uniform mat4 u_color_matrix;
|
||||||
uniform vec4 u_color_offset;
|
uniform vec4 u_color_offset;
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
// VERTEX_SHADER:
|
// VERTEX_SHADER:
|
||||||
|
// coloring.glsl
|
||||||
|
|
||||||
_OUT_ vec4 final_color;
|
_OUT_ vec4 final_color;
|
||||||
flat _OUT_ int use_color;
|
flat _OUT_ int use_color;
|
||||||
|
|
||||||
@ -19,6 +21,7 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FRAGMENT_SHADER:
|
// FRAGMENT_SHADER:
|
||||||
|
// coloring.glsl
|
||||||
|
|
||||||
_IN_ vec4 final_color;
|
_IN_ vec4 final_color;
|
||||||
flat _IN_ int use_color;
|
flat _IN_ int use_color;
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
// VERTEX_SHADER
|
// VERTEX_SHADER
|
||||||
|
// conic_gradient.glsl
|
||||||
|
|
||||||
uniform vec4 u_geometry;
|
uniform vec4 u_geometry;
|
||||||
|
|
||||||
_NOPERSPECTIVE_ _OUT_ vec2 coord;
|
_NOPERSPECTIVE_ _OUT_ vec2 coord;
|
||||||
@ -14,6 +16,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FRAGMENT_SHADER:
|
// FRAGMENT_SHADER:
|
||||||
|
// conic_gradient.glsl
|
||||||
|
|
||||||
#ifdef GSK_LEGACY
|
#ifdef GSK_LEGACY
|
||||||
uniform int u_num_color_stops;
|
uniform int u_num_color_stops;
|
||||||
#else
|
#else
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
// VERTEX_SHADER:
|
// VERTEX_SHADER:
|
||||||
|
// cross_fade.glsl
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
|
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
|
||||||
@ -7,6 +8,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FRAGMENT_SHADER:
|
// FRAGMENT_SHADER:
|
||||||
|
// cross_fade.glsl
|
||||||
|
|
||||||
uniform float u_progress;
|
uniform float u_progress;
|
||||||
uniform sampler2D u_source2;
|
uniform sampler2D u_source2;
|
||||||
|
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
// VERTEX_SHADER:
|
// VERTEX_SHADER:
|
||||||
|
// custom.glsl
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
|
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
|
||||||
vUv = vec2(aUv.x, aUv.y);
|
vUv = vec2(aUv.x, aUv.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FRAGMENT_SHADER:
|
// FRAGMENT_SHADER:
|
||||||
|
// custom.glsl
|
||||||
|
|
||||||
// The shader supplies:
|
// The shader supplies:
|
||||||
void mainImage(out vec4 fragColor, in vec2 fragCoord, in vec2 resolution, in vec2 uv);
|
void mainImage(out vec4 fragColor, in vec2 fragCoord, in vec2 resolution, in vec2 uv);
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
// VERTEX_SHADER:
|
// VERTEX_SHADER:
|
||||||
|
// inset_shadow.glsl
|
||||||
|
|
||||||
uniform float u_spread;
|
uniform float u_spread;
|
||||||
uniform vec2 u_offset;
|
uniform vec2 u_offset;
|
||||||
uniform vec4[3] u_outline_rect;
|
uniform vec4[3] u_outline_rect;
|
||||||
@ -25,6 +27,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FRAGMENT_SHADER:
|
// FRAGMENT_SHADER:
|
||||||
|
// inset_shadow.glsl
|
||||||
|
|
||||||
_IN_ vec4 final_color;
|
_IN_ vec4 final_color;
|
||||||
_IN_ _GSK_ROUNDED_RECT_UNIFORM_ transformed_outside_outline;
|
_IN_ _GSK_ROUNDED_RECT_UNIFORM_ transformed_outside_outline;
|
||||||
_IN_ _GSK_ROUNDED_RECT_UNIFORM_ transformed_inside_outline;
|
_IN_ _GSK_ROUNDED_RECT_UNIFORM_ transformed_inside_outline;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
// VERTEX_SHADER
|
// VERTEX_SHADER
|
||||||
|
// linear_gradient.glsl
|
||||||
uniform vec4 u_points;
|
uniform vec4 u_points;
|
||||||
|
|
||||||
_NOPERSPECTIVE_ _OUT_ vec4 info;
|
_NOPERSPECTIVE_ _OUT_ vec4 info;
|
||||||
@ -39,6 +40,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FRAGMENT_SHADER:
|
// FRAGMENT_SHADER:
|
||||||
|
// linear_gradient.glsl
|
||||||
|
|
||||||
#ifdef GSK_LEGACY
|
#ifdef GSK_LEGACY
|
||||||
uniform int u_num_color_stops;
|
uniform int u_num_color_stops;
|
||||||
#else
|
#else
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
// VERTEX_SHADER:
|
// VERTEX_SHADER:
|
||||||
|
// outset_shadow.glsl
|
||||||
|
|
||||||
uniform vec4[3] u_outline_rect;
|
uniform vec4[3] u_outline_rect;
|
||||||
|
|
||||||
_OUT_ vec4 final_color;
|
_OUT_ vec4 final_color;
|
||||||
@ -17,13 +19,15 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FRAGMENT_SHADER:
|
// FRAGMENT_SHADER:
|
||||||
|
// outset_shadow.glsl
|
||||||
|
|
||||||
_IN_ vec4 final_color;
|
_IN_ vec4 final_color;
|
||||||
_IN_ _GSK_ROUNDED_RECT_UNIFORM_ transformed_outline;
|
_IN_ _GSK_ROUNDED_RECT_UNIFORM_ transformed_outline;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec2 frag = gsk_get_frag_coord();
|
vec2 frag = gsk_get_frag_coord();
|
||||||
|
|
||||||
float alpha = GskTexture(u_source, vUv).a;
|
float alpha = GskTexture(u_source, vUv).a;
|
||||||
|
|
||||||
alpha *= (1.0 - clamp(gsk_rounded_rect_coverage(gsk_decode_rect(transformed_outline), frag), 0.0, 1.0));
|
alpha *= (1.0 - clamp(gsk_rounded_rect_coverage(gsk_decode_rect(transformed_outline), frag), 0.0, 1.0));
|
||||||
|
|
||||||
vec4 color = final_color * alpha;
|
vec4 color = final_color * alpha;
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
// VERTEX_SHADER
|
// VERTEX_SHADER
|
||||||
|
// radial_gradient.glsl
|
||||||
|
|
||||||
uniform vec4 u_geometry;
|
uniform vec4 u_geometry;
|
||||||
|
|
||||||
_NOPERSPECTIVE_ _OUT_ vec2 coord;
|
_NOPERSPECTIVE_ _OUT_ vec2 coord;
|
||||||
@ -16,6 +18,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FRAGMENT_SHADER:
|
// FRAGMENT_SHADER:
|
||||||
|
// radial_gradient.glsl
|
||||||
|
|
||||||
#ifdef GSK_LEGACY
|
#ifdef GSK_LEGACY
|
||||||
uniform int u_num_color_stops;
|
uniform int u_num_color_stops;
|
||||||
#else
|
#else
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
// VERTEX_SHADER:
|
// VERTEX_SHADER:
|
||||||
|
// repeat.glsl
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
|
gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0);
|
||||||
@ -7,6 +8,8 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FRAGMENT_SHADER:
|
// FRAGMENT_SHADER:
|
||||||
|
// repeat.glsl
|
||||||
|
|
||||||
uniform vec4 u_child_bounds;
|
uniform vec4 u_child_bounds;
|
||||||
uniform vec4 u_texture_rect;
|
uniform vec4 u_texture_rect;
|
||||||
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
// VERTEX_SHADER:
|
// VERTEX_SHADER:
|
||||||
|
// unblurred_outset_shadow.glsl
|
||||||
|
|
||||||
uniform float u_spread;
|
uniform float u_spread;
|
||||||
uniform vec2 u_offset;
|
uniform vec2 u_offset;
|
||||||
uniform vec4[3] u_outline_rect;
|
uniform vec4[3] u_outline_rect;
|
||||||
@ -25,6 +27,7 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FRAGMENT_SHADER:
|
// FRAGMENT_SHADER:
|
||||||
|
// unblurred_outset_shadow.glsl
|
||||||
_IN_ vec4 final_color;
|
_IN_ vec4 final_color;
|
||||||
_IN_ _GSK_ROUNDED_RECT_UNIFORM_ transformed_outside_outline;
|
_IN_ _GSK_ROUNDED_RECT_UNIFORM_ transformed_outside_outline;
|
||||||
_IN_ _GSK_ROUNDED_RECT_UNIFORM_ transformed_inside_outline;
|
_IN_ _GSK_ROUNDED_RECT_UNIFORM_ transformed_inside_outline;
|
||||||
|
Loading…
Reference in New Issue
Block a user