Monado OpenXR Runtime
chl_scratch Struct Reference

Scratch images that can be used for staging buffers. More...

#include <util/comp_high_level_scratch.h>

Collaboration diagram for chl_scratch:

Public Member Functions

void chl_scratch_init (struct chl_scratch *scratch)
 Must becalled before used and before the scratch images are registered with the u_var system. More...
 
void chl_scratch_fini (struct chl_scratch *scratch)
 Resources must be manually called before calling this functions, and the scratch images unregistered from the u_var system. More...
 
bool chl_scratch_ensure (struct chl_scratch *scratch, struct render_resources *rr, uint32_t view_count, VkExtent2D extent, const VkFormat format)
 Ensure the scratch images and the render target resources are created. More...
 
void chl_scratch_free_resources (struct chl_scratch *scratch, struct render_resources *rr)
 Free all Vulkan resources that this scratch has created. More...
 

Static Public Member Functions

static VkImage chl_scratch_get_image (struct chl_scratch *scratch, uint32_t view_index, uint32_t image_index)
 Get the image, see comp_scratch_single_images_get_image. More...
 
static VkImageView chl_scratch_get_sample_view (struct chl_scratch *scratch, uint32_t view_index, uint32_t image_index)
 Get the sample view, see comp_scratch_single_images_get_sample_view. More...
 
static VkImageView chl_scratch_get_storage_view (struct chl_scratch *scratch, uint32_t view_index, uint32_t image_index)
 Get the storage view, see comp_scratch_single_images_get_storage_view. More...
 

Data Fields

struct render_gfx_render_pass render_pass
 Shared render passed for the views. More...
 
struct {
   struct comp_scratch_single_images   cssi
 Per-view scratch images. More...
 
   struct render_gfx_target_resources   targets [(4)]
 Targets for rendering to the scratch buffer. More...
 
views [XRT_MAX_VIEWS]
 
uint32_t view_count
 Number of views that has been ensured and have Vulkan resources, all comp_scratch_single_images are always inited. More...
 
VkExtent2D extent
 The extent used to create the images. More...
 
VkFormat format
 Format requested. More...
 
bool render_pass_initialized
 Has the render pass been initialized. More...
 

Detailed Description

Scratch images that can be used for staging buffers.

Member Function Documentation

◆ chl_scratch_ensure()

bool chl_scratch_ensure ( struct chl_scratch scratch,
struct render_resources rr,
uint32_t  view_count,
VkExtent2D  extent,
const VkFormat  format 
)

Ensure the scratch images and the render target resources are created.

References chl_scratch_free_resources(), extent, format, render_gfx_render_pass::render_gfx_render_pass_init(), render_pass, view_count, and render_resources::vk.

◆ chl_scratch_fini()

void chl_scratch_fini ( struct chl_scratch scratch)

Resources must be manually called before calling this functions, and the scratch images unregistered from the u_var system.

References ARRAY_SIZE, comp_scratch_single_images::comp_scratch_single_images_destroy(), and cssi.

◆ chl_scratch_free_resources()

◆ chl_scratch_get_image()

static VkImage chl_scratch_get_image ( struct chl_scratch scratch,
uint32_t  view_index,
uint32_t  image_index 
)
inlinestatic

Get the image, see comp_scratch_single_images_get_image.

References comp_scratch_single_images::comp_scratch_single_images_get_image(), and cssi.

◆ chl_scratch_get_sample_view()

static VkImageView chl_scratch_get_sample_view ( struct chl_scratch scratch,
uint32_t  view_index,
uint32_t  image_index 
)
inlinestatic

Get the sample view, see comp_scratch_single_images_get_sample_view.

References comp_scratch_single_images::comp_scratch_single_images_get_sample_view(), and cssi.

◆ chl_scratch_get_storage_view()

static VkImageView chl_scratch_get_storage_view ( struct chl_scratch scratch,
uint32_t  view_index,
uint32_t  image_index 
)
inlinestatic

Get the storage view, see comp_scratch_single_images_get_storage_view.

References comp_scratch_single_images::comp_scratch_single_images_get_storage_view(), and cssi.

◆ chl_scratch_init()

void chl_scratch_init ( struct chl_scratch scratch)

Must becalled before used and before the scratch images are registered with the u_var system.

References ARRAY_SIZE, comp_scratch_single_images::comp_scratch_single_images_init(), and cssi.

Field Documentation

◆ cssi

◆ extent

VkExtent2D chl_scratch::extent

The extent used to create the images.

Referenced by chl_scratch_ensure(), and chl_scratch_free_resources().

◆ format

VkFormat chl_scratch::format

Format requested.

Referenced by chl_scratch_ensure(), and chl_scratch_free_resources().

◆ render_pass

struct render_gfx_render_pass chl_scratch::render_pass

Shared render passed for the views.

Referenced by chl_scratch_ensure(), and chl_scratch_free_resources().

◆ render_pass_initialized

bool chl_scratch::render_pass_initialized

Has the render pass been initialized.

Referenced by chl_scratch_free_resources().

◆ targets

struct render_gfx_target_resources chl_scratch::targets[(4)]

Targets for rendering to the scratch buffer.

Referenced by chl_scratch_free_resources().

◆ view_count

uint32_t chl_scratch::view_count

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