Monado OpenXR Runtime
comp_renderer.h
Go to the documentation of this file.
1// Copyright 2019-2023, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Compositor rendering code header.
6 * @author Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
7 * @author Jakob Bornecrantz <jakob@collabora.com>
8 * @ingroup comp_main
9 */
10
11#pragma once
12
13#include "xrt/xrt_compiler.h"
14#include "xrt/xrt_defines.h"
16
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22
23struct comp_compositor;
25/*!
26 * @brief Renderer used by compositor.
27 */
28struct comp_renderer;
29
30/*!
31 * Called by the main compositor code to create the renderer.
32 *
33 * @param c Owning compositor.
34 * @param scratch_extent Size for scratch image used when squashing layers.
35 *
36 * @public @memberof comp_renderer
37 * @see comp_compositor
38 * @ingroup comp_main
39 */
40struct comp_renderer *
41comp_renderer_create(struct comp_compositor *c, VkExtent2D scratch_extent);
42
43/*!
44 * Clean up and free the renderer.
45 *
46 * Does null checking and sets to null after freeing.
47 *
48 * @public @memberof comp_renderer
49 * @ingroup comp_main
50 */
51void
53
54/*!
55 * Render frame.
56 *
57 * @public @memberof comp_renderer
58 * @ingroup comp_main
59 */
60XRT_CHECK_RESULT xrt_result_t
62
63void
64comp_renderer_add_debug_vars(struct comp_renderer *self);
65
66#ifdef __cplusplus
67}
68#endif
struct comp_renderer * comp_renderer_create(struct comp_compositor *c, VkExtent2D scratch_extent)
Called by the main compositor code to create the renderer.
Definition: comp_renderer.c:1286
void comp_renderer_destroy(struct comp_renderer **ptr_r)
Clean up and free the renderer.
Definition: comp_renderer.c:1296
XRT_CHECK_RESULT xrt_result_t comp_renderer_draw(struct comp_renderer *r)
Render frame.
Definition: comp_renderer.c:1085
enum xrt_result xrt_result_t
Result type used across Monado.
Main compositor struct tying everything in the compositor together.
Definition: comp_compositor.h:89
Holds associated vulkan objects and state to render with a distortion.
Definition: comp_renderer.c:97
struct comp_compositor * c
The compositor we were created by.
Definition: comp_renderer.c:103
A single swapchain image, holds the needed state for tracking image usage.
Definition: comp_swapchain.h:58
Header holding common defines.
Common defines and enums for XRT.
Include all of the Vulkan headers in one place, and cope with any "messy" includes implied by it.