Class VkSparseMemoryBind

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class VkSparseMemoryBind
    extends Struct
    implements NativeResource
    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 VkSparseImageMemoryRequirements 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 VkSparseImageMemoryRequirements::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,VkMemoryRequirements::size).

    Valid Usage
    • If memory is not NULL_HANDLE, memory and memoryOffset must match the memory requirements of the resource, as described in section the “Resource Memory Association” section
    • If memory is not NULL_HANDLE, memory must not have been created with a memory type that reports MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT bit set
    • size must be greater than 0
    • resourceOffset must be less than the size of the resource
    • size must be less than or equal to the size of the resource minus resourceOffset
    • memoryOffset must be less than the size of memory
    • size must be less than or equal to the size of memory minus memoryOffset
    Valid Usage (Implicit)
    • If memory is not NULL_HANDLE, memory must be a valid VkDeviceMemory handle
    • flags must be a valid combination of VkSparseMemoryBindFlagBits values
    See Also

    VkSparseBufferMemoryBindInfo, VkSparseImageOpaqueMemoryBindInfo

    Member documentation

    • resourceOffset – the offset into the resource.
    • size – the size of the memory region to be bound.
    • memory – the VkDeviceMemory object that the range of the resource is bound to. If memory is NULL_HANDLE, the range is unbound.
    • memoryOffset – the offset into the VkDeviceMemory object to bind the resource range to. If memory is NULL_HANDLE, this value is ignored.
    • flags – a bitmask of VkSparseMemoryBindFlagBits specifying usage of the binding operation.

    Layout

    
     struct VkSparseMemoryBind {
         VkDeviceSize resourceOffset;
         VkDeviceSize size;
         VkDeviceMemory memory;
         VkDeviceSize memoryOffset;
         VkSparseMemoryBindFlags flags;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • RESOURCEOFFSET, SIZE, MEMORY, MEMORYOFFSET, FLAGS

        The struct member offsets.
    • Constructor Detail

      • VkSparseMemoryBind

        public VkSparseMemoryBind​(java.nio.ByteBuffer container)
        Creates a VkSparseMemoryBind instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.