Monado OpenXR Runtime
comp_scratch.c File Reference

Helper implementation for native compositors. More...

Include dependency graph for comp_scratch.c:

Data Structures

struct  tmp
 

Macros

#define INVALID_INDEX   ((uint32_t)(-1))
 

Functions

static void fill_info (VkExtent2D extent, struct xrt_swapchain_create_info *out_info)
 
static void indices_init (struct comp_scratch_indices *i)
 
static void indices_get (struct comp_scratch_indices *i, uint32_t *out_index)
 
static uint32_t indices_done (struct comp_scratch_indices *i)
 
static void indices_discard (struct comp_scratch_indices *i)
 
static bool tmp_init_and_create (struct tmp *t, struct vk_bundle *vk, const struct xrt_swapchain_create_info *info)
 
static void tmp_take (struct tmp *t, struct xrt_image_native native_images[(4)], struct render_scratch_color_image images[(4)])
 
static void tmp_destroy (struct tmp *t, struct vk_bundle *vk)
 
void comp_scratch_single_images_init (struct comp_scratch_single_images *cssi)
 Init the struct, this function must be called before calling any other function on this struct, or variable tracking setup on unid. More...
 
bool comp_scratch_single_images_ensure (struct comp_scratch_single_images *cssi, struct vk_bundle *vk, VkExtent2D extent)
 Ensure that the scratch images are allocated and match extent size. More...
 
void comp_scratch_single_images_free (struct comp_scratch_single_images *cssi, struct vk_bundle *vk)
 Free all images allocated, init must be called before calling this function, is safe to call without any image allocated. More...
 
void comp_scratch_single_images_get (struct comp_scratch_single_images *cssi, uint32_t *out_index)
 Get the next free image, after this function has been called you must call either done or discard before calling any other function. More...
 
void comp_scratch_single_images_done (struct comp_scratch_single_images *cssi)
 After calling get and rendering to the image you call this function to signal that you are done with this function, the GPU work needs to be fully completed before calling done. More...
 
void comp_scratch_single_images_discard (struct comp_scratch_single_images *cssi)
 Discard a @g get call, this clears the image debug part causing no image to be shown in the debug UI. More...
 
void comp_scratch_single_images_clear_debug (struct comp_scratch_single_images *cssi)
 Clears the debug output, this causes nothing to be shown in the debug UI. More...
 
void comp_scratch_single_images_destroy (struct comp_scratch_single_images *cssi)
 Destroys scratch image struct, if any images has been allocated must call free before as this function only destroys the mutex, and the unid must no longer be tracked. More...
 
void comp_scratch_stereo_images_init (struct comp_scratch_stereo_images *cssi)
 
bool comp_scratch_stereo_images_ensure (struct comp_scratch_stereo_images *cssi, struct vk_bundle *vk, VkExtent2D extent)
 
void comp_scratch_stereo_images_free (struct comp_scratch_stereo_images *cssi, struct vk_bundle *vk)
 
void comp_scratch_stereo_images_get (struct comp_scratch_stereo_images *cssi, uint32_t *out_index)
 
void comp_scratch_stereo_images_done (struct comp_scratch_stereo_images *cssi)
 
void comp_scratch_stereo_images_discard (struct comp_scratch_stereo_images *cssi)
 
void comp_scratch_stereo_images_clear_debug (struct comp_scratch_stereo_images *cssi)
 
void comp_scratch_stereo_images_destroy (struct comp_scratch_stereo_images *cssi)
 

Detailed Description

Helper implementation for native compositors.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m
Lubosz Sarnecki lubos.nosp@m.z.sa.nosp@m.rneck.nosp@m.i@co.nosp@m.llabo.nosp@m.ra.c.nosp@m.om