225 data->fast_path = fast_path;
226 data->do_timewarp = do_timewarp;
260 VkImage squash_image,
263 uint32_t i = data->squash_view_count++;
278 view->squash.
image = squash_image;
286 VkImageView squash_as_src_sample_view,
290 uint32_t i = data->target.view_count++;
292 assert(i < data->squash_view_count);
298 view->squash_as_src.
sample_view = squash_as_src_sample_view;
299 view->squash_as_src.
norm_rect = *squash_as_src_norm_rect;
338 data->target.initialized =
true;
341 data->target.gfx.rtr = target_rtr;
374 VkImage squash_image,
385 layer_viewport_data);
388 view->squash.gfx.
rtr = squash_rtr;
393 VkImageView squash_as_src_sample_view,
400 squash_as_src_sample_view,
401 squash_as_src_norm_rect,
402 target_viewport_data);
405 view->target.gfx.
vertex_rot = *target_vertex_rot;
437 uint32_t layer_count,
439 VkImageLayout transition_to);
478 const uint32_t layer_count,
515 data->target.initialized =
true;
518 data->target.cs.image = target_image;
519 data->target.cs.storage_view = target_storage_view;
552 VkImage squash_image,
553 VkImageView squash_storage_view,
563 squash_viewport_data);
571 VkImageView squash_as_src_sample_view,
577 squash_as_src_sample_view,
578 squash_as_src_norm_rect,
579 target_viewport_data);
615 const uint32_t layer_count,
620 const VkImage target_image,
621 const VkImageView target_image_view,
654 const uint32_t layer_count,
656 VkImageLayout transition_to);
692 const uint32_t layer_count,
static struct comp_render_view_data * comp_render_dispatch_add_squash_view(struct comp_render_dispatch_data *data, const struct xrt_pose *world_pose_scanout_begin, const struct xrt_pose *world_pose_scanout_end, const struct xrt_pose *eye_pose, const struct xrt_fov *fov, VkImage squash_image, const struct render_viewport_data *squash_viewport_data)
Shared implementation setting up common view params between GFX and CS.
Definition: comp_render.h:255
static void comp_render_initial_init(struct comp_render_dispatch_data *data, bool fast_path, bool do_timewarp)
Initialize structure for use without the target step.
Definition: comp_render.h:221
#define U_ZERO(PTR)
Zeroes the correct amount of memory based on the type pointed-to by the argument.
Definition: u_misc.h:68
static void comp_render_cs_add_squash_view(struct comp_render_dispatch_data *data, const struct xrt_pose *world_pose_scanout_begin, const struct xrt_pose *world_pose_scanout_end, const struct xrt_pose *eye_pose, const struct xrt_fov *fov, VkImage squash_image, VkImageView squash_storage_view, const struct render_viewport_data *squash_viewport_data)
Add view to the common data, as required by the CS renderer.
Definition: comp_render.h:547
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.
Definition: comp_render_cs.c:699
static void comp_render_cs_add_target(struct comp_render_dispatch_data *data, VkImage target_image, VkImageView target_storage_view)
Add the target info, as required by the CS renderer.
Definition: comp_render.h:512
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_scanout_begin, const struct xrt_pose *world_pose_scanout_end, 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.
Definition: comp_render_cs.c:527
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.
Definition: comp_render_cs.c:747
void comp_render_gfx_dispatch(struct render_gfx *render, 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.
Definition: comp_render_gfx.c:884
void comp_render_gfx_layers(struct render_gfx *render, const struct comp_layer *layers, uint32_t layer_count, const struct comp_render_dispatch_data *d, VkImageLayout transition_to)
Dispatch the (graphics pipeline) layer squasher, on any number of views.
Definition: comp_render_gfx.c:678
static void comp_render_gfx_add_target(struct comp_render_dispatch_data *data, struct render_gfx_target_resources *target_rtr)
Initialize structure for use of the GFX renderer.
Definition: comp_render.h:335
static void comp_render_gfx_add_squash_view(struct comp_render_dispatch_data *data, const struct xrt_pose *world_pose, const struct xrt_pose *eye_pose, const struct xrt_fov *fov, VkImage squash_image, struct render_gfx_target_resources *squash_rtr, const struct render_viewport_data *layer_viewport_data)
Add view to the common data, as required by the GFX renderer.
Definition: comp_render.h:370
void render_calc_uv_to_tangent_lengths_rect(const struct xrt_fov *fov, struct xrt_normalized_rect *out_rect)
This function constructs a transformation in the form of a normalized rect that lets you go from a UV...
Definition: render_util.c:138
The NEW compositor rendering code header.
A single layer in a comp_layer_accum.
Definition: comp_layer_accum.h:36
The input data needed for a complete layer squashing distortion rendering to a target.
Definition: comp_render.h:167
VkImageView storage_view
Target image view for distortion.
Definition: comp_render.h:208
uint32_t view_count
The number of target views currently, when calling dispatch this has to be either zero or the same nu...
Definition: comp_render.h:192
struct render_gfx_target_resources * rtr
The resources needed for the target.
Definition: comp_render.h:198
bool initialized
Has this struct been setup to use the target.
Definition: comp_render.h:185
bool do_timewarp
Very often true, can be disabled for debugging.
Definition: comp_render.h:180
VkImage image
Target image for distortion, used for barrier.
Definition: comp_render.h:205
struct comp_render_dispatch_data::@114::@115 gfx
Members used only by GFX Comp_render_gfx.
struct comp_render_dispatch_data::@114::@116 cs
Members used only by CS Comp_render_cs.
uint32_t squash_view_count
The number of squash views currently in this dispatch data.
Definition: comp_render.h:173
bool fast_path
Fast path can be disabled for mirroing so needs to be an argument.
Definition: comp_render.h:177
The input data needed for a single view, shared between both GFX and CS paths.
Definition: comp_render.h:73
struct xrt_pose world_pose_scanout_begin
New world pose of this view at the beginng of scanout.
Definition: comp_render.h:75
VkImageView storage_view
View into layer image (aka scratch image), for used as a storage tagert of the CS (write) path.
Definition: comp_render.h:121
struct xrt_fov fov
New fov of this view, used for the layer scratch image.
Definition: comp_render.h:87
struct xrt_normalized_rect norm_rect
When sampling from the layer image (aka scratch image), how should we transform it to get to the pixe...
Definition: comp_render.h:134
struct xrt_matrix_2x2 vertex_rot
Distortion target vertex rotation information.
Definition: comp_render.h:155
VkImageView sample_view
View into layer image (aka scratch image) when sampling the image, used for both GFX (read) and CS (r...
Definition: comp_render.h:143
struct render_gfx_target_resources * rtr
Per-view layer target resources.
Definition: comp_render.h:112
struct xrt_pose eye_pose
New eye pose of this view.
Definition: comp_render.h:81
VkImage image
The layer image for this view (aka scratch image), used for barrier operations.
Definition: comp_render.h:101
struct xrt_pose world_pose_scanout_end
New world pose of this view at the end of scanout.
Definition: comp_render.h:78
struct render_viewport_data viewport_data
Pre-view layer target viewport_data (where in the image we should render the view).
Definition: comp_render.h:107
struct xrt_normalized_rect pre_transform
Go from UV to tanangle for both the target and layer image since they share the same fov,...
Definition: comp_render.h:93
The semi-low level resources and operations required to squash layers and/or apply distortion for a s...
Definition: render_interface.h:1172
Each rendering (render_gfx) render to one or more targets (render_gfx_target_resources),...
Definition: render_interface.h:791
The low-level resources and operations to perform layer squashing and/or mesh distortion for a single...
Definition: render_interface.h:854
The pure data information about a view that the renderer is rendering to.
Definition: render_interface.h:693
Describes a projection matrix fov.
Definition: xrt_defines.h:498
A tightly packed 2x2 matrix of floats.
Definition: xrt_defines.h:525
Normalized image rectangle, coordinates and size in 0 .
Definition: xrt_defines.h:466
A pose composed of a position and orientation.
Definition: xrt_defines.h:478
#define ARRAY_SIZE(a)
Array size helper.
Definition: xrt_compiler.h:56
Common defines and enums for XRT.
Include all of the Vulkan headers in one place, and cope with any "messy" includes implied by it.