Monado OpenXR Runtime
comp_frame.h
Go to the documentation of this file.
1// Copyright 2022-2023, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Small helper functions to manage frames.
6 * @author Jakob Bornecrantz <jakob@collabora.com>
7 * @ingroup comp_main
8 */
9
10#pragma once
11
13
14
15/*!
16 * Is this frame invalid.
17 */
18static inline bool
20{
21 return f->id == -1;
22}
23
24/*!
25 * Clear a slot, need to be externally synchronized.
26 */
27static inline void
29{
30 U_ZERO(slot);
31 slot->id = -1;
32}
33
34/*!
35 * Move a frame into a cleared frame, need to be externally synchronized.
36 */
37static inline void
39{
41
42 // Copy data.
43 *dst = *src;
44
45 U_ZERO(src);
46 src->id = -1;
47}
48
49/*!
50 * Move a frame, clear src, need to be externally synchronized.
51 */
52static inline void
54{
57}
Main compositor written using Vulkan header.
static bool comp_frame_is_invalid_locked(struct comp_frame *f)
Is this frame invalid.
Definition: comp_frame.h:19
static void comp_frame_move_and_clear_locked(struct comp_frame *dst, struct comp_frame *src)
Move a frame, clear src, need to be externally synchronized.
Definition: comp_frame.h:53
static void comp_frame_move_into_cleared(struct comp_frame *dst, struct comp_frame *src)
Move a frame into a cleared frame, need to be externally synchronized.
Definition: comp_frame.h:38
static void comp_frame_clear_locked(struct comp_frame *slot)
Clear a slot, need to be externally synchronized.
Definition: comp_frame.h:28
#define U_ZERO(PTR)
Zeroes the correct amount of memory based on the type pointed-to by the argument.
Definition: u_misc.h:68
Tracking frame state.
Definition: comp_compositor.h:69