Add support for render-ahead

For periods of time during which latency is less important
allow a client to request a deeper render-ahead pipeline.

The latency tradeoff results in less overall visual jank

Test: none, only used by macrobench

Change-Id: I516203b70bdc75b6415fa08bf9c4fb1b598b0102
This commit is contained in:
John Reck
2018-04-05 16:41:41 -07:00
parent 413293ff62
commit ec100976e0
14 changed files with 107 additions and 21 deletions

View File

@@ -103,9 +103,8 @@ void DrawFrameTask::run() {
// Even if we aren't drawing this vsync pulse the next frame number will still be accurate
if (CC_UNLIKELY(callback)) {
context->enqueueFrameWork([callback, frameNr = context->getFrameNumber()]() {
callback(frameNr);
});
context->enqueueFrameWork(
[ callback, frameNr = context->getFrameNumber() ]() { callback(frameNr); });
}
if (CC_LIKELY(canDrawThisFrame)) {