Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype VkMemoryMapFlags = VkMemoryMapFlags VkFlags
- type VkDeviceMemory = Ptr VkDeviceMemory_T
- vkAllocateMemory :: ("device" ::: VkDevice) -> ("pAllocateInfo" ::: Ptr VkMemoryAllocateInfo) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> ("pMemory" ::: Ptr VkDeviceMemory) -> IO VkResult
- vkFreeMemory :: ("device" ::: VkDevice) -> ("memory" ::: VkDeviceMemory) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> IO ()
- vkMapMemory :: ("device" ::: VkDevice) -> ("memory" ::: VkDeviceMemory) -> ("offset" ::: VkDeviceSize) -> ("size" ::: VkDeviceSize) -> ("flags" ::: VkMemoryMapFlags) -> ("ppData" ::: Ptr (Ptr ())) -> IO VkResult
- vkUnmapMemory :: ("device" ::: VkDevice) -> ("memory" ::: VkDeviceMemory) -> IO ()
- vkFlushMappedMemoryRanges :: ("device" ::: VkDevice) -> ("memoryRangeCount" ::: Word32) -> ("pMemoryRanges" ::: Ptr VkMappedMemoryRange) -> IO VkResult
- vkInvalidateMappedMemoryRanges :: ("device" ::: VkDevice) -> ("memoryRangeCount" ::: Word32) -> ("pMemoryRanges" ::: Ptr VkMappedMemoryRange) -> IO VkResult
- vkGetDeviceMemoryCommitment :: ("device" ::: VkDevice) -> ("memory" ::: VkDeviceMemory) -> ("pCommittedMemoryInBytes" ::: Ptr VkDeviceSize) -> IO ()
- data VkMemoryAllocateInfo = VkMemoryAllocateInfo {}
- data VkMappedMemoryRange = VkMappedMemoryRange {
- vkSType :: VkStructureType
- vkPNext :: Ptr ()
- vkMemory :: VkDeviceMemory
- vkOffset :: VkDeviceSize
- vkSize :: VkDeviceSize
Documentation
newtype VkMemoryMapFlags Source #
VkMemoryMapFlags - Reserved for future use
Description
VkMemoryMapFlags
is a bitmask type for setting a mask, but is
currently reserved for future use.
See Also
Instances
type VkDeviceMemory = Ptr VkDeviceMemory_T Source #
VkDeviceMemory - Opaque handle to a device memory object
See Also
VkBindBufferMemoryInfo
,
VkBindImageMemoryInfo
,
VkMappedMemoryRange
,
VkMemoryGetAndroidHardwareBufferInfoANDROID
,
VkMemoryGetFdInfoKHR
,
VkMemoryGetWin32HandleInfoKHR
,
VkSparseImageMemoryBind
,
VkSparseMemoryBind
,
VkWin32KeyedMutexAcquireReleaseInfoKHR
,
VkWin32KeyedMutexAcquireReleaseInfoNV
,
vkAllocateMemory
,
vkBindBufferMemory
,
vkBindImageMemory
,
vkFreeMemory
, vkGetDeviceMemoryCommitment
,
vkGetMemoryWin32HandleNV
,
vkMapMemory
, vkUnmapMemory
vkAllocateMemory :: ("device" ::: VkDevice) -> ("pAllocateInfo" ::: Ptr VkMemoryAllocateInfo) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> ("pMemory" ::: Ptr VkDeviceMemory) -> IO VkResult Source #
vkAllocateMemory - Allocate device memory
Parameters
device
is the logical device that owns the memory.
pAllocateInfo
is a pointer to an instance of theVkMemoryAllocateInfo
structure describing parameters of the allocation. A successful returned allocation must use the requested parameters — no substitution is permitted by the implementation.pAllocator
controls host memory allocation as described in the Memory Allocation chapter.pMemory
is a pointer to aVkDeviceMemory
handle in which information about the allocated memory is returned.
Description
Allocations returned by vkAllocateMemory
are guaranteed to meet any
alignment requirement of the implementation. For example, if an
implementation requires 128 byte alignment for images and 64 byte
alignment for buffers, the device memory returned through this mechanism
would be 128-byte aligned. This ensures that applications can
correctly suballocate objects of different types (with potentially
different alignment requirements) in the same memory object.
When memory is allocated, its contents are undefined.
The maximum number of valid memory allocations that can exist
simultaneously within a
VkDevice
may be
restricted by implementation- or platform-dependent limits. If a call to
vkAllocateMemory
would cause the total number of allocations to exceed
these limits, such a call will fail and must return
VK_ERROR_TOO_MANY_OBJECTS
. The
@maxMemoryAllocationCount@
feature describes the number of allocations that can exist
simultaneously before encountering these internal limits.
Some platforms may have a limit on the maximum size of a single
allocation. For example, certain systems may fail to create
allocations with a size greater than or equal to 4GB. Such a limit is
implementation-dependent, and if such a failure occurs then the error
VK_ERROR_OUT_OF_DEVICE_MEMORY
must be returned. This limit is
advertised in
VkPhysicalDeviceMaintenance3Properties
::maxMemoryAllocationSize
.
Valid Usage
pAllocateInfo
->allocationSize
must be less than or equal toVkPhysicalDeviceMemoryProperties
::memoryHeaps
[pAllocateInfo
->memoryTypeIndex
].size
as returned byvkGetPhysicalDeviceMemoryProperties
for theVkPhysicalDevice
thatdevice
was created from.
pAllocateInfo
->memoryTypeIndex
must be less thanVkPhysicalDeviceMemoryProperties
::memoryTypeCount
as returned byvkGetPhysicalDeviceMemoryProperties
for theVkPhysicalDevice
thatdevice
was created from.
Valid Usage (Implicit)
device
must be a validVkDevice
handle
pAllocateInfo
must be a valid pointer to a validVkMemoryAllocateInfo
structure- If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validVkAllocationCallbacks
structure pMemory
must be a valid pointer to aVkDeviceMemory
handle
Return Codes
[Success]
- VK_SUCCESS
[Failure]
- VK_ERROR_OUT_OF_HOST_MEMORY
VK_ERROR_OUT_OF_DEVICE_MEMORY
VK_ERROR_TOO_MANY_OBJECTS
VK_ERROR_INVALID_EXTERNAL_HANDLE
See Also
VkAllocationCallbacks
,
VkDevice
,
VkDeviceMemory
, VkMemoryAllocateInfo
vkFreeMemory :: ("device" ::: VkDevice) -> ("memory" ::: VkDeviceMemory) -> ("pAllocator" ::: Ptr VkAllocationCallbacks) -> IO () Source #
vkFreeMemory - Free device memory
Parameters
device
is the logical device that owns the memory.
memory
is theVkDeviceMemory
object to be freed.pAllocator
controls host memory allocation as described in the Memory Allocation chapter.
Description
Before freeing a memory object, an application must ensure the memory object is no longer in use by the device—for example by command buffers in the pending state. The memory can remain bound to images or buffers at the time the memory object is freed, but any further use of them (on host or device) for anything other than destroying those objects will result in undefined behavior. If there are still any bound images or buffers, the memory may not be immediately released by the implementation, but must be released by the time all bound images and buffers have been destroyed. Once memory is released, it is returned to the heap from which it was allocated.
How memory objects are bound to Images and Buffers is described in detail in the Resource Memory Association section.
If a memory object is mapped at the time it is freed, it is implicitly unmapped.
Note
As described below, host writes are not implicitly flushed when the memory object is unmapped, but the implementation must guarantee that writes that have not been flushed do not affect any other memory.
Valid Usage
- All submitted commands that refer to
memory
(via images or buffers) must have completed execution
Valid Usage (Implicit)
device
must be a validVkDevice
handle
- If
memory
is notVK_NULL_HANDLE
,memory
must be a validVkDeviceMemory
handle - If
pAllocator
is notNULL
,pAllocator
must be a valid pointer to a validVkAllocationCallbacks
structure - If
memory
is a valid handle, it must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
memory
must be externally synchronized
See Also
vkMapMemory :: ("device" ::: VkDevice) -> ("memory" ::: VkDeviceMemory) -> ("offset" ::: VkDeviceSize) -> ("size" ::: VkDeviceSize) -> ("flags" ::: VkMemoryMapFlags) -> ("ppData" ::: Ptr (Ptr ())) -> IO VkResult Source #
vkMapMemory - Map a memory object into application address space
Parameters
device
is the logical device that owns the memory.
memory
is theVkDeviceMemory
object to be mapped.offset
is a zero-based byte offset from the beginning of the memory object.size
is the size of the memory range to map, orVK_WHOLE_SIZE
to map fromoffset
to the end of the allocation.flags
is reserved for future use.ppData
points to a pointer in which is returned a host-accessible pointer to the beginning of the mapped range. This pointer minusoffset
must be aligned to at leastVkPhysicalDeviceLimits
::minMemoryMapAlignment
.
Description
It is an application error to call vkMapMemory
on a memory object that
is already mapped.
Note
vkMapMemory
will fail if the implementation is unable to allocate an
appropriately sized contiguous virtual address range, e.g. due to
virtual address space fragmentation or platform limits. In such cases,
vkMapMemory
must return VK_ERROR_MEMORY_MAP_FAILED
. The
application can improve the likelihood of success by reducing the size
of the mapped range and/or removing unneeded mappings using
VkUnmapMemory
.
vkMapMemory
does not check whether the device memory is currently in
use before returning the host-accessible pointer. The application must
guarantee that any previously submitted command that writes to this
range has completed before the host reads from or writes to that range,
and that any previously submitted command that reads from that range has
completed before the host writes to that region (see
here
for details on fulfilling such a guarantee). If the device memory was
allocated without the VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
set, these
guarantees must be made for an extended range: the application must
round down the start of the range to the nearest multiple of
VkPhysicalDeviceLimits
::nonCoherentAtomSize
,
and round the end of the range up to the nearest multiple of
VkPhysicalDeviceLimits
::nonCoherentAtomSize
.
While a range of device memory is mapped for host access, the application is responsible for synchronizing both device and host access to that memory range.
Note
It is important for the application developer to become meticulously familiar with all of the mechanisms described in the chapter on Synchronization and Cache Control as they are crucial to maintaining memory access ordering.
Valid Usage
memory
must not be currently mapped
offset
must be less than the size ofmemory
- If
size
is not equal toVK_WHOLE_SIZE
,size
must be greater than0
- If
size
is not equal toVK_WHOLE_SIZE
,size
must be less than or equal to the size of thememory
minusoffset
memory
must have been created with a memory type that reportsVK_MEMORY_PROPERTY_HOST_VISIBLE_BIT
memory
must not have been allocated with multiple instances.
Valid Usage (Implicit)
device
must be a validVkDevice
handle
memory
must be a validVkDeviceMemory
handleflags
must be0
ppData
must be a valid pointer to a pointer valuememory
must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
memory
must be externally synchronized
Return Codes
[Success]
- VK_SUCCESS
[Failure]
- VK_ERROR_OUT_OF_HOST_MEMORY
VK_ERROR_OUT_OF_DEVICE_MEMORY
VK_ERROR_MEMORY_MAP_FAILED
See Also
VkDevice
,
VkDeviceMemory
, VkDeviceSize
, VkMemoryMapFlags
vkUnmapMemory :: ("device" ::: VkDevice) -> ("memory" ::: VkDeviceMemory) -> IO () Source #
vkUnmapMemory - Unmap a previously mapped memory object
Parameters
device
is the logical device that owns the memory.
memory
is the memory object to be unmapped.
Valid Usage
memory
must be currently mapped
Valid Usage (Implicit)
device
must be a validVkDevice
handle
memory
must be a validVkDeviceMemory
handlememory
must have been created, allocated, or retrieved fromdevice
Host Synchronization
- Host access to
memory
must be externally synchronized
See Also
vkFlushMappedMemoryRanges :: ("device" ::: VkDevice) -> ("memoryRangeCount" ::: Word32) -> ("pMemoryRanges" ::: Ptr VkMappedMemoryRange) -> IO VkResult Source #
vkFlushMappedMemoryRanges - Flush mapped memory ranges
Parameters
device
is the logical device that owns the memory ranges.
memoryRangeCount
is the length of thepMemoryRanges
array.pMemoryRanges
is a pointer to an array ofVkMappedMemoryRange
structures describing the memory ranges to flush.
Description
vkFlushMappedMemoryRanges
guarantees that host writes to the memory
ranges described by pMemoryRanges
can be made available to device
access, via availability
operations
from the VK_ACCESS_HOST_WRITE_BIT
access
type.
Within each range described by pMemoryRanges
, each set of
nonCoherentAtomSize
bytes in that range is flushed if any byte in that
set has been written by the host since it was first mapped, or the last
time it was flushed. If pMemoryRanges
includes sets of
nonCoherentAtomSize
bytes where no bytes have been written by the
host, those bytes must not be flushed.
Unmapping non-coherent memory does not implicitly flush the mapped memory, and host writes that have not been flushed may not ever be visible to the device. However, implementations must ensure that writes that have not been flushed do not become visible to any other memory.
Note
The above guarantee avoids a potential memory corruption in scenarios where host writes to a mapped memory object have not been flushed before the memory is unmapped (or freed), and the virtual address range is subsequently reused for a different mapping (or memory allocation).
Valid Usage (Implicit)
device
must be a validVkDevice
handle
pMemoryRanges
must be a valid pointer to an array ofmemoryRangeCount
validVkMappedMemoryRange
structuresmemoryRangeCount
must be greater than0
Return Codes
[Success]
- VK_SUCCESS
[Failure]
- VK_ERROR_OUT_OF_HOST_MEMORY
VK_ERROR_OUT_OF_DEVICE_MEMORY
See Also
vkInvalidateMappedMemoryRanges :: ("device" ::: VkDevice) -> ("memoryRangeCount" ::: Word32) -> ("pMemoryRanges" ::: Ptr VkMappedMemoryRange) -> IO VkResult Source #
vkInvalidateMappedMemoryRanges - Invalidate ranges of mapped memory objects
Parameters
device
is the logical device that owns the memory ranges.
memoryRangeCount
is the length of thepMemoryRanges
array.pMemoryRanges
is a pointer to an array ofVkMappedMemoryRange
structures describing the memory ranges to invalidate.
Description
vkInvalidateMappedMemoryRanges
guarantees that device writes to the
memory ranges described by pMemoryRanges
, which have been made visible
to the VK_ACCESS_HOST_WRITE_BIT
and VK_ACCESS_HOST_READ_BIT
access
types,
are made visible to the host. If a range of non-coherent memory is
written by the host and then invalidated without first being flushed,
its contents are undefined.
Within each range described by pMemoryRanges
, each set of
nonCoherentAtomSize
bytes in that range is invalidated if any byte in
that set has been written by the device since it was first mapped, or
the last time it was invalidated.
Note
Mapping non-coherent memory does not implicitly invalidate the mapped memory, and device writes that have not been invalidated must be made visible before the host reads or overwrites them.
Valid Usage (Implicit)
device
must be a validVkDevice
handle
pMemoryRanges
must be a valid pointer to an array ofmemoryRangeCount
validVkMappedMemoryRange
structuresmemoryRangeCount
must be greater than0
Return Codes
[Success]
- VK_SUCCESS
[Failure]
- VK_ERROR_OUT_OF_HOST_MEMORY
VK_ERROR_OUT_OF_DEVICE_MEMORY
See Also
vkGetDeviceMemoryCommitment :: ("device" ::: VkDevice) -> ("memory" ::: VkDeviceMemory) -> ("pCommittedMemoryInBytes" ::: Ptr VkDeviceSize) -> IO () Source #
vkGetDeviceMemoryCommitment - Query the current commitment for a VkDeviceMemory
Parameters
device
is the logical device that owns the memory.
memory
is the memory object being queried.pCommittedMemoryInBytes
is a pointer to aVkDeviceSize
value in which the number of bytes currently committed is returned, on success.
Description
The implementation may update the commitment at any time, and the value returned by this query may be out of date.
The implementation guarantees to allocate any committed memory from the heapIndex indicated by the memory type that the memory object was created with.
Valid Usage
memory
must have been created with a memory type that reportsVK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT
Valid Usage (Implicit)
device
must be a validVkDevice
handle
memory
must be a validVkDeviceMemory
handlepCommittedMemoryInBytes
must be a valid pointer to aVkDeviceSize
valuememory
must have been created, allocated, or retrieved fromdevice
See Also
VkDevice
,
VkDeviceMemory
, VkDeviceSize
data VkMemoryAllocateInfo Source #
VkMemoryAllocateInfo - Structure containing parameters of a memory allocation
Description
An instance of the VkMemoryAllocateInfo
structure defines a memory
import operation if the pNext
chain contains an instance of one of the
following structures: *
VkImportMemoryWin32HandleInfoKHR
with non-zero handleType
value *
VkImportMemoryFdInfoKHR
with a non-zero handleType
value *
VkImportMemoryHostPointerInfoEXT
with a non-zero handleType
value *
VkImportAndroidHardwareBufferInfoANDROID
with a non-NULL
buffer
value
Importing memory must not modify the content of the memory. Implementations must ensure that importing memory does not enable the importing Vulkan instance to access any memory or resources in other Vulkan instances other than that corresponding to the memory object imported. Implementations must also ensure accessing imported memory which has not been initialized does not allow the importing Vulkan instance to obtain data from the exporting Vulkan instance or vice-versa.
Note
How exported and imported memory is isolated is left to the implementation, but applications should be aware that such isolation may prevent implementations from placing multiple exportable memory objects in the same physical or virtual page. Hence, applications should avoid creating many small external memory objects whenever possible.
When performing a memory import operation, it is the responsibility of
the application to ensure the external handles meet all valid usage
requirements. However, implementations must perform sufficient
validation of external handles to ensure that the operation results in a
valid memory object which will not cause program termination, device
loss, queue stalls, or corruption of other resources when used as
allowed according to its allocation parameters. If the external handle
provided does not meet these requirements, the implementation must
fail the memory import operation with the error code
VK_ERROR_INVALID_EXTERNAL_HANDLE
.
Valid Usage
- If the
pNext
chain contains an instance ofVkExportMemoryAllocateInfo
, and any of the handle types specified inVkExportMemoryAllocateInfo
::handleTypes
require a dedicated allocation, as reported byvkGetPhysicalDeviceImageFormatProperties2
inVkExternalImageFormatProperties
::externalMemoryProperties
::externalMemoryFeatures
orVkExternalBufferProperties
::externalMemoryProperties
::externalMemoryFeatures
, thepNext
chain must contain an instance ofVkMemoryDedicatedAllocateInfo
orVkDedicatedAllocationMemoryAllocateInfoNV
with either itsimage
orbuffer
field set to a value other thanVK_NULL_HANDLE
.
- If the
pNext
chain contains an instance ofVkExportMemoryAllocateInfo
, it must not contain an instance ofVkExportMemoryAllocateInfoNV
orVkExportMemoryWin32HandleInfoNV
. - If the
pNext
chain contains an instance ofVkImportMemoryWin32HandleInfoKHR
, it must not contain an instance ofVkImportMemoryWin32HandleInfoNV
. - If the parameters define an import operation, the external handle
specified was created by the Vulkan API, and the external handle
type is
VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR
, then the values ofallocationSize
andmemoryTypeIndex
must match those specified when the memory object being imported was created. - If the parameters define an import operation and the external handle
specified was created by the Vulkan API, the device mask specified
by
VkMemoryAllocateFlagsInfo
must match that specified when the memory object being imported was allocated. - If the parameters define an import operation and the external handle
specified was created by the Vulkan API, the list of physical
devices that comprise the logical device passed to
vkAllocateMemory
must match the list of physical devices that comprise the logical device on which the memory was originally allocated. - If the parameters define an import operation and the external handle
is an NT handle or a global share handle created outside of the
Vulkan API, the value of
memoryTypeIndex
must be one of those returned byvkGetMemoryWin32HandlePropertiesKHR
. - If the parameters define an import operation, the external handle
was created by the Vulkan API, and the external handle type is
VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR
orVK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR
, then the values ofallocationSize
andmemoryTypeIndex
must match those specified when the memory object being imported was created. - If the parameters define an import operation and the external handle
type is
VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT
,VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT
, orVK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT
,allocationSize
must match the size reported in the memory requirements of theimage
orbuffer
member of the instance ofVkDedicatedAllocationMemoryAllocateInfoNV
included in thepNext
chain. - If the parameters define an import operation and the external handle
type is
VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT
,allocationSize
must match the size specified when creating the Direct3D 12 heap from which the external handle was extracted. - If the parameters define an import operation and the external handle
is a POSIX file descriptor created outside of the Vulkan API, the
value of
memoryTypeIndex
must be one of those returned byvkGetMemoryFdPropertiesKHR
. - If the parameters define an import operation and the external handle
is a host pointer, the value of
memoryTypeIndex
must be one of those returned byvkGetMemoryHostPointerPropertiesEXT
- If the parameters define an import operation and the external handle
is a host pointer,
allocationSize
must be an integer multiple ofVkPhysicalDeviceExternalMemoryHostPropertiesEXT
::minImportedHostPointerAlignment
If the parameters define an import operation and the external handle type is
VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BIT_ANDROID
:allocationSize
must be the size returned byvkGetAndroidHardwareBufferPropertiesANDROID
for the Android hardware buffer- If the
pNext
chain doesn’t contain an instance ofVkMemoryDedicatedAllocateInfo
orVkMemoryDedicatedAllocateInfo
::image
isVK_NULL_HANDLE
, the Android hardware buffer must have a format ofAHARDWAREBUFFER_FORMAT_BLOB
and a usage that includesAHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER
memoryTypeIndex
must be one of those returned byvkGetAndroidHardwareBufferPropertiesANDROID
for the Android hardware buffer
- If the parameters do not define an import operation, and the
pNext
chain contains an instance ofVkExportMemoryAllocateInfo
withVK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID
included in itshandleTypes
member, and thepNext
contains an instance ofVkMemoryDedicatedAllocateInfo
withimage
not equal toVK_NULL_HANDLE
, thenallocationSize
must be0
, otherwiseallocationSize
must be greater than0
. If the parameters define an import operation, the external handle is an Android hardware buffer, and the
pNext
chain includes an instance ofVkMemoryDedicatedAllocateInfo
withimage
that is notVK_NULL_HANDLE
:- The Android hardware buffer’s usage must include at least one
of
AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT
orAHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE
- The
image
’s format must beVK_FORMAT_UNDEFINED
or the format returned byvkGetAndroidHardwareBufferPropertiesANDROID
inVkAndroidHardwareBufferFormatPropertiesANDROID
::format
for the Android hardware buffer. - The image’s and Android hardware buffer’s width, height, and array layer dimensions must be the same
- If the Android hardware buffer’s usage includes
AHARDWAREBUFFER_USAGE_GPU_MIPMAP_COMPLETE
, the image must have ⌊log2(max(width
,height
))⌋ + 1 mip levels, otherwise it must have exactly1
mip level. - Each bit set in the image’s usage must be listed in
AHardwareBuffer Usage
Equivalence,
and if there is a corresponding
AHARDWAREBUFFER_USAGE
bit listed that bit must be included in the Android hardware buffer’s usage
- The Android hardware buffer’s usage must include at least one
of
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
- Each
pNext
member of any structure (including this one) in thepNext
chain must be eitherNULL
or a pointer to a valid instance ofVkDedicatedAllocationMemoryAllocateInfoNV
,VkExportMemoryAllocateInfo
,VkExportMemoryAllocateInfoNV
,VkExportMemoryWin32HandleInfoKHR
,VkExportMemoryWin32HandleInfoNV
,VkImportAndroidHardwareBufferInfoANDROID
,VkImportMemoryFdInfoKHR
,VkImportMemoryHostPointerInfoEXT
,VkImportMemoryWin32HandleInfoKHR
,VkImportMemoryWin32HandleInfoNV
,VkMemoryAllocateFlagsInfo
, orVkMemoryDedicatedAllocateInfo
- Each
sType
member in thepNext
chain must be unique
See Also
VkDeviceSize
, VkStructureType
,
vkAllocateMemory
VkMemoryAllocateInfo | |
|
Instances
Eq VkMemoryAllocateInfo Source # | |
(==) :: VkMemoryAllocateInfo -> VkMemoryAllocateInfo -> Bool # (/=) :: VkMemoryAllocateInfo -> VkMemoryAllocateInfo -> Bool # | |
Show VkMemoryAllocateInfo Source # | |
showsPrec :: Int -> VkMemoryAllocateInfo -> ShowS # show :: VkMemoryAllocateInfo -> String # showList :: [VkMemoryAllocateInfo] -> ShowS # | |
Storable VkMemoryAllocateInfo Source # | |
sizeOf :: VkMemoryAllocateInfo -> Int # alignment :: VkMemoryAllocateInfo -> Int # peekElemOff :: Ptr VkMemoryAllocateInfo -> Int -> IO VkMemoryAllocateInfo # pokeElemOff :: Ptr VkMemoryAllocateInfo -> Int -> VkMemoryAllocateInfo -> IO () # peekByteOff :: Ptr b -> Int -> IO VkMemoryAllocateInfo # pokeByteOff :: Ptr b -> Int -> VkMemoryAllocateInfo -> IO () # peek :: Ptr VkMemoryAllocateInfo -> IO VkMemoryAllocateInfo # poke :: Ptr VkMemoryAllocateInfo -> VkMemoryAllocateInfo -> IO () # |
data VkMappedMemoryRange Source #
VkMappedMemoryRange - Structure specifying a mapped memory range
Valid Usage
memory
must be currently mapped
- If
size
is not equal toVK_WHOLE_SIZE
,offset
andsize
must specify a range contained within the currently mapped range ofmemory
- If
size
is equal toVK_WHOLE_SIZE
,offset
must be within the currently mapped range ofmemory
- If
size
is equal toVK_WHOLE_SIZE
, the end of the current mapping ofmemory
must be a multiple ofVkPhysicalDeviceLimits
::nonCoherentAtomSize
bytes from the beginning of the memory object. offset
must be a multiple ofVkPhysicalDeviceLimits
::nonCoherentAtomSize
- If
size
is not equal toVK_WHOLE_SIZE
,size
must either be a multiple ofVkPhysicalDeviceLimits
::nonCoherentAtomSize
, oroffset
plussize
must equal the size ofmemory
.
Valid Usage (Implicit)
sType
must beVK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
pNext
must beNULL
memory
must be a validVkDeviceMemory
handle
See Also
VkDeviceMemory
, VkDeviceSize
,
VkStructureType
,
vkFlushMappedMemoryRanges
, vkInvalidateMappedMemoryRanges
VkMappedMemoryRange | |
|
Instances
Eq VkMappedMemoryRange Source # | |
(==) :: VkMappedMemoryRange -> VkMappedMemoryRange -> Bool # (/=) :: VkMappedMemoryRange -> VkMappedMemoryRange -> Bool # | |
Show VkMappedMemoryRange Source # | |
showsPrec :: Int -> VkMappedMemoryRange -> ShowS # show :: VkMappedMemoryRange -> String # showList :: [VkMappedMemoryRange] -> ShowS # | |
Storable VkMappedMemoryRange Source # | |
sizeOf :: VkMappedMemoryRange -> Int # alignment :: VkMappedMemoryRange -> Int # peekElemOff :: Ptr VkMappedMemoryRange -> Int -> IO VkMappedMemoryRange # pokeElemOff :: Ptr VkMappedMemoryRange -> Int -> VkMappedMemoryRange -> IO () # peekByteOff :: Ptr b -> Int -> IO VkMappedMemoryRange # pokeByteOff :: Ptr b -> Int -> VkMappedMemoryRange -> IO () # peek :: Ptr VkMappedMemoryRange -> IO VkMappedMemoryRange # poke :: Ptr VkMappedMemoryRange -> VkMappedMemoryRange -> IO () # |