222 data->fast_path = fast_path;
223 data->do_timewarp = do_timewarp;
256 VkImage squash_image,
259 uint32_t i = data->squash_view_count++;
273 view->squash.
image = squash_image;
281 VkImageView squash_as_src_sample_view,
285 uint32_t i = data->target.view_count++;
287 assert(i < data->squash_view_count);
293 view->squash_as_src.
sample_view = squash_as_src_sample_view;
294 view->squash_as_src.
norm_rect = *squash_as_src_norm_rect;
333 data->target.initialized =
true;
336 data->target.gfx.rtr = target_rtr;
369 VkImage squash_image,
379 layer_viewport_data);
382 view->squash.gfx.
rtr = squash_rtr;
387 VkImageView squash_as_src_sample_view,
394 squash_as_src_sample_view,
395 squash_as_src_norm_rect,
396 target_viewport_data);
399 view->target.gfx.
vertex_rot = *target_vertex_rot;
431 uint32_t layer_count,
433 VkImageLayout transition_to);
472 const uint32_t layer_count,
509 data->target.initialized =
true;
512 data->target.cs.image = target_image;
513 data->target.cs.storage_view = target_storage_view;
543 VkImage squash_image,
544 VkImageView squash_storage_view,
553 squash_viewport_data);
561 VkImageView squash_as_src_sample_view,
567 squash_as_src_sample_view,
568 squash_as_src_norm_rect,
569 target_viewport_data);
605 const uint32_t layer_count,
609 const VkImage target_image,
610 const VkImageView target_image_view,
643 const uint32_t layer_count,
645 VkImageLayout transition_to);
681 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, 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:252
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:218
#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_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:506
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
static void comp_render_cs_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, 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:539
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
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:330
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:365
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:205
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:189
struct render_gfx_target_resources * rtr
The resources needed for the target.
Definition: comp_render.h:195
bool initialized
Has this struct been setup to use the target.
Definition: comp_render.h:182
bool do_timewarp
Very often true, can be disabled for debugging.
Definition: comp_render.h:177
struct comp_render_dispatch_data::@112::@113 gfx
Members used only by GFX Comp_render_gfx.
VkImage image
Target image for distortion, used for barrier.
Definition: comp_render.h:202
uint32_t squash_view_count
The number of squash views currently in this dispatch data.
Definition: comp_render.h:170
bool fast_path
Fast path can be disabled for mirroing so needs to be an argument.
Definition: comp_render.h:174
struct comp_render_dispatch_data::@112::@114 cs
Members used only by CS Comp_render_cs.
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.