Nebula
Loading...
Searching...
No Matches
vkcommandbufferthread.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
9//------------------------------------------------------------------------------
10#include "vkloader.h"
12#include "coregraphics/config.h"
13#include "debug/debugtimer.h"
14
15namespace Vulkan
16{
18{
20
21public:
22
24 {
26 VkCommandBufferBeginInfo info;
27 VkCommandBufferInheritanceInfo inheritInfo;
28 VkCommandBuffer buf;
29 };
30
35
37 {
38 static const CommandType Type = EndCommand;
39 };
40
42 {
44 VkPipeline pipeline;
45 VkPipelineLayout layout;
46#if NEBULA_GRAPHICS_DEBUG
47 const char* name;
48#endif
49 };
50
52 {
54 VkPipeline pipeline;
55 VkPipelineLayout layout;
56#if NEBULA_GRAPHICS_DEBUG
57 const char* name;
58#endif
59 };
60
62 {
64 VkBuffer buffer;
66 VkDeviceSize offset;
67 };
68
70 {
72 VkBuffer buffer;
73 VkDeviceSize offset;
74 VkIndexType indexType;
75 };
76
78 {
79 static const CommandType Type = Draw;
80 uint32_t baseIndex;
81 uint32_t baseVertex;
82 uint32_t numIndices;
83 uint32_t numVerts;
84 uint32_t baseInstance;
85 uint32_t numInstances;
86 };
87
89 {
91 VkBuffer buffer;
92 VkDeviceSize offset;
93 uint32_t drawCount;
94 uint32_t stride;
95 };
96
98 {
100 VkBuffer buffer;
101 VkDeviceSize offset;
102 uint32_t drawCount;
103 uint32_t stride;
104 };
105
107 {
108 static const CommandType Type = Dispatch;
109 uint32_t numGroupsX;
110 uint32_t numGroupsY;
111 uint32_t numGroupsZ;
112 };
113
115 {
117 VkPipelineBindPoint type;
118 uint32_t baseSet;
119 uint32_t numSets;
120 const VkDescriptorSet* sets;
121 uint32_t numOffsets;
122 const uint32_t* offsets;
123 };
124
126 {
127 static const CommandType Type = PushRange;
128 VkShaderStageFlags stages;
129 VkPipelineLayout layout;
130 uint32_t offset;
131 uint32_t size;
132 byte data[512];
133 };
134
136 {
137 static const CommandType Type = Viewport;
138 VkViewport vp;
139 uint32_t index;
140 };
141
143 {
145 VkViewport* vps;
146 uint32_t first;
147 uint32_t num;
148 };
149
151 {
153 VkRect2D sc;
154 uint32_t index;
155 };
156
158 {
160 VkRect2D* scs;
161 uint32_t first;
162 uint32_t num;
163 };
164
166 {
168 uint32_t frontRef, backRef;
169 };
170
172 {
174 uint32_t mask;
175 };
176
178 {
180 uint32_t mask;
181 };
182
184 {
186 VkBuffer buf;
187 VkDeviceSize offset;
188 VkDeviceSize size;
189 const void* data;
190 };
191
193 {
194 static const CommandType Type = SetEvent;
195 VkEvent event;
196 VkPipelineStageFlags stages;
197 };
198
200 {
202 VkEvent event;
203 VkPipelineStageFlags stages;
204 };
205
207 {
209 VkEvent event;
210 uint32_t numEvents;
211 VkPipelineStageFlags signalingStage;
212 VkPipelineStageFlags waitingStage;
214 VkMemoryBarrier* memoryBarriers;
216 VkBufferMemoryBarrier* bufferBarriers;
218 VkImageMemoryBarrier* imageBarriers;
219 };
220
222 {
223 static const CommandType Type = Barrier;
224 VkPipelineStageFlags srcMask;
225 VkPipelineStageFlags dstMask;
226 VkDependencyFlags dep;
228 VkMemoryBarrier* memoryBarriers;
230 VkBufferMemoryBarrier* bufferBarriers;
232 VkImageMemoryBarrier* imageBarriers;
233 };
234
236 {
237 static const CommandType Type = Timestamp;
238 VkPipelineStageFlags flags;
239 VkQueryPool pool;
241 };
242
244 {
246 VkQueryControlFlags flags;
247 VkQueryPool pool;
249 };
250
252 {
253 static const CommandType Type = EndQuery;
254 VkQueryPool pool;
256 };
257
259 {
261 const char* text;
262 float values[4];
263 };
264
266 {
267 static const CommandType Type = EndMarker;
268 };
269
271 {
273 const char* text;
274 float values[4];
275 };
276
280 virtual ~VkCommandBufferThread();
281
283 void DoWork() override;
284private:
285 VkCommandBuffer vkCommandBuffer;
286 VkPipelineLayout vkPipelineLayout;
287
288#if NEBULA_ENABLE_PROFILING
289 _declare_timer(debugTimer);
290#endif
291};
292
293} // namespace Vulkan
A CoreGraphics thread meant to only record draw commands to command buffers.
Definition drawthread.h:18
CommandType
Definition drawthread.h:25
@ StencilWriteMask
Definition drawthread.h:45
@ ViewportArray
Definition drawthread.h:40
@ ScissorRect
Definition drawthread.h:41
@ Draw
Definition drawthread.h:33
@ GraphicsPipeline
Definition drawthread.h:29
@ Viewport
Definition drawthread.h:39
@ Dispatch
Definition drawthread.h:36
@ BindDescriptors
Definition drawthread.h:37
@ EndCommand
Definition drawthread.h:28
@ WaitForEvent
Definition drawthread.h:49
@ InputAssemblyIndex
Definition drawthread.h:32
@ SetEvent
Definition drawthread.h:47
@ Barrier
Definition drawthread.h:50
@ InsertMarker
Definition drawthread.h:57
@ ComputePipeline
Definition drawthread.h:30
@ StencilRefs
Definition drawthread.h:43
@ BeginMarker
Definition drawthread.h:55
@ PushRange
Definition drawthread.h:38
@ ResetCommand
Definition drawthread.h:27
@ ScissorRectArray
Definition drawthread.h:42
@ IndirectIndexedDraw
Definition drawthread.h:35
@ BeginQuery
Definition drawthread.h:53
@ StencilReadMask
Definition drawthread.h:44
@ BeginCommand
Definition drawthread.h:26
@ UpdateBuffer
Definition drawthread.h:46
@ EndMarker
Definition drawthread.h:56
@ ResetEvent
Definition drawthread.h:48
@ EndQuery
Definition drawthread.h:54
@ InputAssemblyVertex
Definition drawthread.h:31
@ Timestamp
Definition drawthread.h:52
@ IndirectDraw
Definition drawthread.h:34
Definition vkcommandbufferthread.h:18
VkPipelineLayout vkPipelineLayout
Definition vkcommandbufferthread.h:286
__DeclareClass(VkCommandBufferThread)
VkCommandBuffer vkCommandBuffer
Definition vkcommandbufferthread.h:285
virtual ~VkCommandBufferThread()
destructor
Definition vkcommandbufferthread.cc:42
void DoWork() override
this method runs in the thread context
Definition vkcommandbufferthread.cc:51
VkCommandBufferThread()
constructor
Definition vkcommandbufferthread.cc:33
#define _declare_timer(timer)
Definition debugtimer.h:35
Vulkan implementation of GPU acceleration structure.
Definition vkaccelerationstructure.cc:15
Compile time configuration options for the CoreGraphics subsystem.
Definition vkcommandbufferthread.h:222
VkBufferMemoryBarrier * bufferBarriers
Definition vkcommandbufferthread.h:230
VkImageMemoryBarrier * imageBarriers
Definition vkcommandbufferthread.h:232
uint32_t imageBarrierCount
Definition vkcommandbufferthread.h:231
static const CommandType Type
Definition vkcommandbufferthread.h:223
VkDependencyFlags dep
Definition vkcommandbufferthread.h:226
VkPipelineStageFlags dstMask
Definition vkcommandbufferthread.h:225
VkPipelineStageFlags srcMask
Definition vkcommandbufferthread.h:224
uint32_t memoryBarrierCount
Definition vkcommandbufferthread.h:227
uint32_t bufferBarrierCount
Definition vkcommandbufferthread.h:229
VkMemoryBarrier * memoryBarriers
Definition vkcommandbufferthread.h:228
Definition vkcommandbufferthread.h:259
float values[4]
Definition vkcommandbufferthread.h:262
const char * text
Definition vkcommandbufferthread.h:261
static const CommandType Type
Definition vkcommandbufferthread.h:260
Definition vkcommandbufferthread.h:244
IndexT index
Definition vkcommandbufferthread.h:248
VkQueryPool pool
Definition vkcommandbufferthread.h:247
VkQueryControlFlags flags
Definition vkcommandbufferthread.h:246
static const CommandType Type
Definition vkcommandbufferthread.h:245
VkCommandBuffer buf
Definition vkcommandbufferthread.h:28
static const CommandType Type
Definition vkcommandbufferthread.h:25
VkCommandBufferBeginInfo info
Definition vkcommandbufferthread.h:26
VkCommandBufferInheritanceInfo inheritInfo
Definition vkcommandbufferthread.h:27
static const CommandType Type
Definition vkcommandbufferthread.h:38
static const CommandType Type
Definition vkcommandbufferthread.h:33
VkPipelineLayout layout
Definition vkcommandbufferthread.h:55
VkPipeline pipeline
Definition vkcommandbufferthread.h:54
static const CommandType Type
Definition vkcommandbufferthread.h:53
Definition vkcommandbufferthread.h:115
uint32_t numSets
Definition vkcommandbufferthread.h:119
uint32_t baseSet
Definition vkcommandbufferthread.h:118
const VkDescriptorSet * sets
Definition vkcommandbufferthread.h:120
uint32_t numOffsets
Definition vkcommandbufferthread.h:121
VkPipelineBindPoint type
Definition vkcommandbufferthread.h:117
const uint32_t * offsets
Definition vkcommandbufferthread.h:122
static const CommandType Type
Definition vkcommandbufferthread.h:116
Definition vkcommandbufferthread.h:107
uint32_t numGroupsY
Definition vkcommandbufferthread.h:110
static const CommandType Type
Definition vkcommandbufferthread.h:108
uint32_t numGroupsZ
Definition vkcommandbufferthread.h:111
uint32_t numGroupsX
Definition vkcommandbufferthread.h:109
Definition vkcommandbufferthread.h:78
uint32_t numInstances
Definition vkcommandbufferthread.h:85
uint32_t numIndices
Definition vkcommandbufferthread.h:82
static const CommandType Type
Definition vkcommandbufferthread.h:79
uint32_t numVerts
Definition vkcommandbufferthread.h:83
uint32_t baseVertex
Definition vkcommandbufferthread.h:81
uint32_t baseIndex
Definition vkcommandbufferthread.h:80
uint32_t baseInstance
Definition vkcommandbufferthread.h:84
Definition vkcommandbufferthread.h:266
static const CommandType Type
Definition vkcommandbufferthread.h:267
Definition vkcommandbufferthread.h:252
IndexT index
Definition vkcommandbufferthread.h:255
static const CommandType Type
Definition vkcommandbufferthread.h:253
VkQueryPool pool
Definition vkcommandbufferthread.h:254
Definition vkcommandbufferthread.h:42
VkPipelineLayout layout
Definition vkcommandbufferthread.h:45
static const CommandType Type
Definition vkcommandbufferthread.h:43
VkPipeline pipeline
Definition vkcommandbufferthread.h:44
Definition vkcommandbufferthread.h:70
VkDeviceSize offset
Definition vkcommandbufferthread.h:73
static const CommandType Type
Definition vkcommandbufferthread.h:71
VkBuffer buffer
Definition vkcommandbufferthread.h:72
VkIndexType indexType
Definition vkcommandbufferthread.h:74
Definition vkcommandbufferthread.h:89
static const CommandType Type
Definition vkcommandbufferthread.h:90
VkBuffer buffer
Definition vkcommandbufferthread.h:91
VkDeviceSize offset
Definition vkcommandbufferthread.h:92
uint32_t drawCount
Definition vkcommandbufferthread.h:93
uint32_t stride
Definition vkcommandbufferthread.h:94
uint32_t stride
Definition vkcommandbufferthread.h:103
VkBuffer buffer
Definition vkcommandbufferthread.h:100
VkDeviceSize offset
Definition vkcommandbufferthread.h:101
static const CommandType Type
Definition vkcommandbufferthread.h:99
uint32_t drawCount
Definition vkcommandbufferthread.h:102
Definition vkcommandbufferthread.h:271
static const CommandType Type
Definition vkcommandbufferthread.h:272
float values[4]
Definition vkcommandbufferthread.h:274
const char * text
Definition vkcommandbufferthread.h:273
Definition vkcommandbufferthread.h:126
byte data[512]
Definition vkcommandbufferthread.h:132
static const CommandType Type
Definition vkcommandbufferthread.h:127
VkShaderStageFlags stages
Definition vkcommandbufferthread.h:128
VkPipelineLayout layout
Definition vkcommandbufferthread.h:129
uint32_t offset
Definition vkcommandbufferthread.h:130
uint32_t size
Definition vkcommandbufferthread.h:131
Definition vkcommandbufferthread.h:200
VkEvent event
Definition vkcommandbufferthread.h:202
VkPipelineStageFlags stages
Definition vkcommandbufferthread.h:203
static const CommandType Type
Definition vkcommandbufferthread.h:201
Definition vkcommandbufferthread.h:158
uint32_t num
Definition vkcommandbufferthread.h:162
uint32_t first
Definition vkcommandbufferthread.h:161
VkRect2D * scs
Definition vkcommandbufferthread.h:160
static const CommandType Type
Definition vkcommandbufferthread.h:159
Definition vkcommandbufferthread.h:151
uint32_t index
Definition vkcommandbufferthread.h:154
VkRect2D sc
Definition vkcommandbufferthread.h:153
static const CommandType Type
Definition vkcommandbufferthread.h:152
Definition vkcommandbufferthread.h:193
VkEvent event
Definition vkcommandbufferthread.h:195
VkPipelineStageFlags stages
Definition vkcommandbufferthread.h:196
static const CommandType Type
Definition vkcommandbufferthread.h:194
Definition vkcommandbufferthread.h:172
uint32_t mask
Definition vkcommandbufferthread.h:174
static const CommandType Type
Definition vkcommandbufferthread.h:173
Definition vkcommandbufferthread.h:166
uint32_t backRef
Definition vkcommandbufferthread.h:168
uint32_t frontRef
Definition vkcommandbufferthread.h:168
static const CommandType Type
Definition vkcommandbufferthread.h:167
Definition vkcommandbufferthread.h:178
uint32_t mask
Definition vkcommandbufferthread.h:180
static const CommandType Type
Definition vkcommandbufferthread.h:179
Definition vkcommandbufferthread.h:184
VkBuffer buf
Definition vkcommandbufferthread.h:186
VkDeviceSize size
Definition vkcommandbufferthread.h:188
VkDeviceSize offset
Definition vkcommandbufferthread.h:187
static const CommandType Type
Definition vkcommandbufferthread.h:185
const void * data
Definition vkcommandbufferthread.h:189
Definition vkcommandbufferthread.h:62
VkDeviceSize offset
Definition vkcommandbufferthread.h:66
VkBuffer buffer
Definition vkcommandbufferthread.h:64
IndexT index
Definition vkcommandbufferthread.h:65
static const CommandType Type
Definition vkcommandbufferthread.h:63
Definition vkcommandbufferthread.h:143
VkViewport * vps
Definition vkcommandbufferthread.h:145
uint32_t first
Definition vkcommandbufferthread.h:146
static const CommandType Type
Definition vkcommandbufferthread.h:144
uint32_t num
Definition vkcommandbufferthread.h:147
Definition vkcommandbufferthread.h:136
uint32_t index
Definition vkcommandbufferthread.h:139
VkViewport vp
Definition vkcommandbufferthread.h:138
static const CommandType Type
Definition vkcommandbufferthread.h:137
Definition vkcommandbufferthread.h:207
uint32_t bufferBarrierCount
Definition vkcommandbufferthread.h:215
VkEvent event
Definition vkcommandbufferthread.h:209
VkBufferMemoryBarrier * bufferBarriers
Definition vkcommandbufferthread.h:216
uint32_t memoryBarrierCount
Definition vkcommandbufferthread.h:213
VkMemoryBarrier * memoryBarriers
Definition vkcommandbufferthread.h:214
uint32_t imageBarrierCount
Definition vkcommandbufferthread.h:217
VkPipelineStageFlags signalingStage
Definition vkcommandbufferthread.h:211
VkImageMemoryBarrier * imageBarriers
Definition vkcommandbufferthread.h:218
VkPipelineStageFlags waitingStage
Definition vkcommandbufferthread.h:212
static const CommandType Type
Definition vkcommandbufferthread.h:208
uint32_t numEvents
Definition vkcommandbufferthread.h:210
Definition vkcommandbufferthread.h:236
static const CommandType Type
Definition vkcommandbufferthread.h:237
VkQueryPool pool
Definition vkcommandbufferthread.h:239
IndexT index
Definition vkcommandbufferthread.h:240
VkPipelineStageFlags flags
Definition vkcommandbufferthread.h:238
int IndexT
Definition types.h:48