Improving performance on mobile
Slow performance on mobile? Here’s something that might help.
Usually, when developing for mobile, one tries to squeeze as much performance as possible. However - there’s only so much an old Android's GPU can do(apart from wondering if you really need all of those shadows). In such cases, where the GPU isn’t as great(usually mobile devices) - some of its work can be offloaded to the CPU by enabling the PreferCPUWorkload backend capability. This will make our rendering library(Renoir) batch commands more aggressively, trying to minimize the number of draw calls needed for the rendering.
To back this up - testing with the DX11 backend, the draw calls count for the minimal page below does in fact go down 50% - from about 200 to 98.
Although, everything comes at a price and the CPU workload has a cost that needs to be considered as well. In that same test on PC - we take about 300µs for painting with GPU workload (the default) and about 450µs for painting with CPU workload. However, on mobile devices - the performance should be generally improved and the draw calls reduced to a minimum(up to a few). To try it and see for yourself you can:
- Go to your Rendering Backend of use
- Look for the PreferCPUWorkload backend capability settings
- Set outCaps.PreferCPUWorkload to true (or respectively the m_PreferCPUWorkload property being passed there)
Note: For the Unity plugin this capability can only be enabled when using the C# Rendering Backend
Please sign in to leave a comment.
Comments
0 comments