vkGetBufferMemoryRequirements - Returns the memory requirements for specified Vulkan object
Modulevulkan-3.27GHC2021
Vulkan.Core10.MemoryManagement
- 2 types
- 4 values
- Packagevulkan-3.27
- Exports6
- LanguageGHC2021
- LicenceBSD-3-Clause
- SourceMemoryManagement.hs
bindBufferMemory :: MonadIO io=> Devicedeviceis the logical device that owns the buffer and memory.-> Bufferbufferis the buffer to be attached to memory.-> DeviceMemorymemoryis a DeviceMemory object describing the device memory to attach.->"memoryOffset"
::: DeviceSizememoryOffsetis the start offset of the region ofmemorywhich is to be bound to the buffer. The number of bytes returned in the MemoryRequirements::sizemember inmemory, starting frommemoryOffsetbytes, will be bound to the specified buffer.-> io ()
vkBindBufferMemory - Bind device memory to a buffer object
Description
bindBufferMemory is equivalent to passing the same parameters through BindBufferMemoryInfo to bindBufferMemory2.
Valid Usage
buffermust not have been bound to a memory object
buffermust not have been created with any sparse memory binding flagsmemoryOffsetmust be less than the size ofmemorymemorymust have been allocated using one of the memory types allowed in thememoryTypeBitsmember of the MemoryRequirements structure returned from a call to getBufferMemoryRequirements withbufferIf
memorywas not allocated from a memory heap with the MEMORY_HEAP_TILE_MEMORY_BIT_QCOM property set,memoryOffsetmust be an integer multiple of thealignmentmember of the MemoryRequirements structure returned from a call to getBufferMemoryRequirements withbufferIf
memorywas allocated from a memory heap with the MEMORY_HEAP_TILE_MEMORY_BIT_QCOM property set,memoryOffsetmust be an integer multiple of thealignmentmember of the TileMemoryRequirementsQCOM structure returned from a call to getBufferMemoryRequirements withbufferIf
memorywas not allocated from a memory heap with the MEMORY_HEAP_TILE_MEMORY_BIT_QCOM property set,sizemember of the MemoryRequirements structure returned from a call to getBufferMemoryRequirements withbuffermust be less than or equal to the size ofmemoryminusmemoryOffsetIf
memorywas allocated from a memory heap with the MEMORY_HEAP_TILE_MEMORY_BIT_QCOM property set,sizemember of the TileMemoryRequirementsQCOM structure returned from a call to getBufferMemoryRequirements withbuffermust be less than or equal to the size ofmemoryminusmemoryOffsetIf
bufferrequires a dedicated allocation (as reported by getBufferMemoryRequirements2 in MemoryDedicatedRequirements::requiresDedicatedAllocationforbuffer),memorymust have been allocated with MemoryDedicatedAllocateInfo::bufferequal tobufferIf the MemoryAllocateInfo provided when
memorywas allocated included a MemoryDedicatedAllocateInfo structure in itspNextchain, and MemoryDedicatedAllocateInfo::bufferwas not NULL_HANDLE, thenbuffermust equal MemoryDedicatedAllocateInfo::buffer, andmemoryOffsetmust be zeroIf the MemoryAllocateInfo provided when
memorywas allocated included a MemoryDedicatedAllocateInfo structure in itspNextchain, MemoryDedicatedAllocateInfo::imagemust have been NULL_HANDLEIf
bufferwas created with the BUFFER_CREATE_PROTECTED_BIT bit set, the buffer must be bound to a memory object allocated with a memory type that reports MEMORY_PROPERTY_PROTECTED_BITIf
bufferwas created with the BUFFER_CREATE_PROTECTED_BIT bit not set, the buffer must not be bound to a memory object allocated with a memory type that reports MEMORY_PROPERTY_PROTECTED_BITIf
bufferwas created with DedicatedAllocationBufferCreateInfoNV::dedicatedAllocationequal to TRUE,memorymust have been allocated with DedicatedAllocationMemoryAllocateInfoNV::bufferequal to a buffer handle created with identical creation parameters tobufferandmemoryOffsetmust be zeroIf the VK_KHR_dedicated_allocation extension is not enabled, PhysicalDeviceProperties::
apiVersionis less than Vulkan 1.1, andbufferwas not created with DedicatedAllocationBufferCreateInfoNV::dedicatedAllocationequal to TRUE,memorymust not have been allocated dedicated for a specific buffer or imageIf the value of ExportMemoryAllocateInfo::
handleTypesused to allocatememoryis not0, it must include at least one of the handles set in ExternalMemoryBufferCreateInfo::handleTypeswhenbufferwas createdIf
memorywas allocated by a memory import operation, that is not ImportAndroidHardwareBufferInfoANDROID with a non-NULLbuffervalue, the external handle type of the imported memory must also have been set in ExternalMemoryBufferCreateInfo::handleTypeswhenbufferwas createdIf
memorywas allocated with the ImportAndroidHardwareBufferInfoANDROID memory import operation with a non-NULLbuffervalue, EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID must also have been set in ExternalMemoryBufferCreateInfo::handleTypeswhenbufferwas createdIf the PhysicalDeviceBufferDeviceAddressFeatures::
bufferDeviceAddressfeature is enabled andbufferwas created with the BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT usage flag set,memorymust have been allocated with the MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT bit setIf the PhysicalDeviceBufferDeviceAddressFeatures::
bufferDeviceAddressCaptureReplayfeature is enabled andbufferwas created with the BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT bit set,memorymust have been allocated with the MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT bit setIf
bufferwas created with BufferCollectionBufferCreateInfoFUCHSIA chained to BufferCreateInfo::pNext,memorymust be allocated with a ImportMemoryBufferCollectionFUCHSIA chained to MemoryAllocateInfo::pNextIf the
bufferwas created with the BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT bit set,memorymust have been allocated with the MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT bit setIf the
bufferwas created with the BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT bit set,memorymust have been allocated with the MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT bit setIf the
bufferwas created with the BUFFER_USAGE_DESCRIPTOR_HEAP_BIT_EXT or BUFFER_USAGE_2_DESCRIPTOR_HEAP_BIT_EXT bit set,memorymust have been allocated with the MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT bit set
Valid Usage (Implicit)
devicemust be a valid Device handle
buffermust be a valid Buffer handlememorymust be a valid DeviceMemory handlebuffermust have been created, allocated, or retrieved fromdevicememorymust have been created, allocated, or retrieved fromdevice
Host Synchronization
Host access to
buffermust be externally synchronized
Return Codes
See Also
getImageMemoryRequirements :: MonadIO io=> Devicedeviceis the logical device that owns the image.-> Imageimageis the image to query.-> io MemoryRequirements
vkGetImageMemoryRequirements - Returns the memory requirements for specified Vulkan object
Valid Usage
imagemust not have been created with the IMAGE_CREATE_DISJOINT_BIT flag set
If
imagewas created with the EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID external memory handle type, thenimagemust be bound to memoryIf
imagewas created with the EXTERNAL_MEMORY_HANDLE_TYPE_SCREEN_BUFFER_BIT_QNX external memory handle type, thenimagemust be bound to memory
Valid Usage (Implicit)
devicemust be a valid Device handle
imagemust be a valid Image handlepMemoryRequirementsmust be a valid pointer to a MemoryRequirements structureimagemust have been created, allocated, or retrieved fromdevice
See Also
bindImageMemory :: MonadIO io=> Devicedeviceis the logical device that owns the image and memory.-> Imageimageis the image.-> DeviceMemorymemoryis the DeviceMemory object describing the device memory to attach.->"memoryOffset"
::: DeviceSizememoryOffsetis the start offset of the region ofmemorywhich is to be bound to the image. The number of bytes returned in the MemoryRequirements::sizemember inmemory, starting frommemoryOffsetbytes, will be bound to the specified image.-> io ()
vkBindImageMemory - Bind device memory to an image object
Description
bindImageMemory is equivalent to passing the same parameters through BindImageMemoryInfo to bindImageMemory2.
Valid Usage
imagemust not have been bound to a memory object
imagemust not have been created with any sparse memory binding flagsmemoryOffsetmust be less than the size ofmemoryIf
imagerequires a dedicated allocation (as reported by getImageMemoryRequirements2 in MemoryDedicatedRequirements::requiresDedicatedAllocationforimage),memorymust have been created with MemoryDedicatedAllocateInfo::imageequal toimageIf the dedicatedAllocationImageAliasing feature is not enabled, and the MemoryAllocateInfo provided when
memorywas allocated included a MemoryDedicatedAllocateInfo structure in itspNextchain, and MemoryDedicatedAllocateInfo::imagewas not NULL_HANDLE, thenimagemust equal MemoryDedicatedAllocateInfo::imageandmemoryOffsetmust be zeroIf the dedicatedAllocationImageAliasing feature is enabled, and the MemoryAllocateInfo provided when
memorywas allocated included a MemoryDedicatedAllocateInfo structure in itspNextchain, and MemoryDedicatedAllocateInfo::imagewas not NULL_HANDLE, thenmemoryOffsetmust be zero, andimagemust be either equal to MemoryDedicatedAllocateInfo::imageor an image that was created using the same parameters in ImageCreateInfo, with the exception thatextentandarrayLayersmay differ subject to the following restrictions: every dimension in theextentparameter of the image being bound must be equal to or smaller than the original image for which the allocation was created; and thearrayLayersparameter of the image being bound must be equal to or smaller than the original image for which the allocation was createdIf the MemoryAllocateInfo provided when
memorywas allocated included a MemoryDedicatedAllocateInfo structure in itspNextchain, MemoryDedicatedAllocateInfo::buffermust have been NULL_HANDLEIf image was created with the IMAGE_CREATE_PROTECTED_BIT bit set, the image must be bound to a memory object allocated with a memory type that reports MEMORY_PROPERTY_PROTECTED_BIT
If image was created with the IMAGE_CREATE_PROTECTED_BIT bit not set, the image must not be bound to a memory object created with a memory type that reports MEMORY_PROPERTY_PROTECTED_BIT
If
imagewas created with DedicatedAllocationImageCreateInfoNV::dedicatedAllocationequal to TRUE,memorymust have been created with DedicatedAllocationMemoryAllocateInfoNV::imageequal to an image handle created with identical creation parameters toimageandmemoryOffsetmust be zeroIf the VK_KHR_dedicated_allocation extension is not enabled, PhysicalDeviceProperties::
apiVersionis less than Vulkan 1.1, andimagewas not created with DedicatedAllocationImageCreateInfoNV::dedicatedAllocationequal to TRUE,memorymust not have been allocated dedicated for a specific buffer or imageIf the value of ExportMemoryAllocateInfo::
handleTypesused to allocatememoryis not0, it must include at least one of the handles set in ExternalMemoryImageCreateInfo::handleTypeswhenimagewas createdIf
memorywas created by a memory import operation, that is not ImportAndroidHardwareBufferInfoANDROID with a non-NULLbuffervalue, the external handle type of the imported memory must also have been set in ExternalMemoryImageCreateInfo::handleTypeswhenimagewas createdIf
memorywas created with the ImportAndroidHardwareBufferInfoANDROID memory import operation with a non-NULLbuffervalue, EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID must also have been set in ExternalMemoryImageCreateInfo::handleTypeswhenimagewas createdIf the
imagewas created with the IMAGE_CREATE_DESCRIPTOR_HEAP_CAPTURE_REPLAY_BIT_EXT bit set,memorymust have been allocated with the MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT bit setIf the
imagewas created with the IMAGE_CREATE_DESCRIPTOR_HEAP_CAPTURE_REPLAY_BIT_EXT bit set,memorymust have been allocated with the MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT bit setimagemust not have been created with the IMAGE_CREATE_DISJOINT_BIT setmemorymust have been allocated using one of the memory types allowed in thememoryTypeBitsmember of the MemoryRequirements structure returned from a call to getImageMemoryRequirements withimageIf
memorywas not allocated from a memory heap with the MEMORY_HEAP_TILE_MEMORY_BIT_QCOM property set,memoryOffsetmust be an integer multiple of thealignmentmember of the MemoryRequirements structure returned from a call to getImageMemoryRequirements withimageIf
memorywas allocated from a memory heap with the MEMORY_HEAP_TILE_MEMORY_BIT_QCOM property set,memoryOffsetmust be an integer multiple of thealignmentmember of the TileMemoryRequirementsQCOM structure returned from a call to getImageMemoryRequirements2 withimageIf
memorywas not allocated from a memory heap with the MEMORY_HEAP_TILE_MEMORY_BIT_QCOM property set,sizemember of the MemoryRequirements structure returned from a call to getImageMemoryRequirements withimagemust be less than or equal to the size ofmemoryminusmemoryOffsetIf
memorywas allocated from a memory heap with the MEMORY_HEAP_TILE_MEMORY_BIT_QCOM property set,sizemember of the TileMemoryRequirementsQCOM structure returned from a call to getImageMemoryRequirements2 withimagemust be less than or equal to the size ofmemoryminusmemoryOffsetIf
imagewas created with BufferCollectionImageCreateInfoFUCHSIA chained to ImageCreateInfo::pNext,memorymust be allocated with a ImportMemoryBufferCollectionFUCHSIA chained to MemoryAllocateInfo::pNext
Valid Usage (Implicit)
devicemust be a valid Device handle
imagemust be a valid Image handlememorymust be a valid DeviceMemory handleimagemust have been created, allocated, or retrieved fromdevicememorymust have been created, allocated, or retrieved fromdevice
Host Synchronization
Host access to
imagemust be externally synchronized
Return Codes
See Also
VkMemoryRequirements - Structure specifying memory requirements
See Also
VK_VERSION_1_0, DeviceSize, MemoryRequirements2, VkVideoSessionMemoryRequirementsKHR, getBufferMemoryRequirements, getImageMemoryRequirements
Constructors
MemoryRequirementssize :: DeviceSizesizeis the size, in bytes, of the memory allocation required for the resource.alignment :: DeviceSizealignmentis the alignment, in bytes, of the offset within the allocation required for the resource.memoryTypeBits :: Word32memoryTypeBitsis a bitmask and contains one bit set for every supported memory type for the resource. Bitiis set if and only if the memory typeiin the PhysicalDeviceMemoryProperties structure for the physical device is supported for the resource.
Instances6Eq, Show, Storable, FromCStruct, ToCStruct, Zero
Eq MemoryRequirementsDefined in vulkan-3.27 · Vulkan.Core10.MemoryManagementShow MemoryRequirementsDefined in vulkan-3.27 · Vulkan.Core10.MemoryManagementStorable MemoryRequirementsDefined in vulkan-3.27 · Vulkan.Core10.MemoryManagementFromCStruct MemoryRequirementsDefined in vulkan-3.27 · Vulkan.Core10.MemoryManagementToCStruct MemoryRequirementsDefined in vulkan-3.27 · Vulkan.Core10.MemoryManagementZero MemoryRequirementsDefined in vulkan-3.27 · Vulkan.Core10.MemoryManagement
VkDeviceMemory - Opaque handle to a device memory object
See Also
VK_DEFINE_NON_DISPATCHABLE_HANDLE, VK_VERSION_1_0, BindAccelerationStructureMemoryInfoNV, BindBufferMemoryInfo, BindDataGraphPipelineSessionMemoryInfoARM, BindImageMemoryInfo, BindTensorMemoryInfoARM, VkBindVideoSessionMemoryInfoKHR, DeviceMemoryOpaqueCaptureAddressInfo, ExportMetalBufferInfoEXT, MappedMemoryRange, MemoryGetAndroidHardwareBufferInfoANDROID, MemoryGetFdInfoKHR, MemoryGetMetalHandleInfoEXT, VkMemoryGetNativeBufferInfoOHOS, MemoryGetRemoteAddressInfoNV, MemoryGetWin32HandleInfoKHR, MemoryGetZirconHandleInfoFUCHSIA, MemoryMapInfo, MemoryUnmapInfo, SparseImageMemoryBind, SparseMemoryBind, TileMemoryBindInfoQCOM, Win32KeyedMutexAcquireReleaseInfoKHR, Win32KeyedMutexAcquireReleaseInfoNV, allocateMemory, bindBufferMemory, bindImageMemory, freeMemory, getDeviceMemoryCommitment, getMemoryWin32HandleNV, mapMemory, setDeviceMemoryPriorityEXT, unmapMemory
Constructors
Instances7Eq, Ord, Show, Storable, HasObjectType, IsHandle, …
Eq DeviceMemoryDefined in vulkan-3.27 · Vulkan.Core10.HandlesOrd DeviceMemoryDefined in vulkan-3.27 · Vulkan.Core10.HandlesShow DeviceMemoryDefined in vulkan-3.27 · Vulkan.Core10.HandlesStorable DeviceMemoryDefined in vulkan-3.27 · Vulkan.Core10.HandlesHasObjectType DeviceMemoryDefined in vulkan-3.27 · Vulkan.Core10.HandlesIsHandle DeviceMemoryDefined in vulkan-3.27 · Vulkan.Core10.HandlesZero DeviceMemoryDefined in vulkan-3.27 · Vulkan.Core10.Handles