Monado OpenXR Runtime
comp_scratch_single_images Struct Reference

Holds scratch images for a single view, designed to work with render code. More...

#include <util/comp_scratch.h>

Collaboration diagram for comp_scratch_single_images:

Public Member Functions

bool comp_scratch_single_images_ensure_mutable (struct comp_scratch_single_images *cssi, struct vk_bundle *vk, VkExtent2D extent)
 Ensure that the scratch images are allocated and match extent size, and srgb_format unorm_format formats. More...
 
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, const VkFormat format)
 Ensure that the scratch images are allocated and match extent size, and format. 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 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...
 

Static Public Member Functions

static VkImage comp_scratch_single_images_get_image (struct comp_scratch_single_images *cssi, uint32_t index)
 Get the image for the given index. More...
 
static VkImageView comp_scratch_single_images_get_sample_view (struct comp_scratch_single_images *cssi, uint32_t index)
 Get the image view for sampling, it will apply any automatic linearization, aka sRGB gamma curve correction. More...
 
static VkImageView comp_scratch_single_images_get_storage_view (struct comp_scratch_single_images *cssi, uint32_t index)
 Get the image view for storage or direct value, no linearization will be done. More...
 

Data Fields

struct render_scratch_color_image images [(4)]
 Images used when rendering. More...
 
struct u_native_images_debug unid
 To connect to the debug UI. More...
 
struct xrt_swapchain_create_info info
 Exposed via unid. More...
 
struct xrt_image_native native_images [(4)]
 Exposed via unid. More...
 
struct comp_scratch_indices indices
 Keeping track of indices. More...
 
xrt_limited_unique_id_t limited_unique_id
 Process unique id, used for caching. More...
 

Detailed Description

Holds scratch images for a single view, designed to work with render code.

Also manages xrt_image_native and u_native_images_debug to facilitate easy debugging.

Field Documentation

◆ images

◆ indices

struct comp_scratch_indices comp_scratch_single_images::indices

Keeping track of indices.

◆ info

struct xrt_swapchain_create_info comp_scratch_single_images::info

Exposed via unid.

◆ limited_unique_id

xrt_limited_unique_id_t comp_scratch_single_images::limited_unique_id

Process unique id, used for caching.

◆ native_images

struct xrt_image_native comp_scratch_single_images::native_images[(4)]

Exposed via unid.

◆ unid

struct u_native_images_debug comp_scratch_single_images::unid

The documentation for this struct was generated from the following files: