-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Improve performance of single light scene #83018
Conversation
On pixel shader bound scenarios, use a specialization constant to generate a variant that uses one single directional light; which is the most common use case. This improves framerate of Adreno 505 by 33%
Sorry, this improvement applies for all hardwares? |
YMMV and 33% improvement is the upper bound, not the average case. Generally speaking advanced GPUs (such as GCN/RDNA/NVIDIA) doesn't really benefit from this at all (and for that HW we often use Forward+, this PR only affects the Mobile backend). But low end GPUs get benefit more. Specially low end phones. The scene must be pixel shader bound to be noticeable. This PR combined with #82215 together can give a combined boost of up to 58% improvement on low end GPUs. There are more things I want to improve (the best I've managed was a combined 87.5% improvement, but that change wasn't simple and changes how the scene looks); although after this PR I will have to focus on fixing the MSAA bug on Forward+ which has much greater priority. |
Tested locally (rebased on top of A build of Export templates: Logcat:
Device info:
|
It's hard to evaluate if this PR causes the problem if the scene doesn't look correctly on unpatched master. But there is an alternate solution: Could you try adding (e.g. cherry pick) #82805 as well? I strongly suspect that could fix your hang. |
Tested locally on Android with #82805 applied on top of this PR (and then rebased on On the same device as above, I don't notice rendering issues but still can't spot a performance improvement on either the cover display (110 FPS) or main screen (60 FPS) in Truck Town. This also applies if I disable MSAA in the project (99 FPS on main screen). This likely helps more on lower-end devices, but since I don't notice any performance regressions or rendering issues, this should be good to go. |
Superseded by #98825 |
On pixel shader bound scenarios, use a specialization constant to generate a variant that uses one single directional light; which is the most common use case.
This improves framerate of Adreno 505 by 33%
NOTE: For Adreno 505 performance improvements to actually appear this PR also needs #82805 to workaround a driver bug.
NOTE: This PR can be merged without having to merge #82805.