Monado OpenXR Runtime
comp_scratch.h File Reference

Helper implementation for native compositors. More...

Include dependency graph for comp_scratch.h:

Go to the source code of this file.

Data Structures

struct  comp_scratch_indices
 Small helper struct to deal with indices. More...
 
struct  comp_scratch_single_images
 Holds scratch images for a single view, designed to work with render code. More...
 
struct  comp_scratch_stereo_images
 Holds scartch images for a stereo views, designed to work with render code. More...
 

Macros

#define COMP_SCRATCH_NUM_IMAGES   (4)
 The number of images for each view, works like a swapchain. More...
 

Functions

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

Macro Definition Documentation

◆ COMP_SCRATCH_NUM_IMAGES

#define COMP_SCRATCH_NUM_IMAGES   (4)

The number of images for each view, works like a swapchain.