Monado OpenXR Runtime
|
GFX renderer control and dispatch - uses graphics shaders. 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_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. More... | |
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. More... | |
GFX renderer control and dispatch - uses graphics shaders.
Depends on the common comp_render_dispatch_data, as well as the resources render_gfx_target_resources (often called rtr
), and render_gfx.
|
inlinestatic |
#include <compositor/util/comp_render.h>
Add view to the common data, as required by the GFX renderer.
[in,out] | data | Common render dispatch data, will be updated |
world_pose | New world pose of this view. Populates comp_render_view_data::world_pose | |
eye_pose | New eye pose of this view Populates comp_render_view_data::eye_pose | |
fov | Assigned to fov in the view data, and used to compute comp_render_view_data::target_pre_transform - also populates comp_render_view_data::fov | |
rtr | Will be associated with this view. GFX-specific | |
layer_viewport_data | Where in the image to render the view Populates comp_render_view_data::layer_viewport_data | |
layer_norm_rect | How to transform when sampling from the scratch image. Populates comp_render_view_data::layer_norm_rect | |
image | Scratch image for this view Populates comp_render_view_data::image | |
srgb_view | SRGB image view into the scratch image Populates comp_render_view_data::srgb_view | |
vertex_rot | ||
target_viewport_data | Distortion target viewport data (aka target) Populates comp_render_view_data::target_viewport_data |
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 | ||
) |
#include <compositor/util/comp_render.h>
Writes the needed commands to the render_gfx to do a full composition with distortion.
Takes a set of layers, new device poses, scratch images with associated render_gfx_target_resources and writes the needed commands to the render_gfx to do a full composition with distortion. The scratch images are optionally used to squash layers should it not be possible to do a comp_render_dispatch_data::fast_path
. Will use the render passes of the targets which set the layout.
The render passes of comp_render_dispatch_data::views::rtr
must be created with a final_layout of VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL
or there will be validation errors.
Expected layouts:
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
After call layouts:
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
rtr
specifies.layers
must implement comp_swapchain in addition to just xrt_swapchain, as this function downcasts to comp_swapchain !render | GFX render object | |
[in] | layers | Layers to render, see note. |
[in] | layer_count | Number of elements in layers array. |
[in] | d | Common render dispatch data |
References comp_layer::data, comp_render_dispatch_data::fast_path, and xrt_layer_data::type.
|
inlinestatic |
#include <compositor/util/comp_render.h>
Initialize structure for use of the GFX renderer.
[out] | data | Common render dispatch data. Will be zeroed and initialized. |
rtr | GFX-specific resources for the entire frameedg. Must be populated before call. | |
fast_path | Whether we will use the "fast path" avoiding layer squashing. | |
do_timewarp | Whether timewarp (reprojection) will be performed. |
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 | ||
) |
#include <compositor/util/comp_render.h>
Dispatch the (graphics pipeline) layer squasher, on any number of views.
All source layer images needs to be in the correct image layout, no barrier is inserted for them. The target images are barriered from undefined to general so they can be written to, then to the layout defined by transition_to
.
Expected layouts:
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
After call layouts:
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL
transition_to
layers
must implement comp_swapchain in addition to just xrt_swapchain, as this function downcasts to comp_swapchain !render | Graphics renderer object | |
[in] | layers | Layers to render, see note. |
[in] | layer_count | Number of elements in layers array. |
[in] | d | Common render dispatch data |
[in] | transition_to | Desired image layout for target images |