KiCad PCB EDA Suite
Loading...
Searching...
No Matches
rhi_control_commands.h
Go to the documentation of this file.
1
/*
2
* This program source code file is part of KiCad, a free EDA CAD application.
3
*
4
* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5
*
6
* This program is free software: you can redistribute it and/or modify it
7
* under the terms of the GNU General Public License as published by the
8
* Free Software Foundation, either version 3 of the License, or (at your
9
* option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License along
17
* with this program. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef RHI_CONTROL_COMMANDS_H
21
#define RHI_CONTROL_COMMANDS_H
22
23
#include <
rhi/rhi_surface.h
>
24
25
#include <cstdint>
26
#include <functional>
27
#include <variant>
28
29
namespace
KIGFX
30
{
31
class
FRAME_MAILBOX
;
32
}
33
34
39
using
RHI_WINDOW_ID
= uint32_t;
40
41
42
struct
RHI_CMD_FRAME_REQUEST
43
{
44
RHI_WINDOW_ID
windowId
= 0;
45
uint64_t
generation
= 0;
46
float
refreshHz
= 0.0f;
47
};
48
49
50
struct
RHI_CMD_SWAPCHAIN_CREATE
51
{
52
RHI_WINDOW_ID
windowId
= 0;
53
RHI_NATIVE_WINDOW_HANDLE
nativeHandle
;
54
uint32_t
width
= 0;
55
uint32_t
height
= 0;
56
float
dpiScale
= 1.0f;
57
59
KIGFX::FRAME_MAILBOX
*
frame2DMailbox
=
nullptr
;
60
};
61
62
63
struct
RHI_CMD_SWAPCHAIN_RESIZE
64
{
65
RHI_WINDOW_ID
windowId
= 0;
66
uint32_t
width
= 0;
67
uint32_t
height
= 0;
68
float
dpiScale
= 1.0f;
69
};
70
71
72
struct
RHI_CMD_SWAPCHAIN_DESTROY
73
{
74
RHI_WINDOW_ID
windowId
= 0;
75
};
76
77
78
struct
RHI_CMD_FENCE
79
{
80
std::function<void()>
onComplete
;
81
83
bool
flushFrames
=
false
;
84
};
85
86
90
using
RHI_CONTROL_COMMAND
= std::variant<
91
RHI_CMD_FRAME_REQUEST
,
92
RHI_CMD_SWAPCHAIN_CREATE
,
93
RHI_CMD_SWAPCHAIN_RESIZE
,
94
RHI_CMD_SWAPCHAIN_DESTROY
,
95
RHI_CMD_FENCE
96
>;
97
98
99
100
#endif
// RHI_CONTROL_COMMANDS_H
KIGFX::FRAME_MAILBOX
Lock-free single-slot mailbox carrying frame state from the main thread to the render thread.
Definition
frame_mailbox.h:39
KIGFX
The Cairo implementation of the graphics abstraction layer.
Definition
eda_group.h:30
RHI_CONTROL_COMMAND
std::variant< RHI_CMD_FRAME_REQUEST, RHI_CMD_SWAPCHAIN_CREATE, RHI_CMD_SWAPCHAIN_RESIZE, RHI_CMD_SWAPCHAIN_DESTROY, RHI_CMD_FENCE > RHI_CONTROL_COMMAND
One entry in the render thread control queue.
Definition
rhi_control_commands.h:90
RHI_WINDOW_ID
uint32_t RHI_WINDOW_ID
Routes control commands to a swapchain.
Definition
rhi_control_commands.h:39
rhi_surface.h
RHI_CMD_FENCE
Definition
rhi_control_commands.h:79
RHI_CMD_FENCE::flushFrames
bool flushFrames
Draw the frames requested before the fence, for a reader of their pixels.
Definition
rhi_control_commands.h:83
RHI_CMD_FENCE::onComplete
std::function< void()> onComplete
Definition
rhi_control_commands.h:80
RHI_CMD_FRAME_REQUEST
Definition
rhi_control_commands.h:43
RHI_CMD_FRAME_REQUEST::windowId
RHI_WINDOW_ID windowId
Definition
rhi_control_commands.h:44
RHI_CMD_FRAME_REQUEST::generation
uint64_t generation
Definition
rhi_control_commands.h:45
RHI_CMD_FRAME_REQUEST::refreshHz
float refreshHz
display refresh rate, 0 when unknown
Definition
rhi_control_commands.h:46
RHI_CMD_SWAPCHAIN_CREATE
Definition
rhi_control_commands.h:51
RHI_CMD_SWAPCHAIN_CREATE::frame2DMailbox
KIGFX::FRAME_MAILBOX * frame2DMailbox
Owned by the panel.
Definition
rhi_control_commands.h:59
RHI_CMD_SWAPCHAIN_CREATE::windowId
RHI_WINDOW_ID windowId
Definition
rhi_control_commands.h:52
RHI_CMD_SWAPCHAIN_CREATE::nativeHandle
RHI_NATIVE_WINDOW_HANDLE nativeHandle
Definition
rhi_control_commands.h:53
RHI_CMD_SWAPCHAIN_CREATE::width
uint32_t width
Definition
rhi_control_commands.h:54
RHI_CMD_SWAPCHAIN_CREATE::dpiScale
float dpiScale
Definition
rhi_control_commands.h:56
RHI_CMD_SWAPCHAIN_CREATE::height
uint32_t height
Definition
rhi_control_commands.h:55
RHI_CMD_SWAPCHAIN_DESTROY
Definition
rhi_control_commands.h:73
RHI_CMD_SWAPCHAIN_DESTROY::windowId
RHI_WINDOW_ID windowId
Definition
rhi_control_commands.h:74
RHI_CMD_SWAPCHAIN_RESIZE
Definition
rhi_control_commands.h:64
RHI_CMD_SWAPCHAIN_RESIZE::width
uint32_t width
Definition
rhi_control_commands.h:66
RHI_CMD_SWAPCHAIN_RESIZE::height
uint32_t height
Definition
rhi_control_commands.h:67
RHI_CMD_SWAPCHAIN_RESIZE::windowId
RHI_WINDOW_ID windowId
Definition
rhi_control_commands.h:65
RHI_CMD_SWAPCHAIN_RESIZE::dpiScale
float dpiScale
Definition
rhi_control_commands.h:68
RHI_NATIVE_WINDOW_HANDLE
Platform-agnostic wrapper for a native window handle.
Definition
rhi_surface.h:45
src
include
rhi
rhi_control_commands.h
Generated on Thu Oct 22 2026 00:06:41 for KiCad PCB EDA Suite by
1.13.2