createBuffer :: (Extendss BufferCreateInfo a, PokeChain a, MonadIO io)=> Devicedeviceis the logical device that creates the buffer object.-> BufferCreateInfo apCreateInfois a pointer to a BufferCreateInfo structure containing parameters affecting creation of the buffer.->"allocator"
::: Maybe AllocationCallbackspAllocatorcontrols host memory allocation as described in the Memory Allocation chapter.-> io Buffer
vkCreateBuffer - Create a new buffer object
Description
Implementations may fail to create a buffer if the
effective usage
includes the
BUFFER_USAGE_2_DESCRIPTOR_HEAP_BIT_EXT
flag, and size is greater than the maximum of
maxResourceHeapSize
and
maxSamplerHeapSize.
If this happens, ERROR_OUT_OF_DEVICE_MEMORY
will be returned.
This is an issue identified with VK_EXT_descriptor_heap, which we plan to tighten up for the KHR version. Applications using VK_EXT_descriptor_heap may wish to avoid suballocating heaps from the same buffer, instead creating one buffer per heap, to avoid situations where this causes issues.
Valid Usage
devicemust support at least one queue family with one of the VK_QUEUE_VIDEO_ENCODE_BIT_KHR, VK_QUEUE_VIDEO_DECODE_BIT_KHR, QUEUE_SPARSE_BINDING_BIT, QUEUE_TRANSFER_BIT, QUEUE_COMPUTE_BIT, or QUEUE_GRAPHICS_BIT capabilities
If the
flagsmember ofpCreateInfoincludes BUFFER_CREATE_SPARSE_BINDING_BIT, and the extendedSparseAddressSpace feature is not enabled, creating this Buffer must not cause the total required sparse memory for all currently valid sparse resources on the device to exceed PhysicalDeviceLimits::sparseAddressSpaceSizeIf the
flagsmember ofpCreateInfoincludes BUFFER_CREATE_SPARSE_BINDING_BIT, the extendedSparseAddressSpace feature is enabled, and theusagemember ofpCreateInfocontains bits not in PhysicalDeviceExtendedSparseAddressSpacePropertiesNV::extendedSparseBufferUsageFlags, creating this Buffer must not cause the total required sparse memory for all currently valid sparse resources on the device, excluding Buffer created withusagemember ofpCreateInfocontaining bits in PhysicalDeviceExtendedSparseAddressSpacePropertiesNV::extendedSparseBufferUsageFlagsand Image created withusagemember ofpCreateInfocontaining bits in PhysicalDeviceExtendedSparseAddressSpacePropertiesNV::extendedSparseImageUsageFlags, to exceed PhysicalDeviceLimits::sparseAddressSpaceSizeIf the
flagsmember ofpCreateInfoincludes BUFFER_CREATE_SPARSE_BINDING_BIT and the extendedSparseAddressSpace feature is enabled, creating this Buffer must not cause the total required sparse memory for all currently valid sparse resources on the device to exceed PhysicalDeviceExtendedSparseAddressSpacePropertiesNV::extendedSparseAddressSpaceSizeIf using the Buffer for an import operation from a BufferCollectionFUCHSIA where a BufferCollectionBufferCreateInfoFUCHSIA has been chained to
pNext,pCreateInfomust match the BufferConstraintsInfoFUCHSIA::createInfoused when setting the constraints on the buffer collection with setBufferCollectionBufferConstraintsFUCHSIA
Valid Usage (Implicit)
devicemust be a valid Device handle
pCreateInfomust be a valid pointer to a valid BufferCreateInfo structureIf
pAllocatoris notNULL,pAllocatormust be a valid pointer to a valid AllocationCallbacks structurepBuffermust be a valid pointer to a Buffer handleThe device must have been created with at least
1queue
Return Codes
See Also
VK_VERSION_1_0, AllocationCallbacks, Buffer, BufferCreateInfo, Device