Pseudo codes like this:
situation0:
long start,end;
long frameInterval,invokeInterval,executeTime;
//GLSurfaceView.Renderer.onDrawFrame
onDrawFrame(){
long cur = System.nanoTime();
frameInterval = cur - start;
invokeInterval = cur - end;
start = cur;
//some logic codes
logicUpdate();
//commit gl commands
renderUpdate();
end = System.nanoTime();
executeTime = end-start;
}
situation1:
long start,end;
long frameInterval,invokeInterval,executeTime;
//logicThread
run(){
while(true)
{
logicUpdate();
}
}
//GLSurfaceView.Renderer.onDrawFrame
onDrawFrame(){
long cur = System.nanoTime();
frameInterval = cur - start;
invokeInterval = cur - end;
start = cur;
renderUpdate();
end = System.nanoTime();
executeTime = end-start;
}
In situation0 : frameInterval = 40 ms,invokeInterval = 7 ms,executeTime = 33 ms In situation1 : frameInterval = 41 ms,invokeInterval = 31 ms,executeTime = 10 ms
Geometries in the scene are same between S0 and S1, why GPU render cost (invokeInterval, I think) differently?