| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vulkan.Core10.MemoryManagement
Synopsis
- getBufferMemoryRequirements :: forall io. MonadIO io => Device -> Buffer -> io MemoryRequirements
- bindBufferMemory :: forall io. MonadIO io => Device -> Buffer -> DeviceMemory -> ("memoryOffset" ::: DeviceSize) -> io ()
- getImageMemoryRequirements :: forall io. MonadIO io => Device -> Image -> io MemoryRequirements
- bindImageMemory :: forall io. MonadIO io => Device -> Image -> DeviceMemory -> ("memoryOffset" ::: DeviceSize) -> io ()
- data MemoryRequirements = MemoryRequirements {}
- newtype DeviceMemory = DeviceMemory Word64
Documentation
getBufferMemoryRequirements Source #
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> Buffer |
|
| -> io MemoryRequirements |
vkGetBufferMemoryRequirements - Returns the memory requirements for specified Vulkan object
Valid Usage (Implicit)
See Also
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> Buffer |
|
| -> DeviceMemory |
|
| -> ("memoryOffset" ::: DeviceSize) |
|
| -> 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 created with any sparse memory binding flags -
memoryOffsetmust be less than the size ofmemory -
memorymust have been allocated using one of the memory types allowed in thememoryTypeBitsmember of theMemoryRequirementsstructure returned from a call togetBufferMemoryRequirementswithbuffer -
memoryOffsetmust be an integer multiple of thealignmentmember of theMemoryRequirementsstructure returned from a call togetBufferMemoryRequirementswithbuffer - The
sizemember of theMemoryRequirementsstructure returned from a call togetBufferMemoryRequirementswithbuffermust be less than or equal to the size ofmemoryminusmemoryOffset - If
bufferrequires a dedicated allocation (as reported bygetBufferMemoryRequirements2inMemoryDedicatedRequirements::requiresDedicatedAllocationforbuffer),memorymust have been allocated withMemoryDedicatedAllocateInfo::bufferequal tobuffer - If the
MemoryAllocateInfoprovided whenmemorywas allocated included aMemoryDedicatedAllocateInfostructure in itspNextchain, andMemoryDedicatedAllocateInfo::bufferwas notNULL_HANDLE, thenbuffermust equalMemoryDedicatedAllocateInfo::buffer, andmemoryOffsetmust be zero - If
bufferwas created with theBUFFER_CREATE_PROTECTED_BITbit set, the buffer must be bound to a memory object allocated with a memory type that reportsMEMORY_PROPERTY_PROTECTED_BIT - If
bufferwas created with theBUFFER_CREATE_PROTECTED_BITbit not set, the buffer must not be bound to a memory object allocated with a memory type that reportsMEMORY_PROPERTY_PROTECTED_BIT - If
bufferwas created withDedicatedAllocationBufferCreateInfoNV::dedicatedAllocationequal toTRUE,memorymust have been allocated withDedicatedAllocationMemoryAllocateInfoNV::bufferequal to a buffer handle created with identical creation parameters tobufferandmemoryOffsetmust be zero - If the value of
ExportMemoryAllocateInfo::handleTypesused to allocatememoryis not0, it must include at least one of the handles set inExternalMemoryBufferCreateInfo::handleTypeswhenbufferwas created - If
memorywas allocated by a memory import operation, that is notImportAndroidHardwareBufferInfoANDROIDwith a non-NULLbuffervalue, the external handle type of the imported memory must also have been set inExternalMemoryBufferCreateInfo::handleTypeswhenbufferwas created - If
memorywas allocated with theImportAndroidHardwareBufferInfoANDROIDmemory import operation with a non-NULLbuffervalue,EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROIDmust also have been set inExternalMemoryBufferCreateInfo::handleTypeswhenbufferwas created - If the
PhysicalDeviceBufferDeviceAddressFeatures::bufferDeviceAddressfeature is enabled andbufferwas created with theBUFFER_USAGE_SHADER_DEVICE_ADDRESS_BITbit set,memorymust have been allocated with theMEMORY_ALLOCATE_DEVICE_ADDRESS_BITbit set - If
bufferwas created withBufferCollectionBufferCreateInfoFUCHSIAchained toBufferCreateInfo::pNext,memorymust be allocated with aImportMemoryBufferCollectionFUCHSIAchained toMemoryAllocateInfo::pNext
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
buffermust be a validBufferhandle -
memorymust be a validDeviceMemoryhandle -
buffermust have been created, allocated, or retrieved fromdevice -
memorymust have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
buffermust be externally synchronized
Return Codes
See Also
getImageMemoryRequirements Source #
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> Image |
|
| -> io MemoryRequirements |
vkGetImageMemoryRequirements - Returns the memory requirements for specified Vulkan object
Valid Usage
-
imagemust not have been created with theIMAGE_CREATE_DISJOINT_BITflag set
- If
imagewas created with theEXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROIDexternal memory handle type, thenimagemust be bound to memory
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
imagemust be a validImagehandle -
pMemoryRequirementsmust be a valid pointer to aMemoryRequirementsstructure -
imagemust have been created, allocated, or retrieved fromdevice
See Also
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> Image |
|
| -> DeviceMemory |
|
| -> ("memoryOffset" ::: DeviceSize) |
|
| -> 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 created with any sparse memory binding flags -
memoryOffsetmust be less than the size ofmemory - If
imagerequires a dedicated allocation (as reported bygetImageMemoryRequirements2inMemoryDedicatedRequirements::requiresDedicatedAllocationforimage),memorymust have been created withMemoryDedicatedAllocateInfo::imageequal toimage - If the
dedicated allocation image aliasing
feature is not enabled, and the
MemoryAllocateInfoprovided whenmemorywas allocated included aMemoryDedicatedAllocateInfostructure in itspNextchain, andMemoryDedicatedAllocateInfo::imagewas notNULL_HANDLE, thenimagemust equalMemoryDedicatedAllocateInfo::imageandmemoryOffsetmust be zero - If the
dedicated allocation image aliasing
feature is enabled, and the
MemoryAllocateInfoprovided whenmemorywas allocated included aMemoryDedicatedAllocateInfostructure in itspNextchain, andMemoryDedicatedAllocateInfo::imagewas notNULL_HANDLE, thenmemoryOffsetmust be zero, andimagemust be either equal toMemoryDedicatedAllocateInfo::imageor an image that was created using the same parameters inImageCreateInfo, 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 created - If image was created with the
IMAGE_CREATE_PROTECTED_BITbit set, the image must be bound to a memory object allocated with a memory type that reportsMEMORY_PROPERTY_PROTECTED_BIT - If image was created with the
IMAGE_CREATE_PROTECTED_BITbit not set, the image must not be bound to a memory object created with a memory type that reportsMEMORY_PROPERTY_PROTECTED_BIT - If
imagewas created withDedicatedAllocationImageCreateInfoNV::dedicatedAllocationequal toTRUE,memorymust have been created withDedicatedAllocationMemoryAllocateInfoNV::imageequal to an image handle created with identical creation parameters toimageandmemoryOffsetmust be zero - If the value of
ExportMemoryAllocateInfo::handleTypesused to allocatememoryis not0, it must include at least one of the handles set inExternalMemoryImageCreateInfo::handleTypeswhenimagewas created - If
memorywas created by a memory import operation, that is notImportAndroidHardwareBufferInfoANDROIDwith a non-NULLbuffervalue, the external handle type of the imported memory must also have been set inExternalMemoryImageCreateInfo::handleTypeswhenimagewas created - If
memorywas created with theImportAndroidHardwareBufferInfoANDROIDmemory import operation with a non-NULLbuffervalue,EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROIDmust also have been set inExternalMemoryImageCreateInfo::handleTypeswhenimagewas created -
imagemust not have been created with theIMAGE_CREATE_DISJOINT_BITset -
memorymust have been allocated using one of the memory types allowed in thememoryTypeBitsmember of theMemoryRequirementsstructure returned from a call togetImageMemoryRequirementswithimage -
memoryOffsetmust be an integer multiple of thealignmentmember of theMemoryRequirementsstructure returned from a call togetImageMemoryRequirementswithimage - The difference of the size of
memoryandmemoryOffsetmust be greater than or equal to thesizemember of theMemoryRequirementsstructure returned from a call togetImageMemoryRequirementswith the sameimage - If
imagewas created withBufferCollectionImageCreateInfoFUCHSIAchained toImageCreateInfo::pNext,memorymust be allocated with aImportMemoryBufferCollectionFUCHSIAchained toMemoryAllocateInfo::pNext
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
imagemust be a validImagehandle -
memorymust be a validDeviceMemoryhandle -
imagemust have been created, allocated, or retrieved fromdevice -
memorymust have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
imagemust be externally synchronized
Return Codes
See Also
data MemoryRequirements Source #
VkMemoryRequirements - Structure specifying memory requirements
See Also
VK_VERSION_1_0,
DeviceSize,
MemoryRequirements2,
getBufferMemoryRequirements, getImageMemoryRequirements
Constructors
| MemoryRequirements | |
Fields
| |
Instances
newtype DeviceMemory Source #
VkDeviceMemory - Opaque handle to a device memory object
See Also
VK_VERSION_1_0,
BindAccelerationStructureMemoryInfoNV,
BindBufferMemoryInfo,
BindImageMemoryInfo,
DeviceMemoryOpaqueCaptureAddressInfo,
MappedMemoryRange,
MemoryGetAndroidHardwareBufferInfoANDROID,
MemoryGetFdInfoKHR,
MemoryGetRemoteAddressInfoNV,
MemoryGetWin32HandleInfoKHR,
MemoryGetZirconHandleInfoFUCHSIA,
SparseImageMemoryBind,
SparseMemoryBind,
VkVideoBindMemoryKHR,
Win32KeyedMutexAcquireReleaseInfoKHR,
Win32KeyedMutexAcquireReleaseInfoNV,
allocateMemory,
bindBufferMemory,
bindImageMemory,
freeMemory,
getDeviceMemoryCommitment,
getMemoryWin32HandleNV,
mapMemory,
setDeviceMemoryPriorityEXT,
unmapMemory
Constructors
| DeviceMemory Word64 |