| 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 already be backed by 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 theMemoryRequirementsstructure returned from a call togetBufferMemoryRequirementswithbuffermemoryOffsetmust 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::requiresDedicatedAllocation forbuffer),memorymust have been created withMemoryDedicatedAllocateInfo::bufferequal tobuffer - If the
MemoryAllocateInfoprovided whenmemorywas allocated included aMemoryDedicatedAllocateInfostructure in itspNextchain, andMemoryDedicatedAllocateInfo::bufferwas notNULL_HANDLE, thenbuffermust equalMemoryDedicatedAllocateInfo::buffer, andmemoryOffsetmust be zero - If buffer was created with the
BUFFER_CREATE_PROTECTED_BITbit set, the buffer must be bound to a memory object allocated with a memory type that reportsMEMORY_PROPERTY_PROTECTED_BIT - If buffer was created with the
BUFFER_CREATE_PROTECTED_BITbit not set, the buffer must not be bound to a memory object created with a memory type that reportsMEMORY_PROPERTY_PROTECTED_BIT - If
bufferwas created withDedicatedAllocationBufferCreateInfoNV::dedicatedAllocationequal toTRUE,memorymust have been created 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 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 inExternalMemoryBufferCreateInfo::handleTypeswhenbufferwas 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 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
Valid Usage (Implicit)
devicemust be a validDevicehandle
buffermust be a validBufferhandlememorymust be a validDeviceMemoryhandlebuffermust 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 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 validImagehandlepMemoryRequirementsmust be a valid pointer to aMemoryRequirementsstructureimagemust 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 theIMAGE_CREATE_DISJOINT_BITset
imagemust not already be backed by a memory objectimagemust 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 theMemoryRequirementsstructure returned from a call togetImageMemoryRequirementswithimagememoryOffsetmust 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
imagerequires a dedicated allocation (as reported bygetImageMemoryRequirements2inMemoryDedicatedRequirements::requiresDedicatedAllocation forimage),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
Valid Usage (Implicit)
devicemust be a validDevicehandle
imagemust be a validImagehandlememorymust be a validDeviceMemoryhandleimagemust 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
data MemoryRequirements Source #
VkMemoryRequirements - Structure specifying memory requirements
See Also
DeviceSize,
MemoryRequirements2,
getBufferMemoryRequirements, getImageMemoryRequirements
Constructors
| MemoryRequirements | |
Fields
| |
Instances
newtype DeviceMemory Source #
VkDeviceMemory - Opaque handle to a device memory object
See Also
BindAccelerationStructureMemoryInfoKHR,
BindBufferMemoryInfo,
BindImageMemoryInfo,
DeviceMemoryOpaqueCaptureAddressInfo,
MappedMemoryRange,
MemoryGetAndroidHardwareBufferInfoANDROID,
MemoryGetFdInfoKHR,
MemoryGetWin32HandleInfoKHR,
SparseImageMemoryBind,
SparseMemoryBind,
Win32KeyedMutexAcquireReleaseInfoKHR,
Win32KeyedMutexAcquireReleaseInfoNV,
allocateMemory,
bindBufferMemory,
bindImageMemory,
freeMemory,
getDeviceMemoryCommitment,
getMemoryWin32HandleNV,
mapMemory, unmapMemory
Constructors
| DeviceMemory Word64 |