FramePipelineEstimator
Estimates the ideal frame rate (throughput) and latency (pipeline depth) from Renderer.getFrameInfoHistory, modelling the main CPU, backend and GPU stages by their mean plus Z standard deviations:
val history = renderer.getFrameInfoHistory(renderer.maxFrameHistorySize)
val workload = FramePipelineEstimator.estimateWorkload(history)
val sizing = FramePipelineEstimator.estimatePacing(history, pacingPeriod = 16_666_666)
pacer.configuration = FramePacer.Configuration(workload.idealFrameRate, sizing.latencyFrames * 16_666_666L)Types
The recommended pipeline depth in frames, and the slack in nanoseconds before CPU work must start.
The confidence that a frame fits the estimated budget; 1 - P is the theoretical miss rate. In practice stutters are rarer: spikes cluster, and the FramePacer's queue depth absorbs them.
Functions
The latency and safe delay for pacing history every pacingPeriod nanoseconds, at targetPercentile.
The latency and safe delay for pacing history every pacingPeriod nanoseconds, zScore deviations above the mean.
The unthrottled throughput history supports at targetPercentile.
The normal distribution Z-score of targetPercentile.