24 #define XRT_MAX_SWAPCHAIN_IMAGES 8 31 #define XRT_MAX_SWAPCHAIN_FORMATS 8 40 XRT_SWAPCHAIN_CREATE_STATIC_IMAGE = (1 << 0),
50 XRT_SWAPCHAIN_USAGE_COLOR = 0x00000001,
51 XRT_SWAPCHAIN_USAGE_DEPTH_STENCIL = 0x00000002,
52 XRT_SWAPCHAIN_USAGE_UNORDERED_ACCESS = 0x00000004,
53 XRT_SWAPCHAIN_USAGE_TRANSFER_SRC = 0x00000008,
54 XRT_SWAPCHAIN_USAGE_TRANSFER_DST = 0x00000010,
55 XRT_SWAPCHAIN_USAGE_SAMPLED = 0x00000020,
56 XRT_SWAPCHAIN_USAGE_MUTABLE_FORMAT = 0x00000040
66 XRT_VIEW_TYPE_MONO = 1,
67 XRT_VIEW_TYPE_STEREO = 2,
136 uint32_t sample_count,
172 uint64_t *predicted_display_time,
173 uint64_t *predicted_display_period);
199 const uint32_t *image_index,
201 uint32_t num_swapchains);
222 uint32_t sample_count,
230 width, height, face_count, array_size,
285 uint64_t *predicted_display_time,
286 uint64_t *predicted_display_period)
288 xc->
wait_frame(xc, predicted_display_time, predicted_display_period);
322 const uint32_t *image_index,
324 uint32_t num_swapchains)
326 xc->
end_frame(xc, blend_mode, xscs, image_index, layers,
396 typedef struct VkImage_T *VkImage;
397 typedef struct VkDeviceMemory_T *VkDeviceMemory;
399 typedef uint64_t VkImage;
400 typedef uint64_t VkDeviceMemory;
void(* begin_session)(struct xrt_compositor *xc, enum xrt_view_type view_type)
See xrBeginSession.
Definition: xrt_compositor.h:158
void(* end_session)(struct xrt_compositor *xc)
See xrEndSession, unlike the OpenXR one the state tracker is responsible to call discard frame before...
Definition: xrt_compositor.h:166
Main compositor.
Definition: xrt_compositor.h:474
Base class for a Vulkan client compositor.
Definition: xrt_compositor.h:421
void(* poll_events)(struct xrt_compositor *xc, uint64_t *WIP)
Poll events from this compositor.
Definition: xrt_compositor.h:148
#define XRT_MAX_SWAPCHAIN_FORMATS
Max formats supported by a compositor, artificial limit.
Definition: xrt_compositor.h:31
A swapchain that exposes fd to be imported into a client API.
Definition: xrt_compositor.h:462
void(* discard_frame)(struct xrt_compositor *xc)
This isn't in the OpenXR API but is explicit in the XRT interfaces.
Definition: xrt_compositor.h:191
Definition: xrt_compositor.h:358
Base class for a Vulkan client swapchain.
Definition: xrt_compositor.h:408
xrt_swapchain_usage_bits
Usage of the swapchain images.
Definition: xrt_compositor.h:48
bool(* wait_image)(struct xrt_swapchain *xc, uint64_t timeout, uint32_t index)
See xrWaitSwapchainImage, state tracker needs to track index.
Definition: xrt_compositor.h:101
void(* end_frame)(struct xrt_compositor *xc, enum xrt_blend_mode blend_mode, struct xrt_swapchain **xscs, const uint32_t *image_index, uint32_t *layers, uint32_t num_swapchains)
See xrEndFrame.
Definition: xrt_compositor.h:196
Common defines and enums for XRT.
Common swapchain base.
Definition: xrt_compositor.h:75
Definition: xrt_compositor.h:371
xrt_blend_mode
Which blend mode does the device support, used as both a bitfield and value.
Definition: xrt_defines.h:34
void(* wait_frame)(struct xrt_compositor *xc, uint64_t *predicted_display_time, uint64_t *predicted_display_period)
See xrWaitFrame.
Definition: xrt_compositor.h:171
void(* prepare_session)(struct xrt_compositor *xc)
This function is implicit in the OpenXR spec but made explicit here.
Definition: xrt_compositor.h:153
uint32_t array_size
Number of array layers per image.
Definition: xrt_compositor.h:85
Common compositor base.
Definition: xrt_compositor.h:116
#define XRT_MAX_SWAPCHAIN_IMAGES
Max swapchain images, artificial limit.
Definition: xrt_compositor.h:24
void(* destroy)(struct xrt_compositor *xc)
Teardown the compositor.
Definition: xrt_compositor.h:209
xrt_view_type
View type to be rendered to by the compositor.
Definition: xrt_compositor.h:64
void(* destroy)(struct xrt_swapchain *sc)
Must have called release_image before calling this function.
Definition: xrt_compositor.h:90
bool(* release_image)(struct xrt_swapchain *xc, uint32_t index)
See xrReleaseSwapchainImage, state tracker needs to track index.
Definition: xrt_compositor.h:108
bool(* acquire_image)(struct xrt_swapchain *xc, uint32_t *index)
See xrWaitSwapchainImage, must make sure that no image is acquired before calling acquire_image...
Definition: xrt_compositor.h:96
struct xrt_swapchain *(* create_swapchain)(struct xrt_compositor *xc, enum xrt_swapchain_create_flags create, enum xrt_swapchain_usage_bits bits, int64_t format, uint32_t sample_count, uint32_t width, uint32_t height, uint32_t face_count, uint32_t array_size, uint32_t mip_count)
Create a swapchain with a set of images.
Definition: xrt_compositor.h:131
uint32_t num_formats
Number of formats.
Definition: xrt_compositor.h:121
xrt_swapchain_create_flags
Special flags for creating swapchain images.
Definition: xrt_compositor.h:38
uint32_t num_images
Number of images, the images themselves are on the subclasses.
Definition: xrt_compositor.h:80
void(* begin_frame)(struct xrt_compositor *xc)
See xrBeginFrame.
Definition: xrt_compositor.h:178
A single image of a fd based swapchain.
Definition: xrt_compositor.h:450