1// Copyright (c) 2019-2020 NVIDIA Corporation 2// 3// SPDX-License-Identifier: CC-BY-4.0 4 5[[device-generated-commands]] 6= Device-Generated Commands 7 8This chapter discusses the generation of command buffer content on the 9device, for which these principle steps are to be taken: 10 11 * Define via sname:VkIndirectCommandsLayoutNV the sequence of commands 12 which should be generated. 13 * Optionally make use of <<graphics-shadergroups, device-bindable Shader 14 Groups>> for graphics pipelines. 15 * Retrieve device addresses by flink:vkGetBufferDeviceAddressEXT for 16 setting buffers on the device. 17ifdef::VK_NV_device_generated_commands_compute[] 18 * Retrieve device addresses of compute pipelines by 19 flink:vkGetPipelineIndirectDeviceAddressNV to be able to bind it in 20 device generated rendering. 21endif::VK_NV_device_generated_commands_compute[] 22 * Fill one or more sname:VkBuffer with the appropriate content that gets 23 interpreted by sname:VkIndirectCommandsLayoutNV. 24 * Create a `preprocess` sname:VkBuffer using the allocation information 25 from flink:vkGetGeneratedCommandsMemoryRequirementsNV. 26 * Optionally preprocess the input data using 27 flink:vkCmdPreprocessGeneratedCommandsNV in a separate action. 28 * Generate and execute the actual commands via 29 flink:vkCmdExecuteGeneratedCommandsNV passing all required data. 30 31flink:vkCmdPreprocessGeneratedCommandsNV executes in a separate logical 32pipeline from either graphics or compute. 33When preprocessing commands in a separate step they must: be explicitly 34synchronized against the command execution. 35When not preprocessing, the preprocessing is automatically synchronized 36against the command execution. 37 38include::{chapters}/VK_NV_device_generated_commands/indirectcommands.adoc[] 39 40include::{chapters}/VK_NV_device_generated_commands/generation.adoc[] 41