From 2ab43f7494d58f8e9b2e193237b66edb0c501521 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 24 Apr 2023 18:10:50 +0100 Subject: [PATCH] c/main: Only do early acquire if we are ready --- src/xrt/compositor/main/comp_renderer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xrt/compositor/main/comp_renderer.c b/src/xrt/compositor/main/comp_renderer.c index f1c827167..e262bc095 100644 --- a/src/xrt/compositor/main/comp_renderer.c +++ b/src/xrt/compositor/main/comp_renderer.c @@ -2072,8 +2072,12 @@ comp_renderer_draw(struct comp_renderer *r) * For direct mode this makes us wait until the last frame has been * actually shown to the user, this avoids us missing that we have * missed a frame and miss-predicting the next frame. + * + * Only do this if we are ready. */ - renderer_acquire_swapchain_image(r); + if (comp_target_check_ready(r->c->target)) { + renderer_acquire_swapchain_image(r); + } comp_target_update_timings(ct); }