mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-04 06:12:04 +00:00
[host] measure ready time at framebuffer publication
Exclude command queue reset and cleanup from the ready stage, and keep the wall-clock residual only as the legacy timing fallback.
This commit is contained in:
@@ -205,6 +205,7 @@ struct RenderTiming
|
||||
uint64_t captureTime;
|
||||
uint64_t postProcessTime;
|
||||
uint64_t copyTime;
|
||||
uint64_t readyTime;
|
||||
uint64_t importTime;
|
||||
};
|
||||
|
||||
@@ -225,6 +226,8 @@ static struct RenderTiming frameTimingLoad(void)
|
||||
&g_state.producerPostProcessTime, memory_order_seq_cst);
|
||||
timing.copyTime = atomic_load_explicit(
|
||||
&g_state.producerCopyTime, memory_order_seq_cst);
|
||||
timing.readyTime = atomic_load_explicit(
|
||||
&g_state.producerReadyTime, memory_order_seq_cst);
|
||||
timing.importTime = atomic_load_explicit(
|
||||
&g_state.clientImportTime, memory_order_seq_cst);
|
||||
|
||||
@@ -245,6 +248,8 @@ static void frameTimingStore(const LG_TransportFrameTiming * timing,
|
||||
timing->postProcessTime, memory_order_seq_cst);
|
||||
atomic_store_explicit(&g_state.producerCopyTime,
|
||||
timing->copyTime, memory_order_seq_cst);
|
||||
atomic_store_explicit(&g_state.producerReadyTime,
|
||||
timing->readyTime, memory_order_seq_cst);
|
||||
atomic_store_explicit(&g_state.clientImportTime,
|
||||
importTime, memory_order_seq_cst);
|
||||
atomic_fetch_add_explicit(
|
||||
@@ -257,13 +262,14 @@ static void preSwapCallback(void * udata)
|
||||
const uint64_t timestamp = nanotime();
|
||||
const uint64_t renderTime = timestamp - timing->renderStart;
|
||||
if (timing->captureTime || timing->postProcessTime || timing->copyTime ||
|
||||
timing->importTime)
|
||||
timing->readyTime || timing->importTime)
|
||||
{
|
||||
const OverlayFrameTiming frameTiming = {
|
||||
.timestamp = timestamp,
|
||||
.capture = timing->captureTime * 1e-6f,
|
||||
.postProcess = timing->postProcessTime * 1e-6f,
|
||||
.copy = timing->copyTime * 1e-6f,
|
||||
.ready = timing->readyTime * 1e-6f,
|
||||
.import = timing->importTime * 1e-6f,
|
||||
.render = renderTime * 1e-6f,
|
||||
};
|
||||
|
||||
@@ -154,6 +154,7 @@ struct AppState
|
||||
atomic_uint_least64_t producerCaptureTime;
|
||||
atomic_uint_least64_t producerPostProcessTime;
|
||||
atomic_uint_least64_t producerCopyTime;
|
||||
atomic_uint_least64_t producerReadyTime;
|
||||
atomic_uint_least64_t clientImportTime;
|
||||
atomic_uint_least64_t renderCount, frameCount;
|
||||
_Atomic(float) fps, ups;
|
||||
|
||||
@@ -179,7 +179,7 @@ static bool rbCalcMetrics(int index, void * value_, void * udata_)
|
||||
#define TIMING_PLOT_WINDOW_NS 20000000000ULL
|
||||
#define TIMING_PLOT_BUCKET_NS \
|
||||
(TIMING_PLOT_WINDOW_NS / TIMING_PLOT_BUCKETS)
|
||||
#define TIMING_STAGE_COUNT 5
|
||||
#define TIMING_STAGE_COUNT 6
|
||||
|
||||
struct TimingPlotData
|
||||
{
|
||||
@@ -239,6 +239,7 @@ static bool accumulateTimingSample(int index, void * value_, void * udata_)
|
||||
timing->capture,
|
||||
timing->postProcess,
|
||||
timing->copy,
|
||||
timing->ready,
|
||||
timing->import,
|
||||
timing->render,
|
||||
};
|
||||
@@ -349,6 +350,7 @@ static void renderTimingStatistic(struct OverlayGraph * graph,
|
||||
"Capture",
|
||||
"Post",
|
||||
"Copy",
|
||||
"Ready",
|
||||
"Import",
|
||||
"Render",
|
||||
};
|
||||
|
||||
@@ -50,6 +50,7 @@ typedef struct OverlayFrameTiming
|
||||
float capture;
|
||||
float postProcess;
|
||||
float copy;
|
||||
float ready;
|
||||
float import;
|
||||
float render;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user