Monado OpenXR Runtime
comp_render.h File Reference

Compositor render implementation. More...

#include "xrt/xrt_defines.h"
#include "xrt/xrt_vulkan_includes.h"
#include "render/render_interface.h"
#include "util/u_misc.h"
#include <assert.h>
Include dependency graph for comp_render.h:

Go to the source code of this file.

Data Structures

struct  comp_render_view_data
 The input data needed for a single view, shared between both GFX and CS paths. More...
 
struct  comp_render_dispatch_data
 The input data needed for a complete layer squashing distortion rendering to a target. More...
 

Functions

static void comp_render_gfx_initial_init (struct comp_render_dispatch_data *data, struct render_gfx_target_resources *rtr, bool fast_path, bool do_timewarp)
 Initialize structure for use of the GFX renderer. More...
 
static void comp_render_gfx_add_view (struct comp_render_dispatch_data *data, const struct xrt_pose *world_pose, const struct xrt_pose *eye_pose, const struct xrt_fov *fov, struct render_gfx_target_resources *rtr, const struct render_viewport_data *layer_viewport_data, const struct xrt_normalized_rect *layer_norm_rect, VkImage image, VkImageView srgb_view, const struct xrt_matrix_2x2 *vertex_rot, const struct render_viewport_data *target_viewport_data)
 Add view to the common data, as required by the GFX renderer. More...
 
void comp_render_gfx_dispatch (struct render_gfx *rr, const struct comp_layer *layers, const uint32_t layer_count, const struct comp_render_dispatch_data *d)
 Writes the needed commands to the render_gfx to do a full composition with distortion. More...
 
static void comp_render_cs_initial_init (struct comp_render_dispatch_data *data, VkImage target_image, VkImageView target_unorm_view, bool fast_path, bool do_timewarp)
 Initialize structure for use of the CS renderer. More...
 
static void comp_render_cs_add_view (struct comp_render_dispatch_data *data, const struct xrt_pose *world_pose, const struct xrt_pose *eye_pose, const struct xrt_fov *fov, const struct render_viewport_data *layer_viewport_data, const struct xrt_normalized_rect *layer_norm_rect, VkImage image, VkImageView srgb_view, VkImageView unorm_view, const struct render_viewport_data *target_viewport_data)
 Add view to the common data, as required by the CS renderer. More...
 
void comp_render_cs_layer (struct render_compute *crc, 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 *crc, 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 *crc, const struct comp_layer *layers, const uint32_t layer_count, const struct comp_render_dispatch_data *d)
 Write commands to crc to do a full composition with distortion. More...
 
Input data structs
static struct comp_render_view_datacomp_render_dispatch_add_view (struct comp_render_dispatch_data *data, const struct xrt_pose *world_pose, const struct xrt_pose *eye_pose, const struct xrt_fov *fov, const struct render_viewport_data *layer_viewport_data, const struct xrt_normalized_rect *layer_norm_rect, VkImage image, VkImageView srgb_view, const struct render_viewport_data *target_viewport_data)
 Shared implementation setting up common view params between GFX and CS. More...
 

Detailed Description

Function Documentation

◆ comp_render_dispatch_add_view()

static struct comp_render_view_data * comp_render_dispatch_add_view ( struct comp_render_dispatch_data data,
const struct xrt_pose world_pose,
const struct xrt_pose eye_pose,
const struct xrt_fov fov,
const struct render_viewport_data layer_viewport_data,
const struct xrt_normalized_rect layer_norm_rect,
VkImage  image,
VkImageView  srgb_view,
const struct render_viewport_data target_viewport_data 
)
inlinestatic

Shared implementation setting up common view params between GFX and CS.

Private implementation method, do not use outside of more-specific add_view calls!

Parameters
dataCommon render dispatch data, will be updated
world_poseNew world pose of this view. Populates comp_render_view_data::world_pose
eye_poseNew eye pose of this view Populates comp_render_view_data::eye_pose
fovAssigned to fov in the view data, and used to compute comp_render_view_data::target_pre_transform Populates comp_render_view_data::fov
layer_viewport_dataWhere in the image to render the view Populates comp_render_view_data::layer_viewport_data
layer_norm_rectHow to transform when sampling from the scratch image. Populates comp_render_view_data::layer_norm_rect
imageScratch image for this view Populates comp_render_view_data::image
srgb_viewSRGB image view into the scratch image Populates comp_render_view_data::srgb_view
target_viewport_dataDistortion target viewport data (aka target) Populates comp_render_view_data::target_viewport_data
Returns
Pointer to the comp_render_view_data we have been populating, for additional setup.