Class VkSparseMemoryBind

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<VkSparseMemoryBind>
org.lwjgl.vulkan.VkSparseMemoryBind
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class VkSparseMemoryBind extends org.lwjgl.system.Struct<VkSparseMemoryBind> implements org.lwjgl.system.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
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

Layout


 struct VkSparseMemoryBind {
     VkDeviceSize resourceOffset();
     VkDeviceSize size();
     VkDeviceMemory memory();
     VkDeviceSize memoryOffset();
     VkSparseMemoryBindFlags flags();
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • RESOURCEOFFSET

      public static final int RESOURCEOFFSET
      The struct member offsets.
    • SIZE

      public static final int SIZE
      The struct member offsets.
    • MEMORY

      public static final int MEMORY
      The struct member offsets.
    • MEMORYOFFSET

      public static final int MEMORYOFFSET
      The struct member offsets.
    • FLAGS

      public static final int FLAGS
      The struct member offsets.
  • Constructor Details

    • VkSparseMemoryBind

      public VkSparseMemoryBind(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.

  • Method Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<VkSparseMemoryBind>
    • resourceOffset

      public long resourceOffset()
      the offset into the resource.
    • size

      public long size()
      the size of the memory region to be bound.
    • memory

      public long memory()
      the VkDeviceMemory object that the range of the resource is bound to. If memory is NULL_HANDLE, the range is unbound.
    • memoryOffset

      public long memoryOffset()
      the offset into the VkDeviceMemory object to bind the resource range to. If memory is NULL_HANDLE, this value is ignored.
    • flags

      public int flags()
      a bitmask of VkSparseMemoryBindFlagBits specifying usage of the binding operation.
    • resourceOffset

      public VkSparseMemoryBind resourceOffset(long value)
      Sets the specified value to the resourceOffset() field.
    • size

      public VkSparseMemoryBind size(long value)
      Sets the specified value to the size() field.
    • memory

      public VkSparseMemoryBind memory(long value)
      Sets the specified value to the memory() field.
    • memoryOffset

      public VkSparseMemoryBind memoryOffset(long value)
      Sets the specified value to the memoryOffset() field.
    • flags

      public VkSparseMemoryBind flags(int value)
      Sets the specified value to the flags() field.
    • set

      public VkSparseMemoryBind set(long resourceOffset, long size, long memory, long memoryOffset, int flags)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static VkSparseMemoryBind malloc()
      Returns a new VkSparseMemoryBind instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static VkSparseMemoryBind calloc()
      Returns a new VkSparseMemoryBind instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static VkSparseMemoryBind create()
      Returns a new VkSparseMemoryBind instance allocated with BufferUtils.
    • create

      public static VkSparseMemoryBind create(long address)
      Returns a new VkSparseMemoryBind instance for the specified memory address.
    • createSafe

      public static @Nullable VkSparseMemoryBind createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static VkSparseMemoryBind.Buffer malloc(int capacity)
      Returns a new VkSparseMemoryBind.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static VkSparseMemoryBind.Buffer calloc(int capacity)
      Returns a new VkSparseMemoryBind.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VkSparseMemoryBind.Buffer create(int capacity)
      Returns a new VkSparseMemoryBind.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VkSparseMemoryBind.Buffer create(long address, int capacity)
      Create a VkSparseMemoryBind.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable VkSparseMemoryBind.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • mallocStack

      @Deprecated public static VkSparseMemoryBind mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static VkSparseMemoryBind callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkSparseMemoryBind mallocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static VkSparseMemoryBind callocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkSparseMemoryBind.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static VkSparseMemoryBind.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static VkSparseMemoryBind.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static VkSparseMemoryBind.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

      public static VkSparseMemoryBind malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VkSparseMemoryBind instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static VkSparseMemoryBind calloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VkSparseMemoryBind instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static VkSparseMemoryBind.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkSparseMemoryBind.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static VkSparseMemoryBind.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkSparseMemoryBind.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nresourceOffset

      public static long nresourceOffset(long struct)
      Unsafe version of resourceOffset().
    • nsize

      public static long nsize(long struct)
      Unsafe version of size().
    • nmemory

      public static long nmemory(long struct)
      Unsafe version of memory().
    • nmemoryOffset

      public static long nmemoryOffset(long struct)
      Unsafe version of memoryOffset().
    • nflags

      public static int nflags(long struct)
      Unsafe version of flags().
    • nresourceOffset

      public static void nresourceOffset(long struct, long value)
      Unsafe version of resourceOffset.
    • nsize

      public static void nsize(long struct, long value)
      Unsafe version of size.
    • nmemory

      public static void nmemory(long struct, long value)
      Unsafe version of memory.
    • nmemoryOffset

      public static void nmemoryOffset(long struct, long value)
      Unsafe version of memoryOffset.
    • nflags

      public static void nflags(long struct, int value)
      Unsafe version of flags.