···734734 *
735735 * The only requirement on the compositor for the @p frame_id
736736 * is that it is a positive number.
737737+ *
738738+ * If the caller can do its own blocking, use the pair of functions
739739+ * xrt_compositor::predict_frame and xrt_compositor::mark_frame instead
740740+ * of this single blocking function.
737741 */
738742 xrt_result_t (*wait_frame)(struct xrt_compositor *xc,
739743 int64_t *out_frame_id,
···746750 xrt_result_t (*begin_frame)(struct xrt_compositor *xc, int64_t frame_id);
747751748752 /*!
753753+ * @brief Explicitly discard a frame.
754754+ *
749755 * This isn't in the OpenXR API but is explicit in the XRT interfaces.
750756 *
751751- * Two calls to xrBeginFrame will cause the state tracker to call.
757757+ * Two calls to xrBeginFrame without intervening xrEndFrame will cause
758758+ * the state tracker to call:
752759 *
753760 * ```c
754754- * xc->begin_frame(xc, frame_id)
755755- * xc->discard_frame(xc, frame_id)
756756- * xc->begin_frame(xc, frame_id)
761761+ * // first xrBeginFrame
762762+ * xrt_comp_begin_frame(xc, frame_id);
763763+ * // second xrBeginFrame
764764+ * xrt_comp_discard_frame(xc, frame_id);
765765+ * xrt_comp_begin_frame(xc, frame_id);
757766 * ```
758767 */
759768 xrt_result_t (*discard_frame)(struct xrt_compositor *xc, int64_t frame_id);
760769761770 /*!
762762- * Begins layer submission, this and the other layer_* calls are
763763- * equivalent to xrEndFrame, except over multiple calls. It's only after
764764- * @p layer_commit that layers will be displayed. From the point of view
765765- * of the swapchain the image is used as soon as it's given in a call.
771771+ * @brief Begins layer submission.
772772+ *
773773+ * This and the other `layer_*` calls are equivalent to xrEndFrame,
774774+ * except split over multiple calls. It's only after
775775+ * xrt_compositor::layer_commit that layers will be displayed.
776776+ * From the point of view of the swapchain, the image is used as
777777+ * soon as it's given in a call.
766778 */
767779 xrt_result_t (*layer_begin)(struct xrt_compositor *xc,
768780 int64_t frame_id,
···770782 enum xrt_blend_mode env_blend_mode);
771783772784 /*!
773773- * Adds a stereo projection layer for submissions.
785785+ * @brief Adds a stereo projection layer for submissions.
786786+ *
787787+ * Note that e.g. the same swapchain object may be passed as both
788788+ * @p l_xsc and @p r_xsc - the parameters in @p data identify
789789+ * the subrect and array texture index to use for each of the views.
774790 *
775791 * @param xc Self pointer
776792 * @param xdev The device the layer is relative to.
777777- * @param l_xsc Left swapchain.
778778- * @param r_xsc Right swapchain.
779779- * @param data All of the pure data bits.
793793+ * @param l_xsc Swapchain object containing left eye RGB data.
794794+ * @param r_xsc Swapchain object containing right eye RGB data.
795795+ * @param data All of the pure data bits (not pointers/handles),
796796+ * including what parts of the supplied swapchain
797797+ * objects to use for each view.
780798 */
781799 xrt_result_t (*layer_stereo_projection)(struct xrt_compositor *xc,
782800 struct xrt_device *xdev,
···785803 const struct xrt_layer_data *data);
786804787805 /*!
788788- * Adds a stereo projection layer for submission, has depth information.
806806+ * @brief Adds a stereo projection layer for submission, has depth information.
807807+ *
808808+ * Note that e.g. the same swapchain object may be passed as both
809809+ * @p l_xsc and @p r_xsc - the parameters in @p data identify
810810+ * the subrect and array texture index to use for each of the views.
811811+ * This flexibility is required by the OpenXR API and is passed through
812812+ * to the compositor to preserve the maximum information
789813 *
790814 * @param xc Self pointer
791815 * @param xdev The device the layer is relative to.
792792- * @param l_xsc Left swapchain.
793793- * @param r_xsc Right swapchain.
794794- * @param l_d_xsc Left depth swapchain.
795795- * @param r_d_xsc Right depth swapchain.
796796- * @param data All of the pure data bits.
816816+ * @param l_xsc Swapchain object containing left eye RGB data.
817817+ * @param r_xsc Swapchain object containing right eye RGB data.
818818+ * @param l_d_xsc Swapchain object containing left eye depth data.
819819+ * @param r_d_xsc Swapchain object containing right eye depth data.
820820+ * @param data All of the pure data bits (not pointers/handles),
821821+ * including what parts of the supplied swapchain
822822+ * objects to use for each view.
797823 */
798824 xrt_result_t (*layer_stereo_projection_depth)(struct xrt_compositor *xc,
799825 struct xrt_device *xdev,
···810836 * @param xc Self pointer
811837 * @param xdev The device the layer is relative to.
812838 * @param xsc Swapchain.
813813- * @param data All of the pure data bits.
839839+ * @param data All of the pure data bits (not pointers/handles),
840840+ * including what part of the supplied swapchain
841841+ * object to use.
814842 */
815843 xrt_result_t (*layer_quad)(struct xrt_compositor *xc,
816844 struct xrt_device *xdev,
···823851 * @param xc Self pointer
824852 * @param xdev The device the layer is relative to.
825853 * @param xsc Swapchain.
826826- * @param data All of the pure data bits.
854854+ * @param data All of the pure data bits (not pointers/handles),
855855+ * including what part of the supplied swapchain
856856+ * object to use.
827857 */
828858 xrt_result_t (*layer_cube)(struct xrt_compositor *xc,
829859 struct xrt_device *xdev,
···836866 * @param xc Self pointer
837867 * @param xdev The device the layer is relative to.
838868 * @param xsc Swapchain.
839839- * @param data All of the pure data bits.
869869+ * @param data All of the pure data bits (not pointers/handles),
870870+ * including what part of the supplied swapchain
871871+ * object to use.
840872 */
841873 xrt_result_t (*layer_cylinder)(struct xrt_compositor *xc,
842874 struct xrt_device *xdev,
···849881 * @param xc Self pointer
850882 * @param xdev The device the layer is relative to.
851883 * @param xsc Swapchain.
852852- * @param data All of the pure data bits.
884884+ * @param data All of the pure data bits (not pointers/handles),
885885+ * including what part of the supplied swapchain
886886+ * object to use.
853887 */
854888 xrt_result_t (*layer_equirect1)(struct xrt_compositor *xc,
855889 struct xrt_device *xdev,
···863897 * @param xc Self pointer
864898 * @param xdev The device the layer is relative to.
865899 * @param xsc Swapchain.
866866- * @param data All of the pure data bits.
900900+ * @param data All of the pure data bits (not pointers/handles),
901901+ * including what part of the supplied swapchain
902902+ * object to use.
867903 */
868904 xrt_result_t (*layer_equirect2)(struct xrt_compositor *xc,
869905 struct xrt_device *xdev,
···871907 const struct xrt_layer_data *data);
872908873909 /*!
874874- * Commits all of the submitted layers, it's from this on that the
875875- * compositor will use the layers.
910910+ * @brief Commits all of the submitted layers.
911911+ *
912912+ * Only after this call will the compositor actually use the layers.
876913 */
877914 xrt_result_t (*layer_commit)(struct xrt_compositor *xc,
878915 int64_t frame_id,
···882919 * Teardown the compositor.
883920 *
884921 * The state tracker must have made sure that no frames or sessions are
885885- * currently pending. See discard_frame, end_frame, end_session.
922922+ * currently pending.
923923+ *
924924+ * @see xrt_compositor::discard_frame or xrt_compositor::end_frame for a pending frame
925925+ * @see xrt_compositor::end_session for an open session.
886926 */
887927 void (*destroy)(struct xrt_compositor *xc);
888928};