gpu: Don't run long loops in shaders

If the border radius is too big, take bigger steps when computing the
shadow.

I randomly chose 8 because that looked good and was fast enough.
This commit is contained in:
Benjamin Otte 2024-07-25 15:22:24 +02:00
parent e216fa3b6d
commit 5e7f227d92

View File

@ -112,7 +112,7 @@ blur_corner (vec2 p,
return 0.0;
float result = 0.0;
float step = 1.0;
float step = max (1.0, r.y / 8.0);
for (float y = 0.5 * step; y <= r.y; y += step)
{
float x = r.x - ellipse_x (r, r.y - y);