Function Prototype

vkCmdInitializeGraphScratchMemoryAMDX

Initialize scratch memory for an execution graph
primary
outside
graphics / compute
action

To initialize scratch memory for a particular execution graph, call:

void vkCmdInitializeGraphScratchMemoryAMDX(
    VkCommandBuffer                                 commandBuffer,
    VkDeviceAddress                                 scratch);
  • commandBuffer is the command buffer into which the command will be recorded.
  • scratch is a pointer to the scratch memory to be initialized.

This command must be called before using scratch to dispatch the currently bound execution graph pipeline.

Execution of this command may modify any memory locations in the range [scratch,scratch + size), where size is the value returned in VkExecutionGraphPipelineScratchSizeAMDX::size by VkExecutionGraphPipelineScratchSizeAMDX for the currently bound execution graph pipeline. Accesses to this memory range are performed in the VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT pipeline stage with the VK_ACCESS_2_SHADER_STORAGE_READ_BIT and VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT access flags.

If any portion of scratch is modified by any command other than vkCmdDispatchGraphAMDX, vkCmdDispatchGraphIndirectAMDX, vkCmdDispatchGraphIndirectCountAMDX, or vkCmdInitializeGraphScratchMemoryAMDX with the same execution graph, it must be reinitialized for the execution graph again before dispatching against it.

Valid Usage

VUID-vkCmdInitializeGraphScratchMemoryAMDX-scratch-09143

scratch must be the device address of an allocated memory range at least as large as the value of VkExecutionGraphPipelineScratchSizeAMDX::size returned by VkExecutionGraphPipelineScratchSizeAMDX for the currently bound execution graph pipeline.

Valid Usage (Implicit)

VUID-vkCmdInitializeGraphScratchMemoryAMDX-commandBuffer-cmdpool

The VkCommandPool that commandBuffer was allocated from must support graphics, or compute operations

VUID-vkCmdInitializeGraphScratchMemoryAMDX-renderpass

This command must only be called outside of a render pass instance

VUID-vkCmdInitializeGraphScratchMemoryAMDX-videocoding

This command must only be called outside of a video coding scope

VUID-vkCmdInitializeGraphScratchMemoryAMDX-bufferlevel

commandBuffer must be a primary VkCommandBuffer

Host Synchronization

  • Host access to the VkCommandPool that commandBuffer was allocated from must be externally synchronized ::