-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
WebGLPrograms: Optimize program cache key generation. #22960
Conversation
On a Pixel 6 the first one runs at 50fps, second one at 48fps and third one at 46fps 🤔 |
My example seems to have a big difference in performance between landscape mode and portrait mode. Can you check if you have the same result when rotating your screen? I think the differences you measure are because the example has randomness. I'll recreate an example without randomness to make sure that we always measure the same thing. the viewport needs to see many objects to make the example work, so I'll add info to show how many objects actually get rendered. |
more deterministic example added => Now the example takes the following timings on my system
The example has been improved by adding a pseudorandom generator to add the meshes always in the same way if the screen resolution stays the same. The example also always now shows 2500 objects in the viewport no matter what. |
I guess I would simplify the example and remove custom shaders and post-processing. It's sufficient for the performance test for producing many different programs which does not require custom shaders and post-processing. |
I have: 24fps before changes, Looks promising 🎉 . |
There are still 2 major performance issues in getProgramCacheKey which I haven't fixed here.
So the example was written with these performance issues also taken into account. The post processing isn't really required for the example. |
Okay, then let's remove the post processing so the example only has the bits which are actually required. |
Seems the screenshot of |
21 fps before changes, ANGLE (AMD, AMD Radeon (TM) RX 460 Graphics (POLARIS11), OpenGL 4.6 (Core Profile) Mesa 21.2.5)] |
I've updated the screenshot |
Thanks! |
Description
Related #22530.
Adds a performance boost to getprogramcachekey. This is done in 2 steps:
unrolling the loop for the parameters
separating the boolean parameters and combining them into 2 integers.
Before:old link to indeterministic exampleAfter unrolling parameters: old link to indeterministic example
After separating booleans:old link to indeterministic example
Dev Version now: link
after unrolling the parameters: link
after separating booleans: link
Add layers link
For me, the example before any changes has only 35fps. After unrolling the parameters it becomes 40fps. And separating the booleans gets me to 50fps.