The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

xrt: Add sync_handle argument to layer_commit

+36 -11
+8 -2
src/xrt/compositor/client/comp_gl_client.c
··· 301 301 } 302 302 303 303 static xrt_result_t 304 - client_gl_compositor_layer_commit(struct xrt_compositor *xc, int64_t frame_id) 304 + client_gl_compositor_layer_commit(struct xrt_compositor *xc, 305 + int64_t frame_id, 306 + xrt_graphics_sync_handle_t sync_handle) 305 307 { 306 308 //! @hack: The swapchain images should have been externally synchronized 307 309 glFlush(); 308 310 309 311 struct client_gl_compositor *c = client_gl_compositor(xc); 310 312 311 - return xrt_comp_layer_commit(&c->xcn->base, frame_id); 313 + //! @todo We should be creating the handle ourselves in the future. 314 + assert(!xrt_graphics_sync_handle_is_valid(sync_handle)); 315 + 316 + return xrt_comp_layer_commit(&c->xcn->base, frame_id, 317 + XRT_GRAPHICS_SYNC_HANDLE_INVALID); 312 318 } 313 319 314 320 static int64_t
+8 -2
src/xrt/compositor/client/comp_vk_client.c
··· 362 362 } 363 363 364 364 static xrt_result_t 365 - client_vk_compositor_layer_commit(struct xrt_compositor *xc, int64_t frame_id) 365 + client_vk_compositor_layer_commit(struct xrt_compositor *xc, 366 + int64_t frame_id, 367 + xrt_graphics_sync_handle_t sync_handle) 366 368 { 367 369 struct client_vk_compositor *c = client_vk_compositor(xc); 368 370 369 - return xrt_comp_layer_commit(&c->xcn->base, frame_id); 371 + //! @todo We should be creating the handle ourselves in the future. 372 + assert(!xrt_graphics_sync_handle_is_valid(sync_handle)); 373 + 374 + return xrt_comp_layer_commit(&c->xcn->base, frame_id, 375 + XRT_GRAPHICS_SYNC_HANDLE_INVALID); 370 376 } 371 377 372 378 static xrt_result_t
+5 -1
src/xrt/compositor/main/comp_compositor.c
··· 459 459 } 460 460 461 461 static xrt_result_t 462 - compositor_layer_commit(struct xrt_compositor *xc, int64_t frame_id) 462 + compositor_layer_commit(struct xrt_compositor *xc, 463 + int64_t frame_id, 464 + xrt_graphics_sync_handle_t sync_handle) 463 465 { 464 466 struct comp_compositor *c = comp_compositor(xc); 467 + 468 + assert(!xrt_graphics_sync_handle_is_valid(sync_handle)); 465 469 466 470 COMP_SPEW(c, "LAYER_COMMIT at %8.3fms", ts_ms()); 467 471
+6 -3
src/xrt/include/xrt/xrt_compositor.h
··· 774 774 * compositor will use the layers. 775 775 */ 776 776 xrt_result_t (*layer_commit)(struct xrt_compositor *xc, 777 - int64_t frame_id); 777 + int64_t frame_id, 778 + xrt_graphics_sync_handle_t sync_handle); 778 779 779 780 /*! 780 781 * Teardown the compositor. ··· 1056 1057 * @public @memberof xrt_compositor 1057 1058 */ 1058 1059 static inline xrt_result_t 1059 - xrt_comp_layer_commit(struct xrt_compositor *xc, int64_t frame_id) 1060 + xrt_comp_layer_commit(struct xrt_compositor *xc, 1061 + int64_t frame_id, 1062 + xrt_graphics_sync_handle_t sync_handle) 1060 1063 { 1061 - return xc->layer_commit(xc, frame_id); 1064 + return xc->layer_commit(xc, frame_id, sync_handle); 1062 1065 } 1063 1066 1064 1067 /*!
+5 -1
src/xrt/ipc/client/ipc_client_compositor.c
··· 610 610 } 611 611 612 612 static xrt_result_t 613 - ipc_compositor_layer_commit(struct xrt_compositor *xc, int64_t frame_id) 613 + ipc_compositor_layer_commit(struct xrt_compositor *xc, 614 + int64_t frame_id, 615 + xrt_graphics_sync_handle_t sync_handle) 614 616 { 615 617 struct ipc_client_compositor *icc = ipc_client_compositor(xc); 618 + 619 + assert(!xrt_graphics_sync_handle_is_valid(sync_handle)); 616 620 617 621 struct ipc_shared_memory *ism = icc->ipc_c->ism; 618 622 struct ipc_layer_slot *slot = &ism->slots[icc->layers.slot_id];
+2 -1
src/xrt/ipc/server/ipc_server_process.c
··· 1055 1055 1056 1056 _update_layers(s, xc); 1057 1057 1058 - xrt_comp_layer_commit(xc, frame_id); 1058 + xrt_comp_layer_commit(xc, frame_id, 1059 + XRT_GRAPHICS_SYNC_HANDLE_INVALID); 1059 1060 1060 1061 #ifndef XRT_OS_ANDROID 1061 1062 // Check polling last, so we know we have valid timing data.
+2 -1
src/xrt/state_trackers/oxr/oxr_session.c
··· 2135 2135 } 2136 2136 } 2137 2137 2138 - CALL_CHK(xrt_comp_layer_commit(xc, sess->frame_id.begun)); 2138 + CALL_CHK(xrt_comp_layer_commit(xc, sess->frame_id.begun, 2139 + XRT_GRAPHICS_SYNC_HANDLE_INVALID)); 2139 2140 sess->frame_id.begun = -1; 2140 2141 2141 2142 sess->frame_started = false;