···411411 uint32_t image_count;
412412413413 /*!
414414- * Must have called release_image before calling this function.
414414+ * @ref dec_image_use must have been called as often as @ref inc_image_use.
415415 */
416416 void (*destroy)(struct xrt_swapchain *xsc);
417417···430430 * Call @ref xrt_swapchain_wait_image before writing to the image index output from this function.
431431 */
432432 xrt_result_t (*acquire_image)(struct xrt_swapchain *xsc, uint32_t *out_index);
433433+434434+ /*!
435435+ * @brief Increments the use counter of a swapchain image.
436436+ */
437437+ xrt_result_t (*inc_image_use)(struct xrt_swapchain *xsc, uint32_t index);
438438+439439+ /*!
440440+ * @brief Decrements the use counter of a swapchain image.
441441+ *
442442+ * @ref wait_image will return once the image use counter is 0.
443443+ */
444444+ xrt_result_t (*dec_image_use)(struct xrt_swapchain *xsc, uint32_t index);
433445434446 /*!
435447 * Wait until image @p index is available for exclusive use, or until @p timeout_ns expires.
···502514xrt_swapchain_acquire_image(struct xrt_swapchain *xsc, uint32_t *out_index)
503515{
504516 return xsc->acquire_image(xsc, out_index);
517517+}
518518+519519+/*!
520520+ * @copydoc xrt_swapchain::inc_image_use
521521+ *
522522+ * Helper for calling through the function pointer.
523523+ *
524524+ * @public @memberof xrt_swapchain
525525+ */
526526+static inline xrt_result_t
527527+xrt_swapchain_inc_image_use(struct xrt_swapchain *xsc, uint32_t index)
528528+{
529529+ return xsc->inc_image_use(xsc, index);
530530+}
531531+532532+/*!
533533+ * @copydoc xrt_swapchain::dec_image_use
534534+ *
535535+ * Helper for calling through the function pointer.
536536+ *
537537+ * @public @memberof xrt_swapchain
538538+ */
539539+static inline xrt_result_t
540540+xrt_swapchain_dec_image_use(struct xrt_swapchain *xsc, uint32_t index)
541541+{
542542+ return xsc->dec_image_use(xsc, index);
505543}
506544507545/*!