VkGeneratedCommandsInfoNV(3)

# VkGeneratedCommandsInfoNV(3) Manual Page

## Name

VkGeneratedCommandsInfoNV - Structure specifying parameters for the generation of commands

Loading… please wait.

## C Specification

    // Provided by VK_NV_device_generated_commands
    typedef struct VkGeneratedCommandsInfoNV {
        VkStructureType                      sType;
        const void*                          pNext;
        VkPipelineBindPoint                  pipelineBindPoint;
        VkPipeline                           pipeline;
        VkIndirectCommandsLayoutNV           indirectCommandsLayout;
        uint32_t                             streamCount;
        const VkIndirectCommandsStreamNV*    pStreams;
        uint32_t                             sequencesCount;
        VkBuffer                             preprocessBuffer;
        VkDeviceSize                         preprocessOffset;
        VkDeviceSize                         preprocessSize;
        VkBuffer                             sequencesCountBuffer;
        VkDeviceSize                         sequencesCountOffset;
        VkBuffer                             sequencesIndexBuffer;
        VkDeviceSize                         sequencesIndexOffset;
    } VkGeneratedCommandsInfoNV;

## Members

- `sType` is the type of this structure.

- `pNext` is `NULL` or a pointer to a structure extending this structure.

- `pipelineBindPoint` is the VkPipelineBindPoint used for the `pipeline`.

- `pipeline` is the VkPipeline used in the generation and execution process.

- `indirectCommandsLayout` is the VkIndirectCommandsLayoutNV that provides the command sequence to generate.

- `streamCount` defines the number of input streams

- `pStreams` provides an array of VkIndirectCommandsStreamNV that provide the input data for the tokens used in `indirectCommandsLayout`.

- `sequencesCount` is the maximum number of sequences to reserve. If `sequencesCountBuffer` is VK_NULL_HANDLE, this is also the actual number of sequences generated.

- `preprocessBuffer` is the VkBuffer that is used for preprocessing the input data for execution. If this structure is used with vkCmdExecuteGeneratedCommandsNV with its `isPreprocessed` set to `VK_TRUE`, then the preprocessing step is skipped and data is only read from this buffer.

- `preprocessOffset` is the byte offset into `preprocessBuffer` where the preprocessed data is stored.

- `preprocessSize` is the maximum byte size within the `preprocessBuffer` after the `preprocessOffset` that is available for preprocessing.

- `sequencesCountBuffer` is a `VkBuffer` in which the actual number of sequences is provided as single `uint32_t` value.

- `sequencesCountOffset` is the byte offset into `sequencesCountBuffer` where the count value is stored.

- `sequencesIndexBuffer` is a `VkBuffer` that encodes the used sequence indices as `uint32_t` array.

- `sequencesIndexOffset` is the byte offset into `sequencesIndexBuffer` where the index values start.

## Description

Valid Usage

- The provided `pipeline` must match the pipeline bound at execution time

- If the `indirectCommandsLayout` uses a token of `VK_INDIRECT_COMMANDS_TOKEN_TYPE_SHADER_GROUP_NV`, then the `pipeline` must have been created with multiple shader groups

- If the `indirectCommandsLayout` uses a token of `VK_INDIRECT_COMMANDS_TOKEN_TYPE_SHADER_GROUP_NV`, then the `pipeline` must have been created with `VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV` set in `VkGraphicsPipelineCreateInfo`::`flags`

- If the `indirectCommandsLayout` uses a token of `VK_INDIRECT_COMMANDS_TOKEN_TYPE_PUSH_CONSTANT_NV`, then the `pipeline``s `VkPipelineLayout` must match the VkIndirectCommandsLayoutTokenNV::`pushconstantPipelineLayout`

- `streamCount` must match the `indirectCommandsLayout`’s `streamCount`

- `sequencesCount` must be less or equal to VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV::`maxIndirectSequenceCount` and VkGeneratedCommandsMemoryRequirementsInfoNV::`maxSequencesCount` that was used to determine the `preprocessSize`

- `preprocessBuffer` must have the `VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT` bit set in its usage flag

- `preprocessOffset` must be aligned to VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV::`minIndirectCommandsBufferOffsetAlignment`

- If `preprocessBuffer` is non-sparse then it must be bound completely and contiguously to a single `VkDeviceMemory` object

- `preprocessSize` must be at least equal to the memory requirement`s size returned by vkGetGeneratedCommandsMemoryRequirementsNV using the matching inputs (`indirectCommandsLayout`, …​) as within this structure

- `sequencesCountBuffer` can be set if the actual used count of sequences is sourced from the provided buffer. In that case the `sequencesCount` serves as upper bound

- If `sequencesCountBuffer` is not VK_NULL_HANDLE, its usage flag must have the `VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT` bit set

- If `sequencesCountBuffer` is not VK_NULL_HANDLE, `sequencesCountOffset` must be aligned to `VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV`::`minSequencesCountBufferOffsetAlignment`

- If `sequencesCountBuffer` is not VK_NULL_HANDLE and is non-sparse then it must be bound completely and contiguously to a single `VkDeviceMemory` object

- If `indirectCommandsLayout`’s `VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NV` is set, `sequencesIndexBuffer` must be set otherwise it must be VK_NULL_HANDLE

- If `sequencesIndexBuffer` is not VK_NULL_HANDLE, its usage flag must have the `VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT` bit set

- If `sequencesIndexBuffer` is not VK_NULL_HANDLE, `sequencesIndexOffset` must be aligned to `VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV`::`minSequencesIndexBufferOffsetAlignment`

- If `sequencesIndexBuffer` is not VK_NULL_HANDLE and is non-sparse then it must be bound completely and contiguously to a single `VkDeviceMemory` object

Valid Usage (Implicit)

- `sType` must be `VK_STRUCTURE_TYPE_GENERATED_COMMANDS_INFO_NV`

- `pNext` must be `NULL`

- `pipelineBindPoint` must be a valid VkPipelineBindPoint value

- `pipeline` must be a valid VkPipeline handle

- `indirectCommandsLayout` must be a valid VkIndirectCommandsLayoutNV handle

- `pStreams` must be a valid pointer to an array of `streamCount` valid VkIndirectCommandsStreamNV structures

- `preprocessBuffer` must be a valid VkBuffer handle

- If `sequencesCountBuffer` is not VK_NULL_HANDLE, `sequencesCountBuffer` must be a valid VkBuffer handle

- If `sequencesIndexBuffer` is not VK_NULL_HANDLE, `sequencesIndexBuffer` must be a valid VkBuffer handle

- `streamCount` must be greater than `0`

- Each of `indirectCommandsLayout`, `pipeline`, `preprocessBuffer`, `sequencesCountBuffer`, and `sequencesIndexBuffer` that are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the same VkDevice

## See Also

VkBuffer, `VkDeviceSize`, VkIndirectCommandsLayoutNV, VkIndirectCommandsStreamNV, VkPipeline, VkPipelineBindPoint, VkStructureType, vkCmdExecuteGeneratedCommandsNV, vkCmdPreprocessGeneratedCommandsNV

## Document Notes

For more information, see the Vulkan Specification

This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.

## Copyright

Copyright (c) 2014-2020 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0