# VkBindAccelerationStructureMemoryInfoKHR(3) Manual Page

## Name

VkBindAccelerationStructureMemoryInfoKHR - Structure specifying acceleration structure memory binding

## C Specification

The `VkBindAccelerationStructureMemoryInfoKHR` structure is defined as:

    typedef struct VkBindAccelerationStructureMemoryInfoKHR {
        VkStructureType               sType;
        const void*                   pNext;
        VkAccelerationStructureKHR    accelerationStructure;
        VkDeviceMemory                memory;
        VkDeviceSize                  memoryOffset;
        uint32_t                      deviceIndexCount;
        const uint32_t*               pDeviceIndices;
    } VkBindAccelerationStructureMemoryInfoKHR;

or the equivalent

    typedef VkBindAccelerationStructureMemoryInfoKHR VkBindAccelerationStructureMemoryInfoNV;

## Members

- `sType` is the type of this structure.

- `pNext` is `NULL` or a pointer to an extension-specific structure.

- `accelerationStructure` is the acceleration structure to be attached to memory.

- `memory` is a `VkDeviceMemory` object describing the device memory to attach.

- `memoryOffset` is the start offset of the region of memory that is to be bound to the acceleration structure. The number of bytes returned in the VkMemoryRequirements::`size` member in `memory`, starting from `memoryOffset` bytes, will be bound to the specified acceleration structure.

- `deviceIndexCount` is the number of elements in `pDeviceIndices`.

- `pDeviceIndices` is a pointer to an array of device indices.

## Description

Valid Usage

- `accelerationStructure` must not already be backed by a memory object

- `memoryOffset` must be less than the size of `memory`

- `memory` must have been allocated using one of the memory types allowed in the `memoryTypeBits` member of the VkMemoryRequirements structure returned from a call to vkGetAccelerationStructureMemoryRequirementsKHR with `accelerationStructure` and `type` of `VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_KHR`

- `memoryOffset` must be an integer multiple of the `alignment` member of the VkMemoryRequirements structure returned from a call to vkGetAccelerationStructureMemoryRequirementsKHR with `accelerationStructure` and `type` of `VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_KHR`

- The `size` member of the `VkMemoryRequirements` structure returned from a call to vkGetAccelerationStructureMemoryRequirementsKHR with `accelerationStructure` and `type` of `VK_ACCELERATION_STRUCTURE_MEMORY_REQUIREMENTS_TYPE_OBJECT_KHR` must be less than or equal to the size of `memory` minus `memoryOffset`

Valid Usage (Implicit)

- `sType` must be `VK_STRUCTURE_TYPE_BIND_ACCELERATION_STRUCTURE_MEMORY_INFO_KHR`

- `pNext` must be `NULL`

- `accelerationStructure` must be a valid VkAccelerationStructureKHR handle

- `memory` must be a valid VkDeviceMemory handle

- If `deviceIndexCount` is not `0`, `pDeviceIndices` must be a valid pointer to an array of `deviceIndexCount` `uint32_t` values

- Both of `accelerationStructure`, and `memory` must have been created, allocated, or retrieved from the same VkDevice

## See Also

VkAccelerationStructureKHR, VkDeviceMemory, `VkDeviceSize`, VkStructureType, vkBindAccelerationStructureMemoryKHR, vkBindAccelerationStructureMemoryNV

## 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 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.