C Specification

To set the fragment output location mappings during rendering, call:

// Provided by VK_KHR_dynamic_rendering_local_read
void vkCmdSetRenderingAttachmentLocationsKHR(
    VkCommandBuffer                             commandBuffer,
    const VkRenderingAttachmentLocationInfoKHR* pLocationInfo);

Parameters

Description

This command sets the attachment location mappings for subsequent drawing commands, and must match the mappings provided to the currently bound pipeline, if one is bound, which can be set by chaining VkRenderingAttachmentLocationInfoKHR to VkGraphicsPipelineCreateInfo.

Until this command is called, mappings in the command buffer state are treated as each color attachment specified in vkCmdBeginRendering having a location equal to its index in VkRenderingInfo::pColorAttachments. This state is reset whenever vkCmdBeginRendering is called.

Valid Usage
  • VUID-vkCmdSetRenderingAttachmentLocationsKHR-dynamicRenderingLocalRead-09509
    dynamicRenderingLocalRead must be enabled

  • VUID-vkCmdSetRenderingAttachmentLocationsKHR-pLocationInfo-09510
    pLocationInfo->colorAttachmentCount must be equal to the value of VkRenderingInfo::colorAttachmentCount used to begin the current render pass instance

  • VUID-vkCmdSetRenderingAttachmentLocationsKHR-commandBuffer-09511
    The current render pass instance must have been started or resumed by vkCmdBeginRendering in this commandBuffer

Valid Usage (Implicit)
  • VUID-vkCmdSetRenderingAttachmentLocationsKHR-commandBuffer-parameter
    commandBuffer must be a valid VkCommandBuffer handle

  • VUID-vkCmdSetRenderingAttachmentLocationsKHR-pLocationInfo-parameter
    pLocationInfo must be a valid pointer to a valid VkRenderingAttachmentLocationInfoKHR structure

  • VUID-vkCmdSetRenderingAttachmentLocationsKHR-commandBuffer-recording
    commandBuffer must be in the recording state

  • VUID-vkCmdSetRenderingAttachmentLocationsKHR-commandBuffer-cmdpool
    The VkCommandPool that commandBuffer was allocated from must support graphics operations

  • VUID-vkCmdSetRenderingAttachmentLocationsKHR-renderpass
    This command must only be called inside of a render pass instance

  • VUID-vkCmdSetRenderingAttachmentLocationsKHR-videocoding
    This command must only be called outside of a video coding scope

Host Synchronization
  • Host access to commandBuffer must be externally synchronized

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

Command Properties
Command Buffer Levels Render Pass Scope Video Coding Scope Supported Queue Types Command Type

Primary
Secondary

Inside

Outside

Graphics

State

See Also

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 2014-2024 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0