···11+Add a native handle type for graphics sync primitives (currently file descriptors on all platforms).
+47-1
src/xrt/include/xrt/xrt_handles.h
···9191 */
9292#define XRT_GRAPHICS_BUFFER_HANDLE_INVALID NULL
93939494-#else
9494+#elif defined(XRT_OS_LINUX)
95959696/*!
9797 * The type underlying buffers shared between compositor clients and the main
···128128 * @relates xrt_graphics_buffer_handle_t
129129 */
130130#define XRT_GRAPHICS_BUFFER_HANDLE_INVALID (-1)
131131+132132+#else
133133+#error "Not yet implemented for this platform"
134134+#endif
135135+136136+#ifdef XRT_OS_UNIX
137137+138138+/*!
139139+ * The type underlying synchronization primitives (semaphores, etc) shared
140140+ * between compositor clients and the main compositor.
141141+ *
142142+ * On Linux, this is a file descriptor.
143143+ */
144144+typedef int xrt_graphics_sync_handle_t;
145145+146146+/*!
147147+ * Defined to allow detection of the underlying type.
148148+ *
149149+ * @relates xrt_graphics_sync_handle_t
150150+ */
151151+#define XRT_GRAPHICS_SYNC_HANDLE_IS_FD 1
152152+153153+/*!
154154+ * Check whether a graphics sync handle is valid.
155155+ *
156156+ * @public @memberof xrt_graphics_sync_handle_t
157157+ */
158158+static inline bool
159159+xrt_graphics_sync_handle_is_valid(xrt_graphics_sync_handle_t handle)
160160+{
161161+ return handle >= 0;
162162+}
163163+164164+/*!
165165+ * An invalid value for a graphics sync primitive.
166166+ *
167167+ * Note that there may be more than one value that's invalid - use
168168+ * xrt_graphics_sync_handle_is_valid() instead of comparing against this!
169169+ *
170170+ * @relates xrt_graphics_sync_handle_t
171171+ */
172172+#define XRT_GRAPHICS_SYNC_HANDLE_INVALID (-1)
173173+174174+#elif defined(XRT_OS_WINDOWS)
175175+176176+#error "Use HANDLE here, etc."
131177132178#endif
133179