2018-09-16 01:35:16 +00:00
|
|
|
[[drawing-mesh-shading]]
|
|
|
|
== Programmable Mesh Shading
|
|
|
|
|
|
|
|
In this drawing approach, primitives are assembled by the mesh shader stage.
|
|
|
|
<<mesh, Mesh shading>> operates similarly to <<dispatch, dispatching
|
|
|
|
compute>> as the shaders make use of workgroups.
|
|
|
|
|
|
|
|
|
|
|
|
[open,refpage='vkCmdDrawMeshTasksNV',desc='Draw mesh task work items',type='protos']
|
|
|
|
--
|
2019-04-16 12:19:43 +00:00
|
|
|
:refpage: vkCmdDrawMeshTasksNV
|
2018-09-16 01:35:16 +00:00
|
|
|
|
|
|
|
To record a draw that uses the mesh pipeline, call:
|
|
|
|
|
2019-04-16 12:19:43 +00:00
|
|
|
include::{generated}/api/protos/vkCmdDrawMeshTasksNV.txt[]
|
2018-09-16 01:35:16 +00:00
|
|
|
|
|
|
|
* pname:commandBuffer is the command buffer into which the command will be
|
|
|
|
recorded.
|
|
|
|
* pname:taskCount is the number of local workgroups to dispatch in the X
|
|
|
|
dimension.
|
|
|
|
Y and Z dimension are implicitly set to one.
|
|
|
|
* pname:firstTask is the X component of the first workgroup ID.
|
|
|
|
|
|
|
|
When the command is executed, a global workgroup consisting of
|
|
|
|
pname:taskCount local workgroups is assembled.
|
|
|
|
|
|
|
|
.Valid Usage
|
|
|
|
****
|
2019-04-16 12:19:43 +00:00
|
|
|
include::{chapters}/commonvalidity/draw_common.txt[]
|
2018-09-16 01:35:16 +00:00
|
|
|
* [[VUID-vkCmdDrawMeshTasksNV-taskCount-02119]]
|
|
|
|
pname:taskCount must: be less than or equal to
|
|
|
|
sname:VkPhysicalDeviceMeshShaderPropertiesNV::pname:maxDrawMeshTasksCount
|
|
|
|
****
|
|
|
|
|
2019-04-16 12:19:43 +00:00
|
|
|
include::{generated}/validity/protos/vkCmdDrawMeshTasksNV.txt[]
|
2018-09-16 01:35:16 +00:00
|
|
|
--
|
|
|
|
|
|
|
|
[open,refpage='vkCmdDrawMeshTasksIndirectNV',desc='Issue an indirect mesh tasks draw into a command buffer',type='protos']
|
|
|
|
--
|
2019-04-16 12:19:43 +00:00
|
|
|
:refpage: vkCmdDrawMeshTasksIndirectNV
|
2018-09-16 01:35:16 +00:00
|
|
|
|
|
|
|
To record an indirect mesh tasks draw, call:
|
|
|
|
|
2019-04-16 12:19:43 +00:00
|
|
|
include::{generated}/api/protos/vkCmdDrawMeshTasksIndirectNV.txt[]
|
2018-09-16 01:35:16 +00:00
|
|
|
|
|
|
|
* pname:commandBuffer is the command buffer into which the command is
|
|
|
|
recorded.
|
|
|
|
* pname:buffer is the buffer containing draw parameters.
|
|
|
|
* pname:offset is the byte offset into pname:buffer where parameters
|
|
|
|
begin.
|
|
|
|
* pname:drawCount is the number of draws to execute, and can: be zero.
|
|
|
|
* pname:stride is the byte stride between successive sets of draw
|
|
|
|
parameters.
|
|
|
|
|
|
|
|
fname:vkCmdDrawMeshTasksIndirectNV behaves similarly to
|
|
|
|
flink:vkCmdDrawMeshTasksNV except that the parameters are read by the device
|
|
|
|
from a buffer during execution.
|
|
|
|
pname:drawCount draws are executed by the command, with parameters taken
|
|
|
|
from pname:buffer starting at pname:offset and increasing by pname:stride
|
|
|
|
bytes for each successive draw.
|
|
|
|
The parameters of each draw are encoded in an array of
|
|
|
|
slink:VkDrawMeshTasksIndirectCommandNV structures.
|
|
|
|
If pname:drawCount is less than or equal to one, pname:stride is ignored.
|
|
|
|
|
|
|
|
.Valid Usage
|
|
|
|
****
|
2019-04-16 12:19:43 +00:00
|
|
|
include::{chapters}/commonvalidity/draw_common.txt[]
|
|
|
|
include::{chapters}/commonvalidity/draw_dispatch_indirect_common.txt[]
|
|
|
|
include::{chapters}/commonvalidity/draw_indirect_drawcount.txt[]
|
2018-09-16 01:35:16 +00:00
|
|
|
* [[VUID-vkCmdDrawMeshTasksIndirectNV-drawCount-02146]]
|
|
|
|
If pname:drawCount is greater than `1`, pname:stride must: be a multiple
|
|
|
|
of `4` and must: be greater than or equal to
|
|
|
|
code:sizeof(sname:VkDrawMeshTasksIndirectCommandNV)
|
|
|
|
* [[VUID-vkCmdDrawMeshTasksIndirectNV-drawCount-02156]]
|
|
|
|
If pname:drawCount is equal to `1`, [eq]#(pname:offset {plus}
|
|
|
|
code:sizeof(slink:VkDrawMeshTasksIndirectCommandNV))# must: be less than
|
|
|
|
or equal to the size of pname:buffer
|
|
|
|
* [[VUID-vkCmdDrawMeshTasksIndirectNV-drawCount-02157]]
|
|
|
|
If pname:drawCount is greater than `1`, [eq]#(pname:stride {times}
|
|
|
|
(pname:drawCount - 1) {plus} pname:offset {plus}
|
|
|
|
code:sizeof(slink:VkDrawMeshTasksIndirectCommandNV))# must: be less than
|
|
|
|
or equal to the size of pname:buffer
|
|
|
|
****
|
|
|
|
|
2019-04-16 12:19:43 +00:00
|
|
|
include::{generated}/validity/protos/vkCmdDrawMeshTasksIndirectNV.txt[]
|
2018-09-16 01:35:16 +00:00
|
|
|
--
|
|
|
|
|
|
|
|
[open,refpage='VkDrawMeshTasksIndirectCommandNV',desc='Structure specifying a mesh tasks draw indirect command',type='structs',xrefs='vkCmdDrawMeshTasksIndirectNV']
|
|
|
|
--
|
|
|
|
|
|
|
|
The sname:VkDrawMeshTasksIndirectCommandNV structure is defined as:
|
|
|
|
|
2019-04-16 12:19:43 +00:00
|
|
|
include::{generated}/api/structs/VkDrawMeshTasksIndirectCommandNV.txt[]
|
2018-09-16 01:35:16 +00:00
|
|
|
|
|
|
|
* pname:taskCount is the number of local workgroups to dispatch in the X
|
|
|
|
dimension.
|
|
|
|
Y and Z dimension are implicitly set to one.
|
|
|
|
* pname:firstTask is the X component of the first workgroup ID.
|
|
|
|
|
|
|
|
The members of sname:VkDrawMeshTasksIndirectCommandNV have the same meaning
|
|
|
|
as the similarly named parameters of flink:vkCmdDrawMeshTasksNV.
|
|
|
|
|
|
|
|
.Valid Usage
|
|
|
|
****
|
|
|
|
* [[VUID-VkDrawMeshTasksIndirectCommandNV-taskCount-02175]]
|
|
|
|
pname:taskCount must: be less than or equal to
|
|
|
|
sname:VkPhysicalDeviceMeshShaderPropertiesNV::pname:maxDrawMeshTasksCount
|
|
|
|
****
|
|
|
|
|
2019-04-16 12:19:43 +00:00
|
|
|
include::{generated}/validity/structs/VkDrawMeshTasksIndirectCommandNV.txt[]
|
2018-09-16 01:35:16 +00:00
|
|
|
--
|
|
|
|
|
|
|
|
[open,refpage='vkCmdDrawMeshTasksIndirectCountNV',desc='Perform an indirect mesh tasks draw with the draw count sourced from a buffer',type='protos']
|
|
|
|
--
|
2019-04-16 12:19:43 +00:00
|
|
|
:refpage: vkCmdDrawMeshTasksIndirectCountNV
|
2018-09-16 01:35:16 +00:00
|
|
|
|
|
|
|
To record an indirect mesh tasks draw with the draw count sourced from a
|
|
|
|
buffer, call:
|
|
|
|
|
2019-04-16 12:19:43 +00:00
|
|
|
include::{generated}/api/protos/vkCmdDrawMeshTasksIndirectCountNV.txt[]
|
2018-09-16 01:35:16 +00:00
|
|
|
|
|
|
|
* pname:commandBuffer is the command buffer into which the command is
|
|
|
|
recorded.
|
|
|
|
* pname:buffer is the buffer containing draw parameters.
|
|
|
|
* pname:offset is the byte offset into pname:buffer where parameters
|
|
|
|
begin.
|
|
|
|
* pname:countBuffer is the buffer containing the draw count.
|
|
|
|
* pname:countBufferOffset is the byte offset into pname:countBuffer where
|
|
|
|
the draw count begins.
|
|
|
|
* pname:maxDrawCount specifies the maximum number of draws that will be
|
|
|
|
executed.
|
|
|
|
The actual number of executed draw calls is the minimum of the count
|
|
|
|
specified in pname:countBuffer and pname:maxDrawCount.
|
|
|
|
* pname:stride is the byte stride between successive sets of draw
|
|
|
|
parameters.
|
|
|
|
|
|
|
|
fname:vkCmdDrawMeshTasksIndirectCountNV behaves similarly to
|
|
|
|
flink:vkCmdDrawMeshTasksIndirectNV except that the draw count is read by the
|
|
|
|
device from a buffer during execution.
|
|
|
|
The command will read an unsigned 32-bit integer from pname:countBuffer
|
|
|
|
located at pname:countBufferOffset and use this as the draw count.
|
|
|
|
|
|
|
|
.Valid Usage
|
|
|
|
****
|
2019-04-16 12:19:43 +00:00
|
|
|
include::{chapters}/commonvalidity/draw_common.txt[]
|
|
|
|
include::{chapters}/commonvalidity/draw_dispatch_indirect_common.txt[]
|
|
|
|
include::{chapters}/commonvalidity/draw_indirect_count_common.txt[]
|
2018-09-16 01:35:16 +00:00
|
|
|
* [[VUID-vkCmdDrawMeshTasksIndirectCountNV-stride-02182]]
|
|
|
|
pname:stride must: be a multiple of `4` and must: be greater than or
|
|
|
|
equal to code:sizeof(sname:VkDrawMeshTasksIndirectCommandNV)
|
|
|
|
* [[VUID-vkCmdDrawMeshTasksIndirectCountNV-maxDrawCount-02183]]
|
|
|
|
If pname:maxDrawCount is greater than or equal to `1`,
|
|
|
|
[eq]#(pname:stride {times} (pname:maxDrawCount - 1) {plus} pname:offset
|
|
|
|
{plus} code:sizeof(sname:VkDrawMeshTasksIndirectCommandNV))# must: be
|
|
|
|
less than or equal to the size of pname:buffer
|
|
|
|
* [[VUID-vkCmdDrawMeshTasksIndirectCountNV-countBuffer-02191]]
|
|
|
|
If the count stored in pname:countBuffer is equal to `1`,
|
|
|
|
[eq]#(pname:offset {plus}
|
|
|
|
code:sizeof(sname:VkDrawMeshTasksIndirectCommandNV))# must: be less than
|
|
|
|
or equal to the size of pname:buffer
|
|
|
|
* [[VUID-vkCmdDrawMeshTasksIndirectCountNV-countBuffer-02192]]
|
|
|
|
If the count stored in pname:countBuffer is greater than `1`,
|
|
|
|
[eq]#(pname:stride {times} (pname:drawCount - 1) {plus} pname:offset
|
|
|
|
{plus} code:sizeof(sname:VkDrawMeshTasksIndirectCommandNV))# must: be
|
|
|
|
less than or equal to the size of pname:buffer
|
|
|
|
****
|
|
|
|
|
2019-04-16 12:19:43 +00:00
|
|
|
include::{generated}/validity/protos/vkCmdDrawMeshTasksIndirectCountNV.txt[]
|
2018-09-16 01:35:16 +00:00
|
|
|
|
|
|
|
--
|