Vulkan-Docs/doc/specs/vulkan/chapters/dispatch.txt

67 lines
2.6 KiB
Plaintext

// Copyright (c) 2015-2016 The Khronos Group Inc.
// Copyright notice at https://www.khronos.org/registry/speccopyright.html
[[dispatch]]
= Dispatching Commands
_Dispatching commands_ (commands with ftext:Dispatch in the name) provoke work
in a compute pipeline. Dispatching commands are recorded into a command
buffer and when executed by a queue, will produce work which executes
according to the currently bound compute pipeline. A compute pipeline must:
be bound to a command buffer before any dispatch commands are recorded in
that command buffer.
// refBegin vkCmdDispatch Dispatch compute work items.
To record a dispatch, call:
include::../api/protos/vkCmdDispatch.txt[]
* pname:commandBuffer is the command buffer into which the command will be
recorded.
* pname:x is the number of local workgroups to dispatch in the X dimension.
* pname:y is the number of local workgroups to dispatch in the Y dimension.
* pname:z is the number of local workgroups to dispatch in the Z dimension.
When the command is executed, a global workgroup consisting of
latexmath:[$x \times y \times z$] local workgroups is assembled.
include::../validity/protos/vkCmdDispatch.txt[]
// refBegin vkCmdDispatchIndirect Dispatch compute work items using indirect parameters.
To record an indirect command dispatch, call:
include::../api/protos/vkCmdDispatchIndirect.txt[]
* pname:commandBuffer is the command buffer into which the command will be
recorded.
* pname:buffer is the buffer containing dispatch parameters.
* pname:offset is the byte offset into pname:buffer where parameters
begin.
fname:vkCmdDispatchIndirect behaves similarly to flink:vkCmdDispatch except
that the parameters are read by the device from a buffer during execution.
The parameters of the dispatch are encoded in a
slink:VkDispatchIndirectCommand structure taken from pname:buffer starting
at pname:offset.
include::../validity/protos/vkCmdDispatchIndirect.txt[]
// refBegin VkDispatchIndirectCommand - Structure specifying a dispatch indirect command
The sname:VkDispatchIndirectCommand structure is defined as:
include::../api/structs/VkDispatchIndirectCommand.txt[]
* pname:x is the number of local workgroups to dispatch in the X dimension.
* pname:y is the number of local workgroups to dispatch in the Y dimension.
* pname:z is the number of local workgroups to dispatch in the Z dimension.
The members of sname:VkDispatchIndirectCommand structure have the same
meaning as the similarly named parameters of flink:vkCmdDispatch.
include::../validity/structs/VkDispatchIndirectCommand.txt[]
// refEnd VkDispatchIndirectCommand vkCmdDispatchIndirect