-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
regression: low FPS on https://servo.org/bhtml-newtab/webrender-demos/moire.html #2706
Comments
I looked at a GPU profile and was horrified by the amount of pixel shading work we do here:
It does strike me as one of the cases where the general approach we take with WR shows it's weak side. However, we might be able to come with a few tricks to address it. Here is one trick I can think of. When the rounded corner radius is the same for all 4 corners, we should be able to only have a single instance of that corner as the clip mask. The other corners can just re-use the same UV rect by mirroring the coordinates. E.g. if we hit the case, we render the top left corner into x0,y0 - x1,y1 region of the clip mask, and then the other corners can use:
Another thing that would help here is not rebuilding the clip masks each frame and instead cache them. This wouldn't help the general case where all the radiuses are animated. @glennw if that sounds reasonable to you, I'll create the respective issues. |
Yep, those sound good. I think the biggest win (which @pcwalton mentioned to me) is that we should tessellate the borders we are drawing when they have very big radii, to reduce overdraw. Once I have ported borders to brushes, I think it's fairly straightforward to use the segment infrastructure to break up very large border radii rects into small, tesselated segments. |
Didn't want to add a new issue, so just commenting on this for now. On Windows 10, Nvidia GTX 1070 and latest drivers (416.34):
On macOS Mojave, Macbook Pro 15" with Radeon 560X I'm not able to replicate the second problem, but the 1. and 3. remain (and performance is considerably worse) |
Looking at the first case again - our behavior has changed (no clip masks, just cached images now), but in general we still suffer from the same thing: too much pixels to process. And the very same optimization (for symmetry) could apply. |
URL: https://servo.org/bhtml-newtab/webrender-demos/moire.html
Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1457683
https://bugzilla.mozilla.org/show_bug.cgi?id=1457683#c6 summarized:
The text was updated successfully, but these errors were encountered: