Monado OpenXR Runtime
|
Compositor rendering code. More...
#include "render/render_interface.h"
#include "xrt/xrt_defines.h"
#include "xrt/xrt_frame.h"
#include "xrt/xrt_compositor.h"
#include "xrt/xrt_results.h"
#include "os/os_time.h"
#include "math/m_api.h"
#include "math/m_matrix_2x2.h"
#include "math/m_space.h"
#include "util/u_misc.h"
#include "util/u_trace_marker.h"
#include "util/u_distortion_mesh.h"
#include "util/u_sink.h"
#include "util/u_var.h"
#include "util/u_frame_times_widget.h"
#include "util/comp_render.h"
#include "main/comp_frame.h"
#include "main/comp_mirror_to_debug_gui.h"
#include "vk/vk_helpers.h"
#include "vk/vk_cmd.h"
#include "vk/vk_image_readback_to_xf_pool.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <math.h>
Data Structures | |
struct | comp_renderer |
Holds associated vulkan objects and state to render with a distortion. More... | |
struct | comp_scratch_view_state |
struct | comp_render_scratch_state |
Holds an array of comp_scratch_view_state to match the number of views. More... | |
Macros | |
#define | CHAIN(STRUCT, NEXT) |
#define | WAIT_SEMAPHORE_COUNT 1 |
Enumerations | |
enum | comp_target_fov_source { COMP_TARGET_FOV_SOURCE_DISTORTION , COMP_TARGET_FOV_SOURCE_DEVICE_VIEWS } |
What is the source of the FoV values used for the final image that the compositor produces and is sent to the hardware (or software). More... | |
Functions | |
static void | scratch_get_init (struct comp_render_scratch_state *crss, struct comp_renderer *r, uint32_t view_count) |
Zeroes the object pointed to by crss then populates it with the image indices. More... | |
static void | scratch_get_fini (struct comp_render_scratch_state *crss, struct comp_renderer *r, uint32_t view_count) |
Calls done or discard on each view in crss , depending on whether "used" is set. More... | |
static void | renderer_wait_queue_idle (struct comp_renderer *r) |
static void | calc_viewport_data (struct comp_renderer *r, struct render_viewport_data out_viewport_data[XRT_MAX_VIEWS], size_t view_count) |
static void | calc_vertex_rot_data (struct comp_renderer *r, struct xrt_matrix_2x2 out_vertex_rots[XRT_MAX_VIEWS], size_t view_count) |
static void | calc_pose_data (struct comp_renderer *r, enum comp_target_fov_source fov_source, struct xrt_fov out_fovs[XRT_MAX_VIEWS], struct xrt_pose out_world[XRT_MAX_VIEWS], struct xrt_pose out_eye[XRT_MAX_VIEWS], uint32_t view_count) |
static void | renderer_build_rendering_target_resources (struct comp_renderer *r, struct render_gfx_target_resources *rtr, uint32_t index) |
static void | renderer_create_renderings_and_fences (struct comp_renderer *r) |
static void | renderer_close_renderings_and_fences (struct comp_renderer *r) |
static void | renderer_init (struct comp_renderer *r, struct comp_compositor *c, VkExtent2D scratch_extent) |
Create renderer and initialize non-image-dependent members. More... | |
static void | renderer_wait_for_last_fence (struct comp_renderer *r) |
static XRT_CHECK_RESULT VkResult | renderer_submit_queue (struct comp_renderer *r, VkCommandBuffer cmd, VkPipelineStageFlags pipeline_stage_flag) |
static void | renderer_acquire_swapchain_image (struct comp_renderer *r) |
static void | renderer_resize (struct comp_renderer *r) |
static void | renderer_present_swapchain_image (struct comp_renderer *r, uint64_t desired_present_time_ns, uint64_t present_slop_ns) |
static void | renderer_fini (struct comp_renderer *r) |
static XRT_CHECK_RESULT VkResult | dispatch_graphics (struct comp_renderer *r, struct render_gfx *rr, struct comp_render_scratch_state *crss, enum comp_target_fov_source fov_source) |
static XRT_CHECK_RESULT VkResult | dispatch_compute (struct comp_renderer *r, struct render_compute *crc, struct comp_render_scratch_state *crss, enum comp_target_fov_source fov_source) |
XRT_CHECK_RESULT xrt_result_t | comp_renderer_draw (struct comp_renderer *r) |
struct comp_renderer * | comp_renderer_create (struct comp_compositor *c, VkExtent2D scratch_extent) |
void | comp_renderer_destroy (struct comp_renderer **ptr_r) |
void | comp_renderer_add_debug_vars (struct comp_renderer *self) |
Compositor rendering code.
#define CHAIN | ( | STRUCT, | |
NEXT | |||
) |
What is the source of the FoV values used for the final image that the compositor produces and is sent to the hardware (or software).
Enumerator | |
---|---|
COMP_TARGET_FOV_SOURCE_DISTORTION | The FoV values used for the final target is taken from the distortion information on the xrt_hmd_parts struct. |
COMP_TARGET_FOV_SOURCE_DEVICE_VIEWS | The FoV values used for the final target is taken from the those returned from the device's get_views. |
|
static |
XRT_CHECK_RESULT xrt_result_t comp_renderer_draw | ( | struct comp_renderer * | r | ) |
|
static |
|
static |
|
static |
Referenced by renderer_create_renderings_and_fences().
|
static |
References comp_renderer::buffer_count, comp_renderer::c, comp_compositor::COMP_DEBUG, comp_compositor::COMP_ERROR, comp_renderer::fences, comp_target::format, comp_compositor::nr, comp_compositor::r, render_gfx_render_pass::render_gfx_render_pass_init(), renderer_build_rendering_target_resources(), comp_renderer::rtr_array, comp_compositor::target, comp_renderer::target_render_pass, U_TYPED_ARRAY_CALLOC, and comp_base::vk.
|
static |
Create renderer and initialize non-image-dependent members.
Referenced by comp_renderer::comp_renderer_create().
|
static |
Calls done or discard on each view in crss
, depending on whether "used" is set.
References comp_renderer::c, comp_scratch_single_images::comp_scratch_single_images_discard(), comp_scratch_single_images::comp_scratch_single_images_done(), and comp_compositor::r.
|
static |
Zeroes the object pointed to by crss
then populates it with the image indices.
References comp_renderer::c, comp_scratch_single_images::comp_scratch_single_images_get(), comp_compositor::r, and U_ZERO.