diff --git a/src/xrt/compositor/client/comp_gl_client.c b/src/xrt/compositor/client/comp_gl_client.c index c0ea7502c..d0f1d3950 100644 --- a/src/xrt/compositor/client/comp_gl_client.c +++ b/src/xrt/compositor/client/comp_gl_client.c @@ -301,14 +301,20 @@ client_gl_compositor_layer_equirect2(struct xrt_compositor *xc, } static xrt_result_t -client_gl_compositor_layer_commit(struct xrt_compositor *xc, int64_t frame_id) +client_gl_compositor_layer_commit(struct xrt_compositor *xc, + int64_t frame_id, + xrt_graphics_sync_handle_t sync_handle) { //! @hack: The swapchain images should have been externally synchronized glFlush(); struct client_gl_compositor *c = client_gl_compositor(xc); - return xrt_comp_layer_commit(&c->xcn->base, frame_id); + //! @todo We should be creating the handle ourselves in the future. + assert(!xrt_graphics_sync_handle_is_valid(sync_handle)); + + return xrt_comp_layer_commit(&c->xcn->base, frame_id, + XRT_GRAPHICS_SYNC_HANDLE_INVALID); } static int64_t diff --git a/src/xrt/compositor/client/comp_vk_client.c b/src/xrt/compositor/client/comp_vk_client.c index f0373535e..7b4c2a2a6 100644 --- a/src/xrt/compositor/client/comp_vk_client.c +++ b/src/xrt/compositor/client/comp_vk_client.c @@ -362,11 +362,17 @@ client_vk_compositor_layer_equirect2(struct xrt_compositor *xc, } static xrt_result_t -client_vk_compositor_layer_commit(struct xrt_compositor *xc, int64_t frame_id) +client_vk_compositor_layer_commit(struct xrt_compositor *xc, + int64_t frame_id, + xrt_graphics_sync_handle_t sync_handle) { struct client_vk_compositor *c = client_vk_compositor(xc); - return xrt_comp_layer_commit(&c->xcn->base, frame_id); + //! @todo We should be creating the handle ourselves in the future. + assert(!xrt_graphics_sync_handle_is_valid(sync_handle)); + + return xrt_comp_layer_commit(&c->xcn->base, frame_id, + XRT_GRAPHICS_SYNC_HANDLE_INVALID); } static xrt_result_t diff --git a/src/xrt/compositor/main/comp_compositor.c b/src/xrt/compositor/main/comp_compositor.c index d9b7c7c4b..d85ce0639 100644 --- a/src/xrt/compositor/main/comp_compositor.c +++ b/src/xrt/compositor/main/comp_compositor.c @@ -459,10 +459,14 @@ compositor_layer_equirect2(struct xrt_compositor *xc, } static xrt_result_t -compositor_layer_commit(struct xrt_compositor *xc, int64_t frame_id) +compositor_layer_commit(struct xrt_compositor *xc, + int64_t frame_id, + xrt_graphics_sync_handle_t sync_handle) { struct comp_compositor *c = comp_compositor(xc); + assert(!xrt_graphics_sync_handle_is_valid(sync_handle)); + COMP_SPEW(c, "LAYER_COMMIT at %8.3fms", ts_ms()); // Always zero for now. diff --git a/src/xrt/include/xrt/xrt_compositor.h b/src/xrt/include/xrt/xrt_compositor.h index 4a8733ef1..71629acd8 100644 --- a/src/xrt/include/xrt/xrt_compositor.h +++ b/src/xrt/include/xrt/xrt_compositor.h @@ -774,7 +774,8 @@ struct xrt_compositor * compositor will use the layers. */ xrt_result_t (*layer_commit)(struct xrt_compositor *xc, - int64_t frame_id); + int64_t frame_id, + xrt_graphics_sync_handle_t sync_handle); /*! * Teardown the compositor. @@ -1056,9 +1057,11 @@ xrt_comp_layer_equirect2(struct xrt_compositor *xc, * @public @memberof xrt_compositor */ static inline xrt_result_t -xrt_comp_layer_commit(struct xrt_compositor *xc, int64_t frame_id) +xrt_comp_layer_commit(struct xrt_compositor *xc, + int64_t frame_id, + xrt_graphics_sync_handle_t sync_handle) { - return xc->layer_commit(xc, frame_id); + return xc->layer_commit(xc, frame_id, sync_handle); } /*! diff --git a/src/xrt/ipc/client/ipc_client_compositor.c b/src/xrt/ipc/client/ipc_client_compositor.c index 2275ac7fb..01abb3ec1 100644 --- a/src/xrt/ipc/client/ipc_client_compositor.c +++ b/src/xrt/ipc/client/ipc_client_compositor.c @@ -610,10 +610,14 @@ ipc_compositor_layer_equirect2(struct xrt_compositor *xc, } static xrt_result_t -ipc_compositor_layer_commit(struct xrt_compositor *xc, int64_t frame_id) +ipc_compositor_layer_commit(struct xrt_compositor *xc, + int64_t frame_id, + xrt_graphics_sync_handle_t sync_handle) { struct ipc_client_compositor *icc = ipc_client_compositor(xc); + assert(!xrt_graphics_sync_handle_is_valid(sync_handle)); + struct ipc_shared_memory *ism = icc->ipc_c->ism; struct ipc_layer_slot *slot = &ism->slots[icc->layers.slot_id]; diff --git a/src/xrt/ipc/server/ipc_server_process.c b/src/xrt/ipc/server/ipc_server_process.c index 19855dc16..c005eabe8 100644 --- a/src/xrt/ipc/server/ipc_server_process.c +++ b/src/xrt/ipc/server/ipc_server_process.c @@ -1055,7 +1055,8 @@ main_loop(struct ipc_server *s) _update_layers(s, xc); - xrt_comp_layer_commit(xc, frame_id); + xrt_comp_layer_commit(xc, frame_id, + XRT_GRAPHICS_SYNC_HANDLE_INVALID); #ifndef XRT_OS_ANDROID // Check polling last, so we know we have valid timing data. diff --git a/src/xrt/state_trackers/oxr/oxr_session.c b/src/xrt/state_trackers/oxr/oxr_session.c index 6497496db..748cb2785 100644 --- a/src/xrt/state_trackers/oxr/oxr_session.c +++ b/src/xrt/state_trackers/oxr/oxr_session.c @@ -2135,7 +2135,8 @@ oxr_session_frame_end(struct oxr_logger *log, } } - CALL_CHK(xrt_comp_layer_commit(xc, sess->frame_id.begun)); + CALL_CHK(xrt_comp_layer_commit(xc, sess->frame_id.begun, + XRT_GRAPHICS_SYNC_HANDLE_INVALID)); sess->frame_id.begun = -1; sess->frame_started = false;