Monado OpenXR Runtime
comp_render_cs.c File Reference

Compositor (compute shader) rendering code. More...

Include dependency graph for comp_render_cs.c:

Functions

static const struct comp_swapchain_imageget_layer_image (const struct comp_layer *layer, uint32_t swapchain_index, uint32_t image_index)
 
static const struct comp_swapchain_imageget_layer_depth_image (const struct comp_layer *layer, uint32_t swapchain_index, uint32_t image_index)
 
static void do_cs_cylinder_layer (const struct comp_layer *layer, const struct xrt_matrix_4x4 *eye_view_mat, const struct xrt_matrix_4x4 *world_view_mat, uint32_t view_index, uint32_t cur_layer, uint32_t cur_image, VkSampler clamp_to_edge, VkSampler clamp_to_border_black, VkSampler src_samplers[RENDER_MAX_IMAGES_SIZE], VkImageView src_image_views[RENDER_MAX_IMAGES_SIZE], struct render_compute_layer_ubo_data *ubo_data, uint32_t *out_cur_image)
 Data setup for a cylinder layer. More...
 
static void do_cs_equirect2_layer (const struct comp_layer *layer, const struct xrt_matrix_4x4 *eye_view_mat, const struct xrt_matrix_4x4 *world_view_mat, uint32_t view_index, uint32_t cur_layer, uint32_t cur_image, VkSampler clamp_to_edge, VkSampler clamp_to_border_black, VkSampler src_samplers[RENDER_MAX_IMAGES_SIZE], VkImageView src_image_views[RENDER_MAX_IMAGES_SIZE], struct render_compute_layer_ubo_data *ubo_data, uint32_t *out_cur_image)
 Data setup for an "equirect2" layer. More...
 
static void do_cs_projection_layer (const struct comp_layer *layer, const struct xrt_pose *world_pose, uint32_t view_index, uint32_t cur_layer, uint32_t cur_image, VkSampler clamp_to_edge, VkSampler clamp_to_border_black, VkSampler src_samplers[RENDER_MAX_IMAGES_SIZE], VkImageView src_image_views[RENDER_MAX_IMAGES_SIZE], struct render_compute_layer_ubo_data *ubo_data, bool do_timewarp, uint32_t *out_cur_image)
 Data setup for a projection layer. More...
 
static void do_cs_quad_layer (const struct comp_layer *layer, const struct xrt_matrix_4x4 *eye_view_mat, const struct xrt_matrix_4x4 *world_view_mat, uint32_t view_index, uint32_t cur_layer, uint32_t cur_image, VkSampler clamp_to_edge, VkSampler clamp_to_border_black, VkSampler src_samplers[RENDER_MAX_IMAGES_SIZE], VkImageView src_image_views[RENDER_MAX_IMAGES_SIZE], struct render_compute_layer_ubo_data *ubo_data, uint32_t *out_cur_image)
 Data setup for a quad layer. More...
 
static void crc_clear_output (struct render_compute *render, const struct comp_render_dispatch_data *d)
 
static void crc_distortion_after_squash (struct render_compute *render, const struct comp_render_dispatch_data *d)
 For use after squashing layers. More...
 
static void crc_distortion_fast_path (struct render_compute *render, const struct comp_render_dispatch_data *d, const struct comp_layer *layer, const struct xrt_layer_projection_view_data *vds[XRT_MAX_VIEWS])
 Fast path. More...
 
void comp_render_cs_layer (struct render_compute *render, uint32_t view_index, const struct comp_layer *layers, const uint32_t layer_count, const struct xrt_normalized_rect *pre_transform, const struct xrt_pose *world_pose, const struct xrt_pose *eye_pose, const VkImage target_image, const VkImageView target_image_view, const struct render_viewport_data *target_view, bool do_timewarp)
 Dispatch the layer squasher for a single view. More...
 
void comp_render_cs_layers (struct render_compute *render, const struct comp_layer *layers, const uint32_t layer_count, const struct comp_render_dispatch_data *d, VkImageLayout transition_to)
 Dispatch the layer squasher, on any number of views. More...
 
void comp_render_cs_dispatch (struct render_compute *render, const struct comp_layer *layers, const uint32_t layer_count, const struct comp_render_dispatch_data *d)
 Write commands to render to do a full composition with distortion. More...
 

Detailed Description

Function Documentation

◆ crc_distortion_after_squash()

static void crc_distortion_after_squash ( struct render_compute render,
const struct comp_render_dispatch_data d 
)
static

For use after squashing layers.

References comp_render_dispatch_data::view_count.

◆ crc_distortion_fast_path()

static void crc_distortion_fast_path ( struct render_compute render,
const struct comp_render_dispatch_data d,
const struct comp_layer layer,
const struct xrt_layer_projection_view_data vds[XRT_MAX_VIEWS] 
)
static

Fast path.

◆ do_cs_cylinder_layer()

static void do_cs_cylinder_layer ( const struct comp_layer layer,
const struct xrt_matrix_4x4 eye_view_mat,
const struct xrt_matrix_4x4 world_view_mat,
uint32_t  view_index,
uint32_t  cur_layer,
uint32_t  cur_image,
VkSampler  clamp_to_edge,
VkSampler  clamp_to_border_black,
VkSampler  src_samplers[RENDER_MAX_IMAGES_SIZE],
VkImageView  src_image_views[RENDER_MAX_IMAGES_SIZE],
struct render_compute_layer_ubo_data ubo_data,
uint32_t *  out_cur_image 
)
inlinestatic

Data setup for a cylinder layer.

References xrt_sub_image::array_index, and comp_layer::data.

◆ do_cs_equirect2_layer()

static void do_cs_equirect2_layer ( const struct comp_layer layer,
const struct xrt_matrix_4x4 eye_view_mat,
const struct xrt_matrix_4x4 world_view_mat,
uint32_t  view_index,
uint32_t  cur_layer,
uint32_t  cur_image,
VkSampler  clamp_to_edge,
VkSampler  clamp_to_border_black,
VkSampler  src_samplers[RENDER_MAX_IMAGES_SIZE],
VkImageView  src_image_views[RENDER_MAX_IMAGES_SIZE],
struct render_compute_layer_ubo_data ubo_data,
uint32_t *  out_cur_image 
)
inlinestatic

Data setup for an "equirect2" layer.

References xrt_sub_image::array_index, and comp_layer::data.

◆ do_cs_projection_layer()

static void do_cs_projection_layer ( const struct comp_layer layer,
const struct xrt_pose world_pose,
uint32_t  view_index,
uint32_t  cur_layer,
uint32_t  cur_image,
VkSampler  clamp_to_edge,
VkSampler  clamp_to_border_black,
VkSampler  src_samplers[RENDER_MAX_IMAGES_SIZE],
VkImageView  src_image_views[RENDER_MAX_IMAGES_SIZE],
struct render_compute_layer_ubo_data ubo_data,
bool  do_timewarp,
uint32_t *  out_cur_image 
)
inlinestatic

Data setup for a projection layer.

References comp_layer::data, and xrt_layer_data::type.

◆ do_cs_quad_layer()

static void do_cs_quad_layer ( const struct comp_layer layer,
const struct xrt_matrix_4x4 eye_view_mat,
const struct xrt_matrix_4x4 world_view_mat,
uint32_t  view_index,
uint32_t  cur_layer,
uint32_t  cur_image,
VkSampler  clamp_to_edge,
VkSampler  clamp_to_border_black,
VkSampler  src_samplers[RENDER_MAX_IMAGES_SIZE],
VkImageView  src_image_views[RENDER_MAX_IMAGES_SIZE],
struct render_compute_layer_ubo_data ubo_data,
uint32_t *  out_cur_image 
)
inlinestatic

Data setup for a quad layer.

References xrt_sub_image::array_index, and comp_layer::data.