| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Vulkan.Core10.SparseResourceMemoryManagement
Synopsis
- getImageSparseMemoryRequirements :: forall io. MonadIO io => Device -> Image -> io ("sparseMemoryRequirements" ::: Vector SparseImageMemoryRequirements)
- getPhysicalDeviceSparseImageFormatProperties :: forall io. MonadIO io => PhysicalDevice -> Format -> ImageType -> ("samples" ::: SampleCountFlagBits) -> ImageUsageFlags -> ImageTiling -> io ("properties" ::: Vector SparseImageFormatProperties)
- queueBindSparse :: forall io. MonadIO io => Queue -> ("bindInfo" ::: Vector (SomeStruct BindSparseInfo)) -> Fence -> io ()
- data SparseImageFormatProperties = SparseImageFormatProperties {}
- data SparseImageMemoryRequirements = SparseImageMemoryRequirements {}
- data ImageSubresource = ImageSubresource {}
- data SparseMemoryBind = SparseMemoryBind {}
- data SparseImageMemoryBind = SparseImageMemoryBind {}
- data SparseBufferMemoryBindInfo = SparseBufferMemoryBindInfo {}
- data SparseImageOpaqueMemoryBindInfo = SparseImageOpaqueMemoryBindInfo {}
- data SparseImageMemoryBindInfo = SparseImageMemoryBindInfo {}
- data BindSparseInfo (es :: [Type]) = BindSparseInfo {}
- newtype ImageAspectFlagBits where
- ImageAspectFlagBits Flags
- pattern IMAGE_ASPECT_COLOR_BIT :: ImageAspectFlagBits
- pattern IMAGE_ASPECT_DEPTH_BIT :: ImageAspectFlagBits
- pattern IMAGE_ASPECT_STENCIL_BIT :: ImageAspectFlagBits
- pattern IMAGE_ASPECT_METADATA_BIT :: ImageAspectFlagBits
- pattern IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT :: ImageAspectFlagBits
- pattern IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT :: ImageAspectFlagBits
- pattern IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT :: ImageAspectFlagBits
- pattern IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT :: ImageAspectFlagBits
- pattern IMAGE_ASPECT_NONE :: ImageAspectFlagBits
- pattern IMAGE_ASPECT_PLANE_2_BIT :: ImageAspectFlagBits
- pattern IMAGE_ASPECT_PLANE_1_BIT :: ImageAspectFlagBits
- pattern IMAGE_ASPECT_PLANE_0_BIT :: ImageAspectFlagBits
- type ImageAspectFlags = ImageAspectFlagBits
- newtype SparseImageFormatFlagBits where
- type SparseImageFormatFlags = SparseImageFormatFlagBits
- newtype SparseMemoryBindFlagBits where
- type SparseMemoryBindFlags = SparseMemoryBindFlagBits
Documentation
getImageSparseMemoryRequirements Source #
Arguments
| :: forall io. MonadIO io | |
| => Device |
|
| -> Image |
|
| -> io ("sparseMemoryRequirements" ::: Vector SparseImageMemoryRequirements) |
vkGetImageSparseMemoryRequirements - Query the memory requirements for a sparse image
Description
If pSparseMemoryRequirements is NULL, then the number of sparse
memory requirements available is returned in
pSparseMemoryRequirementCount. Otherwise,
pSparseMemoryRequirementCount must point to a variable set by the
user to the number of elements in the pSparseMemoryRequirements array,
and on return the variable is overwritten with the number of structures
actually written to pSparseMemoryRequirements. If
pSparseMemoryRequirementCount is less than the number of sparse memory
requirements available, at most pSparseMemoryRequirementCount
structures will be written.
If the image was not created with
IMAGE_CREATE_SPARSE_RESIDENCY_BIT
then pSparseMemoryRequirementCount will be set to zero and
pSparseMemoryRequirements will not be written to.
Note
It is legal for an implementation to report a larger value in
MemoryRequirements::size than would
be obtained by adding together memory sizes for all
SparseImageMemoryRequirements returned by
getImageSparseMemoryRequirements. This may occur when the
implementation requires unused padding in the address range describing
the resource.
Valid Usage (Implicit)
-
devicemust be a validDevicehandle
-
imagemust be a validImagehandle -
pSparseMemoryRequirementCountmust be a valid pointer to auint32_tvalue -
If the value referenced by
pSparseMemoryRequirementCountis not0, andpSparseMemoryRequirementsis notNULL,pSparseMemoryRequirementsmust be a valid pointer to an array ofpSparseMemoryRequirementCountSparseImageMemoryRequirementsstructures -
imagemust have been created, allocated, or retrieved fromdevice
See Also
VK_VERSION_1_0,
Device, Image,
SparseImageMemoryRequirements
getPhysicalDeviceSparseImageFormatProperties Source #
Arguments
| :: forall io. MonadIO io | |
| => PhysicalDevice |
|
| -> Format |
|
| -> ImageType |
|
| -> ("samples" ::: SampleCountFlagBits) |
|
| -> ImageUsageFlags |
|
| -> ImageTiling |
|
| -> io ("properties" ::: Vector SparseImageFormatProperties) |
vkGetPhysicalDeviceSparseImageFormatProperties - Retrieve properties of an image format applied to sparse images
Description
If pProperties is NULL, then the number of sparse format properties
available is returned in pPropertyCount. Otherwise, pPropertyCount
must point to a variable set by the user to the number of elements in
the pProperties array, and on return the variable is overwritten with
the number of structures actually written to pProperties. If
pPropertyCount is less than the number of sparse format properties
available, at most pPropertyCount structures will be written.
If
IMAGE_CREATE_SPARSE_RESIDENCY_BIT
is not supported for the given arguments, pPropertyCount will be set
to zero upon return, and no data will be written to pProperties.
Multiple aspects are returned for depth/stencil images that are
implemented as separate planes by the implementation. The depth and
stencil data planes each have unique SparseImageFormatProperties data.
Depth/stencil images with depth and stencil data interleaved into a
single plane will return a single SparseImageFormatProperties
structure with the aspectMask set to
IMAGE_ASPECT_DEPTH_BIT |
IMAGE_ASPECT_STENCIL_BIT.
Valid Usage
-
samplesmust be a bit value that is set inImageFormatProperties::sampleCountsreturned bygetPhysicalDeviceImageFormatPropertieswithformat,type,tiling, andusageequal to those in this command andflagsequal to the value that is set inImageCreateInfo::flagswhen the image is created
Valid Usage (Implicit)
-
physicalDevicemust be a validPhysicalDevicehandle
-
formatmust be a validFormatvalue -
typemust be a validImageTypevalue -
samplesmust be a validSampleCountFlagBitsvalue -
usagemust be a valid combination ofImageUsageFlagBitsvalues -
usagemust not be0 -
tilingmust be a validImageTilingvalue -
pPropertyCountmust be a valid pointer to auint32_tvalue -
If the value referenced by
pPropertyCountis not0, andpPropertiesis notNULL,pPropertiesmust be a valid pointer to an array ofpPropertyCountSparseImageFormatPropertiesstructures
See Also
VK_VERSION_1_0,
Format,
ImageTiling,
ImageType,
ImageUsageFlags,
PhysicalDevice,
SampleCountFlagBits,
SparseImageFormatProperties
Arguments
| :: forall io. MonadIO io | |
| => Queue |
|
| -> ("bindInfo" ::: Vector (SomeStruct BindSparseInfo)) |
|
| -> Fence |
|
| -> io () |
vkQueueBindSparse - Bind device memory to a sparse resource object
Description
queueBindSparse is a
queue submission command,
with each batch defined by an element of pBindInfo as a
BindSparseInfo structure. Batches begin execution in the order they
appear in pBindInfo, but may complete out of order.
Within a batch, a given range of a resource must not be bound more than once. Across batches, if a range is to be bound to one allocation and offset and then to another allocation and offset, then the application must guarantee (usually using semaphores) that the binding operations are executed in the correct order, as well as to order binding operations against the execution of command buffer submissions.
As no operation to queueBindSparse causes any pipeline stage to access
memory, synchronization primitives used in this command effectively only
define execution dependencies.
Additional information about fence and semaphore operation is described in the synchronization chapter.
Valid Usage
- If
fenceis notNULL_HANDLE,fencemust be unsignaled
- If
fenceis notNULL_HANDLE,fencemust not be associated with any other queue command that has not yet completed execution on that queue - Each element of the
pSignalSemaphoresmember of each element ofpBindInfomust be unsignaled when the semaphore signal operation it defines is executed on the device - When a semaphore wait
operation referring to a binary semaphore defined by any element of
the
pWaitSemaphoresmember of any element ofpBindInfoexecutes onqueue, there must be no other queues waiting on the same semaphore - All elements of the
pWaitSemaphoresmember of all elements ofpBindInfocreated with aSemaphoreTypeofSEMAPHORE_TYPE_BINARYmust reference a semaphore signal operation that has been submitted for execution and any semaphore signal operations on which it depends (if any) must have also been submitted for execution
Valid Usage (Implicit)
-
queuemust be a validQueuehandle
- If
bindInfoCountis not0,pBindInfomust be a valid pointer to an array ofbindInfoCountvalidBindSparseInfostructures - If
fenceis notNULL_HANDLE,fencemust be a validFencehandle - The
queuemust support sparse binding operations - Both of
fence, andqueuethat are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the sameDevice
Host Synchronization
- Host access to
queuemust be externally synchronized
- Host access to
fencemust be externally synchronized
Command Properties
'
| Command Buffer Levels | Render Pass Scope | Video Coding Scope | Supported Queue Types | Command Type |
|---|---|---|---|---|
| - | - | - | SPARSE_BINDING | - |
Return Codes
See Also
data SparseImageFormatProperties Source #
VkSparseImageFormatProperties - Structure specifying sparse image format properties
See Also
VK_VERSION_1_0,
Extent3D,
ImageAspectFlags,
SparseImageFormatFlags,
SparseImageFormatProperties2,
SparseImageMemoryRequirements,
getPhysicalDeviceSparseImageFormatProperties
Constructors
| SparseImageFormatProperties | |
Fields
| |
Instances
data SparseImageMemoryRequirements Source #
VkSparseImageMemoryRequirements - Structure specifying sparse image memory requirements
See Also
VK_VERSION_1_0,
DeviceSize,
SparseImageFormatProperties,
SparseImageMemoryRequirements2,
getImageSparseMemoryRequirements
Constructors
| SparseImageMemoryRequirements | |
Fields
| |
Instances
data ImageSubresource Source #
VkImageSubresource - Structure specifying an image subresource
Valid Usage (Implicit)
See Also
VK_VERSION_1_0,
ImageAspectFlags,
ImageSubresource2KHR,
SparseImageMemoryBind, getImageSubresourceLayout
Constructors
| ImageSubresource | |
Fields
| |
Instances
data SparseMemoryBind Source #
VkSparseMemoryBind - Structure specifying a sparse memory bind operation
Description
The binding range [resourceOffset, resourceOffset + size) has
different constraints based on flags. If flags contains
SPARSE_MEMORY_BIND_METADATA_BIT,
the binding range must be within the mip tail region of the metadata
aspect. This metadata region is defined by:
- metadataRegion = [base, base +
imageMipTailSize) - base =
imageMipTailOffset+imageMipTailStride× n
and imageMipTailOffset, imageMipTailSize, and imageMipTailStride
values are from the SparseImageMemoryRequirements corresponding to the
metadata aspect of the image, and n is a valid array layer index for the
image,
imageMipTailStride is considered to be zero for aspects where
SparseImageMemoryRequirements::formatProperties.flags contains
SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT.
If flags does not contain
SPARSE_MEMORY_BIND_METADATA_BIT,
the binding range must be within the range
[0,MemoryRequirements::size).
Valid Usage
- If
memoryis notNULL_HANDLE,memoryandmemoryOffsetmust match the memory requirements of the resource, as described in section https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#resources-association
- If
memoryis notNULL_HANDLE,memorymust not have been created with a memory type that reportsMEMORY_PROPERTY_LAZILY_ALLOCATED_BITbit set -
sizemust be greater than0 -
resourceOffsetmust be less than the size of the resource -
sizemust be less than or equal to the size of the resource minusresourceOffset -
memoryOffsetmust be less than the size ofmemory -
sizemust be less than or equal to the size ofmemoryminusmemoryOffset - If
memorywas created withExportMemoryAllocateInfo::handleTypesnot equal to0, at least one handle type it contained must also have been set inExternalMemoryBufferCreateInfo::handleTypesorExternalMemoryImageCreateInfo::handleTypeswhen the resource was created - If
memorywas created by a memory import operation, the external handle type of the imported memory must also have been set inExternalMemoryBufferCreateInfo::handleTypesorExternalMemoryImageCreateInfo::handleTypeswhen the resource was created
Valid Usage (Implicit)
- If
memoryis notNULL_HANDLE,memorymust be a validDeviceMemoryhandle
-
flagsmust be a valid combination ofSparseMemoryBindFlagBitsvalues
See Also
VK_VERSION_1_0,
DeviceMemory,
DeviceSize,
SparseBufferMemoryBindInfo, SparseImageOpaqueMemoryBindInfo,
SparseMemoryBindFlags
Constructors
| SparseMemoryBind | |
Fields
| |
Instances
data SparseImageMemoryBind Source #
VkSparseImageMemoryBind - Structure specifying sparse image memory bind
Valid Usage
- If the
sparseResidencyAliased
feature is not enabled, and if any other resources are bound to
ranges of
memory, the range ofmemorybeing bound must not overlap with those bound ranges
-
memoryandmemoryOffsetmust match the memory requirements of the calling command’simage, as described in section https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#resources-association -
subresourcemust be a valid image subresource forimage(see https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#resources-image-views) -
offset.xmust be a multiple of the sparse image block width (SparseImageFormatProperties::imageGranularity.width) of the image -
extent.widthmust be greater than0 -
extent.widthmust either be a multiple of the sparse image block width of the image, or else (extent.width+offset.x) must equal the width of the image subresource -
offset.ymust be a multiple of the sparse image block height (SparseImageFormatProperties::imageGranularity.height) of the image -
extent.heightmust be greater than0 -
extent.heightmust either be a multiple of the sparse image block height of the image, or else (extent.height+offset.y) must equal the height of the image subresource -
offset.zmust be a multiple of the sparse image block depth (SparseImageFormatProperties::imageGranularity.depth) of the image -
extent.depthmust be greater than0 -
extent.depthmust either be a multiple of the sparse image block depth of the image, or else (extent.depth+offset.z) must equal the depth of the image subresource - If
memorywas created withExportMemoryAllocateInfo::handleTypesnot equal to0, at least one handle type it contained must also have been set inExternalMemoryImageCreateInfo::handleTypeswhen the image was created - If
memorywas created by a memory import operation, the external handle type of the imported memory must also have been set inExternalMemoryImageCreateInfo::handleTypeswhenimagewas created
Valid Usage (Implicit)
-
subresourcemust be a validImageSubresourcestructure
- If
memoryis notNULL_HANDLE,memorymust be a validDeviceMemoryhandle -
flagsmust be a valid combination ofSparseMemoryBindFlagBitsvalues
See Also
VK_VERSION_1_0,
DeviceMemory,
DeviceSize,
Extent3D, ImageSubresource,
Offset3D, SparseImageMemoryBindInfo,
SparseMemoryBindFlags
Constructors
| SparseImageMemoryBind | |
Fields
| |
Instances
data SparseBufferMemoryBindInfo Source #
VkSparseBufferMemoryBindInfo - Structure specifying a sparse buffer memory bind operation
Valid Usage (Implicit)
See Also
Constructors
| SparseBufferMemoryBindInfo | |
Fields
| |
Instances
data SparseImageOpaqueMemoryBindInfo Source #
VkSparseImageOpaqueMemoryBindInfo - Structure specifying sparse image opaque memory bind information
Valid Usage
- If the
flagsmember of any element ofpBindscontainsSPARSE_MEMORY_BIND_METADATA_BIT, the binding range defined must be within the mip tail region of the metadata aspect ofimage
Valid Usage (Implicit)
-
imagemust be a validImagehandle
-
pBindsmust be a valid pointer to an array ofbindCountvalidSparseMemoryBindstructures -
bindCountmust be greater than0
See Also
Constructors
| SparseImageOpaqueMemoryBindInfo | |
Fields
| |
Instances
| Show SparseImageOpaqueMemoryBindInfo Source # | |
Defined in Vulkan.Core10.SparseResourceMemoryManagement Methods showsPrec :: Int -> SparseImageOpaqueMemoryBindInfo -> ShowS # | |
| FromCStruct SparseImageOpaqueMemoryBindInfo Source # | |
| ToCStruct SparseImageOpaqueMemoryBindInfo Source # | |
Defined in Vulkan.Core10.SparseResourceMemoryManagement Methods withCStruct :: SparseImageOpaqueMemoryBindInfo -> (Ptr SparseImageOpaqueMemoryBindInfo -> IO b) -> IO b Source # pokeCStruct :: Ptr SparseImageOpaqueMemoryBindInfo -> SparseImageOpaqueMemoryBindInfo -> IO b -> IO b Source # withZeroCStruct :: (Ptr SparseImageOpaqueMemoryBindInfo -> IO b) -> IO b Source # pokeZeroCStruct :: Ptr SparseImageOpaqueMemoryBindInfo -> IO b -> IO b Source # cStructSize :: Int Source # | |
| Zero SparseImageOpaqueMemoryBindInfo Source # | |
Defined in Vulkan.Core10.SparseResourceMemoryManagement Methods | |
data SparseImageMemoryBindInfo Source #
VkSparseImageMemoryBindInfo - Structure specifying sparse image memory bind information
Valid Usage
- The
subresource.mipLevelmember of each element ofpBindsmust be less than themipLevelsspecified inImageCreateInfowhenimagewas created
- The
subresource.arrayLayermember of each element ofpBindsmust be less than thearrayLayersspecified inImageCreateInfowhenimagewas created -
imagemust have been created withIMAGE_CREATE_SPARSE_RESIDENCY_BITset
Valid Usage (Implicit)
-
imagemust be a validImagehandle
-
pBindsmust be a valid pointer to an array ofbindCountvalidSparseImageMemoryBindstructures -
bindCountmust be greater than0
See Also
VK_VERSION_1_0,
BindSparseInfo, Image, SparseImageMemoryBind
Constructors
| SparseImageMemoryBindInfo | |
Fields
| |
Instances
data BindSparseInfo (es :: [Type]) Source #
VkBindSparseInfo - Structure specifying a sparse binding operation
Valid Usage
- If any element of
pWaitSemaphoresorpSignalSemaphoreswas created with aSemaphoreTypeofSEMAPHORE_TYPE_TIMELINEthen thepNextchain must include aTimelineSemaphoreSubmitInfostructure
- If the
pNextchain of this structure includes aTimelineSemaphoreSubmitInfostructure and any element ofpWaitSemaphoreswas created with aSemaphoreTypeofSEMAPHORE_TYPE_TIMELINEthen itswaitSemaphoreValueCountmember must equalwaitSemaphoreCount - If the
pNextchain of this structure includes aTimelineSemaphoreSubmitInfostructure and any element ofpSignalSemaphoreswas created with aSemaphoreTypeofSEMAPHORE_TYPE_TIMELINEthen itssignalSemaphoreValueCountmember must equalsignalSemaphoreCount - For each element of
pSignalSemaphorescreated with aSemaphoreTypeofSEMAPHORE_TYPE_TIMELINEthe corresponding element ofTimelineSemaphoreSubmitInfo::pSignalSemaphoreValuesmust have a value greater than the current value of the semaphore when the semaphore signal operation is executed - For each element of
pWaitSemaphorescreated with aSemaphoreTypeofSEMAPHORE_TYPE_TIMELINEthe corresponding element ofTimelineSemaphoreSubmitInfo::pWaitSemaphoreValuesmust have a value which does not differ from the current value of the semaphore or from the value of any outstanding semaphore wait or signal operation on that semaphore by more than maxTimelineSemaphoreValueDifference - For each element of
pSignalSemaphorescreated with aSemaphoreTypeofSEMAPHORE_TYPE_TIMELINEthe corresponding element ofTimelineSemaphoreSubmitInfo::pSignalSemaphoreValuesmust have a value which does not differ from the current value of the semaphore or from the value of any outstanding semaphore wait or signal operation on that semaphore by more than maxTimelineSemaphoreValueDifference
Valid Usage (Implicit)
-
sTypemust beSTRUCTURE_TYPE_BIND_SPARSE_INFO
- Each
pNextmember of any structure (including this one) in thepNextchain must be eitherNULLor a pointer to a valid instance ofDeviceGroupBindSparseInfo,FrameBoundaryEXT, orTimelineSemaphoreSubmitInfo - The
sTypevalue of each struct in thepNextchain must be unique - If
waitSemaphoreCountis not0,pWaitSemaphoresmust be a valid pointer to an array ofwaitSemaphoreCountvalidSemaphorehandles - If
bufferBindCountis not0,pBufferBindsmust be a valid pointer to an array ofbufferBindCountvalidSparseBufferMemoryBindInfostructures - If
imageOpaqueBindCountis not0,pImageOpaqueBindsmust be a valid pointer to an array ofimageOpaqueBindCountvalidSparseImageOpaqueMemoryBindInfostructures - If
imageBindCountis not0,pImageBindsmust be a valid pointer to an array ofimageBindCountvalidSparseImageMemoryBindInfostructures - If
signalSemaphoreCountis not0,pSignalSemaphoresmust be a valid pointer to an array ofsignalSemaphoreCountvalidSemaphorehandles - Both of the elements of
pSignalSemaphores, and the elements ofpWaitSemaphoresthat are valid handles of non-ignored parameters must have been created, allocated, or retrieved from the sameDevice
See Also
VK_VERSION_1_0,
Semaphore, SparseBufferMemoryBindInfo,
SparseImageMemoryBindInfo, SparseImageOpaqueMemoryBindInfo,
StructureType, queueBindSparse
Constructors
| BindSparseInfo | |
Fields
| |
Instances
newtype ImageAspectFlagBits Source #
VkImageAspectFlagBits - Bitmask specifying which aspects of an image are included in a view
See Also
VK_VERSION_1_0,
BindImagePlaneMemoryInfo,
DeviceImageMemoryRequirements,
ExportMetalTextureInfoEXT,
ImageAspectFlags,
ImagePlaneMemoryRequirementsInfo,
ImportMetalTextureInfoEXT
Constructors
| ImageAspectFlagBits Flags |
Bundled Patterns
Instances
newtype SparseImageFormatFlagBits Source #
VkSparseImageFormatFlagBits - Bitmask specifying additional information about a sparse image resource
See Also
Constructors
| SparseImageFormatFlagBits Flags |
Bundled Patterns
| pattern SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT :: SparseImageFormatFlagBits |
|
| pattern SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT :: SparseImageFormatFlagBits |
|
| pattern SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT :: SparseImageFormatFlagBits |
|
Instances
newtype SparseMemoryBindFlagBits Source #
VkSparseMemoryBindFlagBits - Bitmask specifying usage of a sparse memory binding operation
See Also
Constructors
| SparseMemoryBindFlagBits Flags |
Bundled Patterns
| pattern SPARSE_MEMORY_BIND_METADATA_BIT :: SparseMemoryBindFlagBits |
|