52 COMP_TARGET_FORCE_FAKE_DISPLAY_TIMING = 0,
53 COMP_TARGET_USE_DISPLAY_IF_AVAILABLE = 1,
82 uint32_t format_count;
91 VkPresentModeKHR present_mode;
223 uint64_t timeline_semaphore_value,
224 int64_t desired_present_time_ns,
225 int64_t present_slop_ns);
244 int64_t *out_frame_id,
245 int64_t *out_wake_up_time_ns,
246 int64_t *out_desired_present_time_ns,
247 int64_t *out_present_slop_ns,
248 int64_t *out_predicted_display_time_ns);
282 struct comp_target *ct, int64_t frame_id, int64_t gpu_start_ns, int64_t gpu_end_ns, int64_t when_ns);
377static inline VkResult
382 return ct->
acquire(ct, out_index);
391static inline VkResult
395 uint64_t timeline_semaphore_value,
396 int64_t desired_present_time_ns,
397 int64_t present_slop_ns)
406 timeline_semaphore_value,
407 desired_present_time_ns,
433 int64_t *out_frame_id,
434 int64_t *out_wake_up_time_ns,
435 int64_t *out_desired_present_time_ns,
436 int64_t *out_present_slop_ns,
437 int64_t *out_predicted_display_time_ns)
445 out_desired_present_time_ns,
447 out_predicted_display_time_ns);
516static inline VkResult
532 struct comp_target *ct, int64_t frame_id, int64_t gpu_start_ns, int64_t gpu_end_ns, int64_t when_ns)
536 ct->
info_gpu(ct, frame_id, gpu_start_ns, gpu_end_ns, when_ns);
static void comp_target_mark_wake_up(struct comp_target *ct, int64_t frame_id, int64_t when_woke_ns)
Quick helper for marking wake up.
Definition: comp_target.h:458
static void comp_target_destroy(struct comp_target **ct_ptr)
Destroys this target.
Definition: comp_target.h:563
comp_target_display_timing_usage
If the target should use the display timing information.
Definition: comp_target.h:51
static VkResult comp_target_present(struct comp_target *ct, VkQueue queue, uint32_t index, uint64_t timeline_semaphore_value, int64_t desired_present_time_ns, int64_t present_slop_ns)
Present the image at index to the screen.
Definition: comp_target.h:392
static VkResult comp_target_acquire(struct comp_target *ct, uint32_t *out_index)
Acquire the next image for rendering.
Definition: comp_target.h:378
static void comp_target_mark_submit_begin(struct comp_target *ct, int64_t frame_id, int64_t when_submit_began_ns)
Quick helper for marking submit began.
Definition: comp_target.h:488
static VkResult comp_target_update_timings(struct comp_target *ct)
Update timing information for this target, this function should be lightweight and is called multiple...
Definition: comp_target.h:517
static void comp_target_flush(struct comp_target *ct)
Flush any WSI state before rendering.
Definition: comp_target.h:418
static bool comp_target_has_images(struct comp_target *ct)
Has this target successfully had images created?
Definition: comp_target.h:364
static void comp_target_set_title(struct comp_target *ct, const char *title)
If the target can show a title (like a window) set the title.
Definition: comp_target.h:546
static void comp_target_create_images(struct comp_target *ct, const struct comp_target_create_images_info *create_info)
Create or recreate the image(s) of the target, for swapchain based targets this will (re)create the s...
Definition: comp_target.h:350
static bool comp_target_check_ready(struct comp_target *ct)
Is this target ready for image creation?
Definition: comp_target.h:336
static void comp_target_calc_frame_pacing(struct comp_target *ct, int64_t *out_frame_id, int64_t *out_wake_up_time_ns, int64_t *out_desired_present_time_ns, int64_t *out_present_slop_ns, int64_t *out_predicted_display_time_ns)
Predict when the next frame should be started and when it will be turned into photons by the hardware...
Definition: comp_target.h:432
comp_target_timing_point
For marking timepoints on a frame's lifetime, not a async event.
Definition: comp_target.h:31
static void comp_target_mark_begin(struct comp_target *ct, int64_t frame_id, int64_t when_began_ns)
Quick helper for marking begin.
Definition: comp_target.h:473
static bool comp_target_factory_detect(const struct comp_target_factory *ctf, struct comp_compositor *c)
Checks if this target can be detected, is the preferred target or some other special consideration th...
Definition: comp_target.h:640
static void comp_target_mark_submit_end(struct comp_target *ct, int64_t frame_id, int64_t when_submit_end_ns)
Quick helper for marking submit end.
Definition: comp_target.h:503
static bool comp_target_factory_create_target(const struct comp_target_factory *ctf, struct comp_compositor *c, struct comp_target **out_ct)
Create a target from this factory, some targets requires Vulkan to have been initialised,...
Definition: comp_target.h:654
static bool comp_target_init_pre_vulkan(struct comp_target *ct)
Do any initialization that is required to happen before Vulkan has been loaded.
Definition: comp_target.h:308
static void comp_target_info_gpu(struct comp_target *ct, int64_t frame_id, int64_t gpu_start_ns, int64_t gpu_end_ns, int64_t when_ns)
Provide frame timing information about GPU start and stop time.
Definition: comp_target.h:531
static bool comp_target_init_post_vulkan(struct comp_target *ct, uint32_t preferred_width, uint32_t preferred_height)
Do any initialization that requires Vulkan to be loaded, you need to call create_images after calling...
Definition: comp_target.h:322
@ COMP_TARGET_TIMING_POINT_SUBMIT_BEGIN
Just before submitting work to the GPU.
Definition: comp_target.h:39
@ COMP_TARGET_TIMING_POINT_BEGIN
Began CPU side work for GPU.
Definition: comp_target.h:36
@ COMP_TARGET_TIMING_POINT_WAKE_UP
Woke up after sleeping in wait frame.
Definition: comp_target.h:33
@ COMP_TARGET_TIMING_POINT_SUBMIT_END
Just after submitting work to the GPU.
Definition: comp_target.h:42
#define XRT_MAX_SWAPCHAIN_FORMATS
Max formats supported by a compositor, artificial limit.
Definition: xrt_limits.h:39
Main compositor struct tying everything in the compositor together.
Definition: comp_compositor.h:89
Information given in when creating the swapchain images, argument to comp_target_create_images.
Definition: comp_target.h:74
VkColorSpaceKHR color_space
Preferred color space, can be ignored by the target.
Definition: comp_target.h:88
VkExtent2D extent
Preferred extent, can be ignored by the target.
Definition: comp_target.h:85
VkImageUsageFlags image_usage
Image usage for the images, must be followed.
Definition: comp_target.h:76
VkFormat formats[XRT_MAX_SWAPCHAIN_FORMATS]
Acceptable formats for the images, must be followed.
Definition: comp_target.h:79
A factory of targets.
Definition: comp_target.h:580
const char ** required_instance_extensions
Required instance extensions.
Definition: comp_target.h:603
bool requires_vulkan_for_create
Does this factory require Vulkan to have been initialized.
Definition: comp_target.h:588
size_t required_instance_extension_count
Required instance extension count.
Definition: comp_target.h:606
const char * identifier
Short all lowercase identifier for target type.
Definition: comp_target.h:585
size_t optional_device_extension_count
Optional device extension count.
Definition: comp_target.h:612
const char ** optional_device_extensions
Optional device extensions.
Definition: comp_target.h:609
const char * name
Pretty loggable name of target type.
Definition: comp_target.h:582
bool(* detect)(const struct comp_target_factory *ctf, struct comp_compositor *c)
Checks if this target can be detected, is the preferred target or some other special consideration th...
Definition: comp_target.h:622
uint32_t required_instance_version
Vulkan version that is required or 0 if no specific requirement, equivalent to VK_MAKE_VERSION(1,...
Definition: comp_target.h:600
bool is_deferred
Is this a deferred target that can have it's creation delayed even further then after Vulkan initiali...
Definition: comp_target.h:594
bool(* create_target)(const struct comp_target_factory *ctf, struct comp_compositor *c, struct comp_target **out_ct)
Create a target from this factory, some targets requires Vulkan to have been initialised,...
Definition: comp_target.h:628
Image and view pair for comp_target.
Definition: comp_target.h:62
Collection of semaphores needed for a target.
Definition: comp_target.h:100
VkSemaphore render_complete
Semaphore the renderer (consuming this target) should signal when rendering is complete.
Definition: comp_target.h:110
VkSemaphore present_complete
Optional semaphore the target should signal when present is complete.
Definition: comp_target.h:104
bool render_complete_is_timeline
If true, render_complete is a timeline semaphore instead of a binary semaphore.
Definition: comp_target.h:116
A compositor target: where the compositor renders to.
Definition: comp_target.h:132
bool(* has_images)(struct comp_target *ct)
Has this target successfully had images created?
Definition: comp_target.h:195
void(* create_images)(struct comp_target *ct, const struct comp_target_create_images_info *create_info)
Create or recreate the image(s) of the target, for swapchain based targets this will (re)create the s...
Definition: comp_target.h:187
bool(* check_ready)(struct comp_target *ct)
Is this target ready for image creation?
Definition: comp_target.h:179
void(* flush)(struct comp_target *ct)
Flush any WSI state before rendering.
Definition: comp_target.h:230
uint32_t width
Current dimensions of the target.
Definition: comp_target.h:140
void(* set_title)(struct comp_target *ct, const char *title)
If the target can show a title (like a window) set the title.
Definition: comp_target.h:293
bool(* init_post_vulkan)(struct comp_target *ct, uint32_t preferred_width, uint32_t preferred_height)
Do any initialization that requires Vulkan to be loaded, you need to call create_images after calling...
Definition: comp_target.h:172
void(* destroy)(struct comp_target *ct)
Destroys this target.
Definition: comp_target.h:298
struct comp_target_image * images
Array of images and image views for rendering.
Definition: comp_target.h:148
uint32_t image_count
Number of images that this target has.
Definition: comp_target.h:146
VkResult(* acquire)(struct comp_target *ct, uint32_t *out_index)
Acquire the next image for rendering.
Definition: comp_target.h:205
void(* mark_timing_point)(struct comp_target *ct, enum comp_target_timing_point point, int64_t frame_id, int64_t when_ns)
The compositor tells the target a timing information about a single timing point on the frames lifecy...
Definition: comp_target.h:254
void(* info_gpu)(struct comp_target *ct, int64_t frame_id, int64_t gpu_start_ns, int64_t gpu_end_ns, int64_t when_ns)
Provide frame timing information about GPU start and stop time.
Definition: comp_target.h:281
bool(* init_pre_vulkan)(struct comp_target *ct)
Do any initialization that is required to happen before Vulkan has been loaded.
Definition: comp_target.h:166
VkResult(* update_timings)(struct comp_target *ct)
Update timing information for this target, this function should be lightweight and is called multiple...
Definition: comp_target.h:264
const char * name
Name of the backing system.
Definition: comp_target.h:137
VkSurfaceTransformFlagBitsKHR surface_transform
Transformation of the current surface, required for pre-rotation.
Definition: comp_target.h:151
void(* calc_frame_pacing)(struct comp_target *ct, int64_t *out_frame_id, int64_t *out_wake_up_time_ns, int64_t *out_desired_present_time_ns, int64_t *out_present_slop_ns, int64_t *out_predicted_display_time_ns)
Predict when the next frame should be started and when it will be turned into photons by the hardware...
Definition: comp_target.h:243
struct comp_compositor * c
Owning compositor.
Definition: comp_target.h:134
VkFormat format
The format that the renderpass targeting this target should use.
Definition: comp_target.h:143
VkResult(* present)(struct comp_target *ct, VkQueue queue, uint32_t index, uint64_t timeline_semaphore_value, int64_t desired_present_time_ns, int64_t present_slop_ns)
Present the image at index to the screen.
Definition: comp_target.h:220
Tracing support code, see Tracing support.
Common Vulkan code header.
Header holding common defines.
Common defines and enums for XRT.