1e5c31af7Sopenharmony_ci// Copyright 2015-2021 The Khronos Group, Inc.
2e5c31af7Sopenharmony_ci//
3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0
4e5c31af7Sopenharmony_ci
5e5c31af7Sopenharmony_ci[[commandbuffers]]
6e5c31af7Sopenharmony_ci= Command Buffers
7e5c31af7Sopenharmony_ci
8e5c31af7Sopenharmony_ci[open,refpage='VkCommandBuffer',desc='Opaque handle to a command buffer object',type='handles']
9e5c31af7Sopenharmony_ci--
10e5c31af7Sopenharmony_ciCommand buffers are objects used to record commands which can: be
11e5c31af7Sopenharmony_cisubsequently submitted to a device queue for execution.
12e5c31af7Sopenharmony_ciThere are two levels of command buffers - _primary command buffers_, which
13e5c31af7Sopenharmony_cican: execute secondary command buffers, and which are submitted to queues,
14e5c31af7Sopenharmony_ciand _secondary command buffers_, which can: be executed by primary command
15e5c31af7Sopenharmony_cibuffers, and which are not directly submitted to queues.
16e5c31af7Sopenharmony_ci
17e5c31af7Sopenharmony_ciCommand buffers are represented by sname:VkCommandBuffer handles:
18e5c31af7Sopenharmony_ci
19e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkCommandBuffer.txt[]
20e5c31af7Sopenharmony_ci--
21e5c31af7Sopenharmony_ci
22e5c31af7Sopenharmony_ciRecorded commands include commands to bind pipelines and descriptor sets to
23e5c31af7Sopenharmony_cithe command buffer, commands to modify dynamic state, commands to draw (for
24e5c31af7Sopenharmony_cigraphics rendering), commands to dispatch (for compute), commands to execute
25e5c31af7Sopenharmony_cisecondary command buffers (for primary command buffers only), commands to
26e5c31af7Sopenharmony_cicopy buffers and images, and other commands.
27e5c31af7Sopenharmony_ci
28e5c31af7Sopenharmony_ci[[commandbuffers-statereset]]
29e5c31af7Sopenharmony_ciEach command buffer manages state independently of other command buffers.
30e5c31af7Sopenharmony_ciThere is no inheritance of state across primary and secondary command
31e5c31af7Sopenharmony_cibuffers, or between secondary command buffers.
32e5c31af7Sopenharmony_ciWhen a command buffer begins recording, all state in that command buffer is
33e5c31af7Sopenharmony_ciundefined:.
34e5c31af7Sopenharmony_ciWhen secondary command buffer(s) are recorded to execute on a primary
35e5c31af7Sopenharmony_cicommand buffer, the secondary command buffer inherits no state from the
36e5c31af7Sopenharmony_ciprimary command buffer, and all state of the primary command buffer is
37e5c31af7Sopenharmony_ciundefined: after an execute secondary command buffer command is recorded.
38e5c31af7Sopenharmony_ciThere is one exception to this rule - if the primary command buffer is
39e5c31af7Sopenharmony_ciinside a render pass instance, then the render pass and subpass state is not
40e5c31af7Sopenharmony_cidisturbed by executing secondary command buffers.
41e5c31af7Sopenharmony_ciFor state dependent commands (such as draws and dispatches), any state
42e5c31af7Sopenharmony_ciconsumed by those commands must: not be undefined:.
43e5c31af7Sopenharmony_ci
44e5c31af7Sopenharmony_ciifdef::VK_NV_inherited_viewport_scissor[]
45e5c31af7Sopenharmony_cislink:VkCommandBufferInheritanceViewportScissorInfoNV defines an exception
46e5c31af7Sopenharmony_ciallowing limited inheritance of dynamic viewport and scissor state.
47e5c31af7Sopenharmony_ciendif::VK_NV_inherited_viewport_scissor[]
48e5c31af7Sopenharmony_ci
49e5c31af7Sopenharmony_ciUnless otherwise specified, and without explicit synchronization, the
50e5c31af7Sopenharmony_civarious commands submitted to a queue via command buffers may: execute in
51e5c31af7Sopenharmony_ciarbitrary order relative to each other, and/or concurrently.
52e5c31af7Sopenharmony_ciAlso, the memory side effects of those commands may: not be directly visible
53e5c31af7Sopenharmony_cito other commands without explicit memory dependencies.
54e5c31af7Sopenharmony_ciThis is true within a command buffer, and across command buffers submitted
55e5c31af7Sopenharmony_cito a given queue.
56e5c31af7Sopenharmony_ciSee <<synchronization, the synchronization chapter>> for information on
57e5c31af7Sopenharmony_ci<<synchronization-implicit, implicit>> and explicit synchronization between
58e5c31af7Sopenharmony_cicommands.
59e5c31af7Sopenharmony_ci
60e5c31af7Sopenharmony_ci
61e5c31af7Sopenharmony_ci[[commandbuffers-lifecycle]]
62e5c31af7Sopenharmony_ci== Command Buffer Lifecycle
63e5c31af7Sopenharmony_ci
64e5c31af7Sopenharmony_ciEach command buffer is always in one of the following states:
65e5c31af7Sopenharmony_ci
66e5c31af7Sopenharmony_ciInitial::
67e5c31af7Sopenharmony_ci    When a command buffer is <<vkAllocateCommandBuffers, allocated>>, it is
68e5c31af7Sopenharmony_ci    in the _initial state_.
69e5c31af7Sopenharmony_ci    Some commands are able to _reset_ a command buffer (or a set of command
70e5c31af7Sopenharmony_ci    buffers) back to this state from any of the executable, recording or
71e5c31af7Sopenharmony_ci    invalid state.
72e5c31af7Sopenharmony_ci    Command buffers in the initial state can: only be moved to the recording
73e5c31af7Sopenharmony_ci    state, or freed.
74e5c31af7Sopenharmony_ciRecording::
75e5c31af7Sopenharmony_ci    flink:vkBeginCommandBuffer changes the state of a command buffer from
76e5c31af7Sopenharmony_ci    the initial state to the _recording state_.
77e5c31af7Sopenharmony_ci    Once a command buffer is in the recording state, ftext:vkCmd* commands
78e5c31af7Sopenharmony_ci    can: be used to record to the command buffer.
79e5c31af7Sopenharmony_ciExecutable::
80e5c31af7Sopenharmony_ci    flink:vkEndCommandBuffer ends the recording of a command buffer, and
81e5c31af7Sopenharmony_ci    moves it from the recording state to the _executable state_.
82e5c31af7Sopenharmony_ci    Executable command buffers can: be <<commandbuffers-submission,
83e5c31af7Sopenharmony_ci    submitted>>, reset, or <<commandbuffers-secondary, recorded to another
84e5c31af7Sopenharmony_ci    command buffer>>.
85e5c31af7Sopenharmony_ciPending::
86e5c31af7Sopenharmony_ci    <<commandbuffers-submission, Queue submission>> of a command buffer
87e5c31af7Sopenharmony_ci    changes the state of a command buffer from the executable state to the
88e5c31af7Sopenharmony_ci    _pending state_.
89e5c31af7Sopenharmony_ci    Whilst in the pending state, applications must: not attempt to modify
90e5c31af7Sopenharmony_ci    the command buffer in any way - as the device may: be processing the
91e5c31af7Sopenharmony_ci    commands recorded to it.
92e5c31af7Sopenharmony_ci    Once execution of a command buffer completes, the command buffer either
93e5c31af7Sopenharmony_ci    reverts back to the _executable state_, or if it was recorded with
94e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT, it moves to the
95e5c31af7Sopenharmony_ci    _invalid state_.
96e5c31af7Sopenharmony_ci    A <<synchronization, synchronization>> command should: be used to detect
97e5c31af7Sopenharmony_ci    when this occurs.
98e5c31af7Sopenharmony_ciInvalid::
99e5c31af7Sopenharmony_ci    Some operations, such as <<fundamentals-objectmodel-lifetime-cmdbuffers,
100e5c31af7Sopenharmony_ci    modifying or deleting a resource>> that was used in a command recorded
101e5c31af7Sopenharmony_ci    to a command buffer, will transition the state of that command buffer
102e5c31af7Sopenharmony_ci    into the _invalid state_.
103e5c31af7Sopenharmony_ci    Command buffers in the invalid state can: only be reset or freed.
104e5c31af7Sopenharmony_ci
105e5c31af7Sopenharmony_ci[[commandbuffer-lifecycle-diagram]]
106e5c31af7Sopenharmony_ciimage::{images}/commandbuffer_lifecycle.svg[title="Lifecycle of a command buffer",align="center",opts="{imageopts}"]
107e5c31af7Sopenharmony_ci
108e5c31af7Sopenharmony_ciAny given command that operates on a command buffer has its own requirements
109e5c31af7Sopenharmony_cion what state a command buffer must: be in, which are detailed in the valid
110e5c31af7Sopenharmony_ciusage constraints for that command.
111e5c31af7Sopenharmony_ci
112e5c31af7Sopenharmony_ciResetting a command buffer is an operation that discards any previously
113e5c31af7Sopenharmony_cirecorded commands and puts a command buffer in the _initial state_.
114e5c31af7Sopenharmony_ciResetting occurs as a result of flink:vkResetCommandBuffer or
115e5c31af7Sopenharmony_ciflink:vkResetCommandPool, or as part of flink:vkBeginCommandBuffer (which
116e5c31af7Sopenharmony_ciadditionally puts the command buffer in the _recording state_).
117e5c31af7Sopenharmony_ci
118e5c31af7Sopenharmony_ci<<commandbuffers-secondary, Secondary command buffers>> can: be recorded to
119e5c31af7Sopenharmony_cia primary command buffer via flink:vkCmdExecuteCommands.
120e5c31af7Sopenharmony_ciThis partially ties the lifecycle of the two command buffers together - if
121e5c31af7Sopenharmony_cithe primary is submitted to a queue, both the primary and any secondaries
122e5c31af7Sopenharmony_cirecorded to it move to the _pending state_.
123e5c31af7Sopenharmony_ciOnce execution of the primary completes, so it does for any secondary
124e5c31af7Sopenharmony_cirecorded within it.
125e5c31af7Sopenharmony_ciAfter all executions of each command buffer complete, they each move to
126e5c31af7Sopenharmony_citheir appropriate completion state (either to the _executable state_ or the
127e5c31af7Sopenharmony_ci_invalid state_, as specified above).
128e5c31af7Sopenharmony_ci
129e5c31af7Sopenharmony_ciIf a secondary moves to the _invalid state_ or the _initial state_, then all
130e5c31af7Sopenharmony_ciprimary buffers it is recorded in move to the _invalid state_.
131e5c31af7Sopenharmony_ciA primary moving to any other state does not affect the state of a secondary
132e5c31af7Sopenharmony_cirecorded in it.
133e5c31af7Sopenharmony_ci
134e5c31af7Sopenharmony_ci[NOTE]
135e5c31af7Sopenharmony_ci.Note
136e5c31af7Sopenharmony_ci====
137e5c31af7Sopenharmony_ciResetting or freeing a primary command buffer removes the lifecycle linkage
138e5c31af7Sopenharmony_cito all secondary command buffers that were recorded into it.
139e5c31af7Sopenharmony_ci====
140e5c31af7Sopenharmony_ci
141e5c31af7Sopenharmony_ci
142e5c31af7Sopenharmony_ci[[commandbuffers-pools]]
143e5c31af7Sopenharmony_ci== Command Pools
144e5c31af7Sopenharmony_ci
145e5c31af7Sopenharmony_ci[open,refpage='VkCommandPool',desc='Opaque handle to a command pool object',type='handles']
146e5c31af7Sopenharmony_ci--
147e5c31af7Sopenharmony_ciCommand pools are opaque objects that command buffer memory is allocated
148e5c31af7Sopenharmony_cifrom, and which allow the implementation to amortize the cost of resource
149e5c31af7Sopenharmony_cicreation across multiple command buffers.
150e5c31af7Sopenharmony_ciCommand pools are externally synchronized, meaning that a command pool must:
151e5c31af7Sopenharmony_cinot be used concurrently in multiple threads.
152e5c31af7Sopenharmony_ciThat includes use via recording commands on any command buffers allocated
153e5c31af7Sopenharmony_cifrom the pool, as well as operations that allocate, free, and reset command
154e5c31af7Sopenharmony_cibuffers or the pool itself.
155e5c31af7Sopenharmony_ci
156e5c31af7Sopenharmony_ciCommand pools are represented by sname:VkCommandPool handles:
157e5c31af7Sopenharmony_ci
158e5c31af7Sopenharmony_ciinclude::{generated}/api/handles/VkCommandPool.txt[]
159e5c31af7Sopenharmony_ci--
160e5c31af7Sopenharmony_ci
161e5c31af7Sopenharmony_ci[open,refpage='vkCreateCommandPool',desc='Create a new command pool object',type='protos']
162e5c31af7Sopenharmony_ci--
163e5c31af7Sopenharmony_ciTo create a command pool, call:
164e5c31af7Sopenharmony_ci
165e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCreateCommandPool.txt[]
166e5c31af7Sopenharmony_ci
167e5c31af7Sopenharmony_ci  * pname:device is the logical device that creates the command pool.
168e5c31af7Sopenharmony_ci  * pname:pCreateInfo is a pointer to a slink:VkCommandPoolCreateInfo
169e5c31af7Sopenharmony_ci    structure specifying the state of the command pool object.
170e5c31af7Sopenharmony_ci  * pname:pAllocator controls host memory allocation as described in the
171e5c31af7Sopenharmony_ci    <<memory-allocation, Memory Allocation>> chapter.
172e5c31af7Sopenharmony_ci  * pname:pCommandPool is a pointer to a slink:VkCommandPool handle in which
173e5c31af7Sopenharmony_ci    the created pool is returned.
174e5c31af7Sopenharmony_ci
175e5c31af7Sopenharmony_ci.Valid Usage
176e5c31af7Sopenharmony_ci****
177e5c31af7Sopenharmony_ci  * [[VUID-vkCreateCommandPool-queueFamilyIndex-01937]]
178e5c31af7Sopenharmony_ci    pname:pCreateInfo->queueFamilyIndex must: be the index of a queue family
179e5c31af7Sopenharmony_ci    available in the logical device pname:device
180e5c31af7Sopenharmony_ci****
181e5c31af7Sopenharmony_ci
182e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCreateCommandPool.txt[]
183e5c31af7Sopenharmony_ci--
184e5c31af7Sopenharmony_ci
185e5c31af7Sopenharmony_ci[open,refpage='VkCommandPoolCreateInfo',desc='Structure specifying parameters of a newly created command pool',type='structs']
186e5c31af7Sopenharmony_ci--
187e5c31af7Sopenharmony_ciThe sname:VkCommandPoolCreateInfo structure is defined as:
188e5c31af7Sopenharmony_ci
189e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCommandPoolCreateInfo.txt[]
190e5c31af7Sopenharmony_ci
191e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
192e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
193e5c31af7Sopenharmony_ci    structure.
194e5c31af7Sopenharmony_ci  * pname:flags is a bitmask of elink:VkCommandPoolCreateFlagBits indicating
195e5c31af7Sopenharmony_ci    usage behavior for the pool and command buffers allocated from it.
196e5c31af7Sopenharmony_ci  * pname:queueFamilyIndex designates a queue family as described in section
197e5c31af7Sopenharmony_ci    <<devsandqueues-queueprops,Queue Family Properties>>.
198e5c31af7Sopenharmony_ci    All command buffers allocated from this command pool must: be submitted
199e5c31af7Sopenharmony_ci    on queues from the same queue family.
200e5c31af7Sopenharmony_ci
201e5c31af7Sopenharmony_ci.Valid Usage
202e5c31af7Sopenharmony_ci****
203e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
204e5c31af7Sopenharmony_ci  * [[VUID-VkCommandPoolCreateInfo-flags-02860]]
205e5c31af7Sopenharmony_ci    If the protected memory feature is not enabled, the
206e5c31af7Sopenharmony_ci    ename:VK_COMMAND_POOL_CREATE_PROTECTED_BIT bit of pname:flags must: not
207e5c31af7Sopenharmony_ci    be set
208e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
209e5c31af7Sopenharmony_ci****
210e5c31af7Sopenharmony_ci
211e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCommandPoolCreateInfo.txt[]
212e5c31af7Sopenharmony_ci--
213e5c31af7Sopenharmony_ci
214e5c31af7Sopenharmony_ci[open,refpage='VkCommandPoolCreateFlagBits',desc='Bitmask specifying usage behavior for a command pool',type='enums']
215e5c31af7Sopenharmony_ci--
216e5c31af7Sopenharmony_ciBits which can: be set in slink:VkCommandPoolCreateInfo::pname:flags to
217e5c31af7Sopenharmony_cispecify usage behavior for a command pool are:
218e5c31af7Sopenharmony_ci
219e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkCommandPoolCreateFlagBits.txt[]
220e5c31af7Sopenharmony_ci
221e5c31af7Sopenharmony_ci  * ename:VK_COMMAND_POOL_CREATE_TRANSIENT_BIT specifies that command
222e5c31af7Sopenharmony_ci    buffers allocated from the pool will be short-lived, meaning that they
223e5c31af7Sopenharmony_ci    will be reset or freed in a relatively short timeframe.
224e5c31af7Sopenharmony_ci    This flag may: be used by the implementation to control memory
225e5c31af7Sopenharmony_ci    allocation behavior within the pool.
226e5c31af7Sopenharmony_ci  * ename:VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT allows any command
227e5c31af7Sopenharmony_ci    buffer allocated from a pool to be individually reset to the
228e5c31af7Sopenharmony_ci    <<commandbuffers-lifecycle, initial state>>; either by calling
229e5c31af7Sopenharmony_ci    flink:vkResetCommandBuffer, or via the implicit reset when calling
230e5c31af7Sopenharmony_ci    flink:vkBeginCommandBuffer.
231e5c31af7Sopenharmony_ci    If this flag is not set on a pool, then fname:vkResetCommandBuffer must:
232e5c31af7Sopenharmony_ci    not be called for any command buffer allocated from that pool.
233e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
234e5c31af7Sopenharmony_ci  * ename:VK_COMMAND_POOL_CREATE_PROTECTED_BIT specifies that command
235e5c31af7Sopenharmony_ci    buffers allocated from the pool are protected command buffers.
236e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
237e5c31af7Sopenharmony_ci--
238e5c31af7Sopenharmony_ci
239e5c31af7Sopenharmony_ci[open,refpage='VkCommandPoolCreateFlags',desc='Bitmask of VkCommandPoolCreateFlagBits',type='flags']
240e5c31af7Sopenharmony_ci--
241e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkCommandPoolCreateFlags.txt[]
242e5c31af7Sopenharmony_ci
243e5c31af7Sopenharmony_citname:VkCommandPoolCreateFlags is a bitmask type for setting a mask of zero
244e5c31af7Sopenharmony_cior more elink:VkCommandPoolCreateFlagBits.
245e5c31af7Sopenharmony_ci--
246e5c31af7Sopenharmony_ci
247e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
248e5c31af7Sopenharmony_ci[open,refpage='vkTrimCommandPool',desc='Trim a command pool',type='protos']
249e5c31af7Sopenharmony_ci--
250e5c31af7Sopenharmony_ciTo trim a command pool, call:
251e5c31af7Sopenharmony_ci
252e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
253e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkTrimCommandPool.txt[]
254e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
255e5c31af7Sopenharmony_ci
256e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1+VK_KHR_maintenance1[or the equivalent command]
257e5c31af7Sopenharmony_ci
258e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance1[]
259e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkTrimCommandPoolKHR.txt[]
260e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance1[]
261e5c31af7Sopenharmony_ci
262e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the command pool.
263e5c31af7Sopenharmony_ci  * pname:commandPool is the command pool to trim.
264e5c31af7Sopenharmony_ci  * pname:flags is reserved for future use.
265e5c31af7Sopenharmony_ci
266e5c31af7Sopenharmony_ciTrimming a command pool recycles unused memory from the command pool back to
267e5c31af7Sopenharmony_cithe system.
268e5c31af7Sopenharmony_ciCommand buffers allocated from the pool are not affected by the command.
269e5c31af7Sopenharmony_ci
270e5c31af7Sopenharmony_ci[NOTE]
271e5c31af7Sopenharmony_ci.Note
272e5c31af7Sopenharmony_ci====
273e5c31af7Sopenharmony_ciThis command provides applications with some control over the internal
274e5c31af7Sopenharmony_cimemory allocations used by command pools.
275e5c31af7Sopenharmony_ci
276e5c31af7Sopenharmony_ciUnused memory normally arises from command buffers that have been recorded
277e5c31af7Sopenharmony_ciand later reset, such that they are no longer using the memory.
278e5c31af7Sopenharmony_ciOn reset, a command buffer can return memory to its command pool, but the
279e5c31af7Sopenharmony_cionly way to release memory from a command pool to the system requires
280e5c31af7Sopenharmony_cicalling flink:vkResetCommandPool, which cannot be executed while any command
281e5c31af7Sopenharmony_cibuffers from that pool are still in use.
282e5c31af7Sopenharmony_ciSubsequent recording operations into command buffers will re-use this memory
283e5c31af7Sopenharmony_cibut since total memory requirements fluctuate over time, unused memory can
284e5c31af7Sopenharmony_ciaccumulate.
285e5c31af7Sopenharmony_ci
286e5c31af7Sopenharmony_ciIn this situation, trimming a command pool may: be useful to return unused
287e5c31af7Sopenharmony_cimemory back to the system, returning the total outstanding memory allocated
288e5c31af7Sopenharmony_ciby the pool back to a more "`average`" value.
289e5c31af7Sopenharmony_ci
290e5c31af7Sopenharmony_ciImplementations utilize many internal allocation strategies that make it
291e5c31af7Sopenharmony_ciimpossible to guarantee that all unused memory is released back to the
292e5c31af7Sopenharmony_cisystem.
293e5c31af7Sopenharmony_ciFor instance, an implementation of a command pool may: involve allocating
294e5c31af7Sopenharmony_cimemory in bulk from the system and sub-allocating from that memory.
295e5c31af7Sopenharmony_ciIn such an implementation any live command buffer that holds a reference to
296e5c31af7Sopenharmony_cia bulk allocation would prevent that allocation from being freed, even if
297e5c31af7Sopenharmony_cionly a small proportion of the bulk allocation is in use.
298e5c31af7Sopenharmony_ci
299e5c31af7Sopenharmony_ciIn most cases trimming will result in a reduction in allocated but unused
300e5c31af7Sopenharmony_cimemory, but it does not guarantee the "`ideal`" behavior.
301e5c31af7Sopenharmony_ci
302e5c31af7Sopenharmony_ciTrimming may: be an expensive operation, and should: not be called
303e5c31af7Sopenharmony_cifrequently.
304e5c31af7Sopenharmony_ciTrimming should: be treated as a way to relieve memory pressure after
305e5c31af7Sopenharmony_ciapplication-known points when there exists enough unused memory that the
306e5c31af7Sopenharmony_cicost of trimming is "`worth`" it.
307e5c31af7Sopenharmony_ci====
308e5c31af7Sopenharmony_ci
309e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkTrimCommandPool.txt[]
310e5c31af7Sopenharmony_ci--
311e5c31af7Sopenharmony_ci
312e5c31af7Sopenharmony_ci[open,refpage='VkCommandPoolTrimFlags',desc='Reserved for future use',type='flags']
313e5c31af7Sopenharmony_ci--
314e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkCommandPoolTrimFlags.txt[]
315e5c31af7Sopenharmony_ci
316e5c31af7Sopenharmony_ciifdef::VK_KHR_maintenance1[]
317e5c31af7Sopenharmony_cior the equivalent
318e5c31af7Sopenharmony_ci
319e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkCommandPoolTrimFlagsKHR.txt[]
320e5c31af7Sopenharmony_ciendif::VK_KHR_maintenance1[]
321e5c31af7Sopenharmony_ci
322e5c31af7Sopenharmony_citname:VkCommandPoolTrimFlags is a bitmask type for setting a mask, but is
323e5c31af7Sopenharmony_cicurrently reserved for future use.
324e5c31af7Sopenharmony_ci--
325e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[]
326e5c31af7Sopenharmony_ci
327e5c31af7Sopenharmony_ci[open,refpage='vkResetCommandPool',desc='Reset a command pool',type='protos']
328e5c31af7Sopenharmony_ci--
329e5c31af7Sopenharmony_ciTo reset a command pool, call:
330e5c31af7Sopenharmony_ci
331e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkResetCommandPool.txt[]
332e5c31af7Sopenharmony_ci
333e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the command pool.
334e5c31af7Sopenharmony_ci  * pname:commandPool is the command pool to reset.
335e5c31af7Sopenharmony_ci  * pname:flags is a bitmask of elink:VkCommandPoolResetFlagBits controlling
336e5c31af7Sopenharmony_ci    the reset operation.
337e5c31af7Sopenharmony_ci
338e5c31af7Sopenharmony_ciResetting a command pool recycles all of the resources from all of the
339e5c31af7Sopenharmony_cicommand buffers allocated from the command pool back to the command pool.
340e5c31af7Sopenharmony_ciAll command buffers that have been allocated from the command pool are put
341e5c31af7Sopenharmony_ciin the <<commandbuffers-lifecycle, initial state>>.
342e5c31af7Sopenharmony_ci
343e5c31af7Sopenharmony_ciAny primary command buffer allocated from another slink:VkCommandPool that
344e5c31af7Sopenharmony_ciis in the <<commandbuffers-lifecycle, recording or executable state>> and
345e5c31af7Sopenharmony_cihas a secondary command buffer allocated from pname:commandPool recorded
346e5c31af7Sopenharmony_ciinto it, becomes <<commandbuffers-lifecycle, invalid>>.
347e5c31af7Sopenharmony_ci
348e5c31af7Sopenharmony_ci.Valid Usage
349e5c31af7Sopenharmony_ci****
350e5c31af7Sopenharmony_ci  * [[VUID-vkResetCommandPool-commandPool-00040]]
351e5c31af7Sopenharmony_ci    All sname:VkCommandBuffer objects allocated from pname:commandPool must:
352e5c31af7Sopenharmony_ci    not be in the <<commandbuffers-lifecycle, pending state>>
353e5c31af7Sopenharmony_ci****
354e5c31af7Sopenharmony_ci
355e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkResetCommandPool.txt[]
356e5c31af7Sopenharmony_ci--
357e5c31af7Sopenharmony_ci
358e5c31af7Sopenharmony_ci[open,refpage='VkCommandPoolResetFlagBits',desc='Bitmask controlling behavior of a command pool reset',type='enums']
359e5c31af7Sopenharmony_ci--
360e5c31af7Sopenharmony_ciBits which can: be set in flink:vkResetCommandPool::pname:flags to control
361e5c31af7Sopenharmony_cithe reset operation are:
362e5c31af7Sopenharmony_ci
363e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkCommandPoolResetFlagBits.txt[]
364e5c31af7Sopenharmony_ci
365e5c31af7Sopenharmony_ci  * ename:VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT specifies that
366e5c31af7Sopenharmony_ci    resetting a command pool recycles all of the resources from the command
367e5c31af7Sopenharmony_ci    pool back to the system.
368e5c31af7Sopenharmony_ci--
369e5c31af7Sopenharmony_ci
370e5c31af7Sopenharmony_ci[open,refpage='VkCommandPoolResetFlags',desc='Bitmask of VkCommandPoolResetFlagBits',type='flags']
371e5c31af7Sopenharmony_ci--
372e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkCommandPoolResetFlags.txt[]
373e5c31af7Sopenharmony_ci
374e5c31af7Sopenharmony_citname:VkCommandPoolResetFlags is a bitmask type for setting a mask of zero
375e5c31af7Sopenharmony_cior more elink:VkCommandPoolResetFlagBits.
376e5c31af7Sopenharmony_ci--
377e5c31af7Sopenharmony_ci
378e5c31af7Sopenharmony_ci[open,refpage='vkDestroyCommandPool',desc='Destroy a command pool object',type='protos']
379e5c31af7Sopenharmony_ci--
380e5c31af7Sopenharmony_ciTo destroy a command pool, call:
381e5c31af7Sopenharmony_ci
382e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkDestroyCommandPool.txt[]
383e5c31af7Sopenharmony_ci
384e5c31af7Sopenharmony_ci  * pname:device is the logical device that destroys the command pool.
385e5c31af7Sopenharmony_ci  * pname:commandPool is the handle of the command pool to destroy.
386e5c31af7Sopenharmony_ci  * pname:pAllocator controls host memory allocation as described in the
387e5c31af7Sopenharmony_ci    <<memory-allocation, Memory Allocation>> chapter.
388e5c31af7Sopenharmony_ci
389e5c31af7Sopenharmony_ciWhen a pool is destroyed, all command buffers allocated from the pool are
390e5c31af7Sopenharmony_ci<<vkFreeCommandBuffers, freed>>.
391e5c31af7Sopenharmony_ci
392e5c31af7Sopenharmony_ciAny primary command buffer allocated from another slink:VkCommandPool that
393e5c31af7Sopenharmony_ciis in the <<commandbuffers-lifecycle, recording or executable state>> and
394e5c31af7Sopenharmony_cihas a secondary command buffer allocated from pname:commandPool recorded
395e5c31af7Sopenharmony_ciinto it, becomes <<commandbuffers-lifecycle, invalid>>.
396e5c31af7Sopenharmony_ci
397e5c31af7Sopenharmony_ci.Valid Usage
398e5c31af7Sopenharmony_ci****
399e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyCommandPool-commandPool-00041]]
400e5c31af7Sopenharmony_ci    All sname:VkCommandBuffer objects allocated from pname:commandPool must:
401e5c31af7Sopenharmony_ci    not be in the <<commandbuffers-lifecycle, pending state>>
402e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyCommandPool-commandPool-00042]]
403e5c31af7Sopenharmony_ci    If sname:VkAllocationCallbacks were provided when pname:commandPool was
404e5c31af7Sopenharmony_ci    created, a compatible set of callbacks must: be provided here
405e5c31af7Sopenharmony_ci  * [[VUID-vkDestroyCommandPool-commandPool-00043]]
406e5c31af7Sopenharmony_ci    If no sname:VkAllocationCallbacks were provided when pname:commandPool
407e5c31af7Sopenharmony_ci    was created, pname:pAllocator must: be `NULL`
408e5c31af7Sopenharmony_ci****
409e5c31af7Sopenharmony_ci
410e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkDestroyCommandPool.txt[]
411e5c31af7Sopenharmony_ci--
412e5c31af7Sopenharmony_ci
413e5c31af7Sopenharmony_ci
414e5c31af7Sopenharmony_ci[[commandbuffer-allocation]]
415e5c31af7Sopenharmony_ci== Command Buffer Allocation and Management
416e5c31af7Sopenharmony_ci
417e5c31af7Sopenharmony_ci[open,refpage='vkAllocateCommandBuffers',desc='Allocate command buffers from an existing command pool',type='protos']
418e5c31af7Sopenharmony_ci--
419e5c31af7Sopenharmony_ciTo allocate command buffers, call:
420e5c31af7Sopenharmony_ci
421e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkAllocateCommandBuffers.txt[]
422e5c31af7Sopenharmony_ci
423e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the command pool.
424e5c31af7Sopenharmony_ci  * pname:pAllocateInfo is a pointer to a sname:VkCommandBufferAllocateInfo
425e5c31af7Sopenharmony_ci    structure describing parameters of the allocation.
426e5c31af7Sopenharmony_ci  * pname:pCommandBuffers is a pointer to an array of slink:VkCommandBuffer
427e5c31af7Sopenharmony_ci    handles in which the resulting command buffer objects are returned.
428e5c31af7Sopenharmony_ci    The array must: be at least the length specified by the
429e5c31af7Sopenharmony_ci    pname:commandBufferCount member of pname:pAllocateInfo.
430e5c31af7Sopenharmony_ci    Each allocated command buffer begins in the initial state.
431e5c31af7Sopenharmony_ci
432e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_maintenance1[]
433e5c31af7Sopenharmony_cifname:vkAllocateCommandBuffers can: be used to allocate multiple command
434e5c31af7Sopenharmony_cibuffers.
435e5c31af7Sopenharmony_ciIf the allocation of any of those command buffers fails, the implementation
436e5c31af7Sopenharmony_cimust: free all successfully allocated command buffer objects from this
437e5c31af7Sopenharmony_cicommand, set all entries of the pname:pCommandBuffers array to `NULL` and
438e5c31af7Sopenharmony_cireturn the error.
439e5c31af7Sopenharmony_ci
440e5c31af7Sopenharmony_ci[NOTE]
441e5c31af7Sopenharmony_ci.Note
442e5c31af7Sopenharmony_ci====
443e5c31af7Sopenharmony_ciFilling pname:pCommandBuffers with `NULL` values on failure is an exception
444e5c31af7Sopenharmony_cito the default error behavior that output parameters will have undefined:
445e5c31af7Sopenharmony_cicontents.
446e5c31af7Sopenharmony_ci====
447e5c31af7Sopenharmony_ci
448e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_maintenance1[]
449e5c31af7Sopenharmony_ci
450e5c31af7Sopenharmony_ciWhen command buffers are first allocated, they are in the
451e5c31af7Sopenharmony_ci<<commandbuffers-lifecycle, initial state>>.
452e5c31af7Sopenharmony_ci
453e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkAllocateCommandBuffers.txt[]
454e5c31af7Sopenharmony_ci--
455e5c31af7Sopenharmony_ci
456e5c31af7Sopenharmony_ci[open,refpage='VkCommandBufferAllocateInfo',desc='Structure specifying the allocation parameters for command buffer object',type='structs']
457e5c31af7Sopenharmony_ci--
458e5c31af7Sopenharmony_ciThe sname:VkCommandBufferAllocateInfo structure is defined as:
459e5c31af7Sopenharmony_ci
460e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCommandBufferAllocateInfo.txt[]
461e5c31af7Sopenharmony_ci
462e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
463e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
464e5c31af7Sopenharmony_ci    structure.
465e5c31af7Sopenharmony_ci  * pname:commandPool is the command pool from which the command buffers are
466e5c31af7Sopenharmony_ci    allocated.
467e5c31af7Sopenharmony_ci  * pname:level is a elink:VkCommandBufferLevel value specifying the command
468e5c31af7Sopenharmony_ci    buffer level.
469e5c31af7Sopenharmony_ci  * pname:commandBufferCount is the number of command buffers to allocate
470e5c31af7Sopenharmony_ci    from the pool.
471e5c31af7Sopenharmony_ci
472e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCommandBufferAllocateInfo.txt[]
473e5c31af7Sopenharmony_ci--
474e5c31af7Sopenharmony_ci
475e5c31af7Sopenharmony_ci[open,refpage='VkCommandBufferLevel',desc='Enumerant specifying a command buffer level',type='enums']
476e5c31af7Sopenharmony_ci--
477e5c31af7Sopenharmony_ciPossible values of slink:VkCommandBufferAllocateInfo::pname:level,
478e5c31af7Sopenharmony_cispecifying the command buffer level, are:
479e5c31af7Sopenharmony_ci
480e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkCommandBufferLevel.txt[]
481e5c31af7Sopenharmony_ci
482e5c31af7Sopenharmony_ci  * ename:VK_COMMAND_BUFFER_LEVEL_PRIMARY specifies a primary command
483e5c31af7Sopenharmony_ci    buffer.
484e5c31af7Sopenharmony_ci  * ename:VK_COMMAND_BUFFER_LEVEL_SECONDARY specifies a secondary command
485e5c31af7Sopenharmony_ci    buffer.
486e5c31af7Sopenharmony_ci--
487e5c31af7Sopenharmony_ci
488e5c31af7Sopenharmony_ci[open,refpage='vkResetCommandBuffer',desc='Reset a command buffer to the initial state',type='protos']
489e5c31af7Sopenharmony_ci--
490e5c31af7Sopenharmony_ciTo reset a command buffer, call:
491e5c31af7Sopenharmony_ci
492e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkResetCommandBuffer.txt[]
493e5c31af7Sopenharmony_ci
494e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer to reset.
495e5c31af7Sopenharmony_ci    The command buffer can: be in any state other than
496e5c31af7Sopenharmony_ci    <<commandbuffers-lifecycle, pending>>, and is moved into the
497e5c31af7Sopenharmony_ci    <<commandbuffers-lifecycle, initial state>>.
498e5c31af7Sopenharmony_ci  * pname:flags is a bitmask of elink:VkCommandBufferResetFlagBits
499e5c31af7Sopenharmony_ci    controlling the reset operation.
500e5c31af7Sopenharmony_ci
501e5c31af7Sopenharmony_ciAny primary command buffer that is in the <<commandbuffers-lifecycle,
502e5c31af7Sopenharmony_cirecording or executable state>> and has pname:commandBuffer recorded into
503e5c31af7Sopenharmony_ciit, becomes <<commandbuffers-lifecycle, invalid>>.
504e5c31af7Sopenharmony_ci
505e5c31af7Sopenharmony_ci.Valid Usage
506e5c31af7Sopenharmony_ci****
507e5c31af7Sopenharmony_ci  * [[VUID-vkResetCommandBuffer-commandBuffer-00045]]
508e5c31af7Sopenharmony_ci    pname:commandBuffer must: not be in the <<commandbuffers-lifecycle,
509e5c31af7Sopenharmony_ci    pending state>>
510e5c31af7Sopenharmony_ci  * [[VUID-vkResetCommandBuffer-commandBuffer-00046]]
511e5c31af7Sopenharmony_ci    pname:commandBuffer must: have been allocated from a pool that was
512e5c31af7Sopenharmony_ci    created with the ename:VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT
513e5c31af7Sopenharmony_ci****
514e5c31af7Sopenharmony_ci
515e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkResetCommandBuffer.txt[]
516e5c31af7Sopenharmony_ci--
517e5c31af7Sopenharmony_ci
518e5c31af7Sopenharmony_ci[open,refpage='VkCommandBufferResetFlagBits',desc='Bitmask controlling behavior of a command buffer reset',type='enums']
519e5c31af7Sopenharmony_ci--
520e5c31af7Sopenharmony_ciBits which can: be set in flink:vkResetCommandBuffer::pname:flags to control
521e5c31af7Sopenharmony_cithe reset operation are:
522e5c31af7Sopenharmony_ci
523e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkCommandBufferResetFlagBits.txt[]
524e5c31af7Sopenharmony_ci
525e5c31af7Sopenharmony_ci  * ename:VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT specifies that most
526e5c31af7Sopenharmony_ci    or all memory resources currently owned by the command buffer should: be
527e5c31af7Sopenharmony_ci    returned to the parent command pool.
528e5c31af7Sopenharmony_ci    If this flag is not set, then the command buffer may: hold onto memory
529e5c31af7Sopenharmony_ci    resources and reuse them when recording commands.
530e5c31af7Sopenharmony_ci    pname:commandBuffer is moved to the <<commandbuffers-lifecycle, initial
531e5c31af7Sopenharmony_ci    state>>.
532e5c31af7Sopenharmony_ci--
533e5c31af7Sopenharmony_ci
534e5c31af7Sopenharmony_ci[open,refpage='VkCommandBufferResetFlags',desc='Bitmask of VkCommandBufferResetFlagBits',type='flags']
535e5c31af7Sopenharmony_ci--
536e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkCommandBufferResetFlags.txt[]
537e5c31af7Sopenharmony_ci
538e5c31af7Sopenharmony_citname:VkCommandBufferResetFlags is a bitmask type for setting a mask of zero
539e5c31af7Sopenharmony_cior more elink:VkCommandBufferResetFlagBits.
540e5c31af7Sopenharmony_ci--
541e5c31af7Sopenharmony_ci
542e5c31af7Sopenharmony_ci[open,refpage='vkFreeCommandBuffers',desc='Free command buffers',type='protos']
543e5c31af7Sopenharmony_ci--
544e5c31af7Sopenharmony_ciTo free command buffers, call:
545e5c31af7Sopenharmony_ci
546e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkFreeCommandBuffers.txt[]
547e5c31af7Sopenharmony_ci
548e5c31af7Sopenharmony_ci  * pname:device is the logical device that owns the command pool.
549e5c31af7Sopenharmony_ci  * pname:commandPool is the command pool from which the command buffers
550e5c31af7Sopenharmony_ci    were allocated.
551e5c31af7Sopenharmony_ci  * pname:commandBufferCount is the length of the pname:pCommandBuffers
552e5c31af7Sopenharmony_ci    array.
553e5c31af7Sopenharmony_ci  * pname:pCommandBuffers is a pointer to an array of handles of command
554e5c31af7Sopenharmony_ci    buffers to free.
555e5c31af7Sopenharmony_ci
556e5c31af7Sopenharmony_ciAny primary command buffer that is in the <<commandbuffers-lifecycle,
557e5c31af7Sopenharmony_cirecording or executable state>> and has any element of pname:pCommandBuffers
558e5c31af7Sopenharmony_cirecorded into it, becomes <<commandbuffers-lifecycle, invalid>>.
559e5c31af7Sopenharmony_ci
560e5c31af7Sopenharmony_ci.Valid Usage
561e5c31af7Sopenharmony_ci****
562e5c31af7Sopenharmony_ci  * [[VUID-vkFreeCommandBuffers-pCommandBuffers-00047]]
563e5c31af7Sopenharmony_ci    All elements of pname:pCommandBuffers must: not be in the
564e5c31af7Sopenharmony_ci    <<commandbuffers-lifecycle, pending state>>
565e5c31af7Sopenharmony_ci  * [[VUID-vkFreeCommandBuffers-pCommandBuffers-00048]]
566e5c31af7Sopenharmony_ci    pname:pCommandBuffers must: be a valid pointer to an array of
567e5c31af7Sopenharmony_ci    pname:commandBufferCount sname:VkCommandBuffer handles, each element of
568e5c31af7Sopenharmony_ci    which must: either be a valid handle or `NULL`
569e5c31af7Sopenharmony_ci****
570e5c31af7Sopenharmony_ci
571e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkFreeCommandBuffers.txt[]
572e5c31af7Sopenharmony_ci--
573e5c31af7Sopenharmony_ci
574e5c31af7Sopenharmony_ci
575e5c31af7Sopenharmony_ci[[commandbuffers-recording]]
576e5c31af7Sopenharmony_ci== Command Buffer Recording
577e5c31af7Sopenharmony_ci
578e5c31af7Sopenharmony_ci[open,refpage='vkBeginCommandBuffer',desc='Start recording a command buffer',type='protos']
579e5c31af7Sopenharmony_ci--
580e5c31af7Sopenharmony_ciTo begin recording a command buffer, call:
581e5c31af7Sopenharmony_ci
582e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkBeginCommandBuffer.txt[]
583e5c31af7Sopenharmony_ci
584e5c31af7Sopenharmony_ci  * pname:commandBuffer is the handle of the command buffer which is to be
585e5c31af7Sopenharmony_ci    put in the recording state.
586e5c31af7Sopenharmony_ci  * pname:pBeginInfo is a pointer to a slink:VkCommandBufferBeginInfo
587e5c31af7Sopenharmony_ci    structure defining additional information about how the command buffer
588e5c31af7Sopenharmony_ci    begins recording.
589e5c31af7Sopenharmony_ci
590e5c31af7Sopenharmony_ci.Valid Usage
591e5c31af7Sopenharmony_ci****
592e5c31af7Sopenharmony_ci  * [[VUID-vkBeginCommandBuffer-commandBuffer-00049]]
593e5c31af7Sopenharmony_ci    pname:commandBuffer must: not be in the <<commandbuffers-lifecycle,
594e5c31af7Sopenharmony_ci    recording or pending state>>
595e5c31af7Sopenharmony_ci  * [[VUID-vkBeginCommandBuffer-commandBuffer-00050]]
596e5c31af7Sopenharmony_ci    If pname:commandBuffer was allocated from a slink:VkCommandPool which
597e5c31af7Sopenharmony_ci    did not have the ename:VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT
598e5c31af7Sopenharmony_ci    flag set, pname:commandBuffer must: be in the
599e5c31af7Sopenharmony_ci    <<commandbuffers-lifecycle, initial state>>
600e5c31af7Sopenharmony_ci  * [[VUID-vkBeginCommandBuffer-commandBuffer-00051]]
601e5c31af7Sopenharmony_ci    If pname:commandBuffer is a secondary command buffer, the
602e5c31af7Sopenharmony_ci    pname:pInheritanceInfo member of pname:pBeginInfo must: be a valid
603e5c31af7Sopenharmony_ci    sname:VkCommandBufferInheritanceInfo structure
604e5c31af7Sopenharmony_ci  * [[VUID-vkBeginCommandBuffer-commandBuffer-00052]]
605e5c31af7Sopenharmony_ci    If pname:commandBuffer is a secondary command buffer and either the
606e5c31af7Sopenharmony_ci    pname:occlusionQueryEnable member of the pname:pInheritanceInfo member
607e5c31af7Sopenharmony_ci    of pname:pBeginInfo is ename:VK_FALSE, or the precise occlusion queries
608e5c31af7Sopenharmony_ci    feature is not enabled, then
609e5c31af7Sopenharmony_ci    pname:pBeginInfo->pInheritanceInfo->queryFlags must: not contain
610e5c31af7Sopenharmony_ci    ename:VK_QUERY_CONTROL_PRECISE_BIT
611e5c31af7Sopenharmony_ci  * [[VUID-vkBeginCommandBuffer-commandBuffer-02840]]
612e5c31af7Sopenharmony_ci    If pname:commandBuffer is a primary command buffer, then
613e5c31af7Sopenharmony_ci    pname:pBeginInfo->flags must: not set both the
614e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT and the
615e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT flags
616e5c31af7Sopenharmony_ci****
617e5c31af7Sopenharmony_ci
618e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkBeginCommandBuffer.txt[]
619e5c31af7Sopenharmony_ci--
620e5c31af7Sopenharmony_ci
621e5c31af7Sopenharmony_ci[open,refpage='VkCommandBufferBeginInfo',desc='Structure specifying a command buffer begin operation',type='structs']
622e5c31af7Sopenharmony_ci--
623e5c31af7Sopenharmony_ciThe sname:VkCommandBufferBeginInfo structure is defined as:
624e5c31af7Sopenharmony_ci
625e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCommandBufferBeginInfo.txt[]
626e5c31af7Sopenharmony_ci
627e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
628e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
629e5c31af7Sopenharmony_ci    structure.
630e5c31af7Sopenharmony_ci  * pname:flags is a bitmask of elink:VkCommandBufferUsageFlagBits
631e5c31af7Sopenharmony_ci    specifying usage behavior for the command buffer.
632e5c31af7Sopenharmony_ci  * pname:pInheritanceInfo is a pointer to a
633e5c31af7Sopenharmony_ci    sname:VkCommandBufferInheritanceInfo structure, used if
634e5c31af7Sopenharmony_ci    pname:commandBuffer is a secondary command buffer.
635e5c31af7Sopenharmony_ci    If this is a primary command buffer, then this value is ignored.
636e5c31af7Sopenharmony_ci
637e5c31af7Sopenharmony_ci.Valid Usage
638e5c31af7Sopenharmony_ci****
639e5c31af7Sopenharmony_ciifndef::VK_KHR_dynamic_rendering[]
640e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferBeginInfo-flags-00053]]
641e5c31af7Sopenharmony_ci    If pname:flags contains
642e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the
643e5c31af7Sopenharmony_ci    pname:renderPass member of pname:pInheritanceInfo must: be a valid
644e5c31af7Sopenharmony_ci    sname:VkRenderPass
645e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferBeginInfo-flags-00054]]
646e5c31af7Sopenharmony_ci    If pname:flags contains
647e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the
648e5c31af7Sopenharmony_ci    pname:subpass member of pname:pInheritanceInfo must: be a valid subpass
649e5c31af7Sopenharmony_ci    index within the pname:renderPass member of pname:pInheritanceInfo
650e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[]
651e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferBeginInfo-flags-00055]]
652e5c31af7Sopenharmony_ci    If pname:flags contains
653e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the
654e5c31af7Sopenharmony_ci    pname:framebuffer member of pname:pInheritanceInfo must: be either
655e5c31af7Sopenharmony_ci    dlink:VK_NULL_HANDLE, or a valid sname:VkFramebuffer that is compatible
656e5c31af7Sopenharmony_ci    with the pname:renderPass member of pname:pInheritanceInfo
657e5c31af7Sopenharmony_ciifdef::VK_KHR_dynamic_rendering[]
658e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferBeginInfo-flags-06000]]
659e5c31af7Sopenharmony_ci    If pname:flags contains
660e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT and the
661e5c31af7Sopenharmony_ci    pname:renderPass member of pname:pInheritanceInfo is not
662e5c31af7Sopenharmony_ci    dlink:VK_NULL_HANDLE, pname:renderPass must: be a valid
663e5c31af7Sopenharmony_ci    sname:VkRenderPass
664e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferBeginInfo-flags-06001]]
665e5c31af7Sopenharmony_ci    If pname:flags contains
666e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT and the
667e5c31af7Sopenharmony_ci    pname:renderPass member of pname:pInheritanceInfo is not
668e5c31af7Sopenharmony_ci    dlink:VK_NULL_HANDLE, the pname:subpass member of pname:pInheritanceInfo
669e5c31af7Sopenharmony_ci    must: be a valid subpass index within the pname:renderPass member of
670e5c31af7Sopenharmony_ci    pname:pInheritanceInfo
671e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferBeginInfo-flags-06002]]
672e5c31af7Sopenharmony_ci    If pname:flags contains
673e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT and the
674e5c31af7Sopenharmony_ci    pname:renderPass member of pname:pInheritanceInfo is
675e5c31af7Sopenharmony_ci    dlink:VK_NULL_HANDLE, the pname:pNext chain of pname:pInheritanceInfo
676e5c31af7Sopenharmony_ci    must: include a slink:VkCommandBufferInheritanceRenderingInfoKHR
677e5c31af7Sopenharmony_ci    structure
678e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[]
679e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferBeginInfo-flags-06003]]
680e5c31af7Sopenharmony_ci    If pname:flags contains
681e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT, the
682e5c31af7Sopenharmony_ci    pname:renderPass member of pname:pInheritanceInfo is
683e5c31af7Sopenharmony_ci    dlink:VK_NULL_HANDLE, and the pname:pNext chain of
684e5c31af7Sopenharmony_ci    pname:pInheritanceInfo includes a slink:VkAttachmentSampleCountInfoAMD
685e5c31af7Sopenharmony_ci    or slink:VkAttachmentSampleCountInfoNV structure, the
686e5c31af7Sopenharmony_ci    pname:colorAttachmentCount member of that structure must: be equal to
687e5c31af7Sopenharmony_ci    the value of
688e5c31af7Sopenharmony_ci    slink:VkCommandBufferInheritanceRenderingInfoKHR::pname:colorAttachmentCount
689e5c31af7Sopenharmony_ciendif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[]
690e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[]
691e5c31af7Sopenharmony_ci****
692e5c31af7Sopenharmony_ci
693e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCommandBufferBeginInfo.txt[]
694e5c31af7Sopenharmony_ci--
695e5c31af7Sopenharmony_ci
696e5c31af7Sopenharmony_ci[open,refpage='VkCommandBufferUsageFlagBits',desc='Bitmask specifying usage behavior for command buffer',type='enums']
697e5c31af7Sopenharmony_ci--
698e5c31af7Sopenharmony_ciBits which can: be set in slink:VkCommandBufferBeginInfo::pname:flags to
699e5c31af7Sopenharmony_cispecify usage behavior for a command buffer are:
700e5c31af7Sopenharmony_ci
701e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkCommandBufferUsageFlagBits.txt[]
702e5c31af7Sopenharmony_ci
703e5c31af7Sopenharmony_ci  * ename:VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT specifies that each
704e5c31af7Sopenharmony_ci    recording of the command buffer will only be submitted once, and the
705e5c31af7Sopenharmony_ci    command buffer will be reset and recorded again between each submission.
706e5c31af7Sopenharmony_ci  * ename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT specifies that a
707e5c31af7Sopenharmony_ci    secondary command buffer is considered to be entirely inside a render
708e5c31af7Sopenharmony_ci    pass.
709e5c31af7Sopenharmony_ci    If this is a primary command buffer, then this bit is ignored.
710e5c31af7Sopenharmony_ci  * ename:VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT specifies that a
711e5c31af7Sopenharmony_ci    command buffer can: be resubmitted to a queue while it is in the
712e5c31af7Sopenharmony_ci    _pending state_, and recorded into multiple primary command buffers.
713e5c31af7Sopenharmony_ci--
714e5c31af7Sopenharmony_ci
715e5c31af7Sopenharmony_ci[open,refpage='VkCommandBufferUsageFlags',desc='Bitmask of VkCommandBufferUsageFlagBits',type='flags']
716e5c31af7Sopenharmony_ci--
717e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkCommandBufferUsageFlags.txt[]
718e5c31af7Sopenharmony_ci
719e5c31af7Sopenharmony_citname:VkCommandBufferUsageFlags is a bitmask type for setting a mask of zero
720e5c31af7Sopenharmony_cior more elink:VkCommandBufferUsageFlagBits.
721e5c31af7Sopenharmony_ci--
722e5c31af7Sopenharmony_ci
723e5c31af7Sopenharmony_ci[open,refpage='VkCommandBufferInheritanceInfo',desc='Structure specifying command buffer inheritance information',type='structs']
724e5c31af7Sopenharmony_ci--
725e5c31af7Sopenharmony_ciIf the command buffer is a secondary command buffer, then the
726e5c31af7Sopenharmony_cisname:VkCommandBufferInheritanceInfo structure defines any state that will
727e5c31af7Sopenharmony_cibe inherited from the primary command buffer:
728e5c31af7Sopenharmony_ci
729e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCommandBufferInheritanceInfo.txt[]
730e5c31af7Sopenharmony_ci
731e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
732e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
733e5c31af7Sopenharmony_ci    structure.
734e5c31af7Sopenharmony_ci  * pname:renderPass is a slink:VkRenderPass object defining which render
735e5c31af7Sopenharmony_ci    passes the sname:VkCommandBuffer will be <<renderpass-compatibility,
736e5c31af7Sopenharmony_ci    compatible>> with and can: be executed within.
737e5c31af7Sopenharmony_ci  * pname:subpass is the index of the subpass within the render pass
738e5c31af7Sopenharmony_ci    instance that the sname:VkCommandBuffer will be executed within.
739e5c31af7Sopenharmony_ci  * pname:framebuffer can: refer to the slink:VkFramebuffer object that the
740e5c31af7Sopenharmony_ci    sname:VkCommandBuffer will be rendering to if it is executed within a
741e5c31af7Sopenharmony_ci    render pass instance.
742e5c31af7Sopenharmony_ci    It can: be dlink:VK_NULL_HANDLE if the framebuffer is not known.
743e5c31af7Sopenharmony_ci+
744e5c31af7Sopenharmony_ci[NOTE]
745e5c31af7Sopenharmony_ci.Note
746e5c31af7Sopenharmony_ci====
747e5c31af7Sopenharmony_ciSpecifying the exact framebuffer that the secondary command buffer will be
748e5c31af7Sopenharmony_ciexecuted with may: result in better performance at command buffer execution
749e5c31af7Sopenharmony_citime.
750e5c31af7Sopenharmony_ci====
751e5c31af7Sopenharmony_ci  * pname:occlusionQueryEnable specifies whether the command buffer can: be
752e5c31af7Sopenharmony_ci    executed while an occlusion query is active in the primary command
753e5c31af7Sopenharmony_ci    buffer.
754e5c31af7Sopenharmony_ci    If this is ename:VK_TRUE, then this command buffer can: be executed
755e5c31af7Sopenharmony_ci    whether the primary command buffer has an occlusion query active or not.
756e5c31af7Sopenharmony_ci    If this is ename:VK_FALSE, then the primary command buffer must: not
757e5c31af7Sopenharmony_ci    have an occlusion query active.
758e5c31af7Sopenharmony_ci  * pname:queryFlags specifies the query flags that can: be used by an
759e5c31af7Sopenharmony_ci    active occlusion query in the primary command buffer when this secondary
760e5c31af7Sopenharmony_ci    command buffer is executed.
761e5c31af7Sopenharmony_ci    If this value includes the ename:VK_QUERY_CONTROL_PRECISE_BIT bit, then
762e5c31af7Sopenharmony_ci    the active query can: return boolean results or actual sample counts.
763e5c31af7Sopenharmony_ci    If this bit is not set, then the active query must: not use the
764e5c31af7Sopenharmony_ci    ename:VK_QUERY_CONTROL_PRECISE_BIT bit.
765e5c31af7Sopenharmony_ci  * pname:pipelineStatistics is a bitmask of
766e5c31af7Sopenharmony_ci    elink:VkQueryPipelineStatisticFlagBits specifying the set of pipeline
767e5c31af7Sopenharmony_ci    statistics that can: be counted by an active query in the primary
768e5c31af7Sopenharmony_ci    command buffer when this secondary command buffer is executed.
769e5c31af7Sopenharmony_ci    If this value includes a given bit, then this command buffer can: be
770e5c31af7Sopenharmony_ci    executed whether the primary command buffer has a pipeline statistics
771e5c31af7Sopenharmony_ci    query active that includes this bit or not.
772e5c31af7Sopenharmony_ci    If this value excludes a given bit, then the active pipeline statistics
773e5c31af7Sopenharmony_ci    query must: not be from a query pool that counts that statistic.
774e5c31af7Sopenharmony_ci
775e5c31af7Sopenharmony_ciIf the slink:VkCommandBuffer will not be executed within a render pass
776e5c31af7Sopenharmony_ciinstance,
777e5c31af7Sopenharmony_ciifdef::VK_KHR_dynamic_rendering[]
778e5c31af7Sopenharmony_cior if the render pass instance was begun with flink:vkCmdBeginRenderingKHR,
779e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[]
780e5c31af7Sopenharmony_cipname:renderPass, pname:subpass, and pname:framebuffer are ignored.
781e5c31af7Sopenharmony_ci
782e5c31af7Sopenharmony_ci.Valid Usage
783e5c31af7Sopenharmony_ci****
784e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceInfo-occlusionQueryEnable-00056]]
785e5c31af7Sopenharmony_ci    If the <<features-inheritedQueries,inherited queries>> feature is not
786e5c31af7Sopenharmony_ci    enabled, pname:occlusionQueryEnable must: be ename:VK_FALSE
787e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceInfo-queryFlags-00057]]
788e5c31af7Sopenharmony_ci    If the <<features-inheritedQueries,inherited queries>> feature is
789e5c31af7Sopenharmony_ci    enabled, pname:queryFlags must: be a valid combination of
790e5c31af7Sopenharmony_ci    elink:VkQueryControlFlagBits values
791e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceInfo-queryFlags-02788]]
792e5c31af7Sopenharmony_ci    If the <<features-inheritedQueries,inherited queries>> feature is not
793e5c31af7Sopenharmony_ci    enabled, pname:queryFlags must: be code:0
794e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceInfo-pipelineStatistics-02789]]
795e5c31af7Sopenharmony_ci    If the <<features-pipelineStatisticsQuery,pipeline statistics queries>>
796e5c31af7Sopenharmony_ci    feature is enabled, pname:pipelineStatistics must: be a valid
797e5c31af7Sopenharmony_ci    combination of elink:VkQueryPipelineStatisticFlagBits values
798e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceInfo-pipelineStatistics-00058]]
799e5c31af7Sopenharmony_ci    If the <<features-pipelineStatisticsQuery,pipeline statistics queries>>
800e5c31af7Sopenharmony_ci    feature is not enabled, pname:pipelineStatistics must: be code:0
801e5c31af7Sopenharmony_ci****
802e5c31af7Sopenharmony_ci
803e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCommandBufferInheritanceInfo.txt[]
804e5c31af7Sopenharmony_ci--
805e5c31af7Sopenharmony_ci
806e5c31af7Sopenharmony_ci[NOTE]
807e5c31af7Sopenharmony_ci.Note
808e5c31af7Sopenharmony_ci====
809e5c31af7Sopenharmony_ciOn some implementations, not using the
810e5c31af7Sopenharmony_ciename:VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT bit enables command
811e5c31af7Sopenharmony_cibuffers to be patched in-place if needed, rather than creating a copy of the
812e5c31af7Sopenharmony_cicommand buffer.
813e5c31af7Sopenharmony_ci====
814e5c31af7Sopenharmony_ci
815e5c31af7Sopenharmony_ciIf a command buffer is in the <<commandbuffers-lifecycle, invalid, or
816e5c31af7Sopenharmony_ciexecutable state>>, and the command buffer was allocated from a command pool
817e5c31af7Sopenharmony_ciwith the ename:VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT flag set,
818e5c31af7Sopenharmony_cithen fname:vkBeginCommandBuffer implicitly resets the command buffer,
819e5c31af7Sopenharmony_cibehaving as if fname:vkResetCommandBuffer had been called with
820e5c31af7Sopenharmony_ciename:VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT not set.
821e5c31af7Sopenharmony_ciAfter the implicit reset, pname:commandBuffer is moved to the
822e5c31af7Sopenharmony_ci<<commandbuffers-lifecycle, recording state>>.
823e5c31af7Sopenharmony_ci
824e5c31af7Sopenharmony_ciifdef::VK_EXT_conditional_rendering[]
825e5c31af7Sopenharmony_ci[open,refpage='VkCommandBufferInheritanceConditionalRenderingInfoEXT',desc='Structure specifying command buffer inheritance information',type='structs']
826e5c31af7Sopenharmony_ci--
827e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkCommandBufferInheritanceInfo includes a
828e5c31af7Sopenharmony_cisname:VkCommandBufferInheritanceConditionalRenderingInfoEXT structure, then
829e5c31af7Sopenharmony_cithat structure controls whether a command buffer can: be executed while
830e5c31af7Sopenharmony_ciconditional rendering is <<active-conditional-rendering,active>> in the
831e5c31af7Sopenharmony_ciprimary command buffer.
832e5c31af7Sopenharmony_ci
833e5c31af7Sopenharmony_ciThe sname:VkCommandBufferInheritanceConditionalRenderingInfoEXT structure is
834e5c31af7Sopenharmony_cidefined as:
835e5c31af7Sopenharmony_ci
836e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCommandBufferInheritanceConditionalRenderingInfoEXT.txt[]
837e5c31af7Sopenharmony_ci
838e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
839e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
840e5c31af7Sopenharmony_ci    structure.
841e5c31af7Sopenharmony_ci  * pname:conditionalRenderingEnable specifies whether the command buffer
842e5c31af7Sopenharmony_ci    can: be executed while conditional rendering is active in the primary
843e5c31af7Sopenharmony_ci    command buffer.
844e5c31af7Sopenharmony_ci    If this is ename:VK_TRUE, then this command buffer can: be executed
845e5c31af7Sopenharmony_ci    whether the primary command buffer has active conditional rendering or
846e5c31af7Sopenharmony_ci    not.
847e5c31af7Sopenharmony_ci    If this is ename:VK_FALSE, then the primary command buffer must: not
848e5c31af7Sopenharmony_ci    have conditional rendering active.
849e5c31af7Sopenharmony_ci
850e5c31af7Sopenharmony_ciIf this structure is not present, the behavior is as if
851e5c31af7Sopenharmony_cipname:conditionalRenderingEnable is ename:VK_FALSE.
852e5c31af7Sopenharmony_ci
853e5c31af7Sopenharmony_ci.Valid Usage
854e5c31af7Sopenharmony_ci****
855e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceConditionalRenderingInfoEXT-conditionalRenderingEnable-01977]]
856e5c31af7Sopenharmony_ci    If the <<features-inheritedConditionalRendering, inherited conditional
857e5c31af7Sopenharmony_ci    rendering>> feature is not enabled, pname:conditionalRenderingEnable
858e5c31af7Sopenharmony_ci    must: be ename:VK_FALSE
859e5c31af7Sopenharmony_ci****
860e5c31af7Sopenharmony_ci
861e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCommandBufferInheritanceConditionalRenderingInfoEXT.txt[]
862e5c31af7Sopenharmony_ci--
863e5c31af7Sopenharmony_ciendif::VK_EXT_conditional_rendering[]
864e5c31af7Sopenharmony_ci
865e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_transform[]
866e5c31af7Sopenharmony_ci[open,refpage='VkCommandBufferInheritanceRenderPassTransformInfoQCOM',desc='Structure describing transformed render pass parameters command buffer',type='structs']
867e5c31af7Sopenharmony_ci--
868e5c31af7Sopenharmony_ci
869e5c31af7Sopenharmony_ciTo begin recording a secondary command buffer compatible with execution
870e5c31af7Sopenharmony_ciinside a render pass using <<vertexpostproc-renderpass-transform, render
871e5c31af7Sopenharmony_cipass transform>>, add the
872e5c31af7Sopenharmony_cislink:VkCommandBufferInheritanceRenderPassTransformInfoQCOM to the
873e5c31af7Sopenharmony_cipname:pNext chain of slink:VkCommandBufferInheritanceInfo structure passed
874e5c31af7Sopenharmony_cito the flink:vkBeginCommandBuffer command specifying the parameters for
875e5c31af7Sopenharmony_citransformed rasterization.
876e5c31af7Sopenharmony_ci
877e5c31af7Sopenharmony_ciThe sname:VkCommandBufferInheritanceRenderPassTransformInfoQCOM structure is
878e5c31af7Sopenharmony_cidefined as:
879e5c31af7Sopenharmony_ci
880e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCommandBufferInheritanceRenderPassTransformInfoQCOM.txt[]
881e5c31af7Sopenharmony_ci
882e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
883e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
884e5c31af7Sopenharmony_ci    structure.
885e5c31af7Sopenharmony_ci  * pname:transform is a elink:VkSurfaceTransformFlagBitsKHR value
886e5c31af7Sopenharmony_ci    describing the transform to be applied to the render pass.
887e5c31af7Sopenharmony_ci  * pname:renderArea is the render area that is affected by the command
888e5c31af7Sopenharmony_ci    buffer.
889e5c31af7Sopenharmony_ci
890e5c31af7Sopenharmony_ciWhen the secondary is recorded to execute within a render pass instance
891e5c31af7Sopenharmony_ciusing flink:vkCmdExecuteCommands, the render pass transform parameters of
892e5c31af7Sopenharmony_cithe secondary command buffer must: be consistent with the render pass
893e5c31af7Sopenharmony_citransform parameters specified for the render pass instance.
894e5c31af7Sopenharmony_ciIn particular, the pname:transform and pname:renderArea for command buffer
895e5c31af7Sopenharmony_cimust: be identical to the pname:transform and pname:renderArea of the render
896e5c31af7Sopenharmony_cipass instance.
897e5c31af7Sopenharmony_ci
898e5c31af7Sopenharmony_ci.Valid Usage
899e5c31af7Sopenharmony_ci****
900e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceRenderPassTransformInfoQCOM-transform-02864]]
901e5c31af7Sopenharmony_ci    pname:transform must: be ename:VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR,
902e5c31af7Sopenharmony_ci    ename:VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR,
903e5c31af7Sopenharmony_ci    ename:VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR, or
904e5c31af7Sopenharmony_ci    ename:VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR
905e5c31af7Sopenharmony_ci****
906e5c31af7Sopenharmony_ci
907e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCommandBufferInheritanceRenderPassTransformInfoQCOM.txt[]
908e5c31af7Sopenharmony_ci--
909e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_transform[]
910e5c31af7Sopenharmony_ci
911e5c31af7Sopenharmony_ciifdef::VK_NV_inherited_viewport_scissor[]
912e5c31af7Sopenharmony_ci[open,refpage='VkCommandBufferInheritanceViewportScissorInfoNV',desc='Structure specifying command buffer inheritance information',type='structs']
913e5c31af7Sopenharmony_ci--
914e5c31af7Sopenharmony_ciThe sname:VkCommandBufferInheritanceViewportScissorInfoNV structure is
915e5c31af7Sopenharmony_cidefined as:
916e5c31af7Sopenharmony_ci
917e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCommandBufferInheritanceViewportScissorInfoNV.txt[]
918e5c31af7Sopenharmony_ci
919e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
920e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
921e5c31af7Sopenharmony_ci    structure.
922e5c31af7Sopenharmony_ci  * pname:viewportScissor2D specifies whether the listed dynamic state is
923e5c31af7Sopenharmony_ci    inherited.
924e5c31af7Sopenharmony_ci  * pname:viewportDepthCount specifies the maximum number of viewports to
925e5c31af7Sopenharmony_ci    inherit.
926e5c31af7Sopenharmony_ci    When pname:viewportScissor2D is ename:VK_FALSE, the behavior is as if
927e5c31af7Sopenharmony_ci    this value is zero.
928e5c31af7Sopenharmony_ci  * pname:pViewportDepths is a pointer to a slink:VkViewport structure
929e5c31af7Sopenharmony_ci    specifying the expected depth range for each inherited viewport.
930e5c31af7Sopenharmony_ci
931e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkCommandBufferInheritanceInfo includes a
932e5c31af7Sopenharmony_cisname:VkCommandBufferInheritanceViewportScissorInfoNV structure, then that
933e5c31af7Sopenharmony_cistructure controls whether a command buffer can: inherit the following state
934e5c31af7Sopenharmony_cifrom other command buffers:
935e5c31af7Sopenharmony_ci
936e5c31af7Sopenharmony_ci  * ename:VK_DYNAMIC_STATE_SCISSOR
937e5c31af7Sopenharmony_ciifdef::VK_EXT_extended_dynamic_state[]
938e5c31af7Sopenharmony_ci  * ename:VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT
939e5c31af7Sopenharmony_ciendif::VK_EXT_extended_dynamic_state[]
940e5c31af7Sopenharmony_ciifdef::VK_EXT_discard_rectangles[]
941e5c31af7Sopenharmony_ci  * ename:VK_DYNAMIC_STATE_DISCARD_RECTANGLE_EXT
942e5c31af7Sopenharmony_ciendif::VK_EXT_discard_rectangles[]
943e5c31af7Sopenharmony_ci
944e5c31af7Sopenharmony_cias well as the following state, with restrictions on inherited depth values
945e5c31af7Sopenharmony_ciand viewport count:
946e5c31af7Sopenharmony_ci
947e5c31af7Sopenharmony_ci  * ename:VK_DYNAMIC_STATE_VIEWPORT
948e5c31af7Sopenharmony_ciifdef::VK_EXT_extended_dynamic_state[]
949e5c31af7Sopenharmony_ci  * ename:VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT
950e5c31af7Sopenharmony_ciendif::VK_EXT_extended_dynamic_state[]
951e5c31af7Sopenharmony_ci
952e5c31af7Sopenharmony_ciIf pname:viewportScissor2D is ename:VK_FALSE, then the command buffer does
953e5c31af7Sopenharmony_cinot inherit the listed dynamic state, and should: set this state itself.
954e5c31af7Sopenharmony_ciIf this structure is not present, the behavior is as if
955e5c31af7Sopenharmony_cipname:viewportScissor2D is ename:VK_FALSE.
956e5c31af7Sopenharmony_ci
957e5c31af7Sopenharmony_ciIf pname:viewportScissor2D is ename:VK_TRUE, then the listed dynamic state
958e5c31af7Sopenharmony_ciis inherited, and the command buffer must: not set this
959e5c31af7Sopenharmony_ciifndef::VK_EXT_extended_dynamic_state[state.]
960e5c31af7Sopenharmony_ciifdef::VK_EXT_extended_dynamic_state[]
961e5c31af7Sopenharmony_cistate, except that the viewport and scissor count may: be set by binding a
962e5c31af7Sopenharmony_cigraphics pipeline that does not specify this state as dynamic.
963e5c31af7Sopenharmony_ci
964e5c31af7Sopenharmony_ci[NOTE]
965e5c31af7Sopenharmony_ci.Note
966e5c31af7Sopenharmony_ci====
967e5c31af7Sopenharmony_ciDue to this restriction, applications should: ensure either all or none of
968e5c31af7Sopenharmony_cithe graphics pipelines bound in this secondary command buffer use dynamic
969e5c31af7Sopenharmony_civiewport/scissor counts.
970e5c31af7Sopenharmony_ci====
971e5c31af7Sopenharmony_ciendif::VK_EXT_extended_dynamic_state[]
972e5c31af7Sopenharmony_ci
973e5c31af7Sopenharmony_ciWhen the command buffer is executed as part of a the execution of a
974e5c31af7Sopenharmony_ciflink:vkCmdExecuteCommands command, the inherited state (if enabled) is
975e5c31af7Sopenharmony_cidetermined by the following procedure, performed separately for each dynamic
976e5c31af7Sopenharmony_cistate, and separately for each value for dynamic state that consists of
977e5c31af7Sopenharmony_cimultiple values (e.g. multiple viewports).
978e5c31af7Sopenharmony_ci
979e5c31af7Sopenharmony_ci  * With [eq]#i# being the index of the executed command buffer in the
980e5c31af7Sopenharmony_ci    pname:pCommandBuffers array of flink:vkCmdExecuteCommands, if [eq]#i >
981e5c31af7Sopenharmony_ci    0# and any secondary command buffer from index [eq]#0# to [eq]#i-1#
982e5c31af7Sopenharmony_ci    modifies the state, the inherited state is provisionally set to the
983e5c31af7Sopenharmony_ci    final value set by the last such secondary command buffer.
984e5c31af7Sopenharmony_ci    Binding a graphics pipeline defining the state statically is equivalent
985e5c31af7Sopenharmony_ci    to setting the state to an undefined: value.
986e5c31af7Sopenharmony_ci  * Otherwise, the tentatative inherited state is that of the primary
987e5c31af7Sopenharmony_ci    command buffer at the point the flink:vkCmdExecuteCommands command was
988e5c31af7Sopenharmony_ci    recorded; if the state is undefined:, then so is the provisional
989e5c31af7Sopenharmony_ci    inherited state.
990e5c31af7Sopenharmony_ci  * If the provisional inherited state is an undefined: value, then the
991e5c31af7Sopenharmony_ci    state is not inherited.
992e5c31af7Sopenharmony_ci  * If the provisional inherited state is a viewport, with [eq]#n# being its
993e5c31af7Sopenharmony_ci    viewport index, then if [eq]#n {geq} pname:viewportDepthCount#, or if
994e5c31af7Sopenharmony_ci    either slink:VkViewport::pname:minDepth or
995e5c31af7Sopenharmony_ci    slink:VkViewport::pname:maxDepth are not equal to the respective values
996e5c31af7Sopenharmony_ci    of the [eq]#n^th^# element of pname:pViewportDepths, then the state is
997e5c31af7Sopenharmony_ci    not inherited.
998e5c31af7Sopenharmony_ci  * If the provisional inherited state passes both checks, then it becomes
999e5c31af7Sopenharmony_ci    the actual inherited state.
1000e5c31af7Sopenharmony_ci
1001e5c31af7Sopenharmony_ci[NOTE]
1002e5c31af7Sopenharmony_ci.Note
1003e5c31af7Sopenharmony_ci====
1004e5c31af7Sopenharmony_ciThere is no support for inheriting dynamic state from a secondary command
1005e5c31af7Sopenharmony_cibuffer executed as part of a different `vkCmdExecuteCommands` command.
1006e5c31af7Sopenharmony_ci====
1007e5c31af7Sopenharmony_ci
1008e5c31af7Sopenharmony_ci.Valid Usage
1009e5c31af7Sopenharmony_ci****
1010e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceViewportScissorInfoNV-viewportScissor2D-04782]]
1011e5c31af7Sopenharmony_ci    If the <<features-inheritedViewportScissor2D, inherited viewport
1012e5c31af7Sopenharmony_ci    scissor>> feature is not enabled, pname:viewportScissor2D must: be
1013e5c31af7Sopenharmony_ci    ename:VK_FALSE
1014e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceViewportScissorInfoNV-viewportScissor2D-04783]]
1015e5c31af7Sopenharmony_ci    If the <<features-multiViewport,multiple viewports>> feature is not
1016e5c31af7Sopenharmony_ci    enabled and pname:viewportScissor2D is ename:VK_TRUE, then
1017e5c31af7Sopenharmony_ci    pname:viewportDepthCount must: be `1`
1018e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceViewportScissorInfoNV-viewportScissor2D-04784]]
1019e5c31af7Sopenharmony_ci    If pname:viewportScissor2D is ename:VK_TRUE, then
1020e5c31af7Sopenharmony_ci    pname:viewportDepthCount must: be greater than `0`
1021e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceViewportScissorInfoNV-viewportScissor2D-04785]]
1022e5c31af7Sopenharmony_ci    If pname:viewportScissor2D is ename:VK_TRUE, then pname:pViewportDepths
1023e5c31af7Sopenharmony_ci    must: be a valid pointer to an array of `viewportDepthCount` valid
1024e5c31af7Sopenharmony_ci    sname:VkViewport structures, except any requirements on `x`, `y`,
1025e5c31af7Sopenharmony_ci    `width`, and `height` do not apply
1026e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceViewportScissorInfoNV-viewportScissor2D-04786]]
1027e5c31af7Sopenharmony_ci    If pname:viewportScissor2D is ename:VK_TRUE, then the command buffer
1028e5c31af7Sopenharmony_ci    must: be recorded with the
1029e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT
1030e5c31af7Sopenharmony_ci****
1031e5c31af7Sopenharmony_ci
1032e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCommandBufferInheritanceViewportScissorInfoNV.txt[]
1033e5c31af7Sopenharmony_ci--
1034e5c31af7Sopenharmony_ciendif::VK_NV_inherited_viewport_scissor[]
1035e5c31af7Sopenharmony_ci
1036e5c31af7Sopenharmony_ciifdef::VK_KHR_dynamic_rendering[]
1037e5c31af7Sopenharmony_ci[open,refpage='VkCommandBufferInheritanceRenderingInfoKHR',desc='Structure specifying command buffer inheritance info for dynamic render pass instances',type='structs']
1038e5c31af7Sopenharmony_ci--
1039e5c31af7Sopenharmony_ci
1040e5c31af7Sopenharmony_ciThe sname:VkCommandBufferInheritanceRenderingInfoKHR structure is defined
1041e5c31af7Sopenharmony_cias:
1042e5c31af7Sopenharmony_ci
1043e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCommandBufferInheritanceRenderingInfoKHR.txt[]
1044e5c31af7Sopenharmony_ci
1045e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure
1046e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1047e5c31af7Sopenharmony_ci    structure
1048e5c31af7Sopenharmony_ci  * pname:flags is a bitmask of elink:VkRenderingFlagBitsKHR used by the
1049e5c31af7Sopenharmony_ci    render pass instance.
1050e5c31af7Sopenharmony_ci  * pname:viewMask is the view mask used for rendering.
1051e5c31af7Sopenharmony_ci  * pname:colorAttachmentCount is the number of color attachments specified
1052e5c31af7Sopenharmony_ci    in the render pass instance.
1053e5c31af7Sopenharmony_ci  * pname:pColorAttachmentFormats is a pointer to an array of elink:VkFormat
1054e5c31af7Sopenharmony_ci    values defining the format of color attachments.
1055e5c31af7Sopenharmony_ci  * pname:depthAttachmentFormat is a elink:VkFormat value defining the
1056e5c31af7Sopenharmony_ci    format of the depth attachment.
1057e5c31af7Sopenharmony_ci  * pname:stencilAttachmentFormat is a elink:VkFormat value defining the
1058e5c31af7Sopenharmony_ci    format of the stencil attachment.
1059e5c31af7Sopenharmony_ci  * pname:rasterizationSamples is a elink:VkSampleCountFlagBits specifying
1060e5c31af7Sopenharmony_ci    the number of samples used in rasterization.
1061e5c31af7Sopenharmony_ci
1062e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkCommandBufferInheritanceInfo includes a
1063e5c31af7Sopenharmony_cisname:VkCommandBufferInheritanceRenderingInfoKHR structure, then that
1064e5c31af7Sopenharmony_cistructure controls parameters of dynamic render pass instances that the
1065e5c31af7Sopenharmony_cislink:VkCommandBuffer can: be executed within.
1066e5c31af7Sopenharmony_ciIf slink:VkCommandBufferInheritanceInfo::pname:renderPass is not
1067e5c31af7Sopenharmony_cidlink:VK_NULL_HANDLE, or
1068e5c31af7Sopenharmony_ciename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT is not specified in
1069e5c31af7Sopenharmony_cislink:VkCommandBufferBeginInfo::pname:flags, parameters of this structure
1070e5c31af7Sopenharmony_ciare ignored.
1071e5c31af7Sopenharmony_ci
1072e5c31af7Sopenharmony_ciIf pname:colorAttachmentCount is `0` and the
1073e5c31af7Sopenharmony_ci<<features-variableMultisampleRate,pname:variableMultisampleRate>> feature
1074e5c31af7Sopenharmony_ciis enabled, pname:rasterizationSamples is ignored.
1075e5c31af7Sopenharmony_ci
1076e5c31af7Sopenharmony_ciIf pname:depthAttachmentFormat, pname:stencilAttachmentFormat, or any
1077e5c31af7Sopenharmony_cielement of pname:pColorAttachmentFormats is ename:VK_FORMAT_UNDEFINED, it
1078e5c31af7Sopenharmony_ciindicates that the corresponding attachment is unused within the render
1079e5c31af7Sopenharmony_cipass.
1080e5c31af7Sopenharmony_ci
1081e5c31af7Sopenharmony_ci.Valid Usage
1082e5c31af7Sopenharmony_ci****
1083e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceRenderingInfoKHR-colorAttachmentCount-06004]]
1084e5c31af7Sopenharmony_ci    If pname:colorAttachmentCount is not `0`, pname:rasterizationSamples
1085e5c31af7Sopenharmony_ci    must: be a valid elink:VkSampleCountFlagBits value
1086e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceRenderingInfoKHR-variableMultisampleRate-06005]]
1087e5c31af7Sopenharmony_ci    If the
1088e5c31af7Sopenharmony_ci    <<features-variableMultisampleRate,pname:variableMultisampleRate>>
1089e5c31af7Sopenharmony_ci    feature is not enabled, pname:rasterizationSamples must: be a valid
1090e5c31af7Sopenharmony_ci    elink:VkSampleCountFlagBits value
1091e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceRenderingInfoKHR-pColorAttachmentFormats-06006]]
1092e5c31af7Sopenharmony_ci    If any element of pname:pColorAttachmentFormats is not
1093e5c31af7Sopenharmony_ci    ename:VK_FORMAT_UNDEFINED, it must: be a format with
1094e5c31af7Sopenharmony_ci    <<potential-format-features, potential format features>> that include
1095e5c31af7Sopenharmony_ci    ename:VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT
1096e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceRenderingInfoKHR-depthAttachmentFormat-06007]]
1097e5c31af7Sopenharmony_ci    If pname:depthAttachmentFormat is not ename:VK_FORMAT_UNDEFINED, it
1098e5c31af7Sopenharmony_ci    must: be a format with <<potential-format-features, potential format
1099e5c31af7Sopenharmony_ci    features>> that include
1100e5c31af7Sopenharmony_ci    ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
1101e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceRenderingInfoKHR-stencilAttachmentFormat-06199]]
1102e5c31af7Sopenharmony_ci    If pname:stencilAttachmentFormat is not ename:VK_FORMAT_UNDEFINED, it
1103e5c31af7Sopenharmony_ci    must: be a format with <<potential-format-features, potential format
1104e5c31af7Sopenharmony_ci    features>> that include
1105e5c31af7Sopenharmony_ci    ename:VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT
1106e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceRenderingInfoKHR-depthAttachmentFormat-06200]]
1107e5c31af7Sopenharmony_ci    If pname:depthAttachmentFormat is not ename:VK_FORMAT_UNDEFINED and
1108e5c31af7Sopenharmony_ci    pname:stencilAttachmentFormat is not ename:VK_FORMAT_UNDEFINED,
1109e5c31af7Sopenharmony_ci    pname:depthAttachmentFormat must: equal pname:stencilAttachmentFormat
1110e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceRenderingInfoKHR-multiview-06008]]
1111e5c31af7Sopenharmony_ci    If the <<features-multiview,pname:multiview>> feature is not enabled,
1112e5c31af7Sopenharmony_ci    pname:viewMask must: be `0`
1113e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_multiview[]
1114e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferInheritanceRenderingInfoKHR-viewMask-06009]]
1115e5c31af7Sopenharmony_ci    The index of the most significant bit in pname:viewMask must: be less
1116e5c31af7Sopenharmony_ci    than <<limits-maxMultiviewViewCount,pname:maxMultiviewViewCount>>
1117e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_multiview[]
1118e5c31af7Sopenharmony_ci****
1119e5c31af7Sopenharmony_ci
1120e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCommandBufferInheritanceRenderingInfoKHR.txt[]
1121e5c31af7Sopenharmony_ci--
1122e5c31af7Sopenharmony_ci
1123e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[]
1124e5c31af7Sopenharmony_ci[open,refpage='VkAttachmentSampleCountInfoAMD',desc='Structure specifying command buffer inheritance info for dynamic render pass instances',type='structs',alias='VkAttachmentSampleCountInfoNV']
1125e5c31af7Sopenharmony_ci--
1126e5c31af7Sopenharmony_ci
1127e5c31af7Sopenharmony_ciThe
1128e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples[sname:VkAttachmentSampleCountInfoAMD]
1129e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples+VK_NV_framebuffer_mixed_samples[or]
1130e5c31af7Sopenharmony_ciifdef::VK_NV_framebuffer_mixed_samples[sname:VkAttachmentSampleCountInfoNV]
1131e5c31af7Sopenharmony_cistructure is defined as:
1132e5c31af7Sopenharmony_ci
1133e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples[]
1134e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAttachmentSampleCountInfoAMD.txt[]
1135e5c31af7Sopenharmony_ciendif::VK_AMD_mixed_attachment_samples[]
1136e5c31af7Sopenharmony_ci
1137e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples+VK_NV_framebuffer_mixed_samples[or the equivalent]
1138e5c31af7Sopenharmony_ci
1139e5c31af7Sopenharmony_ciifdef::VK_NV_framebuffer_mixed_samples[]
1140e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkAttachmentSampleCountInfoNV.txt[]
1141e5c31af7Sopenharmony_ciendif::VK_NV_framebuffer_mixed_samples[]
1142e5c31af7Sopenharmony_ci
1143e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure
1144e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1145e5c31af7Sopenharmony_ci    structure
1146e5c31af7Sopenharmony_ci  * pname:colorAttachmentCount is the number of color attachments specified
1147e5c31af7Sopenharmony_ci    in a render pass instance.
1148e5c31af7Sopenharmony_ci  * pname:pColorAttachmentSamples is a pointer to an array of
1149e5c31af7Sopenharmony_ci    elink:VkSampleCountFlagBits values defining the sample count of color
1150e5c31af7Sopenharmony_ci    attachments.
1151e5c31af7Sopenharmony_ci  * pname:depthStencilAttachmentSamples is a elink:VkSampleCountFlagBits
1152e5c31af7Sopenharmony_ci    value defining the sample count of a depth/stencil attachment.
1153e5c31af7Sopenharmony_ci
1154e5c31af7Sopenharmony_ciIf slink:VkCommandBufferInheritanceInfo::pname:renderPass is
1155e5c31af7Sopenharmony_cidlink:VK_NULL_HANDLE, ename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT
1156e5c31af7Sopenharmony_ciis specified in slink:VkCommandBufferBeginInfo::pname:flags, and the
1157e5c31af7Sopenharmony_cipname:pNext chain of slink:VkCommandBufferInheritanceInfo includes
1158e5c31af7Sopenharmony_cisname:VkAttachmentSampleCountInfoAMD, then this structure defines the sample
1159e5c31af7Sopenharmony_cicounts of each attachment within the render pass instance.
1160e5c31af7Sopenharmony_ciIf sname:VkAttachmentSampleCountInfoAMD is not included, the value of
1161e5c31af7Sopenharmony_cislink:VkCommandBufferInheritanceRenderingInfoKHR::pname:rasterizationSamples
1162e5c31af7Sopenharmony_ciis used as the sample count for each attachment.
1163e5c31af7Sopenharmony_ciIf slink:VkCommandBufferInheritanceInfo::pname:renderPass is not
1164e5c31af7Sopenharmony_cidlink:VK_NULL_HANDLE, or
1165e5c31af7Sopenharmony_ciename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT is not specified in
1166e5c31af7Sopenharmony_cislink:VkCommandBufferBeginInfo::pname:flags, parameters of this structure
1167e5c31af7Sopenharmony_ciare ignored.
1168e5c31af7Sopenharmony_ci
1169e5c31af7Sopenharmony_cisname:VkAttachmentSampleCountInfoAMD can: also be included in the
1170e5c31af7Sopenharmony_cipname:pNext chain of slink:VkGraphicsPipelineCreateInfo.
1171e5c31af7Sopenharmony_ciWhen a graphics pipeline is created without a slink:VkRenderPass, if this
1172e5c31af7Sopenharmony_cistructure is present in the pname:pNext chain of
1173e5c31af7Sopenharmony_cislink:VkGraphicsPipelineCreateInfo, it specifies the sample count of
1174e5c31af7Sopenharmony_ciattachments used for rendering.
1175e5c31af7Sopenharmony_ciIf this structure is not specified, and the pipeline does not include a
1176e5c31af7Sopenharmony_cislink:VkRenderPass, the value of
1177e5c31af7Sopenharmony_cislink:VkPipelineMultisampleStateCreateInfo::pname:rasterizationSamples is
1178e5c31af7Sopenharmony_ciused as the sample count for each attachment.
1179e5c31af7Sopenharmony_ciIf a graphics pipeline is created with a valid slink:VkRenderPass,
1180e5c31af7Sopenharmony_ciparameters of this structure are ignored.
1181e5c31af7Sopenharmony_ci
1182e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkAttachmentSampleCountInfoAMD.txt[]
1183e5c31af7Sopenharmony_ci--
1184e5c31af7Sopenharmony_ciendif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[]
1185e5c31af7Sopenharmony_ci
1186e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[]
1187e5c31af7Sopenharmony_ci
1188e5c31af7Sopenharmony_ciOnce recording starts, an application records a sequence of commands
1189e5c31af7Sopenharmony_ci(ftext:vkCmd*) to set state in the command buffer, draw, dispatch, and other
1190e5c31af7Sopenharmony_cicommands.
1191e5c31af7Sopenharmony_ci
1192e5c31af7Sopenharmony_ciifdef::VK_NV_device_generated_commands[]
1193e5c31af7Sopenharmony_ciSeveral commands can also be recorded indirectly from sname:VkBuffer
1194e5c31af7Sopenharmony_cicontent, see <<device-generated-commands>>.
1195e5c31af7Sopenharmony_ciendif::VK_NV_device_generated_commands[]
1196e5c31af7Sopenharmony_ci
1197e5c31af7Sopenharmony_ci[open,refpage='vkEndCommandBuffer',desc='Finish recording a command buffer',type='protos']
1198e5c31af7Sopenharmony_ci--
1199e5c31af7Sopenharmony_ciTo complete recording of a command buffer, call:
1200e5c31af7Sopenharmony_ci
1201e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkEndCommandBuffer.txt[]
1202e5c31af7Sopenharmony_ci
1203e5c31af7Sopenharmony_ci  * pname:commandBuffer is the command buffer to complete recording.
1204e5c31af7Sopenharmony_ci
1205e5c31af7Sopenharmony_ciIf there was an error during recording, the application will be notified by
1206e5c31af7Sopenharmony_cian unsuccessful return code returned by fname:vkEndCommandBuffer.
1207e5c31af7Sopenharmony_ciIf the application wishes to further use the command buffer, the command
1208e5c31af7Sopenharmony_cibuffer must: be reset.
1209e5c31af7Sopenharmony_ci
1210e5c31af7Sopenharmony_ciThe command buffer must: have been in the <<commandbuffers-lifecycle,
1211e5c31af7Sopenharmony_cirecording state>>, and is moved to the <<commandbuffers-lifecycle,
1212e5c31af7Sopenharmony_ciexecutable state>>.
1213e5c31af7Sopenharmony_ci
1214e5c31af7Sopenharmony_ci.Valid Usage
1215e5c31af7Sopenharmony_ci****
1216e5c31af7Sopenharmony_ci  * [[VUID-vkEndCommandBuffer-commandBuffer-00059]]
1217e5c31af7Sopenharmony_ci    pname:commandBuffer must: be in the <<commandbuffers-lifecycle,
1218e5c31af7Sopenharmony_ci    recording state>>
1219e5c31af7Sopenharmony_ci  * [[VUID-vkEndCommandBuffer-commandBuffer-00060]]
1220e5c31af7Sopenharmony_ci    If pname:commandBuffer is a primary command buffer, there must: not be
1221e5c31af7Sopenharmony_ci    an active render pass instance
1222e5c31af7Sopenharmony_ci  * [[VUID-vkEndCommandBuffer-commandBuffer-00061]]
1223e5c31af7Sopenharmony_ci    All queries made <<queries-operation-active,active>> during the
1224e5c31af7Sopenharmony_ci    recording of pname:commandBuffer must: have been made inactive
1225e5c31af7Sopenharmony_ciifdef::VK_EXT_conditional_rendering[]
1226e5c31af7Sopenharmony_ci  * [[VUID-vkEndCommandBuffer-None-01978]]
1227e5c31af7Sopenharmony_ci    Conditional rendering must: not be
1228e5c31af7Sopenharmony_ci    <<active-conditional-rendering,active>>
1229e5c31af7Sopenharmony_ciendif::VK_EXT_conditional_rendering[]
1230e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_utils[]
1231e5c31af7Sopenharmony_ci  * [[VUID-vkEndCommandBuffer-commandBuffer-01815]]
1232e5c31af7Sopenharmony_ci    If pname:commandBuffer is a secondary command buffer, there must: not be
1233e5c31af7Sopenharmony_ci    an outstanding flink:vkCmdBeginDebugUtilsLabelEXT command recorded to
1234e5c31af7Sopenharmony_ci    pname:commandBuffer that has not previously been ended by a call to
1235e5c31af7Sopenharmony_ci    flink:vkCmdEndDebugUtilsLabelEXT
1236e5c31af7Sopenharmony_ciendif::VK_EXT_debug_utils[]
1237e5c31af7Sopenharmony_ciifdef::VK_EXT_debug_marker[]
1238e5c31af7Sopenharmony_ci  * [[VUID-vkEndCommandBuffer-commandBuffer-00062]]
1239e5c31af7Sopenharmony_ci    If pname:commandBuffer is a secondary command buffer, there must: not be
1240e5c31af7Sopenharmony_ci    an outstanding flink:vkCmdDebugMarkerBeginEXT command recorded to
1241e5c31af7Sopenharmony_ci    pname:commandBuffer that has not previously been ended by a call to
1242e5c31af7Sopenharmony_ci    flink:vkCmdDebugMarkerEndEXT
1243e5c31af7Sopenharmony_ciendif::VK_EXT_debug_marker[]
1244e5c31af7Sopenharmony_ci****
1245e5c31af7Sopenharmony_ci
1246e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkEndCommandBuffer.txt[]
1247e5c31af7Sopenharmony_ci--
1248e5c31af7Sopenharmony_ci
1249e5c31af7Sopenharmony_ciWhen a command buffer is in the executable state, it can: be submitted to a
1250e5c31af7Sopenharmony_ciqueue for execution.
1251e5c31af7Sopenharmony_ci
1252e5c31af7Sopenharmony_ci
1253e5c31af7Sopenharmony_ci[[commandbuffers-submission]]
1254e5c31af7Sopenharmony_ci== Command Buffer Submission
1255e5c31af7Sopenharmony_ci
1256e5c31af7Sopenharmony_ci[NOTE]
1257e5c31af7Sopenharmony_ci.Note
1258e5c31af7Sopenharmony_ci====
1259e5c31af7Sopenharmony_ciSubmission can be a high overhead operation, and applications should:
1260e5c31af7Sopenharmony_ciattempt to batch work together into as few calls to fname:vkQueueSubmit
1261e5c31af7Sopenharmony_ciifdef::VK_KHR_synchronization2[]
1262e5c31af7Sopenharmony_cior fname:vkQueueSubmit2KHR
1263e5c31af7Sopenharmony_ciendif::VK_KHR_synchronization2[]
1264e5c31af7Sopenharmony_cias possible.
1265e5c31af7Sopenharmony_ci====
1266e5c31af7Sopenharmony_ci
1267e5c31af7Sopenharmony_ciifdef::VK_KHR_synchronization2[]
1268e5c31af7Sopenharmony_ci[open,refpage='vkQueueSubmit2KHR',desc='Submits command buffers to a queue',type='protos']
1269e5c31af7Sopenharmony_ci--
1270e5c31af7Sopenharmony_ciTo submit command buffers to a queue, call:
1271e5c31af7Sopenharmony_ci
1272e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkQueueSubmit2KHR.txt[]
1273e5c31af7Sopenharmony_ci
1274e5c31af7Sopenharmony_ci  * pname:queue is the queue that the command buffers will be submitted to.
1275e5c31af7Sopenharmony_ci  * pname:submitCount is the number of elements in the pname:pSubmits array.
1276e5c31af7Sopenharmony_ci  * pname:pSubmits is a pointer to an array of slink:VkSubmitInfo2KHR
1277e5c31af7Sopenharmony_ci    structures, each specifying a command buffer submission batch.
1278e5c31af7Sopenharmony_ci  * pname:fence is an optional: handle to a fence to be signaled once all
1279e5c31af7Sopenharmony_ci    submitted command buffers have completed execution.
1280e5c31af7Sopenharmony_ci    If pname:fence is not dlink:VK_NULL_HANDLE, it defines a
1281e5c31af7Sopenharmony_ci    <<synchronization-fences-signaling, fence signal operation>>.
1282e5c31af7Sopenharmony_ci
1283e5c31af7Sopenharmony_cifname:vkQueueSubmit2KHR is a <<devsandqueues-submission,queue submission
1284e5c31af7Sopenharmony_cicommand>>, with each batch defined by an element of pname:pSubmits.
1285e5c31af7Sopenharmony_ci
1286e5c31af7Sopenharmony_ciSemaphore operations submitted with flink:vkQueueSubmit2KHR have additional
1287e5c31af7Sopenharmony_ciordering constraints compared to other submission commands, with
1288e5c31af7Sopenharmony_cidependencies involving previous and subsequent queue operations.
1289e5c31af7Sopenharmony_ciInformation about these additional constraints can be found in the
1290e5c31af7Sopenharmony_ci<<synchronization-semaphores, semaphore>> section of <<synchronization, the
1291e5c31af7Sopenharmony_cisynchronization chapter>>.
1292e5c31af7Sopenharmony_ci
1293e5c31af7Sopenharmony_ciIf any command buffer submitted to this queue is in the
1294e5c31af7Sopenharmony_ci<<commandbuffers-lifecycle, executable state>>, it is moved to the
1295e5c31af7Sopenharmony_ci<<commandbuffers-lifecycle, pending state>>.
1296e5c31af7Sopenharmony_ciOnce execution of all submissions of a command buffer complete, it moves
1297e5c31af7Sopenharmony_cifrom the <<commandbuffers-lifecycle, pending state>>, back to the
1298e5c31af7Sopenharmony_ci<<commandbuffers-lifecycle, executable state>>.
1299e5c31af7Sopenharmony_ciIf a command buffer was recorded with the
1300e5c31af7Sopenharmony_ciename:VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT flag, it instead moves
1301e5c31af7Sopenharmony_ciback to the <<commandbuffers-lifecycle, invalid state>>.
1302e5c31af7Sopenharmony_ci
1303e5c31af7Sopenharmony_ciIf fname:vkQueueSubmit2KHR fails, it may: return
1304e5c31af7Sopenharmony_ciename:VK_ERROR_OUT_OF_HOST_MEMORY or ename:VK_ERROR_OUT_OF_DEVICE_MEMORY.
1305e5c31af7Sopenharmony_ciIf it does, the implementation must: ensure that the state and contents of
1306e5c31af7Sopenharmony_ciany resources or synchronization primitives referenced by the submitted
1307e5c31af7Sopenharmony_cicommand buffers and any semaphores referenced by pname:pSubmits is
1308e5c31af7Sopenharmony_ciunaffected by the call or its failure.
1309e5c31af7Sopenharmony_ciIf fname:vkQueueSubmit2KHR fails in such a way that the implementation is
1310e5c31af7Sopenharmony_ciunable to make that guarantee, the implementation must: return
1311e5c31af7Sopenharmony_ciename:VK_ERROR_DEVICE_LOST.
1312e5c31af7Sopenharmony_ciSee <<devsandqueues-lost-device,Lost Device>>.
1313e5c31af7Sopenharmony_ci
1314e5c31af7Sopenharmony_ci.Valid Usage
1315e5c31af7Sopenharmony_ci****
1316e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-fence-04894]]
1317e5c31af7Sopenharmony_ci    If pname:fence is not dlink:VK_NULL_HANDLE, pname:fence must: be
1318e5c31af7Sopenharmony_ci    unsignaled
1319e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-fence-04895]]
1320e5c31af7Sopenharmony_ci    If pname:fence is not dlink:VK_NULL_HANDLE, pname:fence must: not be
1321e5c31af7Sopenharmony_ci    associated with any other queue command that has not yet completed
1322e5c31af7Sopenharmony_ci    execution on that queue
1323e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-synchronization2-03866]]
1324e5c31af7Sopenharmony_ci    The <<features-synchronization2, pname:synchronization2>> feature must:
1325e5c31af7Sopenharmony_ci    be enabled
1326e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-commandBuffer-03867]]
1327e5c31af7Sopenharmony_ci    If a command recorded into the pname:commandBuffer member of any element
1328e5c31af7Sopenharmony_ci    of the pname:pCommandBufferInfos member of any element of pname:pSubmits
1329e5c31af7Sopenharmony_ci    referenced an slink:VkEvent, that event must: not be referenced by a
1330e5c31af7Sopenharmony_ci    command that has been submitted to another queue and is still in the
1331e5c31af7Sopenharmony_ci    _pending state_
1332e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-semaphore-03868]]
1333e5c31af7Sopenharmony_ci    The pname:semaphore member of any binary semaphore element of the
1334e5c31af7Sopenharmony_ci    pname:pSignalSemaphoreInfos member of any element of pname:pSubmits
1335e5c31af7Sopenharmony_ci    must: be unsignaled when the semaphore signal operation it defines is
1336e5c31af7Sopenharmony_ci    executed on the device
1337e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-stageMask-03869]]
1338e5c31af7Sopenharmony_ci    The pname:stageMask member of any element of the
1339e5c31af7Sopenharmony_ci    pname:pSignalSemaphoreInfos member of any element of pname:pSubmits
1340e5c31af7Sopenharmony_ci    must: only include pipeline stages that are supported by the queue
1341e5c31af7Sopenharmony_ci    family which pname:queue belongs to
1342e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-stageMask-03870]]
1343e5c31af7Sopenharmony_ci    The pname:stageMask member of any element of the
1344e5c31af7Sopenharmony_ci    pname:pWaitSemaphoreInfos member of any element of pname:pSubmits must:
1345e5c31af7Sopenharmony_ci    only include pipeline stages that are supported by the queue family
1346e5c31af7Sopenharmony_ci    which pname:queue belongs to
1347e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-semaphore-03871]]
1348e5c31af7Sopenharmony_ci    When a semaphore wait operation for a binary semaphore is executed, as
1349e5c31af7Sopenharmony_ci    defined by the pname:semaphore member of any element of the
1350e5c31af7Sopenharmony_ci    pname:pWaitSemaphoreInfos member of any element of pname:pSubmits, there
1351e5c31af7Sopenharmony_ci    must: be no other queues waiting on the same semaphore
1352e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-semaphore-03872]]
1353e5c31af7Sopenharmony_ci    The pname:semaphore member of any element of the
1354e5c31af7Sopenharmony_ci    pname:pWaitSemaphoreInfos member of any element of pname:pSubmits must:
1355e5c31af7Sopenharmony_ci    be semaphores that are signaled, or have
1356e5c31af7Sopenharmony_ci    <<synchronization-semaphores-signaling, semaphore signal operations>>
1357e5c31af7Sopenharmony_ci    previously submitted for execution
1358e5c31af7Sopenharmony_ciifdef::VK_KHR_timeline_semaphore[]
1359e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-semaphore-03873]]
1360e5c31af7Sopenharmony_ci    Any pname:semaphore member of any element of the
1361e5c31af7Sopenharmony_ci    pname:pWaitSemaphoreInfos member of any element of pname:pSubmits that
1362e5c31af7Sopenharmony_ci    was created with a elink:VkSemaphoreTypeKHR of
1363e5c31af7Sopenharmony_ci    ename:VK_SEMAPHORE_TYPE_BINARY_KHR must: reference a semaphore signal
1364e5c31af7Sopenharmony_ci    operation that has been submitted for execution and any semaphore signal
1365e5c31af7Sopenharmony_ci    operations on which it depends (if any) must: have also been submitted
1366e5c31af7Sopenharmony_ci    for execution
1367e5c31af7Sopenharmony_ciendif::VK_KHR_timeline_semaphore[]
1368e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-commandBuffer-03874]]
1369e5c31af7Sopenharmony_ci    The pname:commandBuffer member of any element of the
1370e5c31af7Sopenharmony_ci    pname:pCommandBufferInfos member of any element of pname:pSubmits must:
1371e5c31af7Sopenharmony_ci    be in the <<commandbuffers-lifecycle, pending or executable state>>
1372e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-commandBuffer-03875]]
1373e5c31af7Sopenharmony_ci    If a command recorded into the pname:commandBuffer member of any element
1374e5c31af7Sopenharmony_ci    of the pname:pCommandBufferInfos member of any element of pname:pSubmits
1375e5c31af7Sopenharmony_ci    was not recorded with the
1376e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT, it must: not be in
1377e5c31af7Sopenharmony_ci    the <<commandbuffers-lifecycle, pending state>>
1378e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-commandBuffer-03876]]
1379e5c31af7Sopenharmony_ci    Any <<commandbuffers-secondary, secondary command buffers recorded>>
1380e5c31af7Sopenharmony_ci    into the pname:commandBuffer member of any element of the
1381e5c31af7Sopenharmony_ci    pname:pCommandBufferInfos member of any element of pname:pSubmits must:
1382e5c31af7Sopenharmony_ci    be in the <<commandbuffers-lifecycle, pending or executable state>>
1383e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-commandBuffer-03877]]
1384e5c31af7Sopenharmony_ci    If any <<commandbuffers-secondary, secondary command buffers recorded>>
1385e5c31af7Sopenharmony_ci    into the pname:commandBuffer member of any element of the
1386e5c31af7Sopenharmony_ci    pname:pCommandBufferInfos member of any element of pname:pSubmits was
1387e5c31af7Sopenharmony_ci    not recorded with the
1388e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT, it must: not be in
1389e5c31af7Sopenharmony_ci    the <<commandbuffers-lifecycle, pending state>>
1390e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-commandBuffer-03878]]
1391e5c31af7Sopenharmony_ci    The pname:commandBuffer member of any element of the
1392e5c31af7Sopenharmony_ci    pname:pCommandBufferInfos member of any element of pname:pSubmits must:
1393e5c31af7Sopenharmony_ci    have been allocated from a sname:VkCommandPool that was created for the
1394e5c31af7Sopenharmony_ci    same queue family pname:queue belongs to
1395e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-commandBuffer-03879]]
1396e5c31af7Sopenharmony_ci    If a command recorded into the pname:commandBuffer member of any element
1397e5c31af7Sopenharmony_ci    of the pname:pCommandBufferInfos member of any element of pname:pSubmits
1398e5c31af7Sopenharmony_ci    includes a <<synchronization-queue-transfers-acquire, Queue Family
1399e5c31af7Sopenharmony_ci    Transfer Acquire Operation>>, there must: exist a previously submitted
1400e5c31af7Sopenharmony_ci    <<synchronization-queue-transfers-release, Queue Family Transfer Release
1401e5c31af7Sopenharmony_ci    Operation>> on a queue in the queue family identified by the acquire
1402e5c31af7Sopenharmony_ci    operation, with parameters matching the acquire operation as defined in
1403e5c31af7Sopenharmony_ci    the definition of such <<synchronization-queue-transfers-acquire,
1404e5c31af7Sopenharmony_ci    acquire operations>>, and which happens before the acquire operation
1405e5c31af7Sopenharmony_ciifdef::VK_KHR_performance_query[]
1406e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-commandBuffer-03880]]
1407e5c31af7Sopenharmony_ci    If a command recorded into the pname:commandBuffer member of any element
1408e5c31af7Sopenharmony_ci    of the pname:pCommandBufferInfos member of any element of pname:pSubmits
1409e5c31af7Sopenharmony_ci    was a flink:vkCmdBeginQuery whose pname:queryPool was created with a
1410e5c31af7Sopenharmony_ci    pname:queryType of ename:VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR, the
1411e5c31af7Sopenharmony_ci    <<profiling-lock, profiling lock>> must: have been held continuously on
1412e5c31af7Sopenharmony_ci    the sname:VkDevice that pname:queue was retrieved from, throughout
1413e5c31af7Sopenharmony_ci    recording of those command buffers
1414e5c31af7Sopenharmony_ciendif::VK_KHR_performance_query[]
1415e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
1416e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit2KHR-queue-06447]]
1417e5c31af7Sopenharmony_ci    If pname:queue was not created with
1418e5c31af7Sopenharmony_ci    ename:VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT, the pname:flags member of
1419e5c31af7Sopenharmony_ci    any element of pname:pSubmits must: not include
1420e5c31af7Sopenharmony_ci    ename:VK_SUBMIT_PROTECTED_BIT_KHR
1421e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
1422e5c31af7Sopenharmony_ci****
1423e5c31af7Sopenharmony_ci
1424e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkQueueSubmit2KHR.txt[]
1425e5c31af7Sopenharmony_ci--
1426e5c31af7Sopenharmony_ci
1427e5c31af7Sopenharmony_ci[open,refpage='VkSubmitInfo2KHR',desc='Structure specifying a queue submit operation',type='structs']
1428e5c31af7Sopenharmony_ci--
1429e5c31af7Sopenharmony_ciThe sname:VkSubmitInfo2KHR structure is defined as:
1430e5c31af7Sopenharmony_ci
1431e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubmitInfo2KHR.txt[]
1432e5c31af7Sopenharmony_ci
1433e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
1434e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1435e5c31af7Sopenharmony_ci    structure.
1436e5c31af7Sopenharmony_ci  * pname:flags is a bitmask of elink:VkSubmitFlagBitsKHR.
1437e5c31af7Sopenharmony_ci  * pname:waitSemaphoreInfoCount is the number of elements in
1438e5c31af7Sopenharmony_ci    pname:pWaitSemaphoreInfos.
1439e5c31af7Sopenharmony_ci  * pname:pWaitSemaphoreInfos is a pointer to an array of
1440e5c31af7Sopenharmony_ci    slink:VkSemaphoreSubmitInfoKHR structures defining
1441e5c31af7Sopenharmony_ci    <<synchronization-semaphores-waiting, semaphore wait operations>>.
1442e5c31af7Sopenharmony_ci  * pname:commandBufferInfoCount is the number of elements in
1443e5c31af7Sopenharmony_ci    pname:pCommandBufferInfos and the number of command buffers to execute
1444e5c31af7Sopenharmony_ci    in the batch.
1445e5c31af7Sopenharmony_ci  * pname:pCommandBufferInfos is a pointer to an array of
1446e5c31af7Sopenharmony_ci    slink:VkCommandBufferSubmitInfoKHR structures describing command buffers
1447e5c31af7Sopenharmony_ci    to execute in the batch.
1448e5c31af7Sopenharmony_ci  * pname:signalSemaphoreInfoCount is the number of elements in
1449e5c31af7Sopenharmony_ci    pname:pSignalSemaphoreInfos.
1450e5c31af7Sopenharmony_ci  * pname:pSignalSemaphoreInfos is a pointer to an array of
1451e5c31af7Sopenharmony_ci    slink:VkSemaphoreSubmitInfoKHR describing
1452e5c31af7Sopenharmony_ci    <<synchronization-semaphores-signaling, semaphore signal operations>>.
1453e5c31af7Sopenharmony_ci
1454e5c31af7Sopenharmony_ci.Valid Usage
1455e5c31af7Sopenharmony_ci****
1456e5c31af7Sopenharmony_ciifdef::VK_KHR_timeline_semaphore[]
1457e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo2KHR-semaphore-03881]]
1458e5c31af7Sopenharmony_ci    If the same semaphore is used as the pname:semaphore member of both an
1459e5c31af7Sopenharmony_ci    element of pname:pSignalSemaphoreInfos and pname:pWaitSemaphoreInfos,
1460e5c31af7Sopenharmony_ci    and that semaphore is a timeline semaphore, the pname:value member of
1461e5c31af7Sopenharmony_ci    the pname:pSignalSemaphoreInfos element must: be greater than the
1462e5c31af7Sopenharmony_ci    pname:value member of the pname:pWaitSemaphoreInfos element
1463e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo2KHR-semaphore-03882]]
1464e5c31af7Sopenharmony_ci    If the pname:semaphore member of any element of
1465e5c31af7Sopenharmony_ci    pname:pSignalSemaphoreInfos is a timeline semaphore, the pname:value
1466e5c31af7Sopenharmony_ci    member of that element must: have a value greater than the current value
1467e5c31af7Sopenharmony_ci    of the semaphore when the <<synchronization-semaphores-signaling,
1468e5c31af7Sopenharmony_ci    semaphore signal operation>> is executed
1469e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo2KHR-semaphore-03883]]
1470e5c31af7Sopenharmony_ci    If the pname:semaphore member of any element of
1471e5c31af7Sopenharmony_ci    pname:pSignalSemaphoreInfos is a timeline semaphore, the pname:value
1472e5c31af7Sopenharmony_ci    member of that element must: have a value which does not differ from the
1473e5c31af7Sopenharmony_ci    current value of the semaphore or the value of any outstanding semaphore
1474e5c31af7Sopenharmony_ci    wait or signal operation on that semaphore by more than
1475e5c31af7Sopenharmony_ci    <<limits-maxTimelineSemaphoreValueDifference,
1476e5c31af7Sopenharmony_ci    pname:maxTimelineSemaphoreValueDifference>>
1477e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo2KHR-semaphore-03884]]
1478e5c31af7Sopenharmony_ci    If the pname:semaphore member of any element of
1479e5c31af7Sopenharmony_ci    pname:pWaitSemaphoreInfos is a timeline semaphore, the pname:value
1480e5c31af7Sopenharmony_ci    member of that element must: have a value which does not differ from the
1481e5c31af7Sopenharmony_ci    current value of the semaphore or the value of any outstanding semaphore
1482e5c31af7Sopenharmony_ci    wait or signal operation on that semaphore by more than
1483e5c31af7Sopenharmony_ci    <<limits-maxTimelineSemaphoreValueDifference,
1484e5c31af7Sopenharmony_ci    pname:maxTimelineSemaphoreValueDifference>>
1485e5c31af7Sopenharmony_ciendif::VK_KHR_timeline_semaphore[]
1486e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
1487e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo2KHR-flags-03886]]
1488e5c31af7Sopenharmony_ci    If pname:flags includes ename:VK_SUBMIT_PROTECTED_BIT_KHR, all elements
1489e5c31af7Sopenharmony_ci    of pname:pCommandBuffers must: be protected command buffers
1490e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo2KHR-flags-03887]]
1491e5c31af7Sopenharmony_ci    If pname:flags does not include ename:VK_SUBMIT_PROTECTED_BIT_KHR, each
1492e5c31af7Sopenharmony_ci    element of pname:pCommandBuffers must: not be a protected command buffer
1493e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
1494e5c31af7Sopenharmony_ciifdef::VK_KHR_dynamic_rendering[]
1495e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo2KHR-commandBuffer-06192]]
1496e5c31af7Sopenharmony_ci    If any pname:commandBuffer member of an element of
1497e5c31af7Sopenharmony_ci    pname:pCommandBufferInfos contains any <<renderpass-suspension,resumed
1498e5c31af7Sopenharmony_ci    render pass instances>>, they must: be suspended by a render pass
1499e5c31af7Sopenharmony_ci    instance earlier in submission order within pname:pCommandBufferInfos
1500e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo2KHR-commandBuffer-06010]]
1501e5c31af7Sopenharmony_ci    If any pname:commandBuffer member of an element of
1502e5c31af7Sopenharmony_ci    pname:pCommandBufferInfos contains any <<renderpass-suspension,suspended
1503e5c31af7Sopenharmony_ci    render pass instances>>, they must: be resumed by a render pass instance
1504e5c31af7Sopenharmony_ci    later in submission order within pname:pCommandBufferInfos
1505e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo2KHR-commandBuffer-06011]]
1506e5c31af7Sopenharmony_ci    If any pname:commandBuffer member of an element of
1507e5c31af7Sopenharmony_ci    pname:pCommandBufferInfos contains any <<renderpass-suspension,suspended
1508e5c31af7Sopenharmony_ci    render pass instances>>, there must: be no action or synchronization
1509e5c31af7Sopenharmony_ci    commands between that render pass instance and the render pass instance
1510e5c31af7Sopenharmony_ci    that resumes it
1511e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo2KHR-commandBuffer-06012]]
1512e5c31af7Sopenharmony_ci    If any pname:commandBuffer member of an element of
1513e5c31af7Sopenharmony_ci    pname:pCommandBufferInfos contains any <<renderpass-suspension,suspended
1514e5c31af7Sopenharmony_ci    render pass instances>>, there must: be no render pass instances between
1515e5c31af7Sopenharmony_ci    that render pass instance and the render pass instance that resumes it
1516e5c31af7Sopenharmony_ciifdef::VK_EXT_sample_locations[]
1517e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo2KHR-variableSampleLocations-06013]]
1518e5c31af7Sopenharmony_ci    If the <<limits-variableSampleLocations, pname:variableSampleLocations>>
1519e5c31af7Sopenharmony_ci    limit is not supported, and any pname:commandBuffer member of an element
1520e5c31af7Sopenharmony_ci    of pname:pCommandBufferInfos contains any
1521e5c31af7Sopenharmony_ci    <<renderpass-suspension,suspended render pass instances>>, where a
1522e5c31af7Sopenharmony_ci    graphics pipeline has been bound, any pipelines bound in the render pass
1523e5c31af7Sopenharmony_ci    instance that resumes it, or any subsequent render pass instances that
1524e5c31af7Sopenharmony_ci    resume from that one and so on, must: use the same sample locations
1525e5c31af7Sopenharmony_ciendif::VK_EXT_sample_locations[]
1526e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[]
1527e5c31af7Sopenharmony_ci****
1528e5c31af7Sopenharmony_ci
1529e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSubmitInfo2KHR.txt[]
1530e5c31af7Sopenharmony_ci--
1531e5c31af7Sopenharmony_ci
1532e5c31af7Sopenharmony_ci[open,refpage='VkSubmitFlagBitsKHR',desc='Bitmask specifying behavior of a submission',type='enums']
1533e5c31af7Sopenharmony_ci--
1534e5c31af7Sopenharmony_ciBits which can: be set in slink:VkSubmitInfo2KHR::pname:flags to specify
1535e5c31af7Sopenharmony_cisubmission behavior are:
1536e5c31af7Sopenharmony_ci
1537e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkSubmitFlagBitsKHR.txt[]
1538e5c31af7Sopenharmony_ci
1539e5c31af7Sopenharmony_ci  * ename:VK_SUBMIT_PROTECTED_BIT_KHR specifies that this batch is a
1540e5c31af7Sopenharmony_ci    protected submission.
1541e5c31af7Sopenharmony_ci--
1542e5c31af7Sopenharmony_ci
1543e5c31af7Sopenharmony_ci[open,refpage='VkSubmitFlagsKHR',desc='Bitmask of VkSubmitFlagBitsKHR',type='flags']
1544e5c31af7Sopenharmony_ci--
1545e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkSubmitFlagsKHR.txt[]
1546e5c31af7Sopenharmony_ci
1547e5c31af7Sopenharmony_citname:VkSubmitFlagsKHR is a bitmask type for setting a mask of zero or more
1548e5c31af7Sopenharmony_cielink:VkSubmitFlagBitsKHR.
1549e5c31af7Sopenharmony_ci--
1550e5c31af7Sopenharmony_ci
1551e5c31af7Sopenharmony_ci[open,refpage='VkSemaphoreSubmitInfoKHR',desc='Structure specifying a semaphore signal or wait operation',type='structs']
1552e5c31af7Sopenharmony_ci--
1553e5c31af7Sopenharmony_ci:refpage: VkSemaphoreSubmitInfoKHR
1554e5c31af7Sopenharmony_ci
1555e5c31af7Sopenharmony_ciThe sname:VkSemaphoreSubmitInfoKHR structure is defined as:
1556e5c31af7Sopenharmony_ci
1557e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSemaphoreSubmitInfoKHR.txt[]
1558e5c31af7Sopenharmony_ci
1559e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
1560e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1561e5c31af7Sopenharmony_ci    structure.
1562e5c31af7Sopenharmony_ci  * pname:semaphore is a slink:VkSemaphore affected by this operation.
1563e5c31af7Sopenharmony_ci  * pname:value is
1564e5c31af7Sopenharmony_ciifdef::VK_KHR_timeline_semaphore[]
1565e5c31af7Sopenharmony_ci    either the value used to signal pname:semaphore or the value waited on
1566e5c31af7Sopenharmony_ci    by pname:semaphore, if pname:semaphore is a timeline semaphore.
1567e5c31af7Sopenharmony_ci    Otherwise it is
1568e5c31af7Sopenharmony_ciendif::VK_KHR_timeline_semaphore[]
1569e5c31af7Sopenharmony_ci    ignored.
1570e5c31af7Sopenharmony_ci  * pname:stageMask is a tlink:VkPipelineStageFlags2KHR mask of pipeline
1571e5c31af7Sopenharmony_ci    stages which limit the first synchronization scope of a semaphore signal
1572e5c31af7Sopenharmony_ci    operation, or second synchronization scope of a semaphore wait operation
1573e5c31af7Sopenharmony_ci    as described in the <<synchronization-semaphores-waiting, semaphore wait
1574e5c31af7Sopenharmony_ci    operation>> and <<synchronization-semaphores-signaling, semaphore signal
1575e5c31af7Sopenharmony_ci    operation>> sections of <<synchronization, the synchronization
1576e5c31af7Sopenharmony_ci    chapter>>.
1577e5c31af7Sopenharmony_ci  * pname:deviceIndex is the index of the device within a device group that
1578e5c31af7Sopenharmony_ci    executes the semaphore wait or signal operation.
1579e5c31af7Sopenharmony_ci
1580e5c31af7Sopenharmony_ciWhether this structure defines a semaphore wait or signal operation is
1581e5c31af7Sopenharmony_cidefined by how it is used.
1582e5c31af7Sopenharmony_ci
1583e5c31af7Sopenharmony_ci.Valid Usage
1584e5c31af7Sopenharmony_ci****
1585e5c31af7Sopenharmony_ci:stageMaskName: stageMask
1586e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/stage_mask_2_common.txt[]
1587e5c31af7Sopenharmony_ci  * [[VUID-VkSemaphoreSubmitInfoKHR-device-03888]]
1588e5c31af7Sopenharmony_ci    If the pname:device that pname:semaphore was created on is not a device
1589e5c31af7Sopenharmony_ci    group, pname:deviceIndex must: be `0`
1590e5c31af7Sopenharmony_ciifdef::VK_KHR_device_group_creation,VK_VERSION_1_1[]
1591e5c31af7Sopenharmony_ci  * [[VUID-VkSemaphoreSubmitInfoKHR-device-03889]]
1592e5c31af7Sopenharmony_ci    If the pname:device that pname:semaphore was created on is a device
1593e5c31af7Sopenharmony_ci    group, pname:deviceIndex must: be a valid device index
1594e5c31af7Sopenharmony_ciendif::VK_KHR_device_group_creation,VK_VERSION_1_1[]
1595e5c31af7Sopenharmony_ci****
1596e5c31af7Sopenharmony_ci
1597e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSemaphoreSubmitInfoKHR.txt[]
1598e5c31af7Sopenharmony_ci--
1599e5c31af7Sopenharmony_ci
1600e5c31af7Sopenharmony_ci[open,refpage='VkCommandBufferSubmitInfoKHR',desc='Structure specifying a command buffer submission',type='structs']
1601e5c31af7Sopenharmony_ci--
1602e5c31af7Sopenharmony_ciThe sname:VkCommandBufferSubmitInfoKHR structure is defined as:
1603e5c31af7Sopenharmony_ci
1604e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkCommandBufferSubmitInfoKHR.txt[]
1605e5c31af7Sopenharmony_ci
1606e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
1607e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1608e5c31af7Sopenharmony_ci    structure.
1609e5c31af7Sopenharmony_ci  * pname:commandBuffer is a slink:VkCommandBuffer to be submitted for
1610e5c31af7Sopenharmony_ci    execution.
1611e5c31af7Sopenharmony_ci  * pname:deviceMask is a bitmask indicating which devices in a device group
1612e5c31af7Sopenharmony_ci    execute the command buffer.
1613e5c31af7Sopenharmony_ci    A pname:deviceMask of `0` is equivalent to setting all bits
1614e5c31af7Sopenharmony_ci    corresponding to valid devices in the group to `1`.
1615e5c31af7Sopenharmony_ci
1616e5c31af7Sopenharmony_ci.Valid Usage
1617e5c31af7Sopenharmony_ci****
1618e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferSubmitInfoKHR-commandBuffer-03890]]
1619e5c31af7Sopenharmony_ci    pname:commandBuffer must: not have been allocated with
1620e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_LEVEL_SECONDARY
1621e5c31af7Sopenharmony_ciifdef::VK_KHR_device_group_creation,VK_VERSION_1_1[]
1622e5c31af7Sopenharmony_ci  * [[VUID-VkCommandBufferSubmitInfoKHR-deviceMask-03891]]
1623e5c31af7Sopenharmony_ci    If pname:deviceMask is not `0`, it must: be a valid device mask
1624e5c31af7Sopenharmony_ciendif::VK_KHR_device_group_creation,VK_VERSION_1_1[]
1625e5c31af7Sopenharmony_ci****
1626e5c31af7Sopenharmony_ci
1627e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkCommandBufferSubmitInfoKHR.txt[]
1628e5c31af7Sopenharmony_ci--
1629e5c31af7Sopenharmony_ciendif::VK_KHR_synchronization2[]
1630e5c31af7Sopenharmony_ci
1631e5c31af7Sopenharmony_ci[open,refpage='vkQueueSubmit',desc='Submits a sequence of semaphores or command buffers to a queue',type='protos']
1632e5c31af7Sopenharmony_ci--
1633e5c31af7Sopenharmony_ciTo submit command buffers to a queue, call:
1634e5c31af7Sopenharmony_ci
1635e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkQueueSubmit.txt[]
1636e5c31af7Sopenharmony_ci
1637e5c31af7Sopenharmony_ci  * pname:queue is the queue that the command buffers will be submitted to.
1638e5c31af7Sopenharmony_ci  * pname:submitCount is the number of elements in the pname:pSubmits array.
1639e5c31af7Sopenharmony_ci  * pname:pSubmits is a pointer to an array of slink:VkSubmitInfo
1640e5c31af7Sopenharmony_ci    structures, each specifying a command buffer submission batch.
1641e5c31af7Sopenharmony_ci  * pname:fence is an optional: handle to a fence to be signaled once all
1642e5c31af7Sopenharmony_ci    submitted command buffers have completed execution.
1643e5c31af7Sopenharmony_ci    If pname:fence is not dlink:VK_NULL_HANDLE, it defines a
1644e5c31af7Sopenharmony_ci    <<synchronization-fences-signaling, fence signal operation>>.
1645e5c31af7Sopenharmony_ci
1646e5c31af7Sopenharmony_cifname:vkQueueSubmit is a <<devsandqueues-submission,queue submission
1647e5c31af7Sopenharmony_cicommand>>, with each batch defined by an element of pname:pSubmits.
1648e5c31af7Sopenharmony_ciBatches begin execution in the order they appear in pname:pSubmits, but may:
1649e5c31af7Sopenharmony_cicomplete out of order.
1650e5c31af7Sopenharmony_ci
1651e5c31af7Sopenharmony_ciFence and semaphore operations submitted with flink:vkQueueSubmit have
1652e5c31af7Sopenharmony_ciadditional ordering constraints compared to other submission commands, with
1653e5c31af7Sopenharmony_cidependencies involving previous and subsequent queue operations.
1654e5c31af7Sopenharmony_ciInformation about these additional constraints can be found in the
1655e5c31af7Sopenharmony_ci<<synchronization-semaphores, semaphore>> and <<synchronization-fences,
1656e5c31af7Sopenharmony_cifence>> sections of <<synchronization, the synchronization chapter>>.
1657e5c31af7Sopenharmony_ci
1658e5c31af7Sopenharmony_ciDetails on the interaction of pname:pWaitDstStageMask with synchronization
1659e5c31af7Sopenharmony_ciare described in the <<synchronization-semaphores-waiting, semaphore wait
1660e5c31af7Sopenharmony_cioperation>> section of <<synchronization, the synchronization chapter>>.
1661e5c31af7Sopenharmony_ci
1662e5c31af7Sopenharmony_ciThe order that batches appear in pname:pSubmits is used to determine
1663e5c31af7Sopenharmony_ci<<synchronization-submission-order, submission order>>, and thus all the
1664e5c31af7Sopenharmony_ci<<synchronization-implicit, implicit ordering guarantees>> that respect it.
1665e5c31af7Sopenharmony_ciOther than these implicit ordering guarantees and any <<synchronization,
1666e5c31af7Sopenharmony_ciexplicit synchronization primitives>>, these batches may: overlap or
1667e5c31af7Sopenharmony_ciotherwise execute out of order.
1668e5c31af7Sopenharmony_ci
1669e5c31af7Sopenharmony_ciIf any command buffer submitted to this queue is in the
1670e5c31af7Sopenharmony_ci<<commandbuffers-lifecycle, executable state>>, it is moved to the
1671e5c31af7Sopenharmony_ci<<commandbuffers-lifecycle, pending state>>.
1672e5c31af7Sopenharmony_ciOnce execution of all submissions of a command buffer complete, it moves
1673e5c31af7Sopenharmony_cifrom the <<commandbuffers-lifecycle, pending state>>, back to the
1674e5c31af7Sopenharmony_ci<<commandbuffers-lifecycle, executable state>>.
1675e5c31af7Sopenharmony_ciIf a command buffer was recorded with the
1676e5c31af7Sopenharmony_ciename:VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT flag, it instead moves to
1677e5c31af7Sopenharmony_cithe <<commandbuffers-lifecycle, invalid state>>.
1678e5c31af7Sopenharmony_ci
1679e5c31af7Sopenharmony_ciIf fname:vkQueueSubmit fails, it may: return
1680e5c31af7Sopenharmony_ciename:VK_ERROR_OUT_OF_HOST_MEMORY or ename:VK_ERROR_OUT_OF_DEVICE_MEMORY.
1681e5c31af7Sopenharmony_ciIf it does, the implementation must: ensure that the state and contents of
1682e5c31af7Sopenharmony_ciany resources or synchronization primitives referenced by the submitted
1683e5c31af7Sopenharmony_cicommand buffers and any semaphores referenced by pname:pSubmits is
1684e5c31af7Sopenharmony_ciunaffected by the call or its failure.
1685e5c31af7Sopenharmony_ciIf fname:vkQueueSubmit fails in such a way that the implementation is unable
1686e5c31af7Sopenharmony_cito make that guarantee, the implementation must: return
1687e5c31af7Sopenharmony_ciename:VK_ERROR_DEVICE_LOST.
1688e5c31af7Sopenharmony_ciSee <<devsandqueues-lost-device,Lost Device>>.
1689e5c31af7Sopenharmony_ci
1690e5c31af7Sopenharmony_ci.Valid Usage
1691e5c31af7Sopenharmony_ci****
1692e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-fence-00063]]
1693e5c31af7Sopenharmony_ci    If pname:fence is not dlink:VK_NULL_HANDLE, pname:fence must: be
1694e5c31af7Sopenharmony_ci    unsignaled
1695e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-fence-00064]]
1696e5c31af7Sopenharmony_ci    If pname:fence is not dlink:VK_NULL_HANDLE, pname:fence must: not be
1697e5c31af7Sopenharmony_ci    associated with any other queue command that has not yet completed
1698e5c31af7Sopenharmony_ci    execution on that queue
1699e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-pCommandBuffers-00065]]
1700e5c31af7Sopenharmony_ci    Any calls to flink:vkCmdSetEvent, flink:vkCmdResetEvent or
1701e5c31af7Sopenharmony_ci    flink:vkCmdWaitEvents that have been recorded into any of the command
1702e5c31af7Sopenharmony_ci    buffer elements of the pname:pCommandBuffers member of any element of
1703e5c31af7Sopenharmony_ci    pname:pSubmits, must: not reference any slink:VkEvent that is referenced
1704e5c31af7Sopenharmony_ci    by any of those commands in a command buffer that has been submitted to
1705e5c31af7Sopenharmony_ci    another queue and is still in the _pending state_
1706e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-pWaitDstStageMask-00066]]
1707e5c31af7Sopenharmony_ci    Any stage flag included in any element of the pname:pWaitDstStageMask
1708e5c31af7Sopenharmony_ci    member of any element of pname:pSubmits must: be a pipeline stage
1709e5c31af7Sopenharmony_ci    supported by one of the capabilities of pname:queue, as specified in the
1710e5c31af7Sopenharmony_ci    <<synchronization-pipeline-stages-supported, table of supported pipeline
1711e5c31af7Sopenharmony_ci    stages>>
1712e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-pSignalSemaphores-00067]]
1713e5c31af7Sopenharmony_ci    Each binary semaphore element of the pname:pSignalSemaphores member of
1714e5c31af7Sopenharmony_ci    any element of pname:pSubmits must: be unsignaled when the semaphore
1715e5c31af7Sopenharmony_ci    signal operation it defines is executed on the device
1716e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-pWaitSemaphores-00068]]
1717e5c31af7Sopenharmony_ci    When a semaphore wait operation referring to a binary semaphore defined
1718e5c31af7Sopenharmony_ci    by any element of the pname:pWaitSemaphores member of any element of
1719e5c31af7Sopenharmony_ci    pname:pSubmits executes on pname:queue, there must: be no other queues
1720e5c31af7Sopenharmony_ci    waiting on the same semaphore
1721e5c31af7Sopenharmony_ciifndef::VK_KHR_timeline_semaphore[]
1722e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-pWaitSemaphores-00069]]
1723e5c31af7Sopenharmony_ci    All elements of the pname:pWaitSemaphores member of all elements of
1724e5c31af7Sopenharmony_ci    pname:pSubmits must: be semaphores that are signaled, or have
1725e5c31af7Sopenharmony_ci    <<synchronization-semaphores-signaling, semaphore signal operations>>
1726e5c31af7Sopenharmony_ci    previously submitted for execution
1727e5c31af7Sopenharmony_ciendif::VK_KHR_timeline_semaphore[]
1728e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_timeline_semaphore[]
1729e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-pWaitSemaphores-03238]]
1730e5c31af7Sopenharmony_ci    All elements of the pname:pWaitSemaphores member of all elements of
1731e5c31af7Sopenharmony_ci    pname:pSubmits created with a elink:VkSemaphoreType of
1732e5c31af7Sopenharmony_ci    ename:VK_SEMAPHORE_TYPE_BINARY must: reference a semaphore signal
1733e5c31af7Sopenharmony_ci    operation that has been submitted for execution and any semaphore signal
1734e5c31af7Sopenharmony_ci    operations on which it depends (if any) must: have also been submitted
1735e5c31af7Sopenharmony_ci    for execution
1736e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_timeline_semaphore[]
1737e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-pCommandBuffers-00070]]
1738e5c31af7Sopenharmony_ci    Each element of the pname:pCommandBuffers member of each element of
1739e5c31af7Sopenharmony_ci    pname:pSubmits must: be in the <<commandbuffers-lifecycle, pending or
1740e5c31af7Sopenharmony_ci    executable state>>
1741e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-pCommandBuffers-00071]]
1742e5c31af7Sopenharmony_ci    If any element of the pname:pCommandBuffers member of any element of
1743e5c31af7Sopenharmony_ci    pname:pSubmits was not recorded with the
1744e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT, it must: not be in
1745e5c31af7Sopenharmony_ci    the <<commandbuffers-lifecycle, pending state>>
1746e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-pCommandBuffers-00072]]
1747e5c31af7Sopenharmony_ci    Any <<commandbuffers-secondary, secondary command buffers recorded>>
1748e5c31af7Sopenharmony_ci    into any element of the pname:pCommandBuffers member of any element of
1749e5c31af7Sopenharmony_ci    pname:pSubmits must: be in the <<commandbuffers-lifecycle, pending or
1750e5c31af7Sopenharmony_ci    executable state>>
1751e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-pCommandBuffers-00073]]
1752e5c31af7Sopenharmony_ci    If any <<commandbuffers-secondary, secondary command buffers recorded>>
1753e5c31af7Sopenharmony_ci    into any element of the pname:pCommandBuffers member of any element of
1754e5c31af7Sopenharmony_ci    pname:pSubmits was not recorded with the
1755e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT, it must: not be in
1756e5c31af7Sopenharmony_ci    the <<commandbuffers-lifecycle, pending state>>
1757e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-pCommandBuffers-00074]]
1758e5c31af7Sopenharmony_ci    Each element of the pname:pCommandBuffers member of each element of
1759e5c31af7Sopenharmony_ci    pname:pSubmits must: have been allocated from a sname:VkCommandPool that
1760e5c31af7Sopenharmony_ci    was created for the same queue family pname:queue belongs to
1761e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-pSubmits-02207]]
1762e5c31af7Sopenharmony_ci    If any element of pname:pSubmits->pCommandBuffers includes a
1763e5c31af7Sopenharmony_ci    <<synchronization-queue-transfers-acquire, Queue Family Transfer Acquire
1764e5c31af7Sopenharmony_ci    Operation>>, there must: exist a previously submitted
1765e5c31af7Sopenharmony_ci    <<synchronization-queue-transfers-release, Queue Family Transfer Release
1766e5c31af7Sopenharmony_ci    Operation>> on a queue in the queue family identified by the acquire
1767e5c31af7Sopenharmony_ci    operation, with parameters matching the acquire operation as defined in
1768e5c31af7Sopenharmony_ci    the definition of such <<synchronization-queue-transfers-acquire,
1769e5c31af7Sopenharmony_ci    acquire operations>>, and which happens-before the acquire operation
1770e5c31af7Sopenharmony_ciifdef::VK_KHR_performance_query[]
1771e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-pCommandBuffers-03220]]
1772e5c31af7Sopenharmony_ci    If a command recorded into any element of pname:pCommandBuffers was a
1773e5c31af7Sopenharmony_ci    flink:vkCmdBeginQuery whose pname:queryPool was created with a
1774e5c31af7Sopenharmony_ci    pname:queryType of ename:VK_QUERY_TYPE_PERFORMANCE_QUERY_KHR, the
1775e5c31af7Sopenharmony_ci    <<profiling-lock, profiling lock>> must: have been held continuously on
1776e5c31af7Sopenharmony_ci    the sname:VkDevice that pname:queue was retrieved from, throughout
1777e5c31af7Sopenharmony_ci    recording of those command buffers
1778e5c31af7Sopenharmony_ciendif::VK_KHR_performance_query[]
1779e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-pSubmits-02808]]
1780e5c31af7Sopenharmony_ci    Any resource created with ename:VK_SHARING_MODE_EXCLUSIVE that is read
1781e5c31af7Sopenharmony_ci    by an operation specified by pname:pSubmits must: not be owned by any
1782e5c31af7Sopenharmony_ci    queue family other than the one which pname:queue belongs to, at the
1783e5c31af7Sopenharmony_ci    time it is executed
1784e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-pSubmits-04626]]
1785e5c31af7Sopenharmony_ci    Any resource created with ename:VK_SHARING_MODE_CONCURRENT that is
1786e5c31af7Sopenharmony_ci    accessed by an operation specified by pname:pSubmits must: have included
1787e5c31af7Sopenharmony_ci    the queue family of pname:queue at resource creation time
1788e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
1789e5c31af7Sopenharmony_ci  * [[VUID-vkQueueSubmit-queue-06448]]
1790e5c31af7Sopenharmony_ci    If pname:queue was not created with
1791e5c31af7Sopenharmony_ci    ename:VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT, there must: be no element of
1792e5c31af7Sopenharmony_ci    pname:pSubmits that includes an slink:VkProtectedSubmitInfo structure in
1793e5c31af7Sopenharmony_ci    its pname:pNext chain with pname:protectedSubmit equal to ename:VK_TRUE
1794e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
1795e5c31af7Sopenharmony_ci****
1796e5c31af7Sopenharmony_ci
1797e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkQueueSubmit.txt[]
1798e5c31af7Sopenharmony_ci--
1799e5c31af7Sopenharmony_ci
1800e5c31af7Sopenharmony_ci[open,refpage='VkSubmitInfo',desc='Structure specifying a queue submit operation',type='structs']
1801e5c31af7Sopenharmony_ci--
1802e5c31af7Sopenharmony_ci:refpage: VkSubmitInfo
1803e5c31af7Sopenharmony_ciThe sname:VkSubmitInfo structure is defined as:
1804e5c31af7Sopenharmony_ci
1805e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkSubmitInfo.txt[]
1806e5c31af7Sopenharmony_ci
1807e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
1808e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1809e5c31af7Sopenharmony_ci    structure.
1810e5c31af7Sopenharmony_ci  * pname:waitSemaphoreCount is the number of semaphores upon which to wait
1811e5c31af7Sopenharmony_ci    before executing the command buffers for the batch.
1812e5c31af7Sopenharmony_ci  * pname:pWaitSemaphores is a pointer to an array of slink:VkSemaphore
1813e5c31af7Sopenharmony_ci    handles upon which to wait before the command buffers for this batch
1814e5c31af7Sopenharmony_ci    begin execution.
1815e5c31af7Sopenharmony_ci    If semaphores to wait on are provided, they define a
1816e5c31af7Sopenharmony_ci    <<synchronization-semaphores-waiting, semaphore wait operation>>.
1817e5c31af7Sopenharmony_ci  * pname:pWaitDstStageMask is a pointer to an array of pipeline stages at
1818e5c31af7Sopenharmony_ci    which each corresponding semaphore wait will occur.
1819e5c31af7Sopenharmony_ci  * pname:commandBufferCount is the number of command buffers to execute in
1820e5c31af7Sopenharmony_ci    the batch.
1821e5c31af7Sopenharmony_ci  * pname:pCommandBuffers is a pointer to an array of slink:VkCommandBuffer
1822e5c31af7Sopenharmony_ci    handles to execute in the batch.
1823e5c31af7Sopenharmony_ci  * pname:signalSemaphoreCount is the number of semaphores to be signaled
1824e5c31af7Sopenharmony_ci    once the commands specified in pname:pCommandBuffers have completed
1825e5c31af7Sopenharmony_ci    execution.
1826e5c31af7Sopenharmony_ci  * pname:pSignalSemaphores is a pointer to an array of slink:VkSemaphore
1827e5c31af7Sopenharmony_ci    handles which will be signaled when the command buffers for this batch
1828e5c31af7Sopenharmony_ci    have completed execution.
1829e5c31af7Sopenharmony_ci    If semaphores to be signaled are provided, they define a
1830e5c31af7Sopenharmony_ci    <<synchronization-semaphores-signaling, semaphore signal operation>>.
1831e5c31af7Sopenharmony_ci
1832e5c31af7Sopenharmony_ciThe order that command buffers appear in pname:pCommandBuffers is used to
1833e5c31af7Sopenharmony_cidetermine <<synchronization-submission-order, submission order>>, and thus
1834e5c31af7Sopenharmony_ciall the <<synchronization-implicit, implicit ordering guarantees>> that
1835e5c31af7Sopenharmony_cirespect it.
1836e5c31af7Sopenharmony_ciOther than these implicit ordering guarantees and any <<synchronization,
1837e5c31af7Sopenharmony_ciexplicit synchronization primitives>>, these command buffers may: overlap or
1838e5c31af7Sopenharmony_ciotherwise execute out of order.
1839e5c31af7Sopenharmony_ci
1840e5c31af7Sopenharmony_ci
1841e5c31af7Sopenharmony_ci.Valid Usage
1842e5c31af7Sopenharmony_ci****
1843e5c31af7Sopenharmony_ci:stageMaskName: pWaitDstStageMask
1844e5c31af7Sopenharmony_ciinclude::{chapters}/commonvalidity/stage_mask_common.txt[]
1845e5c31af7Sopenharmony_ci
1846e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo-pCommandBuffers-00075]]
1847e5c31af7Sopenharmony_ci    Each element of pname:pCommandBuffers must: not have been allocated with
1848e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_LEVEL_SECONDARY
1849e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo-pWaitDstStageMask-00078]]
1850e5c31af7Sopenharmony_ci    Each element of pname:pWaitDstStageMask must: not include
1851e5c31af7Sopenharmony_ci    ename:VK_PIPELINE_STAGE_HOST_BIT
1852e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_timeline_semaphore[]
1853e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo-pWaitSemaphores-03239]]
1854e5c31af7Sopenharmony_ci    If any element of pname:pWaitSemaphores or pname:pSignalSemaphores was
1855e5c31af7Sopenharmony_ci    created with a elink:VkSemaphoreType of
1856e5c31af7Sopenharmony_ci    ename:VK_SEMAPHORE_TYPE_TIMELINE, then the pname:pNext chain must:
1857e5c31af7Sopenharmony_ci    include a slink:VkTimelineSemaphoreSubmitInfo structure
1858e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo-pNext-03240]]
1859e5c31af7Sopenharmony_ci    If the pname:pNext chain of this structure includes a
1860e5c31af7Sopenharmony_ci    slink:VkTimelineSemaphoreSubmitInfo structure and any element of
1861e5c31af7Sopenharmony_ci    pname:pWaitSemaphores was created with a elink:VkSemaphoreType of
1862e5c31af7Sopenharmony_ci    ename:VK_SEMAPHORE_TYPE_TIMELINE, then its pname:waitSemaphoreValueCount
1863e5c31af7Sopenharmony_ci    member must: equal pname:waitSemaphoreCount
1864e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo-pNext-03241]]
1865e5c31af7Sopenharmony_ci    If the pname:pNext chain of this structure includes a
1866e5c31af7Sopenharmony_ci    slink:VkTimelineSemaphoreSubmitInfo structure and any element of
1867e5c31af7Sopenharmony_ci    pname:pSignalSemaphores was created with a elink:VkSemaphoreType of
1868e5c31af7Sopenharmony_ci    ename:VK_SEMAPHORE_TYPE_TIMELINE, then its
1869e5c31af7Sopenharmony_ci    pname:signalSemaphoreValueCount member must: equal
1870e5c31af7Sopenharmony_ci    pname:signalSemaphoreCount
1871e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo-pSignalSemaphores-03242]]
1872e5c31af7Sopenharmony_ci    For each element of pname:pSignalSemaphores created with a
1873e5c31af7Sopenharmony_ci    elink:VkSemaphoreType of ename:VK_SEMAPHORE_TYPE_TIMELINE the
1874e5c31af7Sopenharmony_ci    corresponding element of
1875e5c31af7Sopenharmony_ci    slink:VkTimelineSemaphoreSubmitInfo::pname:pSignalSemaphoreValues must:
1876e5c31af7Sopenharmony_ci    have a value greater than the current value of the semaphore when the
1877e5c31af7Sopenharmony_ci    <<synchronization-semaphores-signaling,semaphore signal operation>> is
1878e5c31af7Sopenharmony_ci    executed
1879e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo-pWaitSemaphores-03243]]
1880e5c31af7Sopenharmony_ci    For each element of pname:pWaitSemaphores created with a
1881e5c31af7Sopenharmony_ci    elink:VkSemaphoreType of ename:VK_SEMAPHORE_TYPE_TIMELINE the
1882e5c31af7Sopenharmony_ci    corresponding element of
1883e5c31af7Sopenharmony_ci    slink:VkTimelineSemaphoreSubmitInfo::pname:pWaitSemaphoreValues must:
1884e5c31af7Sopenharmony_ci    have a value which does not differ from the current value of the
1885e5c31af7Sopenharmony_ci    semaphore or the value of any outstanding semaphore wait or signal
1886e5c31af7Sopenharmony_ci    operation on that semaphore by more than
1887e5c31af7Sopenharmony_ci    <<limits-maxTimelineSemaphoreValueDifference,
1888e5c31af7Sopenharmony_ci    pname:maxTimelineSemaphoreValueDifference>>
1889e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo-pSignalSemaphores-03244]]
1890e5c31af7Sopenharmony_ci    For each element of pname:pSignalSemaphores created with a
1891e5c31af7Sopenharmony_ci    elink:VkSemaphoreType of ename:VK_SEMAPHORE_TYPE_TIMELINE the
1892e5c31af7Sopenharmony_ci    corresponding element of
1893e5c31af7Sopenharmony_ci    slink:VkTimelineSemaphoreSubmitInfo::pname:pSignalSemaphoreValues must:
1894e5c31af7Sopenharmony_ci    have a value which does not differ from the current value of the
1895e5c31af7Sopenharmony_ci    semaphore or the value of any outstanding semaphore wait or signal
1896e5c31af7Sopenharmony_ci    operation on that semaphore by more than
1897e5c31af7Sopenharmony_ci    <<limits-maxTimelineSemaphoreValueDifference,
1898e5c31af7Sopenharmony_ci    pname:maxTimelineSemaphoreValueDifference>>
1899e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_timeline_semaphore[]
1900e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
1901e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo-pNext-04120]]
1902e5c31af7Sopenharmony_ci    If the pname:pNext chain of this structure does not include a
1903e5c31af7Sopenharmony_ci    sname:VkProtectedSubmitInfo structure with pname:protectedSubmit set to
1904e5c31af7Sopenharmony_ci    ename:VK_TRUE, then each element of the pname:pCommandBuffers array
1905e5c31af7Sopenharmony_ci    must: be an unprotected command buffer
1906e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo-pNext-04148]]
1907e5c31af7Sopenharmony_ci    If the pname:pNext chain of this structure includes a
1908e5c31af7Sopenharmony_ci    sname:VkProtectedSubmitInfo structure with pname:protectedSubmit set to
1909e5c31af7Sopenharmony_ci    ename:VK_TRUE, then each element of the pname:pCommandBuffers array
1910e5c31af7Sopenharmony_ci    must: be a protected command buffer
1911e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
1912e5c31af7Sopenharmony_ciifdef::VK_KHR_dynamic_rendering[]
1913e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo-pCommandBuffers-06193]]
1914e5c31af7Sopenharmony_ci    If pname:pCommandBuffers contains any <<renderpass-suspension,resumed
1915e5c31af7Sopenharmony_ci    render pass instances>>, they must: be suspended by a render pass
1916e5c31af7Sopenharmony_ci    instance earlier in submission order within pname:pCommandBuffers
1917e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo-pCommandBuffers-06014]]
1918e5c31af7Sopenharmony_ci    If pname:pCommandBuffers contains any <<renderpass-suspension,suspended
1919e5c31af7Sopenharmony_ci    render pass instances>>, they must: be resumed by a render pass instance
1920e5c31af7Sopenharmony_ci    later in submission order within pname:pCommandBuffers
1921e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo-pCommandBuffers-06015]]
1922e5c31af7Sopenharmony_ci    If pname:pCommandBuffers contains any <<renderpass-suspension,suspended
1923e5c31af7Sopenharmony_ci    render pass instances>>, there must: be no action or synchronization
1924e5c31af7Sopenharmony_ci    commands between that render pass instance and the render pass instance
1925e5c31af7Sopenharmony_ci    that resumes it
1926e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo-pCommandBuffers-06016]]
1927e5c31af7Sopenharmony_ci    If pname:pCommandBuffers contains any <<renderpass-suspension,suspended
1928e5c31af7Sopenharmony_ci    render pass instances>>, there must: be no render pass instances between
1929e5c31af7Sopenharmony_ci    that render pass instance and the render pass instance that resumes it
1930e5c31af7Sopenharmony_ciifdef::VK_EXT_sample_locations[]
1931e5c31af7Sopenharmony_ci  * [[VUID-VkSubmitInfo-variableSampleLocations-06017]]
1932e5c31af7Sopenharmony_ci    If the <<limits-variableSampleLocations, pname:variableSampleLocations>>
1933e5c31af7Sopenharmony_ci    limit is not supported, and any element of pname:pCommandBuffers
1934e5c31af7Sopenharmony_ci    contains any <<renderpass-suspension,suspended render pass instances>>,
1935e5c31af7Sopenharmony_ci    where a graphics pipeline has been bound, any pipelines bound in the
1936e5c31af7Sopenharmony_ci    render pass instance that resumes it, or any subsequent render pass
1937e5c31af7Sopenharmony_ci    instances that resume from that one and so on, must: use the same sample
1938e5c31af7Sopenharmony_ci    locations
1939e5c31af7Sopenharmony_ciendif::VK_EXT_sample_locations[]
1940e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[]
1941e5c31af7Sopenharmony_ci****
1942e5c31af7Sopenharmony_ci
1943e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkSubmitInfo.txt[]
1944e5c31af7Sopenharmony_ci--
1945e5c31af7Sopenharmony_ci
1946e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_timeline_semaphore[]
1947e5c31af7Sopenharmony_ci[open,refpage='VkTimelineSemaphoreSubmitInfo',desc='Structure specifying signal and wait values for timeline semaphores',type='structs',alias='VkTimelineSemaphoreSubmitInfoKHR']
1948e5c31af7Sopenharmony_ci--
1949e5c31af7Sopenharmony_ciTo specify the values to use when waiting for and signaling semaphores
1950e5c31af7Sopenharmony_cicreated with a elink:VkSemaphoreType of ename:VK_SEMAPHORE_TYPE_TIMELINE,
1951e5c31af7Sopenharmony_ciadd a slink:VkTimelineSemaphoreSubmitInfo structure to the pname:pNext chain
1952e5c31af7Sopenharmony_ciof the slink:VkSubmitInfo structure when using flink:vkQueueSubmit or the
1953e5c31af7Sopenharmony_cislink:VkBindSparseInfo structure when using flink:vkQueueBindSparse.
1954e5c31af7Sopenharmony_ciThe sname:VkTimelineSemaphoreSubmitInfo structure is defined as:
1955e5c31af7Sopenharmony_ci
1956e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkTimelineSemaphoreSubmitInfo.txt[]
1957e5c31af7Sopenharmony_ci
1958e5c31af7Sopenharmony_ciifdef::VK_KHR_timeline_semaphore[]
1959e5c31af7Sopenharmony_cior the equivalent
1960e5c31af7Sopenharmony_ci
1961e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkTimelineSemaphoreSubmitInfoKHR.txt[]
1962e5c31af7Sopenharmony_ciendif::VK_KHR_timeline_semaphore[]
1963e5c31af7Sopenharmony_ci
1964e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
1965e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
1966e5c31af7Sopenharmony_ci    structure.
1967e5c31af7Sopenharmony_ci  * pname:waitSemaphoreValueCount is the number of semaphore wait values
1968e5c31af7Sopenharmony_ci    specified in pname:pWaitSemaphoreValues.
1969e5c31af7Sopenharmony_ci  * pname:pWaitSemaphoreValues is a pointer to an array of
1970e5c31af7Sopenharmony_ci    pname:waitSemaphoreValueCount values for the corresponding semaphores in
1971e5c31af7Sopenharmony_ci    slink:VkSubmitInfo::pname:pWaitSemaphores to wait for.
1972e5c31af7Sopenharmony_ci  * pname:signalSemaphoreValueCount is the number of semaphore signal values
1973e5c31af7Sopenharmony_ci    specified in pname:pSignalSemaphoreValues.
1974e5c31af7Sopenharmony_ci  * pname:pSignalSemaphoreValues is a pointer to an array
1975e5c31af7Sopenharmony_ci    pname:signalSemaphoreValueCount values for the corresponding semaphores
1976e5c31af7Sopenharmony_ci    in slink:VkSubmitInfo::pname:pSignalSemaphores to set when signaled.
1977e5c31af7Sopenharmony_ci
1978e5c31af7Sopenharmony_ciIf the semaphore in slink:VkSubmitInfo::pname:pWaitSemaphores or
1979e5c31af7Sopenharmony_cislink:VkSubmitInfo::pname:pSignalSemaphores corresponding to an entry in
1980e5c31af7Sopenharmony_cipname:pWaitSemaphoreValues or pname:pSignalSemaphoreValues respectively was
1981e5c31af7Sopenharmony_cinot created with a elink:VkSemaphoreType of
1982e5c31af7Sopenharmony_ciename:VK_SEMAPHORE_TYPE_TIMELINE, the implementation must: ignore the value
1983e5c31af7Sopenharmony_ciin the pname:pWaitSemaphoreValues or pname:pSignalSemaphoreValues entry.
1984e5c31af7Sopenharmony_ci
1985e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkTimelineSemaphoreSubmitInfo.txt[]
1986e5c31af7Sopenharmony_ci--
1987e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_timeline_semaphore[]
1988e5c31af7Sopenharmony_ci
1989e5c31af7Sopenharmony_ciifdef::VK_KHR_external_semaphore_win32[]
1990e5c31af7Sopenharmony_ci[open,refpage='VkD3D12FenceSubmitInfoKHR',desc='Structure specifying values for Direct3D 12 fence-backed semaphores',type='structs']
1991e5c31af7Sopenharmony_ci--
1992e5c31af7Sopenharmony_ciTo specify the values to use when waiting for and signaling semaphores whose
1993e5c31af7Sopenharmony_ci<<synchronization-semaphores-importing,current payload>> refers to a
1994e5c31af7Sopenharmony_ciDirect3D 12 fence, add a slink:VkD3D12FenceSubmitInfoKHR structure to the
1995e5c31af7Sopenharmony_cipname:pNext chain of the slink:VkSubmitInfo structure.
1996e5c31af7Sopenharmony_ciThe sname:VkD3D12FenceSubmitInfoKHR structure is defined as:
1997e5c31af7Sopenharmony_ci
1998e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkD3D12FenceSubmitInfoKHR.txt[]
1999e5c31af7Sopenharmony_ci
2000e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
2001e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
2002e5c31af7Sopenharmony_ci    structure.
2003e5c31af7Sopenharmony_ci  * pname:waitSemaphoreValuesCount is the number of semaphore wait values
2004e5c31af7Sopenharmony_ci    specified in pname:pWaitSemaphoreValues.
2005e5c31af7Sopenharmony_ci  * pname:pWaitSemaphoreValues is a pointer to an array of
2006e5c31af7Sopenharmony_ci    pname:waitSemaphoreValuesCount values for the corresponding semaphores
2007e5c31af7Sopenharmony_ci    in slink:VkSubmitInfo::pname:pWaitSemaphores to wait for.
2008e5c31af7Sopenharmony_ci  * pname:signalSemaphoreValuesCount is the number of semaphore signal
2009e5c31af7Sopenharmony_ci    values specified in pname:pSignalSemaphoreValues.
2010e5c31af7Sopenharmony_ci  * pname:pSignalSemaphoreValues is a pointer to an array of
2011e5c31af7Sopenharmony_ci    pname:signalSemaphoreValuesCount values for the corresponding semaphores
2012e5c31af7Sopenharmony_ci    in slink:VkSubmitInfo::pname:pSignalSemaphores to set when signaled.
2013e5c31af7Sopenharmony_ci
2014e5c31af7Sopenharmony_ciIf the semaphore in slink:VkSubmitInfo::pname:pWaitSemaphores or
2015e5c31af7Sopenharmony_cislink:VkSubmitInfo::pname:pSignalSemaphores corresponding to an entry in
2016e5c31af7Sopenharmony_cipname:pWaitSemaphoreValues or pname:pSignalSemaphoreValues respectively does
2017e5c31af7Sopenharmony_cinot currently have a <<synchronization-semaphores-payloads, payload>>
2018e5c31af7Sopenharmony_cireferring to a Direct3D 12 fence, the implementation must: ignore the value
2019e5c31af7Sopenharmony_ciin the pname:pWaitSemaphoreValues or pname:pSignalSemaphoreValues entry.
2020e5c31af7Sopenharmony_ci
2021e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_timeline_semaphore[]
2022e5c31af7Sopenharmony_ci[NOTE]
2023e5c31af7Sopenharmony_ci.Note
2024e5c31af7Sopenharmony_ci====
2025e5c31af7Sopenharmony_ciAs the introduction of the external semaphore handle type
2026e5c31af7Sopenharmony_ciename:VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT predates that of
2027e5c31af7Sopenharmony_citimeline semaphores, support for importing semaphore payloads from external
2028e5c31af7Sopenharmony_cihandles of that type into semaphores created (implicitly or explicitly) with
2029e5c31af7Sopenharmony_cia elink:VkSemaphoreType of ename:VK_SEMAPHORE_TYPE_BINARY is preserved for
2030e5c31af7Sopenharmony_cibackwards compatibility.
2031e5c31af7Sopenharmony_ciHowever, applications should: prefer importing such handle types into
2032e5c31af7Sopenharmony_cisemaphores created with a elink:VkSemaphoreType of
2033e5c31af7Sopenharmony_ciename:VK_SEMAPHORE_TYPE_TIMELINE, and use the
2034e5c31af7Sopenharmony_cislink:VkTimelineSemaphoreSubmitInfo structure instead of the
2035e5c31af7Sopenharmony_cisname:VkD3D12FenceSubmitInfoKHR structure to specify the values to use when
2036e5c31af7Sopenharmony_ciwaiting for and signaling such semaphores.
2037e5c31af7Sopenharmony_ci====
2038e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_timeline_semaphore[]
2039e5c31af7Sopenharmony_ci
2040e5c31af7Sopenharmony_ci.Valid Usage
2041e5c31af7Sopenharmony_ci****
2042e5c31af7Sopenharmony_ci  * [[VUID-VkD3D12FenceSubmitInfoKHR-waitSemaphoreValuesCount-00079]]
2043e5c31af7Sopenharmony_ci    pname:waitSemaphoreValuesCount must: be the same value as
2044e5c31af7Sopenharmony_ci    sname:VkSubmitInfo::pname:waitSemaphoreCount, where sname:VkSubmitInfo
2045e5c31af7Sopenharmony_ci    is in the pname:pNext chain of this sname:VkD3D12FenceSubmitInfoKHR
2046e5c31af7Sopenharmony_ci    structure
2047e5c31af7Sopenharmony_ci  * [[VUID-VkD3D12FenceSubmitInfoKHR-signalSemaphoreValuesCount-00080]]
2048e5c31af7Sopenharmony_ci    pname:signalSemaphoreValuesCount must: be the same value as
2049e5c31af7Sopenharmony_ci    sname:VkSubmitInfo::pname:signalSemaphoreCount, where sname:VkSubmitInfo
2050e5c31af7Sopenharmony_ci    is in the pname:pNext chain of this sname:VkD3D12FenceSubmitInfoKHR
2051e5c31af7Sopenharmony_ci    structure
2052e5c31af7Sopenharmony_ci****
2053e5c31af7Sopenharmony_ci
2054e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkD3D12FenceSubmitInfoKHR.txt[]
2055e5c31af7Sopenharmony_ci--
2056e5c31af7Sopenharmony_ciendif::VK_KHR_external_semaphore_win32[]
2057e5c31af7Sopenharmony_ci
2058e5c31af7Sopenharmony_ciifdef::VK_KHR_win32_keyed_mutex[]
2059e5c31af7Sopenharmony_ci[open,refpage='VkWin32KeyedMutexAcquireReleaseInfoKHR',desc='Use the Windows keyed mutex mechanism to synchronize work',type='structs']
2060e5c31af7Sopenharmony_ci--
2061e5c31af7Sopenharmony_ciWhen submitting work that operates on memory imported from a Direct3D 11
2062e5c31af7Sopenharmony_ciresource to a queue, the keyed mutex mechanism may: be used in addition to
2063e5c31af7Sopenharmony_ciVulkan semaphores to synchronize the work.
2064e5c31af7Sopenharmony_ciKeyed mutexes are a property of a properly created shareable Direct3D 11
2065e5c31af7Sopenharmony_ciresource.
2066e5c31af7Sopenharmony_ciThey can: only be used if the imported resource was created with the
2067e5c31af7Sopenharmony_cietext:D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX flag.
2068e5c31af7Sopenharmony_ci
2069e5c31af7Sopenharmony_ciTo acquire keyed mutexes before submitted work and/or release them after,
2070e5c31af7Sopenharmony_ciadd a slink:VkWin32KeyedMutexAcquireReleaseInfoKHR structure to the
2071e5c31af7Sopenharmony_cipname:pNext chain of the slink:VkSubmitInfo structure.
2072e5c31af7Sopenharmony_ci
2073e5c31af7Sopenharmony_ciThe sname:VkWin32KeyedMutexAcquireReleaseInfoKHR structure is defined as:
2074e5c31af7Sopenharmony_ci
2075e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkWin32KeyedMutexAcquireReleaseInfoKHR.txt[]
2076e5c31af7Sopenharmony_ci
2077e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
2078e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
2079e5c31af7Sopenharmony_ci    structure.
2080e5c31af7Sopenharmony_ci  * pname:acquireCount is the number of entries in the pname:pAcquireSyncs,
2081e5c31af7Sopenharmony_ci    pname:pAcquireKeys, and pname:pAcquireTimeouts arrays.
2082e5c31af7Sopenharmony_ci  * pname:pAcquireSyncs is a pointer to an array of slink:VkDeviceMemory
2083e5c31af7Sopenharmony_ci    objects which were imported from Direct3D 11 resources.
2084e5c31af7Sopenharmony_ci  * pname:pAcquireKeys is a pointer to an array of mutex key values to wait
2085e5c31af7Sopenharmony_ci    for prior to beginning the submitted work.
2086e5c31af7Sopenharmony_ci    Entries refer to the keyed mutex associated with the corresponding
2087e5c31af7Sopenharmony_ci    entries in pname:pAcquireSyncs.
2088e5c31af7Sopenharmony_ci  * pname:pAcquireTimeouts is a pointer to an array of timeout values, in
2089e5c31af7Sopenharmony_ci    millisecond units, for each acquire specified in pname:pAcquireKeys.
2090e5c31af7Sopenharmony_ci  * pname:releaseCount is the number of entries in the pname:pReleaseSyncs
2091e5c31af7Sopenharmony_ci    and pname:pReleaseKeys arrays.
2092e5c31af7Sopenharmony_ci  * pname:pReleaseSyncs is a pointer to an array of slink:VkDeviceMemory
2093e5c31af7Sopenharmony_ci    objects which were imported from Direct3D 11 resources.
2094e5c31af7Sopenharmony_ci  * pname:pReleaseKeys is a pointer to an array of mutex key values to set
2095e5c31af7Sopenharmony_ci    when the submitted work has completed.
2096e5c31af7Sopenharmony_ci    Entries refer to the keyed mutex associated with the corresponding
2097e5c31af7Sopenharmony_ci    entries in pname:pReleaseSyncs.
2098e5c31af7Sopenharmony_ci
2099e5c31af7Sopenharmony_ci.Valid Usage
2100e5c31af7Sopenharmony_ci****
2101e5c31af7Sopenharmony_ci  * [[VUID-VkWin32KeyedMutexAcquireReleaseInfoKHR-pAcquireSyncs-00081]]
2102e5c31af7Sopenharmony_ci    Each member of pname:pAcquireSyncs and pname:pReleaseSyncs must: be a
2103e5c31af7Sopenharmony_ci    device memory object imported by setting
2104e5c31af7Sopenharmony_ci    slink:VkImportMemoryWin32HandleInfoKHR::pname:handleType to
2105e5c31af7Sopenharmony_ci    ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT or
2106e5c31af7Sopenharmony_ci    ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT
2107e5c31af7Sopenharmony_ci****
2108e5c31af7Sopenharmony_ci
2109e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkWin32KeyedMutexAcquireReleaseInfoKHR.txt[]
2110e5c31af7Sopenharmony_ci--
2111e5c31af7Sopenharmony_ciendif::VK_KHR_win32_keyed_mutex[]
2112e5c31af7Sopenharmony_ci
2113e5c31af7Sopenharmony_ciifdef::VK_NV_win32_keyed_mutex[]
2114e5c31af7Sopenharmony_ciinclude::{chapters}/VK_NV_win32_keyed_mutex/keyed_mutex_submit.txt[]
2115e5c31af7Sopenharmony_ciendif::VK_NV_win32_keyed_mutex[]
2116e5c31af7Sopenharmony_ci
2117e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
2118e5c31af7Sopenharmony_ci[open,refpage='VkProtectedSubmitInfo',desc='Structure indicating whether the submission is protected',type='structs']
2119e5c31af7Sopenharmony_ci--
2120e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkSubmitInfo includes a
2121e5c31af7Sopenharmony_cisname:VkProtectedSubmitInfo structure, then the structure indicates whether
2122e5c31af7Sopenharmony_cithe batch is protected.
2123e5c31af7Sopenharmony_ciThe sname:VkProtectedSubmitInfo structure is defined as:
2124e5c31af7Sopenharmony_ci
2125e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkProtectedSubmitInfo.txt[]
2126e5c31af7Sopenharmony_ci
2127e5c31af7Sopenharmony_ci  * pname:protectedSubmit specifies whether the batch is protected.
2128e5c31af7Sopenharmony_ci    If pname:protectedSubmit is ename:VK_TRUE, the batch is protected.
2129e5c31af7Sopenharmony_ci    If pname:protectedSubmit is ename:VK_FALSE, the batch is unprotected.
2130e5c31af7Sopenharmony_ci    If the sname:VkSubmitInfo::pname:pNext chain does not include this
2131e5c31af7Sopenharmony_ci    structure, the batch is unprotected.
2132e5c31af7Sopenharmony_ci
2133e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkProtectedSubmitInfo.txt[]
2134e5c31af7Sopenharmony_ci--
2135e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
2136e5c31af7Sopenharmony_ci
2137e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[]
2138e5c31af7Sopenharmony_ci[open,refpage='VkDeviceGroupSubmitInfo',desc='Structure indicating which physical devices execute semaphore operations and command buffers',type='structs']
2139e5c31af7Sopenharmony_ci--
2140e5c31af7Sopenharmony_ci
2141e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkSubmitInfo includes a
2142e5c31af7Sopenharmony_cisname:VkDeviceGroupSubmitInfo structure, then that structure includes device
2143e5c31af7Sopenharmony_ciindices and masks specifying which physical devices execute semaphore
2144e5c31af7Sopenharmony_cioperations and command buffers.
2145e5c31af7Sopenharmony_ci
2146e5c31af7Sopenharmony_ciThe sname:VkDeviceGroupSubmitInfo structure is defined as:
2147e5c31af7Sopenharmony_ci
2148e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDeviceGroupSubmitInfo.txt[]
2149e5c31af7Sopenharmony_ci
2150e5c31af7Sopenharmony_ciifdef::VK_KHR_device_group[]
2151e5c31af7Sopenharmony_cior the equivalent
2152e5c31af7Sopenharmony_ci
2153e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDeviceGroupSubmitInfoKHR.txt[]
2154e5c31af7Sopenharmony_ciendif::VK_KHR_device_group[]
2155e5c31af7Sopenharmony_ci
2156e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
2157e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
2158e5c31af7Sopenharmony_ci    structure.
2159e5c31af7Sopenharmony_ci  * pname:waitSemaphoreCount is the number of elements in the
2160e5c31af7Sopenharmony_ci    pname:pWaitSemaphoreDeviceIndices array.
2161e5c31af7Sopenharmony_ci  * pname:pWaitSemaphoreDeviceIndices is a pointer to an array of
2162e5c31af7Sopenharmony_ci    pname:waitSemaphoreCount device indices indicating which physical device
2163e5c31af7Sopenharmony_ci    executes the semaphore wait operation in the corresponding element of
2164e5c31af7Sopenharmony_ci    slink:VkSubmitInfo::pname:pWaitSemaphores.
2165e5c31af7Sopenharmony_ci  * pname:commandBufferCount is the number of elements in the
2166e5c31af7Sopenharmony_ci    pname:pCommandBufferDeviceMasks array.
2167e5c31af7Sopenharmony_ci  * pname:pCommandBufferDeviceMasks is a pointer to an array of
2168e5c31af7Sopenharmony_ci    pname:commandBufferCount device masks indicating which physical devices
2169e5c31af7Sopenharmony_ci    execute the command buffer in the corresponding element of
2170e5c31af7Sopenharmony_ci    slink:VkSubmitInfo::pname:pCommandBuffers.
2171e5c31af7Sopenharmony_ci    A physical device executes the command buffer if the corresponding bit
2172e5c31af7Sopenharmony_ci    is set in the mask.
2173e5c31af7Sopenharmony_ci  * pname:signalSemaphoreCount is the number of elements in the
2174e5c31af7Sopenharmony_ci    pname:pSignalSemaphoreDeviceIndices array.
2175e5c31af7Sopenharmony_ci  * pname:pSignalSemaphoreDeviceIndices is a pointer to an array of
2176e5c31af7Sopenharmony_ci    pname:signalSemaphoreCount device indices indicating which physical
2177e5c31af7Sopenharmony_ci    device executes the semaphore signal operation in the corresponding
2178e5c31af7Sopenharmony_ci    element of slink:VkSubmitInfo::pname:pSignalSemaphores.
2179e5c31af7Sopenharmony_ci
2180e5c31af7Sopenharmony_ciIf this structure is not present, semaphore operations and command buffers
2181e5c31af7Sopenharmony_ciexecute on device index zero.
2182e5c31af7Sopenharmony_ci
2183e5c31af7Sopenharmony_ci.Valid Usage
2184e5c31af7Sopenharmony_ci****
2185e5c31af7Sopenharmony_ci  * [[VUID-VkDeviceGroupSubmitInfo-waitSemaphoreCount-00082]]
2186e5c31af7Sopenharmony_ci    pname:waitSemaphoreCount must: equal
2187e5c31af7Sopenharmony_ci    slink:VkSubmitInfo::pname:waitSemaphoreCount
2188e5c31af7Sopenharmony_ci  * [[VUID-VkDeviceGroupSubmitInfo-commandBufferCount-00083]]
2189e5c31af7Sopenharmony_ci    pname:commandBufferCount must: equal
2190e5c31af7Sopenharmony_ci    slink:VkSubmitInfo::pname:commandBufferCount
2191e5c31af7Sopenharmony_ci  * [[VUID-VkDeviceGroupSubmitInfo-signalSemaphoreCount-00084]]
2192e5c31af7Sopenharmony_ci    pname:signalSemaphoreCount must: equal
2193e5c31af7Sopenharmony_ci    slink:VkSubmitInfo::pname:signalSemaphoreCount
2194e5c31af7Sopenharmony_ci  * [[VUID-VkDeviceGroupSubmitInfo-pWaitSemaphoreDeviceIndices-00085]]
2195e5c31af7Sopenharmony_ci    All elements of pname:pWaitSemaphoreDeviceIndices and
2196e5c31af7Sopenharmony_ci    pname:pSignalSemaphoreDeviceIndices must: be valid device indices
2197e5c31af7Sopenharmony_ci  * [[VUID-VkDeviceGroupSubmitInfo-pCommandBufferDeviceMasks-00086]]
2198e5c31af7Sopenharmony_ci    All elements of pname:pCommandBufferDeviceMasks must: be valid device
2199e5c31af7Sopenharmony_ci    masks
2200e5c31af7Sopenharmony_ci****
2201e5c31af7Sopenharmony_ci
2202e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDeviceGroupSubmitInfo.txt[]
2203e5c31af7Sopenharmony_ci--
2204e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[]
2205e5c31af7Sopenharmony_ci
2206e5c31af7Sopenharmony_ciifdef::VK_KHR_performance_query[]
2207e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkSubmitInfo includes a
2208e5c31af7Sopenharmony_cislink:VkPerformanceQuerySubmitInfoKHR structure, then the structure
2209e5c31af7Sopenharmony_ciindicates which counter pass is active for the batch in that submit.
2210e5c31af7Sopenharmony_ci
2211e5c31af7Sopenharmony_ci[open,refpage='VkPerformanceQuerySubmitInfoKHR',desc='Structure indicating which counter pass index is active for performance queries',type='structs']
2212e5c31af7Sopenharmony_ci--
2213e5c31af7Sopenharmony_ciThe sname:VkPerformanceQuerySubmitInfoKHR structure is defined as:
2214e5c31af7Sopenharmony_ci
2215e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkPerformanceQuerySubmitInfoKHR.txt[]
2216e5c31af7Sopenharmony_ci
2217e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
2218e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
2219e5c31af7Sopenharmony_ci    structure.
2220e5c31af7Sopenharmony_ci  * pname:counterPassIndex specifies which counter pass index is active.
2221e5c31af7Sopenharmony_ci
2222e5c31af7Sopenharmony_ciIf the sname:VkSubmitInfo::pname:pNext chain does not include this
2223e5c31af7Sopenharmony_cistructure, the batch defaults to use counter pass index 0.
2224e5c31af7Sopenharmony_ci
2225e5c31af7Sopenharmony_ci.Valid Usage
2226e5c31af7Sopenharmony_ci****
2227e5c31af7Sopenharmony_ci  * [[VUID-VkPerformanceQuerySubmitInfoKHR-counterPassIndex-03221]]
2228e5c31af7Sopenharmony_ci    pname:counterPassIndex must: be less than the number of counter passes
2229e5c31af7Sopenharmony_ci    required by any queries within the batch.
2230e5c31af7Sopenharmony_ci    The required number of counter passes for a performance query is
2231e5c31af7Sopenharmony_ci    obtained by calling
2232e5c31af7Sopenharmony_ci    flink:vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR
2233e5c31af7Sopenharmony_ci****
2234e5c31af7Sopenharmony_ci
2235e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkPerformanceQuerySubmitInfoKHR.txt[]
2236e5c31af7Sopenharmony_ci--
2237e5c31af7Sopenharmony_ciendif::VK_KHR_performance_query[]
2238e5c31af7Sopenharmony_ci
2239e5c31af7Sopenharmony_ci
2240e5c31af7Sopenharmony_ci[[commandbuffers-submission-progress]]
2241e5c31af7Sopenharmony_ci== Queue Forward Progress
2242e5c31af7Sopenharmony_ci
2243e5c31af7Sopenharmony_ciWhen using binary semaphores, the application must: ensure that command
2244e5c31af7Sopenharmony_cibuffer submissions will be able to complete without any subsequent
2245e5c31af7Sopenharmony_cioperations by the application on any queue.
2246e5c31af7Sopenharmony_ciAfter any call to fname:vkQueueSubmit (or other queue operation), for every
2247e5c31af7Sopenharmony_ciqueued wait on a semaphore
2248e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_timeline_semaphore[]
2249e5c31af7Sopenharmony_cicreated with a elink:VkSemaphoreType of ename:VK_SEMAPHORE_TYPE_BINARY
2250e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_timeline_semaphore[]
2251e5c31af7Sopenharmony_cithere must: be a prior signal of that semaphore that will not be consumed by
2252e5c31af7Sopenharmony_cia different wait on the semaphore.
2253e5c31af7Sopenharmony_ci
2254e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_2,VK_KHR_timeline_semaphore[]
2255e5c31af7Sopenharmony_ciWhen using timeline semaphores, wait-before-signal behavior is well-defined
2256e5c31af7Sopenharmony_ciand applications can: submit work via fname:vkQueueSubmit defining a
2257e5c31af7Sopenharmony_ci<<synchronization-semaphores-waiting, timeline semaphore wait operation>>
2258e5c31af7Sopenharmony_cibefore submitting a corresponding <<synchronization-semaphores-signaling,
2259e5c31af7Sopenharmony_cisemaphore signal operation>>.
2260e5c31af7Sopenharmony_ciFor each <<synchronization-semaphores-waiting, timeline semaphore wait
2261e5c31af7Sopenharmony_cioperation>> defined by a call to fname:vkQueueSubmit, the application must:
2262e5c31af7Sopenharmony_ciensure that a corresponding <<synchronization-semaphores-signaling,
2263e5c31af7Sopenharmony_cisemaphore signal operation>> is executed before forward progress can be
2264e5c31af7Sopenharmony_cimade.
2265e5c31af7Sopenharmony_ciendif::VK_VERSION_1_2,VK_KHR_timeline_semaphore[]
2266e5c31af7Sopenharmony_ci
2267e5c31af7Sopenharmony_ciCommand buffers in the submission can: include flink:vkCmdWaitEvents
2268e5c31af7Sopenharmony_cicommands that wait on events that will not be signaled by earlier commands
2269e5c31af7Sopenharmony_ciin the queue.
2270e5c31af7Sopenharmony_ciSuch events must: be signaled by the application using flink:vkSetEvent, and
2271e5c31af7Sopenharmony_cithe fname:vkCmdWaitEvents commands that wait upon them must: not be inside a
2272e5c31af7Sopenharmony_cirender pass instance.
2273e5c31af7Sopenharmony_ciThe event must: be set before the flink:vkCmdWaitEvents command is executed.
2274e5c31af7Sopenharmony_ci
2275e5c31af7Sopenharmony_ci[NOTE]
2276e5c31af7Sopenharmony_ci.Note
2277e5c31af7Sopenharmony_ci====
2278e5c31af7Sopenharmony_ciImplementations may have some tolerance for waiting on events to be set, but
2279e5c31af7Sopenharmony_cithis is defined outside of the scope of Vulkan.
2280e5c31af7Sopenharmony_ci====
2281e5c31af7Sopenharmony_ci
2282e5c31af7Sopenharmony_ci
2283e5c31af7Sopenharmony_ci[[commandbuffers-secondary]]
2284e5c31af7Sopenharmony_ci== Secondary Command Buffer Execution
2285e5c31af7Sopenharmony_ci
2286e5c31af7Sopenharmony_ci[open,refpage='vkCmdExecuteCommands',desc='Execute a secondary command buffer from a primary command buffer',type='protos']
2287e5c31af7Sopenharmony_ci--
2288e5c31af7Sopenharmony_ciA secondary command buffer must: not be directly submitted to a queue.
2289e5c31af7Sopenharmony_ciInstead, secondary command buffers are recorded to execute as part of a
2290e5c31af7Sopenharmony_ciprimary command buffer with the command:
2291e5c31af7Sopenharmony_ci
2292e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdExecuteCommands.txt[]
2293e5c31af7Sopenharmony_ci
2294e5c31af7Sopenharmony_ci  * pname:commandBuffer is a handle to a primary command buffer that the
2295e5c31af7Sopenharmony_ci    secondary command buffers are executed in.
2296e5c31af7Sopenharmony_ci  * pname:commandBufferCount is the length of the pname:pCommandBuffers
2297e5c31af7Sopenharmony_ci    array.
2298e5c31af7Sopenharmony_ci  * pname:pCommandBuffers is a pointer to an array of
2299e5c31af7Sopenharmony_ci    pname:commandBufferCount secondary command buffer handles, which are
2300e5c31af7Sopenharmony_ci    recorded to execute in the primary command buffer in the order they are
2301e5c31af7Sopenharmony_ci    listed in the array.
2302e5c31af7Sopenharmony_ci
2303e5c31af7Sopenharmony_ciIf any element of pname:pCommandBuffers was not recorded with the
2304e5c31af7Sopenharmony_ciename:VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT flag, and it was recorded
2305e5c31af7Sopenharmony_ciinto any other primary command buffer which is currently in the
2306e5c31af7Sopenharmony_ci<<commandbuffers-lifecycle, executable or recording state>>, that primary
2307e5c31af7Sopenharmony_cicommand buffer becomes <<commandbuffers-lifecycle, invalid>>.
2308e5c31af7Sopenharmony_ci
2309e5c31af7Sopenharmony_ci.Valid Usage
2310e5c31af7Sopenharmony_ci****
2311e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pCommandBuffers-00088]]
2312e5c31af7Sopenharmony_ci    Each element of pname:pCommandBuffers must: have been allocated with a
2313e5c31af7Sopenharmony_ci    pname:level of ename:VK_COMMAND_BUFFER_LEVEL_SECONDARY
2314e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pCommandBuffers-00089]]
2315e5c31af7Sopenharmony_ci    Each element of pname:pCommandBuffers must: be in the
2316e5c31af7Sopenharmony_ci    <<commandbuffers-lifecycle, pending or executable state>>
2317e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pCommandBuffers-00091]]
2318e5c31af7Sopenharmony_ci    If any element of pname:pCommandBuffers was not recorded with the
2319e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT flag, it must: not be
2320e5c31af7Sopenharmony_ci    in the <<commandbuffers-lifecycle, pending state>>
2321e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pCommandBuffers-00092]]
2322e5c31af7Sopenharmony_ci    If any element of pname:pCommandBuffers was not recorded with the
2323e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT flag, it must: not
2324e5c31af7Sopenharmony_ci    have already been recorded to pname:commandBuffer
2325e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pCommandBuffers-00093]]
2326e5c31af7Sopenharmony_ci    If any element of pname:pCommandBuffers was not recorded with the
2327e5c31af7Sopenharmony_ci    ename:VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT flag, it must: not
2328e5c31af7Sopenharmony_ci    appear more than once in pname:pCommandBuffers
2329e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pCommandBuffers-00094]]
2330e5c31af7Sopenharmony_ci    Each element of pname:pCommandBuffers must: have been allocated from a
2331e5c31af7Sopenharmony_ci    sname:VkCommandPool that was created for the same queue family as the
2332e5c31af7Sopenharmony_ci    sname:VkCommandPool from which pname:commandBuffer was allocated
2333e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pCommandBuffers-00096]]
2334e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2335e5c31af7Sopenharmony_ci    instance, each element of pname:pCommandBuffers must: have been recorded
2336e5c31af7Sopenharmony_ci    with the ename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT
2337e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pCommandBuffers-00099]]
2338e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2339e5c31af7Sopenharmony_ci    instance, and any element of pname:pCommandBuffers was recorded with
2340e5c31af7Sopenharmony_ci    slink:VkCommandBufferInheritanceInfo::pname:framebuffer not equal to
2341e5c31af7Sopenharmony_ci    dlink:VK_NULL_HANDLE, that sname:VkFramebuffer must: match the
2342e5c31af7Sopenharmony_ci    sname:VkFramebuffer used in the current render pass instance
2343e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-contents-06018]]
2344e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2345e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderPass, its pname:contents
2346e5c31af7Sopenharmony_ci    parameter must: have been set to
2347e5c31af7Sopenharmony_ci    ename:VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS
2348e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pCommandBuffers-06019]]
2349e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2350e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderPass, each element of
2351e5c31af7Sopenharmony_ci    pname:pCommandBuffers must: have been recorded with
2352e5c31af7Sopenharmony_ci    slink:VkCommandBufferInheritanceInfo::pname:subpass set to the index of
2353e5c31af7Sopenharmony_ci    the subpass which the given command buffer will be executed in
2354e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pBeginInfo-06020]]
2355e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2356e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderPass, the render passes
2357e5c31af7Sopenharmony_ci    specified in the pname:pBeginInfo->pInheritanceInfo->renderPass members
2358e5c31af7Sopenharmony_ci    of the flink:vkBeginCommandBuffer commands used to begin recording each
2359e5c31af7Sopenharmony_ci    element of pname:pCommandBuffers must: be
2360e5c31af7Sopenharmony_ci    <<renderpass-compatibility,compatible>> with the current render pass
2361e5c31af7Sopenharmony_ciifndef::VK_KHR_dynamic_rendering[]
2362e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-contents-00095]]
2363e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2364e5c31af7Sopenharmony_ci    instance, that render pass instance must: have been begun with the
2365e5c31af7Sopenharmony_ci    pname:contents parameter of fname:vkCmdBeginRenderPass set to
2366e5c31af7Sopenharmony_ci    ename:VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS
2367e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pCommandBuffers-00097]]
2368e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2369e5c31af7Sopenharmony_ci    instance, each element of pname:pCommandBuffers must: have been recorded
2370e5c31af7Sopenharmony_ci    with sname:VkCommandBufferInheritanceInfo::pname:subpass set to the
2371e5c31af7Sopenharmony_ci    index of the subpass which the given command buffer will be executed in
2372e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pInheritanceInfo-00098]]
2373e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2374e5c31af7Sopenharmony_ci    instance, the render passes specified in the
2375e5c31af7Sopenharmony_ci    pname:pBeginInfo->pInheritanceInfo->renderPass members of the
2376e5c31af7Sopenharmony_ci    flink:vkBeginCommandBuffer commands used to begin recording each element
2377e5c31af7Sopenharmony_ci    of pname:pCommandBuffers must: be
2378e5c31af7Sopenharmony_ci    <<renderpass-compatibility,compatible>> with the current render pass
2379e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[]
2380e5c31af7Sopenharmony_ciifdef::VK_QCOM_render_pass_transform[]
2381e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pNext-02865]]
2382e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2383e5c31af7Sopenharmony_ci    instance that included slink:VkRenderPassTransformBeginInfoQCOM in the
2384e5c31af7Sopenharmony_ci    pname:pNext chain of slink:VkRenderPassBeginInfo, then each element of
2385e5c31af7Sopenharmony_ci    pname:pCommandBuffers must: have been recorded with
2386e5c31af7Sopenharmony_ci    slink:VkCommandBufferInheritanceRenderPassTransformInfoQCOM in the
2387e5c31af7Sopenharmony_ci    pname:pNext chain of slink:VkCommandBufferBeginInfo
2388e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pNext-02866]]
2389e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2390e5c31af7Sopenharmony_ci    instance that included slink:VkRenderPassTransformBeginInfoQCOM in the
2391e5c31af7Sopenharmony_ci    pname:pNext chain of slink:VkRenderPassBeginInfo, then each element of
2392e5c31af7Sopenharmony_ci    pname:pCommandBuffers must: have been recorded with
2393e5c31af7Sopenharmony_ci    slink:VkCommandBufferInheritanceRenderPassTransformInfoQCOM::pname:transform
2394e5c31af7Sopenharmony_ci    identical to slink:VkRenderPassTransformBeginInfoQCOM::pname:transform
2395e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pNext-02867]]
2396e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2397e5c31af7Sopenharmony_ci    instance that included slink:VkRenderPassTransformBeginInfoQCOM in the
2398e5c31af7Sopenharmony_ci    pname:pNext chain of slink:VkRenderPassBeginInfo, then each element of
2399e5c31af7Sopenharmony_ci    pname:pCommandBuffers must: have been recorded with
2400e5c31af7Sopenharmony_ci    slink:VkCommandBufferInheritanceRenderPassTransformInfoQCOM::pname:renderArea
2401e5c31af7Sopenharmony_ci    identical to slink:VkRenderPassBeginInfo::pname:renderArea
2402e5c31af7Sopenharmony_ciendif::VK_QCOM_render_pass_transform[]
2403e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pCommandBuffers-00100]]
2404e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is not being called within a render pass
2405e5c31af7Sopenharmony_ci    instance, each element of pname:pCommandBuffers must: not have been
2406e5c31af7Sopenharmony_ci    recorded with the ename:VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT
2407e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-commandBuffer-00101]]
2408e5c31af7Sopenharmony_ci    If the <<features-inheritedQueries,inherited queries>> feature is not
2409e5c31af7Sopenharmony_ci    enabled, pname:commandBuffer must: not have any queries
2410e5c31af7Sopenharmony_ci    <<queries-operation-active,active>>
2411e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-commandBuffer-00102]]
2412e5c31af7Sopenharmony_ci    If pname:commandBuffer has a ename:VK_QUERY_TYPE_OCCLUSION query
2413e5c31af7Sopenharmony_ci    <<queries-operation-active,active>>, then each element of
2414e5c31af7Sopenharmony_ci    pname:pCommandBuffers must: have been recorded with
2415e5c31af7Sopenharmony_ci    sname:VkCommandBufferInheritanceInfo::pname:occlusionQueryEnable set to
2416e5c31af7Sopenharmony_ci    ename:VK_TRUE
2417e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-commandBuffer-00103]]
2418e5c31af7Sopenharmony_ci    If pname:commandBuffer has a ename:VK_QUERY_TYPE_OCCLUSION query
2419e5c31af7Sopenharmony_ci    <<queries-operation-active,active>>, then each element of
2420e5c31af7Sopenharmony_ci    pname:pCommandBuffers must: have been recorded with
2421e5c31af7Sopenharmony_ci    sname:VkCommandBufferInheritanceInfo::pname:queryFlags having all bits
2422e5c31af7Sopenharmony_ci    set that are set for the query
2423e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-commandBuffer-00104]]
2424e5c31af7Sopenharmony_ci    If pname:commandBuffer has a ename:VK_QUERY_TYPE_PIPELINE_STATISTICS
2425e5c31af7Sopenharmony_ci    query <<queries-operation-active,active>>, then each element of
2426e5c31af7Sopenharmony_ci    pname:pCommandBuffers must: have been recorded with
2427e5c31af7Sopenharmony_ci    sname:VkCommandBufferInheritanceInfo::pname:pipelineStatistics having
2428e5c31af7Sopenharmony_ci    all bits set that are set in the sname:VkQueryPool the query uses
2429e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pCommandBuffers-00105]]
2430e5c31af7Sopenharmony_ci    Each element of pname:pCommandBuffers must: not begin any query types
2431e5c31af7Sopenharmony_ci    that are <<queries-operation-active,active>> in pname:commandBuffer
2432e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
2433e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-commandBuffer-01820]]
2434e5c31af7Sopenharmony_ci    If pname:commandBuffer is a protected command buffer and
2435e5c31af7Sopenharmony_ci    <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
2436e5c31af7Sopenharmony_ci    each element of pname:pCommandBuffers must: be a protected command
2437e5c31af7Sopenharmony_ci    buffer
2438e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-commandBuffer-01821]]
2439e5c31af7Sopenharmony_ci    If pname:commandBuffer is an unprotected command buffer and
2440e5c31af7Sopenharmony_ci    <<limits-protectedNoFault, pname:protectedNoFault>> is not supported,
2441e5c31af7Sopenharmony_ci    each element of pname:pCommandBuffers must: be an unprotected command
2442e5c31af7Sopenharmony_ci    buffer
2443e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
2444e5c31af7Sopenharmony_ciifdef::VK_EXT_transform_feedback[]
2445e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-None-02286]]
2446e5c31af7Sopenharmony_ci    This command must: not be recorded when transform feedback is active
2447e5c31af7Sopenharmony_ciendif::VK_EXT_transform_feedback[]
2448e5c31af7Sopenharmony_ciifdef::VK_KHR_dynamic_rendering[]
2449e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pCommandBuffers-06021]]
2450e5c31af7Sopenharmony_ci    If pname:pCommandBuffers contains any <<renderpass-suspension,suspended
2451e5c31af7Sopenharmony_ci    render pass instances>>, there must: be no action or synchronization
2452e5c31af7Sopenharmony_ci    commands between that render pass instance and any render pass instance
2453e5c31af7Sopenharmony_ci    that resumes it
2454e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pCommandBuffers-06022]]
2455e5c31af7Sopenharmony_ci    If pname:pCommandBuffers contains any <<renderpass-suspension,suspended
2456e5c31af7Sopenharmony_ci    render pass instances>>, there must: be no render pass instances between
2457e5c31af7Sopenharmony_ci    that render pass instance and any render pass instance that resumes it
2458e5c31af7Sopenharmony_ciifdef::VK_EXT_sample_locations[]
2459e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-variableSampleLocations-06023]]
2460e5c31af7Sopenharmony_ci    If the <<limits-variableSampleLocations, pname:variableSampleLocations>>
2461e5c31af7Sopenharmony_ci    limit is not supported, and any element of pname:pCommandBuffers
2462e5c31af7Sopenharmony_ci    contains any <<renderpass-suspension,suspended render pass instances>>,
2463e5c31af7Sopenharmony_ci    where a graphics pipeline has been bound, any pipelines bound in the
2464e5c31af7Sopenharmony_ci    render pass instance that resumes it, or any subsequent render pass
2465e5c31af7Sopenharmony_ci    instances that resume from that one and so on, must: use the same sample
2466e5c31af7Sopenharmony_ci    locations
2467e5c31af7Sopenharmony_ciendif::VK_EXT_sample_locations[]
2468e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-flags-06024]]
2469e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2470e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderingKHR, its
2471e5c31af7Sopenharmony_ci    slink:VkRenderingInfoKHR::pname:flags parameter must: have included
2472e5c31af7Sopenharmony_ci    ename:VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT_KHR
2473e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pBeginInfo-06025]]
2474e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2475e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderingKHR, the render passes
2476e5c31af7Sopenharmony_ci    specified in the pname:pBeginInfo->pInheritanceInfo->renderPass members
2477e5c31af7Sopenharmony_ci    of the flink:vkBeginCommandBuffer commands used to begin recording each
2478e5c31af7Sopenharmony_ci    element of pname:pCommandBuffers must: be dlink:VK_NULL_HANDLE
2479e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-flags-06026]]
2480e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2481e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderingKHR, the pname:flags member
2482e5c31af7Sopenharmony_ci    of the slink:VkCommandBufferInheritanceRenderingInfoKHR structure
2483e5c31af7Sopenharmony_ci    included in the pname:pNext chain of
2484e5c31af7Sopenharmony_ci    slink:VkCommandBufferBeginInfo::pname:pInheritanceInfo used to begin
2485e5c31af7Sopenharmony_ci    recording each element of pname:pCommandBuffers must: be equal to the
2486e5c31af7Sopenharmony_ci    slink:VkRenderingInfoKHR::pname:flags parameter to
2487e5c31af7Sopenharmony_ci    flink:vkCmdBeginRenderingKHR, excluding
2488e5c31af7Sopenharmony_ci    ename:VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT_KHR
2489e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-colorAttachmentCount-06027]]
2490e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2491e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderingKHR, the
2492e5c31af7Sopenharmony_ci    pname:colorAttachmentCount member of the
2493e5c31af7Sopenharmony_ci    slink:VkCommandBufferInheritanceRenderingInfoKHR structure included in
2494e5c31af7Sopenharmony_ci    the pname:pNext chain of
2495e5c31af7Sopenharmony_ci    slink:VkCommandBufferBeginInfo::pname:pInheritanceInfo used to begin
2496e5c31af7Sopenharmony_ci    recording each element of pname:pCommandBuffers must: be equal to the
2497e5c31af7Sopenharmony_ci    slink:VkRenderingInfoKHR::pname:colorAttachmentCount parameter to
2498e5c31af7Sopenharmony_ci    flink:vkCmdBeginRenderingKHR
2499e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-imageView-06028]]
2500e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2501e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderingKHR, if the pname:imageView
2502e5c31af7Sopenharmony_ci    member of an element of the
2503e5c31af7Sopenharmony_ci    slink:VkRenderingInfoKHR::pname:pColorAttachments parameter to
2504e5c31af7Sopenharmony_ci    flink:vkCmdBeginRenderingKHR is not dlink:VK_NULL_HANDLE, the
2505e5c31af7Sopenharmony_ci    corresponding element of the pname:pColorAttachmentFormats member of the
2506e5c31af7Sopenharmony_ci    slink:VkCommandBufferInheritanceRenderingInfoKHR structure included in
2507e5c31af7Sopenharmony_ci    the pname:pNext chain of
2508e5c31af7Sopenharmony_ci    slink:VkCommandBufferBeginInfo::pname:pInheritanceInfo used to begin
2509e5c31af7Sopenharmony_ci    recording each element of pname:pCommandBuffers must: be equal to the
2510e5c31af7Sopenharmony_ci    format used to create that image view
2511e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pDepthAttachment-06029]]
2512e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2513e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderingKHR, if the
2514e5c31af7Sopenharmony_ci    slink:VkRenderingInfoKHR::pname:pDepthAttachment->imageView parameter to
2515e5c31af7Sopenharmony_ci    flink:vkCmdBeginRenderingKHR is not dlink:VK_NULL_HANDLE, the value of
2516e5c31af7Sopenharmony_ci    the pname:depthAttachmentFormat member of the
2517e5c31af7Sopenharmony_ci    slink:VkCommandBufferInheritanceRenderingInfoKHR structure included in
2518e5c31af7Sopenharmony_ci    the pname:pNext chain of
2519e5c31af7Sopenharmony_ci    slink:VkCommandBufferBeginInfo::pname:pInheritanceInfo used to begin
2520e5c31af7Sopenharmony_ci    recording each element of pname:pCommandBuffers must: be equal to the
2521e5c31af7Sopenharmony_ci    format used to create that image view
2522e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pStencilAttachment-06030]]
2523e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2524e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderingKHR, if the
2525e5c31af7Sopenharmony_ci    slink:VkRenderingInfoKHR::pname:pStencilAttachment->imageView parameter
2526e5c31af7Sopenharmony_ci    to flink:vkCmdBeginRenderingKHR is not dlink:VK_NULL_HANDLE, the value
2527e5c31af7Sopenharmony_ci    of the pname:stencilAttachmentFormat member of the
2528e5c31af7Sopenharmony_ci    slink:VkCommandBufferInheritanceRenderingInfoKHR structure included in
2529e5c31af7Sopenharmony_ci    the pname:pNext chain of
2530e5c31af7Sopenharmony_ci    slink:VkCommandBufferBeginInfo::pname:pInheritanceInfo used to begin
2531e5c31af7Sopenharmony_ci    recording each element of pname:pCommandBuffers must: be equal to the
2532e5c31af7Sopenharmony_ci    format used to create that image view
2533e5c31af7Sopenharmony_ciifdef::VK_KHR_multiview,VK_VERSION_1_1[]
2534e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-viewMask-06031]]
2535e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2536e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderingKHR, the pname:viewMask
2537e5c31af7Sopenharmony_ci    member of the slink:VkCommandBufferInheritanceRenderingInfoKHR structure
2538e5c31af7Sopenharmony_ci    included in the pname:pNext chain of
2539e5c31af7Sopenharmony_ci    slink:VkCommandBufferBeginInfo::pname:pInheritanceInfo used to begin
2540e5c31af7Sopenharmony_ci    recording each element of pname:pCommandBuffers must: be equal to the
2541e5c31af7Sopenharmony_ci    slink:VkRenderingInfoKHR::pname:viewMask parameter to
2542e5c31af7Sopenharmony_ci    flink:vkCmdBeginRenderingKHR
2543e5c31af7Sopenharmony_ciendif::VK_KHR_multiview,VK_VERSION_1_1[]
2544e5c31af7Sopenharmony_ciifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[]
2545e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pNext-06032]]
2546e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2547e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderingKHR and the pname:pNext
2548e5c31af7Sopenharmony_ci    chain of slink:VkCommandBufferInheritanceInfo includes a
2549e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoAMD or
2550e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoNV structure, if the pname:imageView
2551e5c31af7Sopenharmony_ci    member of an element of the
2552e5c31af7Sopenharmony_ci    slink:VkRenderingInfoKHR::pname:pColorAttachments parameter to
2553e5c31af7Sopenharmony_ci    flink:vkCmdBeginRenderingKHR is not dlink:VK_NULL_HANDLE, the
2554e5c31af7Sopenharmony_ci    corresponding element of the pname:pColorAttachmentSamples member of the
2555e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoAMD or
2556e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoNV structure included in the
2557e5c31af7Sopenharmony_ci    pname:pNext chain of
2558e5c31af7Sopenharmony_ci    slink:VkCommandBufferBeginInfo::pname:pInheritanceInfo used to begin
2559e5c31af7Sopenharmony_ci    recording each element of pname:pCommandBuffers must: be equal to the
2560e5c31af7Sopenharmony_ci    sample count used to create that image view
2561e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pNext-06033]]
2562e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2563e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderingKHR and the pname:pNext
2564e5c31af7Sopenharmony_ci    chain of slink:VkCommandBufferInheritanceInfo includes a
2565e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoAMD or
2566e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoNV structure, if the
2567e5c31af7Sopenharmony_ci    slink:VkRenderingInfoKHR::pname:pDepthAttachment->imageView parameter to
2568e5c31af7Sopenharmony_ci    flink:vkCmdBeginRenderingKHR is not dlink:VK_NULL_HANDLE, the value of
2569e5c31af7Sopenharmony_ci    the pname:depthStencilAttachmentSamples member of the
2570e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoAMD or
2571e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoNV structure included in the
2572e5c31af7Sopenharmony_ci    pname:pNext chain of
2573e5c31af7Sopenharmony_ci    slink:VkCommandBufferBeginInfo::pname:pInheritanceInfo used to begin
2574e5c31af7Sopenharmony_ci    recording each element of pname:pCommandBuffers must: be equal to the
2575e5c31af7Sopenharmony_ci    sample count used to create that image view
2576e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pNext-06034]]
2577e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2578e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderingKHR and the pname:pNext
2579e5c31af7Sopenharmony_ci    chain of slink:VkCommandBufferInheritanceInfo includes a
2580e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoAMD or
2581e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoNV structure, if the
2582e5c31af7Sopenharmony_ci    slink:VkRenderingInfoKHR::pname:pStencilAttachment->imageView parameter
2583e5c31af7Sopenharmony_ci    to flink:vkCmdBeginRenderingKHR is not dlink:VK_NULL_HANDLE, the value
2584e5c31af7Sopenharmony_ci    of the pname:depthStencilAttachmentSamples member of the
2585e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoAMD or
2586e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoNV structure included in the
2587e5c31af7Sopenharmony_ci    pname:pNext chain of
2588e5c31af7Sopenharmony_ci    slink:VkCommandBufferBeginInfo::pname:pInheritanceInfo used to begin
2589e5c31af7Sopenharmony_ci    recording each element of pname:pCommandBuffers must: be equal to the
2590e5c31af7Sopenharmony_ci    sample count used to create that image view
2591e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pNext-06035]]
2592e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2593e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderingKHR and the pname:pNext
2594e5c31af7Sopenharmony_ci    chain of slink:VkCommandBufferInheritanceInfo does not include a
2595e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoAMD or
2596e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoNV structure, if the pname:imageView
2597e5c31af7Sopenharmony_ci    member of an element of the
2598e5c31af7Sopenharmony_ci    slink:VkRenderingInfoKHR::pname:pColorAttachments parameter to
2599e5c31af7Sopenharmony_ci    flink:vkCmdBeginRenderingKHR is not dlink:VK_NULL_HANDLE, the value of
2600e5c31af7Sopenharmony_ci    slink:VkCommandBufferInheritanceRenderingInfoKHR::pname:rasterizationSamples
2601e5c31af7Sopenharmony_ci    must: be equal to the sample count used to create that image view
2602e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pNext-06036]]
2603e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2604e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderingKHR and the pname:pNext
2605e5c31af7Sopenharmony_ci    chain of slink:VkCommandBufferInheritanceInfo does not include a
2606e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoAMD or
2607e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoNV structure, if the
2608e5c31af7Sopenharmony_ci    slink:VkRenderingInfoKHR::pname:pDepthAttachment->imageView parameter to
2609e5c31af7Sopenharmony_ci    flink:vkCmdBeginRenderingKHR is not dlink:VK_NULL_HANDLE, the value of
2610e5c31af7Sopenharmony_ci    slink:VkCommandBufferInheritanceRenderingInfoKHR::pname:rasterizationSamples
2611e5c31af7Sopenharmony_ci    must: be equal to the sample count used to create that image view
2612e5c31af7Sopenharmony_ci  * [[VUID-vkCmdExecuteCommands-pNext-06037]]
2613e5c31af7Sopenharmony_ci    If fname:vkCmdExecuteCommands is being called within a render pass
2614e5c31af7Sopenharmony_ci    instance begun with flink:vkCmdBeginRenderingKHR and the pname:pNext
2615e5c31af7Sopenharmony_ci    chain of slink:VkCommandBufferInheritanceInfo does not include a
2616e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoAMD or
2617e5c31af7Sopenharmony_ci    slink:VkAttachmentSampleCountInfoNV structure, if the
2618e5c31af7Sopenharmony_ci    slink:VkRenderingInfoKHR::pname:pStencilAttachment->imageView parameter
2619e5c31af7Sopenharmony_ci    to flink:vkCmdBeginRenderingKHR is not dlink:VK_NULL_HANDLE, the value
2620e5c31af7Sopenharmony_ci    of
2621e5c31af7Sopenharmony_ci    slink:VkCommandBufferInheritanceRenderingInfoKHR::pname:rasterizationSamples
2622e5c31af7Sopenharmony_ci    must: be equal to the sample count used to create that image view
2623e5c31af7Sopenharmony_ciendif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples[]
2624e5c31af7Sopenharmony_ciendif::VK_KHR_dynamic_rendering[]
2625e5c31af7Sopenharmony_ci****
2626e5c31af7Sopenharmony_ci
2627e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdExecuteCommands.txt[]
2628e5c31af7Sopenharmony_ci--
2629e5c31af7Sopenharmony_ci
2630e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1,VK_KHR_device_group[]
2631e5c31af7Sopenharmony_ci[[commandbuffers-devicemask]]
2632e5c31af7Sopenharmony_ci== Command Buffer Device Mask
2633e5c31af7Sopenharmony_ci
2634e5c31af7Sopenharmony_ciEach command buffer has a piece of state storing the current device mask of
2635e5c31af7Sopenharmony_cithe command buffer.
2636e5c31af7Sopenharmony_ciThis mask controls which physical devices within the logical device all
2637e5c31af7Sopenharmony_cisubsequent commands will execute on, including state-setting commands,
2638e5c31af7Sopenharmony_ciaction commands, and synchronization commands.
2639e5c31af7Sopenharmony_ci
2640e5c31af7Sopenharmony_ciifndef::VK_NV_scissor_exclusive[]
2641e5c31af7Sopenharmony_ciScissor
2642e5c31af7Sopenharmony_ciendif::VK_NV_scissor_exclusive[]
2643e5c31af7Sopenharmony_ciifdef::VK_NV_scissor_exclusive[]
2644e5c31af7Sopenharmony_ciScissor, exclusive scissor,
2645e5c31af7Sopenharmony_ciendif::VK_NV_scissor_exclusive[]
2646e5c31af7Sopenharmony_ciand viewport state
2647e5c31af7Sopenharmony_ciifdef::VK_EXT_extended_dynamic_state[]
2648e5c31af7Sopenharmony_ci(excluding the count of each)
2649e5c31af7Sopenharmony_ciendif::VK_EXT_extended_dynamic_state[]
2650e5c31af7Sopenharmony_cican: be set to different values on each physical device (only when set as
2651e5c31af7Sopenharmony_cidynamic state), and each physical device will render using its local copy of
2652e5c31af7Sopenharmony_cithe state.
2653e5c31af7Sopenharmony_ciOther state is shared between physical devices, such that all physical
2654e5c31af7Sopenharmony_cidevices use the most recently set values for the state.
2655e5c31af7Sopenharmony_ciHowever, when recording an action command that uses a piece of state, the
2656e5c31af7Sopenharmony_cimost recent command that set that state must: have included all physical
2657e5c31af7Sopenharmony_cidevices that execute the action command in its current device mask.
2658e5c31af7Sopenharmony_ci
2659e5c31af7Sopenharmony_ciThe command buffer's device mask is orthogonal to the
2660e5c31af7Sopenharmony_cipname:pCommandBufferDeviceMasks member of slink:VkDeviceGroupSubmitInfo.
2661e5c31af7Sopenharmony_ciCommands only execute on a physical device if the device index is set in
2662e5c31af7Sopenharmony_ciboth device masks.
2663e5c31af7Sopenharmony_ci
2664e5c31af7Sopenharmony_ci[open,refpage='VkDeviceGroupCommandBufferBeginInfo',desc='Set the initial device mask for a command buffer',type='structs']
2665e5c31af7Sopenharmony_ci--
2666e5c31af7Sopenharmony_ciIf the pname:pNext chain of slink:VkCommandBufferBeginInfo includes a
2667e5c31af7Sopenharmony_cisname:VkDeviceGroupCommandBufferBeginInfo structure, then that structure
2668e5c31af7Sopenharmony_ciincludes an initial device mask for the command buffer.
2669e5c31af7Sopenharmony_ci
2670e5c31af7Sopenharmony_ciThe sname:VkDeviceGroupCommandBufferBeginInfo structure is defined as:
2671e5c31af7Sopenharmony_ci
2672e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDeviceGroupCommandBufferBeginInfo.txt[]
2673e5c31af7Sopenharmony_ci
2674e5c31af7Sopenharmony_ciifdef::VK_KHR_device_group[]
2675e5c31af7Sopenharmony_cior the equivalent
2676e5c31af7Sopenharmony_ci
2677e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkDeviceGroupCommandBufferBeginInfoKHR.txt[]
2678e5c31af7Sopenharmony_ciendif::VK_KHR_device_group[]
2679e5c31af7Sopenharmony_ci
2680e5c31af7Sopenharmony_ci  * pname:sType is the type of this structure.
2681e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
2682e5c31af7Sopenharmony_ci    structure.
2683e5c31af7Sopenharmony_ci  * pname:deviceMask is the initial value of the command buffer's device
2684e5c31af7Sopenharmony_ci    mask.
2685e5c31af7Sopenharmony_ci
2686e5c31af7Sopenharmony_ciThe initial device mask also acts as an upper bound on the set of devices
2687e5c31af7Sopenharmony_cithat can: ever be in the device mask in the command buffer.
2688e5c31af7Sopenharmony_ci
2689e5c31af7Sopenharmony_ciIf this structure is not present, the initial value of a command buffer's
2690e5c31af7Sopenharmony_cidevice mask is set to include all physical devices in the logical device
2691e5c31af7Sopenharmony_ciwhen the command buffer begins recording.
2692e5c31af7Sopenharmony_ci
2693e5c31af7Sopenharmony_ci.Valid Usage
2694e5c31af7Sopenharmony_ci****
2695e5c31af7Sopenharmony_ci  * [[VUID-VkDeviceGroupCommandBufferBeginInfo-deviceMask-00106]]
2696e5c31af7Sopenharmony_ci    pname:deviceMask must: be a valid device mask value
2697e5c31af7Sopenharmony_ci  * [[VUID-VkDeviceGroupCommandBufferBeginInfo-deviceMask-00107]]
2698e5c31af7Sopenharmony_ci    pname:deviceMask must: not be zero
2699e5c31af7Sopenharmony_ci****
2700e5c31af7Sopenharmony_ci
2701e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkDeviceGroupCommandBufferBeginInfo.txt[]
2702e5c31af7Sopenharmony_ci--
2703e5c31af7Sopenharmony_ci
2704e5c31af7Sopenharmony_ci[open,refpage='vkCmdSetDeviceMask',desc='Modify device mask of a command buffer',type='protos']
2705e5c31af7Sopenharmony_ci--
2706e5c31af7Sopenharmony_ciTo update the current device mask of a command buffer, call:
2707e5c31af7Sopenharmony_ci
2708e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1[]
2709e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdSetDeviceMask.txt[]
2710e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1[]
2711e5c31af7Sopenharmony_ci
2712e5c31af7Sopenharmony_ciifdef::VK_VERSION_1_1+VK_KHR_device_group[or the equivalent command]
2713e5c31af7Sopenharmony_ci
2714e5c31af7Sopenharmony_ciifdef::VK_KHR_device_group[]
2715e5c31af7Sopenharmony_ciinclude::{generated}/api/protos/vkCmdSetDeviceMaskKHR.txt[]
2716e5c31af7Sopenharmony_ciendif::VK_KHR_device_group[]
2717e5c31af7Sopenharmony_ci
2718e5c31af7Sopenharmony_ci  * pname:commandBuffer is command buffer whose current device mask is
2719e5c31af7Sopenharmony_ci    modified.
2720e5c31af7Sopenharmony_ci  * pname:deviceMask is the new value of the current device mask.
2721e5c31af7Sopenharmony_ci
2722e5c31af7Sopenharmony_cipname:deviceMask is used to filter out subsequent commands from executing on
2723e5c31af7Sopenharmony_ciall physical devices whose bit indices are not set in the mask, except
2724e5c31af7Sopenharmony_cicommands beginning a render pass instance, commands transitioning to the
2725e5c31af7Sopenharmony_cinext subpass in the render pass instance, and commands ending a render pass
2726e5c31af7Sopenharmony_ciinstance, which always execute on the set of physical devices whose bit
2727e5c31af7Sopenharmony_ciindices are included in the pname:deviceMask member of the
2728e5c31af7Sopenharmony_cislink:VkDeviceGroupRenderPassBeginInfo structure passed to the command
2729e5c31af7Sopenharmony_cibeginning the corresponding render pass instance.
2730e5c31af7Sopenharmony_ci
2731e5c31af7Sopenharmony_ci.Valid Usage
2732e5c31af7Sopenharmony_ci****
2733e5c31af7Sopenharmony_ci  * [[VUID-vkCmdSetDeviceMask-deviceMask-00108]]
2734e5c31af7Sopenharmony_ci    pname:deviceMask must: be a valid device mask value
2735e5c31af7Sopenharmony_ci  * [[VUID-vkCmdSetDeviceMask-deviceMask-00109]]
2736e5c31af7Sopenharmony_ci    pname:deviceMask must: not be zero
2737e5c31af7Sopenharmony_ci  * [[VUID-vkCmdSetDeviceMask-deviceMask-00110]]
2738e5c31af7Sopenharmony_ci    pname:deviceMask must: not include any set bits that were not in the
2739e5c31af7Sopenharmony_ci    slink:VkDeviceGroupCommandBufferBeginInfo::pname:deviceMask value when
2740e5c31af7Sopenharmony_ci    the command buffer began recording
2741e5c31af7Sopenharmony_ci  * [[VUID-vkCmdSetDeviceMask-deviceMask-00111]]
2742e5c31af7Sopenharmony_ci    If fname:vkCmdSetDeviceMask is called inside a render pass instance,
2743e5c31af7Sopenharmony_ci    pname:deviceMask must: not include any set bits that were not in the
2744e5c31af7Sopenharmony_ci    slink:VkDeviceGroupRenderPassBeginInfo::pname:deviceMask value when the
2745e5c31af7Sopenharmony_ci    render pass instance began recording
2746e5c31af7Sopenharmony_ci****
2747e5c31af7Sopenharmony_ci
2748e5c31af7Sopenharmony_ciinclude::{generated}/validity/protos/vkCmdSetDeviceMask.txt[]
2749e5c31af7Sopenharmony_ci--
2750e5c31af7Sopenharmony_ciendif::VK_VERSION_1_1,VK_KHR_device_group[]
2751