227 VkImage squash_image,
229 VkImageView squash_as_src_sample_view,
233 uint32_t i = data->view_count++;
247 view->squash.
image = squash_image;
251 view->squash_as_src.
sample_view = squash_as_src_sample_view;
252 view->squash_as_src.
norm_rect = *squash_as_src_norm_rect;
297 data->fast_path = fast_path;
298 data->do_timewarp = do_timewarp;
301 data->target.gfx.rtr = target_rtr;
334 VkImage squash_image,
337 VkImageView squash_as_src_sample_view,
349 squash_as_src_sample_view,
350 squash_as_src_norm_rect,
351 target_viewport_data);
354 view->squash.gfx.
rtr = squash_rtr;
357 view->target.gfx.
vertex_rot = *target_vertex_rot;
389 uint32_t layer_count,
391 VkImageLayout transition_to);
430 const uint32_t layer_count,
467 VkImage target_image,
468 VkImageView target_storage_view,
474 data->fast_path = fast_path;
475 data->do_timewarp = do_timewarp;
478 data->target.cs.image = target_image;
479 data->target.cs.storage_view = target_storage_view;
509 VkImage squash_image,
510 VkImageView squash_storage_view,
512 VkImageView squash_as_src_sample_view,
522 squash_viewport_data,
523 squash_as_src_sample_view,
524 squash_as_src_norm_rect,
525 target_viewport_data);
563 const uint32_t layer_count,
567 const VkImage target_image,
568 const VkImageView target_image_view,
601 const uint32_t layer_count,
603 VkImageLayout transition_to);
639 const uint32_t layer_count,
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, VkImage squash_image, const struct render_viewport_data *squash_viewport_data, VkImageView squash_as_src_sample_view, const struct xrt_normalized_rect *squash_as_src_norm_rect, const struct render_viewport_data *target_viewport_data)
Shared implementation setting up common view params between GFX and CS.
Definition: comp_render.h:223
#define U_ZERO(PTR)
Zeroes the correct amount of memory based on the type pointed-to by the argument.
Definition: u_misc.h:68
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:670
static void comp_render_cs_initial_init(struct comp_render_dispatch_data *data, VkImage target_image, VkImageView target_storage_view, bool fast_path, bool do_timewarp)
Initialize structure for use of the CS renderer.
Definition: comp_render.h:466
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:717
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.
Definition: comp_render_cs.c:499
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, VkImage squash_image, VkImageView squash_storage_view, const struct render_viewport_data *squash_viewport_data, VkImageView squash_as_src_sample_view, const struct xrt_normalized_rect *squash_as_src_norm_rect, const struct render_viewport_data *target_viewport_data)
Add view to the common data, as required by the CS renderer.
Definition: comp_render.h:505
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_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, VkImageView squash_as_src_sample_view, const struct xrt_normalized_rect *squash_as_src_norm_rect, const struct xrt_matrix_2x2 *target_vertex_rot, const struct render_viewport_data *target_viewport_data)
Add view to the common data, as required by the GFX renderer.
Definition: comp_render.h:330
static void comp_render_gfx_initial_init(struct comp_render_dispatch_data *data, struct render_gfx_target_resources *target_rtr, bool fast_path, bool do_timewarp)
Initialize structure for use of the GFX renderer.
Definition: comp_render.h:290
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:127
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:164
VkImageView storage_view
Target image view for distortion.
Definition: comp_render.h:192
uint32_t view_count
The number of views currently in this dispatch data.
Definition: comp_render.h:168
struct render_gfx_target_resources * rtr
The resources needed for the target.
Definition: comp_render.h:182
bool do_timewarp
Very often true, can be disabled for debugging.
Definition: comp_render.h:174
VkImage image
Target image for distortion, used for barrier.
Definition: comp_render.h:189
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.
bool fast_path
Fast path can be disabled for mirroing so needs to be an argument.
Definition: comp_render.h:171
The input data needed for a single view, shared between both GFX and CS paths.
Definition: comp_render.h:73
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:118
struct xrt_fov fov
New fov of this view, used for the layer scratch image.
Definition: comp_render.h:84
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:131
struct xrt_matrix_2x2 vertex_rot
Distortion target vertex rotation information.
Definition: comp_render.h:152
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:140
struct xrt_pose world_pose
New world pose of this view.
Definition: comp_render.h:75
struct render_gfx_target_resources * rtr
Per-view layer target resources.
Definition: comp_render.h:109
struct xrt_pose eye_pose
New eye pose of this view.
Definition: comp_render.h:78
VkImage image
The layer image for this view (aka scratch image), used for barrier operations.
Definition: comp_render.h:98
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:104
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:90
The semi-low level resources and operations required to squash layers and/or apply distortion for a s...
Definition: render_interface.h:1166
Each rendering (render_gfx) render to one or more targets (render_gfx_target_resources),...
Definition: render_interface.h:785
The low-level resources and operations to perform layer squashing and/or mesh distortion for a single...
Definition: render_interface.h:848
The pure data information about a view that the renderer is rendering to.
Definition: render_interface.h:687
Describes a projection matrix fov.
Definition: xrt_defines.h:483
A tightly packed 2x2 matrix of floats.
Definition: xrt_defines.h:510
Normalized image rectangle, coordinates and size in 0 .
Definition: xrt_defines.h:451
A pose composed of a position and orientation.
Definition: xrt_defines.h:463
#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.