summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/context.h
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/gpu/context.h')
-rw-r--r--video/out/gpu/context.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/video/out/gpu/context.h b/video/out/gpu/context.h
index a2fcb3711a..b6b6ffcf43 100644
--- a/video/out/gpu/context.h
+++ b/video/out/gpu/context.h
@@ -83,6 +83,15 @@ struct ra_swapchain_fns {
// Performs a buffer swap. This blocks for as long as necessary to meet
// params.swapchain_depth, or until the next vblank (for vsynced contexts)
void (*swap_buffers)(struct ra_swapchain *sw);
+
+ // Return the latency at which swap_buffers() is performed. This is in
+ // seconds and always >= 0. Essentially, it's the predicted time the last
+ // shown frame will take until it is actually displayed on the physical
+ // screen. (A reasonable implementation is returning the duration the
+ // last actually displayed frame took after its swap_buffers() was called.)
+ // Should return -1 on error (e.g. discontinuities).
+ // Can be NULL 0 or always return -1 if unsupported.
+ double (*get_latency)(struct ra_swapchain *sw);
};
// Create and destroy a ra_ctx. This also takes care of creating and destroying