Class VkMappedMemoryRange

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

public class VkMappedMemoryRange extends org.lwjgl.system.Struct<VkMappedMemoryRange> implements org.lwjgl.system.NativeResource
Structure specifying a mapped memory range.
Valid Usage
  • memory must be currently host mapped
  • If size is not equal to WHOLE_SIZE, offset and size must specify a range contained within the currently mapped range of memory
  • If size is equal to WHOLE_SIZE, offset must be within the currently mapped range of memory
  • offset must be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize
  • If size is equal to WHOLE_SIZE, the end of the current mapping of memory must either be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize bytes from the beginning of the memory object, or be equal to the end of the memory object
  • If size is not equal to WHOLE_SIZE, size must either be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize, or offset plus size must equal the size of memory
Valid Usage (Implicit)
See Also

FlushMappedMemoryRanges, InvalidateMappedMemoryRanges

Layout


 struct VkMappedMemoryRange {
     VkStructureType sType();
     void const * pNext();
     VkDeviceMemory memory();
     VkDeviceSize offset();
     VkDeviceSize size();
 }
  • Field Details

    • SIZEOF

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

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

      public static final int STYPE
      The struct member offsets.
    • PNEXT

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

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

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

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

    • VkMappedMemoryRange

      public VkMappedMemoryRange(ByteBuffer container)
      Creates a VkMappedMemoryRange 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<VkMappedMemoryRange>
    • sType

      public int sType()
      a VkStructureType value identifying this structure.
    • pNext

      public long pNext()
      NULL or a pointer to a structure extending this structure.
    • memory

      public long memory()
      the memory object to which this range belongs.
    • offset

      public long offset()
      the zero-based byte offset from the beginning of the memory object.
    • size

      public long size()
      either the size of range, or WHOLE_SIZE to affect the range from offset to the end of the current mapping of the allocation.
    • sType

      public VkMappedMemoryRange sType(int value)
      Sets the specified value to the sType() field.
    • sType$Default

      public VkMappedMemoryRange sType$Default()
      Sets the STRUCTURE_TYPE_MAPPED_MEMORY_RANGE value to the sType() field.
    • pNext

      public VkMappedMemoryRange pNext(long value)
      Sets the specified value to the pNext() field.
    • memory

      public VkMappedMemoryRange memory(long value)
      Sets the specified value to the memory() field.
    • offset

      public VkMappedMemoryRange offset(long value)
      Sets the specified value to the offset() field.
    • size

      public VkMappedMemoryRange size(long value)
      Sets the specified value to the size() field.
    • set

      public VkMappedMemoryRange set(int sType, long pNext, long memory, long offset, long size)
      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 VkMappedMemoryRange malloc()
      Returns a new VkMappedMemoryRange instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      @Deprecated public static VkMappedMemoryRange.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 VkMappedMemoryRange.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 VkMappedMemoryRange malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VkMappedMemoryRange instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

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

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

      public static VkMappedMemoryRange.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VkMappedMemoryRange.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
    • nsType

      public static int nsType(long struct)
      Unsafe version of sType().
    • npNext

      public static long npNext(long struct)
      Unsafe version of pNext().
    • nmemory

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

      public static long noffset(long struct)
      Unsafe version of offset().
    • nsize

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

      public static void nsType(long struct, int value)
      Unsafe version of sType.
    • npNext

      public static void npNext(long struct, long value)
      Unsafe version of pNext.
    • nmemory

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

      public static void noffset(long struct, long value)
      Unsafe version of offset.
    • nsize

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