vkCreateBuffer(3)
C Specification
To create buffers, call:
// Provided by VK_VERSION_1_0VkResult vkCreateBuffer( VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer);Parameters
deviceis the logical device that creates the buffer object.pCreateInfois a pointer to aVkBufferCreateInfo structurecontaining parameters affecting creation of the buffer.pAllocatorcontrols host memory allocation as described in theMemory Allocation chapter.pBufferis a pointer to aVkBuffer handle in which theresulting buffer object is returned.
Description
VUID-vkCreateBuffer-device-09664
devicemust support at least one queue family with one of theVK_QUEUE_VIDEO_ENCODE_BIT_KHR,VK_QUEUE_VIDEO_DECODE_BIT_KHR,VK_QUEUE_SPARSE_BINDING_BIT,VK_QUEUE_TRANSFER_BIT,VK_QUEUE_COMPUTE_BIT, orVK_QUEUE_GRAPHICS_BIT capabilitiesVUID-vkCreateBuffer-flags-00911
If theflagsmember ofpCreateInfoincludesVK_BUFFER_CREATE_SPARSE_BINDING_BIT,and theextendedSparseAddressSpacefeature is not enabled,creating thisVkBuffermust not cause the total required sparsememory for all currently valid sparse resources on the device to exceedVkPhysicalDeviceLimits::sparseAddressSpaceSizeVUID-vkCreateBuffer-flags-09383
If theflagsmember ofpCreateInfoincludesVK_BUFFER_CREATE_SPARSE_BINDING_BIT, theextendedSparseAddressSpacefeature is enabled, and theusagemember ofpCreateInfocontains bits not inVkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV::extendedSparseBufferUsageFlags,creating thisVkBuffermust not cause the total required sparsememory for all currently valid sparse resources on the device, excludingVkBuffercreated withusagemember ofpCreateInfocontaining bits inVkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV::extendedSparseBufferUsageFlagsandVkImagecreated withusagemember ofpCreateInfocontaining bits inVkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV::extendedSparseImageUsageFlags,to exceedVkPhysicalDeviceLimits::sparseAddressSpaceSizeVUID-vkCreateBuffer-flags-09384
If theflagsmember ofpCreateInfoincludesVK_BUFFER_CREATE_SPARSE_BINDING_BIT and theextendedSparseAddressSpacefeature is enabled, creating thisVkBuffermust not cause the total required sparse memory for allcurrently valid sparse resources on the device to exceedVkPhysicalDeviceExtendedSparseAddressSpacePropertiesNV::extendedSparseAddressSpaceSize
VUID-vkCreateBuffer-pNext-06387
If using theVkBuffer for an import operation from aVkBufferCollectionFUCHSIA where aVkBufferCollectionBufferCreateInfoFUCHSIA has been chained topNext,pCreateInfomust match theVkBufferConstraintsInfoFUCHSIA::createInfoused when settingthe constraints on the buffer collection withvkSetBufferCollectionBufferConstraintsFUCHSIA
VUID-vkCreateBuffer-device-parameter
devicemust be a validVkDevice handleVUID-vkCreateBuffer-pCreateInfo-parameter
pCreateInfomust be a valid pointer to a validVkBufferCreateInfo structureVUID-vkCreateBuffer-pAllocator-parameter
IfpAllocatoris notNULL,pAllocatormust be a valid pointer to a validVkAllocationCallbacks structureVUID-vkCreateBuffer-pBuffer-parameter
pBuffermust be a valid pointer to aVkBuffer handleVUID-vkCreateBuffer-device-queuecount
The devicemust have been created with at least1queue
Document Notes
For more information, see theVulkan Specification.
This page is extracted from the Vulkan Specification.Fixes and changes should be made to the Specification, not directly.