Author Topic: high cpu-waits-gpu on iPad  (Read 4626 times)

dilshod

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 7
  • Posts: 14
    • View Profile
high cpu-waits-gpu on iPad
« on: October 20, 2014, 10:46:35 PM »
Hi,

I have a simple scene, all standard ngui sprites, 3 panels and 60-70 sprites, not so many draw calls and verts/tris, no special shaders, no post processing shaders, no clipping panels.
Why cpu-waits-gpu time is so high? Value changes over time, some times it is 0, some times it is 3-4.
On 60 fps, i can see some motion lags when cpu-waits-gpu is greater than 1. Testing on iPad mini 2, iOS 8.

----------------------------------------
iPhone Unity internal profiler stats:
cpu-player>    min:  8.4   max: 10.6   avg:  9.2
cpu-ogles-drv> min:  0.5   max:  1.3   avg:  0.5
cpu-present>   min:  4.5   max:  9.4   avg:  6.7
cpu-waits-gpu> min:  4.5   max:  9.4   avg:  6.7
 msaa-resolve> min:  0.0   max:  0.0   avg:  0.0
frametime>     min: 14.2   max: 19.5   avg: 16.6
draw-call #>   min:  12    max:  12    avg:  12     | batched:     0
tris #>        min:   466  max:   466  avg:   466   | batched:     0
verts #>       min:   932  max:   932  avg:   932   | batched:     0
player-detail> physx:  0.2 animation:  0.0 culling  0.0 skinning:  0.0 batching:  0.0 render:  2.3 fixed-update-count: 0 .. 1
mono-scripts>  update:  3.4   fixedUpdate:  0.0 coroutines:  0.0
mono-memory>   used heap: 7618560 allocated heap: 8036352  max number of collections: 0 collection total duration:  0.0
----------------------------------------
« Last Edit: October 22, 2014, 04:59:52 AM by dilshod »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: high cpu-waits-gpu on iPad
« Reply #1 on: October 20, 2014, 11:52:48 PM »
Because your framerate is higher than 60 fps, and the device has to wait?

dilshod

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 7
  • Posts: 14
    • View Profile
Re: high cpu-waits-gpu on iPad
« Reply #2 on: October 21, 2014, 09:12:53 PM »
Because your framerate is higher than 60 fps, and the device has to wait?

Nope, it is 60 fps, it's not higher.
I think it has some input lags, maybe touches priority is low. Because when i move objects with a tween, it moves smoothly, but when i drag objects by hand moves are not smooth.

As it is said on page http://docs.unity3d.com/Manual/iphone-iOS-Optimization.html
Quote
Conversely, you can increase the framerate to give the rendering priority over other activities such as touch input and accelerometer processing.

dilshod

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 7
  • Posts: 14
    • View Profile
Re: high cpu-waits-gpu on iPad
« Reply #3 on: October 27, 2014, 12:01:13 AM »
I fixed motion lag by smoothing drag delta. I just did something like this:

  1. Vector2 totalDelta, targetTotalDelta;
  2.  
  3. void OnDragStart() {
  4.   totalDelta = Vector2.zero;
  5.   targetTotalDelta = Vector2.zero;
  6.   dragging = true;
  7. }
  8.  
  9. void OnDrag() {
  10.   targetTotalDelta = UICurrent.currentTouch.totalDelta;
  11. }
  12.  
  13. void Update() {
  14.   if (dragging) {
  15.     totalDelta = Vector2.Lerp(totalDelta, targetTotalDelta, 0.25f);
  16.     // ...
  17.   }
  18. }
  19.