Monado OpenXR Runtime
comp_mirror_to_debug_gui.c File Reference

Compositor mirroring code. More...

Include dependency graph for comp_mirror_to_debug_gui.c:

Macros

#define C(c)
 If COND is not VK_SUCCESS returns false. More...
 
#define D(TYPE, THING)
 Calls vkDestroy##TYPE on THING if it is not VK_NULL_HANDLE, sets it to VK_NULL_HANDLE afterwards. More...
 
#define DF(TYPE, THING)
 Calls vkFree##TYPE on THING if it is not VK_NULL_HANDLE, sets it to VK_NULL_HANDLE afterwards. More...
 
#define P2_DIVIDE_ROUND_UP(v, div)   ((v + (div - 1)) / div)
 

Functions

static VkResult create_blit_descriptor_set_layout (struct vk_bundle *vk, VkDescriptorSetLayout *out_descriptor_set_layout)
 
static VkResult create_blit_pipeline_layout (struct vk_bundle *vk, VkDescriptorSetLayout descriptor_set_layout, VkPipelineLayout *out_pipeline_layout)
 
static bool ensure_scratch (struct comp_mirror_to_debug_gui *m, struct vk_bundle *vk)
 
static void update_blit_descriptor_set (struct vk_bundle *vk, VkSampler src_sampler, VkImageView src_view, VkImageView target_view, VkDescriptorSet descriptor_set)
 
static void calc_dispatch_dims (const VkExtent2D extent, uint32_t *out_w, uint32_t *out_h)
 
VkResult comp_mirror_init (struct comp_mirror_to_debug_gui *m, struct vk_bundle *vk, struct render_shaders *shaders, VkExtent2D extent)
 
void comp_mirror_add_debug_vars (struct comp_mirror_to_debug_gui *m, struct comp_compositor *c)
 
void comp_mirror_fixup_ui_state (struct comp_mirror_to_debug_gui *m, struct comp_compositor *c)
 
bool comp_mirror_is_ready_and_active (struct comp_mirror_to_debug_gui *m, struct comp_compositor *c, uint64_t predicted_display_time_ns)
 
XRT_CHECK_RESULT xrt_result_t comp_mirror_do_blit (struct comp_mirror_to_debug_gui *m, struct vk_bundle *vk, uint64_t frame_id, uint64_t predicted_display_time_ns, VkImage from_image, VkImageView from_view, VkSampler from_sampler, VkExtent2D from_extent, struct xrt_normalized_rect from_rect)
 
void comp_mirror_fini (struct comp_mirror_to_debug_gui *m, struct vk_bundle *vk)
 

Detailed Description

Macro Definition Documentation

◆ C

#define C (   c)
Value:
do { \
VkResult ret = c; \
if (ret != VK_SUCCESS) { \
comp_mirror_fini(m, vk); \
return ret; \
} \
} while (false)

If COND is not VK_SUCCESS returns false.

◆ D

#define D (   TYPE,
  THING 
)
Value:
if (THING != VK_NULL_HANDLE) { \
vk->vkDestroy##TYPE(vk->device, THING, NULL); \
THING = VK_NULL_HANDLE; \
}

Calls vkDestroy##TYPE on THING if it is not VK_NULL_HANDLE, sets it to VK_NULL_HANDLE afterwards.

◆ DF

#define DF (   TYPE,
  THING 
)
Value:
if (THING != VK_NULL_HANDLE) { \
vk->vkFree##TYPE(vk->device, THING, NULL); \
THING = VK_NULL_HANDLE; \
}

Calls vkFree##TYPE on THING if it is not VK_NULL_HANDLE, sets it to VK_NULL_HANDLE afterwards.

Function Documentation

◆ comp_mirror_do_blit()

XRT_CHECK_RESULT xrt_result_t comp_mirror_do_blit ( struct comp_mirror_to_debug_gui m,
struct vk_bundle vk,
uint64_t  frame_id,
uint64_t  predicted_display_time_ns,
VkImage  from_image,
VkImageView  from_view,
VkSampler  from_sampler,
VkExtent2D  from_extent,
struct xrt_normalized_rect  from_rect 
)
Todo:
Better handling of error?