mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 05:00:16 +00:00
blade: quad render fast path (#8110)
Ported from #7231 Release Notes: - N/A
This commit is contained in:
parent
5e43290aa1
commit
9fcda5a5ac
1 changed files with 9 additions and 0 deletions
|
@ -215,6 +215,15 @@ fn fs_quad(input: QuadVarying) -> @location(0) vec4<f32> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let quad = b_quads[input.quad_id];
|
let quad = b_quads[input.quad_id];
|
||||||
|
// Fast path when the quad is not rounded and doesn't have any border.
|
||||||
|
if (quad.corner_radii.top_left == 0.0 && quad.corner_radii.bottom_left == 0.0 &&
|
||||||
|
quad.corner_radii.top_right == 0.0 &&
|
||||||
|
quad.corner_radii.bottom_right == 0.0 && quad.border_widths.top == 0.0 &&
|
||||||
|
quad.border_widths.left == 0.0 && quad.border_widths.right == 0.0 &&
|
||||||
|
quad.border_widths.bottom == 0.0) {
|
||||||
|
return input.background_color;
|
||||||
|
}
|
||||||
|
|
||||||
let half_size = quad.bounds.size / 2.0;
|
let half_size = quad.bounds.size / 2.0;
|
||||||
let center = quad.bounds.origin + half_size;
|
let center = quad.bounds.origin + half_size;
|
||||||
let center_to_point = input.position.xy - center;
|
let center_to_point = input.position.xy - center;
|
||||||
|
|
Loading…
Reference in a new issue