The open source OpenXR runtime
0
fork

Configure Feed

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

inc/xrt: Add a native handle type for graphics sync primitives

authored by

Ryan Pavlik and committed by
Jakob Bornecrantz
7b24fca5 8889f811

+48 -1
+1
doc/changes/xrt/mr.469.2.md
··· 1 + Add a native handle type for graphics sync primitives (currently file descriptors on all platforms).
+47 -1
src/xrt/include/xrt/xrt_handles.h
··· 91 91 */ 92 92 #define XRT_GRAPHICS_BUFFER_HANDLE_INVALID NULL 93 93 94 - #else 94 + #elif defined(XRT_OS_LINUX) 95 95 96 96 /*! 97 97 * The type underlying buffers shared between compositor clients and the main ··· 128 128 * @relates xrt_graphics_buffer_handle_t 129 129 */ 130 130 #define XRT_GRAPHICS_BUFFER_HANDLE_INVALID (-1) 131 + 132 + #else 133 + #error "Not yet implemented for this platform" 134 + #endif 135 + 136 + #ifdef XRT_OS_UNIX 137 + 138 + /*! 139 + * The type underlying synchronization primitives (semaphores, etc) shared 140 + * between compositor clients and the main compositor. 141 + * 142 + * On Linux, this is a file descriptor. 143 + */ 144 + typedef int xrt_graphics_sync_handle_t; 145 + 146 + /*! 147 + * Defined to allow detection of the underlying type. 148 + * 149 + * @relates xrt_graphics_sync_handle_t 150 + */ 151 + #define XRT_GRAPHICS_SYNC_HANDLE_IS_FD 1 152 + 153 + /*! 154 + * Check whether a graphics sync handle is valid. 155 + * 156 + * @public @memberof xrt_graphics_sync_handle_t 157 + */ 158 + static inline bool 159 + xrt_graphics_sync_handle_is_valid(xrt_graphics_sync_handle_t handle) 160 + { 161 + return handle >= 0; 162 + } 163 + 164 + /*! 165 + * An invalid value for a graphics sync primitive. 166 + * 167 + * Note that there may be more than one value that's invalid - use 168 + * xrt_graphics_sync_handle_is_valid() instead of comparing against this! 169 + * 170 + * @relates xrt_graphics_sync_handle_t 171 + */ 172 + #define XRT_GRAPHICS_SYNC_HANDLE_INVALID (-1) 173 + 174 + #elif defined(XRT_OS_WINDOWS) 175 + 176 + #error "Use HANDLE here, etc." 131 177 132 178 #endif 133 179