Monado OpenXR Runtime
chl_frame_state Struct Reference

Encapsulates all the needed state to run the layer squasher and distortion passes, state object needs to be kept alive until the GPU work finishes. More...

#include <util/comp_high_level_render.h>

Collaboration diagram for chl_frame_state:

Public Member Functions

void chl_frame_state_init (struct chl_frame_state *frame_state, struct render_resources *rr, uint32_t view_count, bool do_timewarp, bool fast_path, struct chl_scratch *scratch)
 Create the Vulkan resources using the given render_resources and the vk_bundle it refers to. More...
 
void chl_frame_state_fini (struct chl_frame_state *state)
 Frees all resources that this frame state tracks and manages the scratch images state. More...
 
void chl_frame_state_gfx_set_views (struct chl_frame_state *frame_state, const struct xrt_pose world_pose[XRT_MAX_VIEWS], const struct xrt_pose eye_pose[XRT_MAX_VIEWS], const struct xrt_fov fov[XRT_MAX_VIEWS], uint32_t layer_count)
 Sets all the needed state to run the layer squasher to the scratch images, this is the graphics version. More...
 
void chl_frame_state_gfx_set_target (struct chl_frame_state *frame_state, struct render_gfx_target_resources *target_rtr, const struct render_viewport_data target_viewport_datas[XRT_MAX_VIEWS], const struct xrt_matrix_2x2 vertex_rots[XRT_MAX_VIEWS])
 Adds the needed information to also perform a distortion step, reuses some information from the _set_views call and as such this needs to be called before calling this function. More...
 
void chl_frame_state_cs_set_views (struct chl_frame_state *frame_state, const struct xrt_pose world_pose[XRT_MAX_VIEWS], const struct xrt_pose eye_pose[XRT_MAX_VIEWS], const struct xrt_fov fov[XRT_MAX_VIEWS], uint32_t layer_count)
 Sets all the needed state to run the layer squasher to the scratch images, this is the compute version. More...
 
void chl_frame_state_cs_set_target (struct chl_frame_state *frame_state, VkImage target_image, VkImageView target_storage_view, const struct render_viewport_data views[XRT_MAX_VIEWS])
 Adds the needed information to also perform a distortion step, reuses some information from the _set_views call and as such this needs to be called before calling this function. More...
 

Static Public Member Functions

static void chl_frame_state_gfx_default_pipeline (struct chl_frame_state *frame_state, struct render_gfx *render, const struct comp_layer *layers, uint32_t layer_count, const struct xrt_pose world_poses[XRT_MAX_VIEWS], const struct xrt_pose eye_poses[XRT_MAX_VIEWS], const struct xrt_fov fovs[XRT_MAX_VIEWS], struct render_gfx_target_resources *target_rtr, const struct render_viewport_data target_viewport_datas[XRT_MAX_VIEWS], const struct xrt_matrix_2x2 vertex_rots[XRT_MAX_VIEWS])
 A single do all function, runs the default graphics pipeline. More...
 
static void chl_frame_state_cs_default_pipeline (struct chl_frame_state *frame_state, struct render_compute *render, const struct comp_layer *layers, uint32_t layer_count, const struct xrt_pose world_poses[XRT_MAX_VIEWS], const struct xrt_pose eye_poses[XRT_MAX_VIEWS], const struct xrt_fov fovs[XRT_MAX_VIEWS], VkImage target_image, VkImageView target_storage_view, const struct render_viewport_data target_viewport_datas[XRT_MAX_VIEWS])
 A single do all function, runs the default compute pipeline. More...
 

Data Fields

struct chl_scratchscratch
 
uint32_t view_count
 
struct chl_scratch_state scratch_state
 
struct comp_render_dispatch_data data
 
struct render_compute cs
 

Detailed Description

Encapsulates all the needed state to run the layer squasher and distortion passes, state object needs to be kept alive until the GPU work finishes.

None of the functions are thread safe so make sure to synchronize access.

The lifetime of this struct is one frame, but as stated above it needs to live for long enough that the GPU work has been finished.

@comp_util

Member Function Documentation

◆ chl_frame_state_cs_default_pipeline()

static void chl_frame_state_cs_default_pipeline ( struct chl_frame_state frame_state,
struct render_compute render,
const struct comp_layer layers,
uint32_t  layer_count,
const struct xrt_pose  world_poses[XRT_MAX_VIEWS],
const struct xrt_pose  eye_poses[XRT_MAX_VIEWS],
const struct xrt_fov  fovs[XRT_MAX_VIEWS],
VkImage  target_image,
VkImageView  target_storage_view,
const struct render_viewport_data  target_viewport_datas[XRT_MAX_VIEWS] 
)
inlinestatic

A single do all function, runs the default compute pipeline.

◆ chl_frame_state_cs_set_target()

void chl_frame_state_cs_set_target ( struct chl_frame_state frame_state,
VkImage  target_image,
VkImageView  target_storage_view,
const struct render_viewport_data  views[XRT_MAX_VIEWS] 
)

Adds the needed information to also perform a distortion step, reuses some information from the _set_views call and as such this needs to be called before calling this function.

This is the compute version.

◆ chl_frame_state_cs_set_views()

void chl_frame_state_cs_set_views ( struct chl_frame_state frame_state,
const struct xrt_pose  world_pose[XRT_MAX_VIEWS],
const struct xrt_pose  eye_pose[XRT_MAX_VIEWS],
const struct xrt_fov  fov[XRT_MAX_VIEWS],
uint32_t  layer_count 
)

Sets all the needed state to run the layer squasher to the scratch images, this is the compute version.

◆ chl_frame_state_fini()

void chl_frame_state_fini ( struct chl_frame_state state)

Frees all resources that this frame state tracks and manages the scratch images state.

Must be called after the GPU work has finished and has been waited on (or the validation layer gets upset).

References chl_scratch_state::chl_scratch_state_discard_or_done(), and U_ZERO.

◆ chl_frame_state_gfx_default_pipeline()

static void chl_frame_state_gfx_default_pipeline ( struct chl_frame_state frame_state,
struct render_gfx render,
const struct comp_layer layers,
uint32_t  layer_count,
const struct xrt_pose  world_poses[XRT_MAX_VIEWS],
const struct xrt_pose  eye_poses[XRT_MAX_VIEWS],
const struct xrt_fov  fovs[XRT_MAX_VIEWS],
struct render_gfx_target_resources target_rtr,
const struct render_viewport_data  target_viewport_datas[XRT_MAX_VIEWS],
const struct xrt_matrix_2x2  vertex_rots[XRT_MAX_VIEWS] 
)
inlinestatic

A single do all function, runs the default graphics pipeline.

◆ chl_frame_state_gfx_set_target()

void chl_frame_state_gfx_set_target ( struct chl_frame_state frame_state,
struct render_gfx_target_resources target_rtr,
const struct render_viewport_data  target_viewport_datas[XRT_MAX_VIEWS],
const struct xrt_matrix_2x2  vertex_rots[XRT_MAX_VIEWS] 
)

Adds the needed information to also perform a distortion step, reuses some information from the _set_views call and as such this needs to be called before calling this function.

This is the graphics version.

◆ chl_frame_state_gfx_set_views()

void chl_frame_state_gfx_set_views ( struct chl_frame_state frame_state,
const struct xrt_pose  world_pose[XRT_MAX_VIEWS],
const struct xrt_pose  eye_pose[XRT_MAX_VIEWS],
const struct xrt_fov  fov[XRT_MAX_VIEWS],
uint32_t  layer_count 
)

Sets all the needed state to run the layer squasher to the scratch images, this is the graphics version.

◆ chl_frame_state_init()

void chl_frame_state_init ( struct chl_frame_state frame_state,
struct render_resources rr,
uint32_t  view_count,
bool  do_timewarp,
bool  fast_path,
struct chl_scratch scratch 
)

Create the Vulkan resources using the given render_resources and the vk_bundle it refers to.

Is used for both graphics and compute paths, also manages the scratch state.

References chl_scratch_state::chl_scratch_state_init_and_get(), comp_render_initial_init(), U_ZERO, and render_resources::vk.


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