/ chapters / VK_NVX_device_generated_commands / generatedcommands.txt
generatedcommands.txt
  1  [[device-generated-commands]]
  2  = Device-Generated Commands
  3  
  4  This chapter discusses the generation of command buffer content on the
  5  device.
  6  These principle steps are to be taken to generate commands on the device:
  7  
  8    * Make resource bindings accessible for the device via registering in a
  9      sname:VkObjectTableNVX.
 10    * Define via sname:VkIndirectCommandsLayoutNVX the sequence of commands
 11      which should be generated.
 12    * Fill one or more sname:VkBuffer with the appropriate content that gets
 13      interpreted by sname:VkIndirectCommandsLayoutNVX.
 14    * Reserve command space via flink:vkCmdReserveSpaceForCommandsNVX in a
 15      secondary sname:VkCommandBuffer where the generated commands should be
 16      recorded.
 17    * Generate the actual commands via flink:vkCmdProcessCommandsNVX passing
 18      all required data.
 19  
 20  Execution of such generated commands can either be triggered directly with
 21  the generation process, or by executing the secondary sname:VkCommandBuffer
 22  that was chosen as optional target.
 23  The latter allows re-using generated commands as well.
 24  Similar to sname:VkDescriptorSet, special care should: be taken for the
 25  lifetime of resources referenced in sname:VkObjectTableNVX, which may be
 26  accessed at either generation or execution time.
 27  
 28  flink:vkCmdProcessCommandsNVX executes in a separate logical pipeline from
 29  either graphics or compute.
 30  When generating commands into a secondary command buffer, the command
 31  generation must: be explicitly synchronized against the secondary command
 32  buffer's execution.
 33  When not using a secondary command buffer, the command generation is
 34  automatically synchronized against the command execution.
 35  
 36  == Features and Limitations
 37  
 38  [open,refpage='vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX',desc='Returns device-generated commands related properties of a physical device',type='protos']
 39  --
 40  
 41  To query the support of related features and limitations, call:
 42  
 43  include::{generated}/api/protos/vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX.txt[]
 44  
 45    * pname:physicalDevice is the handle to the physical device whose
 46      properties will be queried.
 47    * pname:pFeatures points to an instance of the
 48      slink:VkDeviceGeneratedCommandsFeaturesNVX structure, that will be
 49      filled with returned information.
 50    * pname:pLimits points to an instance of the
 51      slink:VkDeviceGeneratedCommandsLimitsNVX structure, that will be filled
 52      with returned information.
 53  
 54  include::{generated}/validity/protos/vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX.txt[]
 55  --
 56  
 57  [open,refpage='VkDeviceGeneratedCommandsFeaturesNVX',desc='Structure specifying physical device support',type='structs']
 58  --
 59  
 60  The sname:VkDeviceGeneratedCommandsFeaturesNVX structure is defined as:
 61  
 62  include::{generated}/api/structs/VkDeviceGeneratedCommandsFeaturesNVX.txt[]
 63  
 64    * pname:sType is the type of this structure.
 65    * pname:pNext is `NULL` or a pointer to an extension-specific structure.
 66    * pname:computeBindingPointSupport specifies whether the
 67      sname:VkObjectTableNVX supports entries with
 68      ename:VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX bit set and
 69      sname:VkIndirectCommandsLayoutNVX supports
 70      ename:VK_PIPELINE_BIND_POINT_COMPUTE.
 71  
 72  include::{generated}/validity/structs/VkDeviceGeneratedCommandsFeaturesNVX.txt[]
 73  --
 74  
 75  [open,refpage='VkDeviceGeneratedCommandsLimitsNVX',desc='Structure specifying physical device limits',type='structs']
 76  --
 77  
 78  The sname:VkDeviceGeneratedCommandsLimitsNVX structure is defined as:
 79  
 80  include::{generated}/api/structs/VkDeviceGeneratedCommandsLimitsNVX.txt[]
 81  
 82    * pname:sType is the type of this structure.
 83    * pname:pNext is `NULL` or a pointer to an extension-specific structure.
 84    * pname:maxIndirectCommandsLayoutTokenCount the maximum number of tokens
 85      in sname:VkIndirectCommandsLayoutNVX.
 86    * pname:maxObjectEntryCounts the maximum number of entries per resource
 87      type in sname:VkObjectTableNVX.
 88    * pname:minSequenceCountBufferOffsetAlignment the minimum alignment for
 89      memory addresses optionally used in fname:vkCmdProcessCommandsNVX.
 90    * pname:minSequenceIndexBufferOffsetAlignment the minimum alignment for
 91      memory addresses optionally used in fname:vkCmdProcessCommandsNVX.
 92    * pname:minCommandsTokenBufferOffsetAlignment the minimum alignment for
 93      memory addresses optionally used in fname:vkCmdProcessCommandsNVX.
 94  
 95  include::{generated}/validity/structs/VkDeviceGeneratedCommandsLimitsNVX.txt[]
 96  --
 97  
 98  include::objecttable.txt[]
 99  
100  include::indirectcommands.txt[]
101  
102  include::generation.txt[]