mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Remove some unused WR1 shaders, copy new shaders, update WR hash.
This commit is contained in:
parent
8cd4b772e9
commit
ce01120fb1
22 changed files with 81 additions and 332 deletions
|
@ -15,51 +15,15 @@ layout(std140) uniform Items {
|
|||
|
||||
void main(void) {
|
||||
Image image = images[gl_InstanceID];
|
||||
Layer layer = layers[image.info.layer_tile_part.x];
|
||||
Tile tile = tiles[image.info.layer_tile_part.y];
|
||||
|
||||
vec2 p0 = image.info.local_rect.xy;
|
||||
vec2 p1 = image.info.local_rect.xy + vec2(image.info.local_rect.z, 0.0);
|
||||
vec2 p2 = image.info.local_rect.xy + vec2(0.0, image.info.local_rect.w);
|
||||
vec2 p3 = image.info.local_rect.xy + image.info.local_rect.zw;
|
||||
TransformVertexInfo vi = write_transform_vertex(image.info);
|
||||
|
||||
vec4 t0 = layer.transform * vec4(p0, 0, 1);
|
||||
vec4 t1 = layer.transform * vec4(p1, 0, 1);
|
||||
vec4 t2 = layer.transform * vec4(p2, 0, 1);
|
||||
vec4 t3 = layer.transform * vec4(p3, 0, 1);
|
||||
vLocalRect = image.info.local_rect;
|
||||
vLocalPos = vi.local_pos;
|
||||
|
||||
vec2 tp0 = t0.xy / t0.w;
|
||||
vec2 tp1 = t1.xy / t1.w;
|
||||
vec2 tp2 = t2.xy / t2.w;
|
||||
vec2 tp3 = t3.xy / t3.w;
|
||||
|
||||
vec2 min_pos = min(tp0.xy, min(tp1.xy, min(tp2.xy, tp3.xy)));
|
||||
vec2 max_pos = max(tp0.xy, max(tp1.xy, max(tp2.xy, tp3.xy)));
|
||||
|
||||
vec2 min_pos_clamped = clamp(min_pos * uDevicePixelRatio,
|
||||
vec2(tile.actual_rect.xy),
|
||||
vec2(tile.actual_rect.xy + tile.actual_rect.zw));
|
||||
|
||||
vec2 max_pos_clamped = clamp(max_pos * uDevicePixelRatio,
|
||||
vec2(tile.actual_rect.xy),
|
||||
vec2(tile.actual_rect.xy + tile.actual_rect.zw));
|
||||
|
||||
vec2 clamped_pos = mix(min_pos_clamped,
|
||||
max_pos_clamped,
|
||||
aPosition.xy);
|
||||
|
||||
vec3 layer_pos = get_layer_pos(clamped_pos / uDevicePixelRatio, image.info.layer_tile_part.x);
|
||||
|
||||
vRect = image.info.local_rect;
|
||||
vPos = layer_pos;
|
||||
|
||||
vec2 f = (layer_pos.xy - image.info.local_rect.xy) / image.info.local_rect.zw;
|
||||
vec2 f = (vi.local_pos.xy - image.info.local_rect.xy) / image.info.local_rect.zw;
|
||||
|
||||
vUv = mix(image.st_rect.xy,
|
||||
image.st_rect.zw,
|
||||
f);
|
||||
|
||||
vec2 final_pos = clamped_pos + vec2(tile.target_rect.xy) - vec2(tile.actual_rect.xy);
|
||||
|
||||
gl_Position = uTransform * vec4(final_pos, 0, 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue