public class NVMeshShader
extends java.lang.Object
There are new programmable shader types -- the task and mesh shader -- to generate these collections to be processed by fixed-function primitive assembly and rasterization logic. When the task and mesh shaders are dispatched, they replace the standard programmable vertex processing pipeline, including vertex array attribute fetching, vertex shader processing, tessellation, and the geometry shader processing.
This extension also adds support for the following SPIR-V extension in Vulkan:
VK_NV_mesh_shaderVK_KHR_get_physical_device_properties2| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
VK_NV_MESH_SHADER_EXTENSION_NAME
The extension name.
|
static int |
VK_NV_MESH_SHADER_SPEC_VERSION
The extension specification version.
|
static int |
VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV
Extends
VkPipelineStageFlagBits. |
static int |
VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV
Extends
VkPipelineStageFlagBits. |
static int |
VK_SHADER_STAGE_MESH_BIT_NV
Extends
VkShaderStageFlagBits. |
static int |
VK_SHADER_STAGE_TASK_BIT_NV
Extends
VkShaderStageFlagBits. |
static int |
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV
Extends
VkStructureType. |
static int |
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV
Extends
VkStructureType. |
| Modifier and Type | Method and Description |
|---|---|
static void |
vkCmdDrawMeshTasksIndirectCountNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer,
long buffer,
long offset,
long countBuffer,
long countBufferOffset,
int maxDrawCount,
int stride)
Perform an indirect mesh tasks draw with the draw count sourced from a buffer.
|
static void |
vkCmdDrawMeshTasksIndirectNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer,
long buffer,
long offset,
int drawCount,
int stride)
Issue an indirect mesh tasks draw into a command buffer.
|
static void |
vkCmdDrawMeshTasksNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer,
int taskCount,
int firstTask)
Draw mesh task work items.
|
public static final int VK_NV_MESH_SHADER_SPEC_VERSION
public static final java.lang.String VK_NV_MESH_SHADER_EXTENSION_NAME
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV
VkStructureType.
public static final int VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV
VkStructureType.
public static final int VK_SHADER_STAGE_TASK_BIT_NV
public static final int VK_SHADER_STAGE_MESH_BIT_NV
public static final int VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV
VkPipelineStageFlagBits.
public static final int VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV
VkPipelineStageFlagBits.
public static void vkCmdDrawMeshTasksNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer,
int taskCount,
int firstTask)
To record a draw that uses the mesh pipeline, call:
void vkCmdDrawMeshTasksNV(
VkCommandBuffer commandBuffer,
uint32_t taskCount,
uint32_t firstTask);
When the command is executed, a global workgroup consisting of taskCount local workgroups is assembled.
VkImageView is sampled with FILTER_LINEAR as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BITVkImageView is accessed using atomic operations as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BITVkImageView is sampled with FILTER_CUBIC_EXT as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXTVkImageView being sampled with FILTER_CUBIC_EXT as a result of this command must have a VkImageViewType and format that supports cubic filtering, as specified by VkFilterCubicImageViewImageFormatPropertiesEXT::filterCubic returned by vkGetPhysicalDeviceImageFormatProperties2VkImageView being sampled with FILTER_CUBIC_EXT with a reduction mode of either SAMPLER_REDUCTION_MODE_MIN_EXT or SAMPLER_REDUCTION_MODE_MAX_EXT as a result of this command must have a VkImageViewType and format that supports cubic filtering together with minmax filtering, as specified by VkFilterCubicImageViewImageFormatPropertiesEXT::filterCubicMinmax returned by vkGetPhysicalDeviceImageFormatProperties2VkImage created with a VkImageCreateInfo::flags containing IMAGE_CREATE_CORNER_SAMPLED_BIT_NV sampled as a result of this command must only be sampled using a VkSamplerAddressMode of SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE.VkPipeline bound to the pipeline bind point used by this command, a descriptor set must have been bound to n at the same pipeline bind point, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout CompatibilityVkPipeline bound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout CompatibilityvkCmdBindDescriptorSets, must be valid if they are statically used by the VkPipeline bound to the pipeline bind point used by this commandVkPipeline object bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set for commandBufferVkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used to sample from any VkImage with a VkImageView of the type IMAGE_VIEW_TYPE_3D, IMAGE_VIEW_TYPE_CUBE, IMAGE_VIEW_TYPE_1D_ARRAY, IMAGE_VIEW_TYPE_2D_ARRAY or IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stageVkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stageVkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stageVkPipeline object bound to the pipeline bind point used by this command accesses a uniform buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind pointVkPipeline object bound to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind pointcommandBuffer is an unprotected command buffer, any resource accessed by the VkPipeline object bound to the pipeline bind point used by this command must not be a protected resourcerenderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to PIPELINE_BIND_POINT_GRAPHICS.subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to PIPELINE_BIND_POINT_GRAPHICS.VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex.VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit settaskCount must be less than or equal to VkPhysicalDeviceMeshShaderPropertiesNV::maxDrawMeshTasksCountcommandBuffer must be a valid VkCommandBuffer handlecommandBuffer must be in the recording stateVkCommandPool that commandBuffer was allocated from must support graphics operationscommandBuffer must be externally synchronizedVkCommandPool that commandBuffer was allocated from must be externally synchronized| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type |
|---|---|---|---|
| Primary Secondary | Inside | Graphics | Graphics |
commandBuffer - the command buffer into which the command will be recorded.taskCount - the number of local workgroups to dispatch in the X dimension. Y and Z dimension are implicitly set to one.firstTask - the X component of the first workgroup ID.public static void vkCmdDrawMeshTasksIndirectNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer,
long buffer,
long offset,
int drawCount,
int stride)
To record an indirect mesh tasks draw, call:
void vkCmdDrawMeshTasksIndirectNV(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
uint32_t drawCount,
uint32_t stride);
vkCmdDrawMeshTasksIndirectNV behaves similarly to CmdDrawMeshTasksNV except that the parameters are read by the device from a buffer during execution. drawCount draws are executed by the command, with parameters taken from buffer starting at offset and increasing by stride bytes for each successive draw. The parameters of each draw are encoded in an array of VkDrawMeshTasksIndirectCommandNV structures. If drawCount is less than or equal to one, stride is ignored.
VkImageView is sampled with FILTER_LINEAR as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BITVkImageView is accessed using atomic operations as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BITVkImageView is sampled with FILTER_CUBIC_EXT as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXTVkImageView being sampled with FILTER_CUBIC_EXT as a result of this command must have a VkImageViewType and format that supports cubic filtering, as specified by VkFilterCubicImageViewImageFormatPropertiesEXT::filterCubic returned by vkGetPhysicalDeviceImageFormatProperties2VkImageView being sampled with FILTER_CUBIC_EXT with a reduction mode of either SAMPLER_REDUCTION_MODE_MIN_EXT or SAMPLER_REDUCTION_MODE_MAX_EXT as a result of this command must have a VkImageViewType and format that supports cubic filtering together with minmax filtering, as specified by VkFilterCubicImageViewImageFormatPropertiesEXT::filterCubicMinmax returned by vkGetPhysicalDeviceImageFormatProperties2VkImage created with a VkImageCreateInfo::flags containing IMAGE_CREATE_CORNER_SAMPLED_BIT_NV sampled as a result of this command must only be sampled using a VkSamplerAddressMode of SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE.VkPipeline bound to the pipeline bind point used by this command, a descriptor set must have been bound to n at the same pipeline bind point, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout CompatibilityVkPipeline bound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout CompatibilityvkCmdBindDescriptorSets, must be valid if they are statically used by the VkPipeline bound to the pipeline bind point used by this commandVkPipeline object bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set for commandBufferVkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used to sample from any VkImage with a VkImageView of the type IMAGE_VIEW_TYPE_3D, IMAGE_VIEW_TYPE_CUBE, IMAGE_VIEW_TYPE_1D_ARRAY, IMAGE_VIEW_TYPE_2D_ARRAY or IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stageVkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stageVkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stageVkPipeline object bound to the pipeline bind point used by this command accesses a uniform buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind pointVkPipeline object bound to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind pointcommandBuffer is an unprotected command buffer, any resource accessed by the VkPipeline object bound to the pipeline bind point used by this command must not be a protected resourcerenderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to PIPELINE_BIND_POINT_GRAPHICS.subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to PIPELINE_BIND_POINT_GRAPHICS.VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex.VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit setbuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory objectbuffer must have been created with the BUFFER_USAGE_INDIRECT_BUFFER_BIT bit setoffset must be a multiple of 4commandBuffer must not be a protected command bufferdrawCount must be 0 or 1drawCount must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCountdrawCount is greater than 1, stride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawMeshTasksIndirectCommandNV)drawCount is equal to 1, (offset sizeof(VkDrawMeshTasksIndirectCommandNV)) must be less than or equal to the size of bufferdrawCount is greater than 1, (stride × (drawCount - 1) + offset sizeof(VkDrawMeshTasksIndirectCommandNV)) must be less than or equal to the size of buffercommandBuffer must be a valid VkCommandBuffer handlebuffer must be a valid VkBuffer handlecommandBuffer must be in the recording stateVkCommandPool that commandBuffer was allocated from must support graphics operationsbuffer, and commandBuffer must have been created, allocated, or retrieved from the same VkDevicecommandBuffer must be externally synchronizedVkCommandPool that commandBuffer was allocated from must be externally synchronized| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type |
|---|---|---|---|
| Primary Secondary | Inside | Graphics | Graphics |
commandBuffer - the command buffer into which the command is recorded.buffer - the buffer containing draw parameters.offset - the byte offset into buffer where parameters begin.drawCount - the number of draws to execute, and can be zero.stride - the byte stride between successive sets of draw parameters.public static void vkCmdDrawMeshTasksIndirectCountNV(org.lwjgl.vulkan.VkCommandBuffer commandBuffer,
long buffer,
long offset,
long countBuffer,
long countBufferOffset,
int maxDrawCount,
int stride)
To record an indirect mesh tasks draw with the draw count sourced from a buffer, call:
void vkCmdDrawMeshTasksIndirectCountNV(
VkCommandBuffer commandBuffer,
VkBuffer buffer,
VkDeviceSize offset,
VkBuffer countBuffer,
VkDeviceSize countBufferOffset,
uint32_t maxDrawCount,
uint32_t stride);
vkCmdDrawMeshTasksIndirectCountNV behaves similarly to CmdDrawMeshTasksIndirectNV 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 countBuffer located at countBufferOffset and use this as the draw count.
VkImageView is sampled with FILTER_LINEAR as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BITVkImageView is accessed using atomic operations as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BITVkImageView is sampled with FILTER_CUBIC_EXT as a result of this command, then the image view’s format features must contain FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXTVkImageView being sampled with FILTER_CUBIC_EXT as a result of this command must have a VkImageViewType and format that supports cubic filtering, as specified by VkFilterCubicImageViewImageFormatPropertiesEXT::filterCubic returned by vkGetPhysicalDeviceImageFormatProperties2VkImageView being sampled with FILTER_CUBIC_EXT with a reduction mode of either SAMPLER_REDUCTION_MODE_MIN_EXT or SAMPLER_REDUCTION_MODE_MAX_EXT as a result of this command must have a VkImageViewType and format that supports cubic filtering together with minmax filtering, as specified by VkFilterCubicImageViewImageFormatPropertiesEXT::filterCubicMinmax returned by vkGetPhysicalDeviceImageFormatProperties2VkImage created with a VkImageCreateInfo::flags containing IMAGE_CREATE_CORNER_SAMPLED_BIT_NV sampled as a result of this command must only be sampled using a VkSamplerAddressMode of SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE.VkPipeline bound to the pipeline bind point used by this command, a descriptor set must have been bound to n at the same pipeline bind point, with a VkPipelineLayout that is compatible for set n, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout CompatibilityVkPipeline bound to the pipeline bind point used by this command, a push constant value must have been set for the same pipeline bind point, with a VkPipelineLayout that is compatible for push constants, with the VkPipelineLayout used to create the current VkPipeline, as described in Pipeline Layout CompatibilityvkCmdBindDescriptorSets, must be valid if they are statically used by the VkPipeline bound to the pipeline bind point used by this commandVkPipeline object bound to the pipeline bind point used by this command requires any dynamic state, that state must have been set for commandBufferVkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used to sample from any VkImage with a VkImageView of the type IMAGE_VIEW_TYPE_3D, IMAGE_VIEW_TYPE_CUBE, IMAGE_VIEW_TYPE_1D_ARRAY, IMAGE_VIEW_TYPE_2D_ARRAY or IMAGE_VIEW_TYPE_CUBE_ARRAY, in any shader stageVkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions with ImplicitLod, Dref or Proj in their name, in any shader stageVkPipeline object bound to the pipeline bind point used by this command accesses a VkSampler object that uses unnormalized coordinates, that sampler must not be used with any of the SPIR-V OpImageSample* or OpImageSparseSample* instructions that includes a LOD bias or any offset values, in any shader stageVkPipeline object bound to the pipeline bind point used by this command accesses a uniform buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind pointVkPipeline object bound to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind pointcommandBuffer is an unprotected command buffer, any resource accessed by the VkPipeline object bound to the pipeline bind point used by this command must not be a protected resourcerenderPass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to PIPELINE_BIND_POINT_GRAPHICS.subpass member of the VkGraphicsPipelineCreateInfo structure specified when creating the VkPipeline bound to PIPELINE_BIND_POINT_GRAPHICS.VkPhysicalDeviceMultiviewProperties::maxMultiviewInstanceIndex.VkPipelineSampleLocationsStateCreateInfoEXT::sampleLocationsEnable set to TRUE and the current subpass has a depth/stencil attachment, then that attachment must have been created with the IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT bit setbuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory objectbuffer must have been created with the BUFFER_USAGE_INDIRECT_BUFFER_BIT bit setoffset must be a multiple of 4commandBuffer must not be a protected command buffercountBuffer is non-sparse then it must be bound completely and contiguously to a single VkDeviceMemory objectcountBuffer must have been created with the BUFFER_USAGE_INDIRECT_BUFFER_BIT bit setcountBufferOffset must be a multiple of 4countBuffer must be less than or equal to VkPhysicalDeviceLimits::maxDrawIndirectCountstride must be a multiple of 4 and must be greater than or equal to sizeof(VkDrawMeshTasksIndirectCommandNV)maxDrawCount is greater than or equal to 1, (stride × (maxDrawCount - 1) + offset + sizeof(VkDrawMeshTasksIndirectCommandNV)) must be less than or equal to the size of buffercountBuffer is equal to 1, (offset sizeof(VkDrawMeshTasksIndirectCommandNV)) must be less than or equal to the size of buffercountBuffer is greater than 1, (stride × (drawCount - 1) + offset + sizeof(VkDrawMeshTasksIndirectCommandNV)) must be less than or equal to the size of buffercommandBuffer must be a valid VkCommandBuffer handlebuffer must be a valid VkBuffer handlecountBuffer must be a valid VkBuffer handlecommandBuffer must be in the recording stateVkCommandPool that commandBuffer was allocated from must support graphics operationsbuffer, commandBuffer, and countBuffer must have been created, allocated, or retrieved from the same VkDevicecommandBuffer must be externally synchronizedVkCommandPool that commandBuffer was allocated from must be externally synchronized| Command Buffer Levels | Render Pass Scope | Supported Queue Types | Pipeline Type |
|---|---|---|---|
| Primary Secondary | Inside | Graphics | Graphics |
commandBuffer - the command buffer into which the command is recorded.buffer - the buffer containing draw parameters.offset - the byte offset into buffer where parameters begin.countBuffer - the buffer containing the draw count.countBufferOffset - the byte offset into countBuffer where the draw count begins.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 countBuffer and maxDrawCount.stride - the byte stride between successive sets of draw parameters.Copyright LWJGL. All Rights Reserved. License terms.