The open source OpenXR runtime
0
fork

Configure Feed

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

c/multi: Make sure to retire delivered frames once the session goes invisible or non-active

Launching two instances of hello_xr will cause an assert in the app pacer.

+21
+6
src/xrt/compositor/multi/comp_multi_compositor.c
··· 942 942 u_pa_latched(mc->upa, mc->delivered.frame_id, when_ns, system_frame_id); 943 943 } 944 944 945 + void 946 + multi_compositor_retire_delivered_locked(struct multi_compositor *mc, uint64_t when_ns) 947 + { 948 + slot_clear_locked(mc, &mc->delivered); 949 + } 950 + 945 951 xrt_result_t 946 952 multi_compositor_create(struct multi_system_compositor *msc, 947 953 const struct xrt_session_info *xsi,
+10
src/xrt/compositor/multi/comp_multi_private.h
··· 228 228 void 229 229 multi_compositor_latch_frame_locked(struct multi_compositor *mc, uint64_t when_ns, int64_t system_frame_id); 230 230 231 + /*! 232 + * Clears and retires the delivered frame, called by the render thread. 233 + * The list_and_timing_lock is held when this function is called. 234 + * 235 + * @ingroup comp_multi 236 + * @private @memberof multi_compositor 237 + */ 238 + void 239 + multi_compositor_retire_delivered_locked(struct multi_compositor *mc, uint64_t when_ns); 240 + 231 241 232 242 /* 233 243 *
+5
src/xrt/compositor/multi/comp_multi_system.c
··· 257 257 258 258 // The client isn't visible, do not submit it's layers. 259 259 if (!mc->state.visible) { 260 + // Need to drop delivered frame as it shouldn't be reused. 261 + multi_compositor_retire_delivered_locked(mc, now_ns); 260 262 continue; 261 263 } 262 264 263 265 // Just in case. 264 266 if (!mc->state.session_active) { 265 267 U_LOG_W("Session is visible but not active."); 268 + 269 + // Need to drop delivered frame as it shouldn't be reused. 270 + multi_compositor_retire_delivered_locked(mc, now_ns); 266 271 continue; 267 272 } 268 273