Class VkMappedMemoryRange

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

    public class VkMappedMemoryRange
    extends Struct
    implements 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
    • If size is equal to WHOLE_SIZE, the end of the current mapping of memory must be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize bytes from the beginning of the memory object.
    • offset must be a multiple of VkPhysicalDeviceLimits::nonCoherentAtomSize
    • 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

    Member documentation

    • sType – the type of this structure.
    • pNextNULL or a pointer to an extension-specific structure.
    • memory – the memory object to which this range belongs.
    • offset – the zero-based byte offset from the beginning of the memory object.
    • 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.

    Layout

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

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • STYPE, PNEXT, MEMORY, OFFSET, SIZE

        The struct member offsets.
    • Constructor Detail

      • VkMappedMemoryRange

        public VkMappedMemoryRange​(java.nio.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 Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • sType

        public int sType()
        Returns the value of the sType field.
      • pNext

        public long pNext()
        Returns the value of the pNext field.
      • memory

        public long memory()
        Returns the value of the memory field.
      • offset

        public long offset()
        Returns the value of the offset field.
      • size

        public long size()
        Returns the value of the size field.
      • sType

        public VkMappedMemoryRange sType​(int value)
        Sets the specified 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.
      • 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​(long address)
        Returns a new VkMappedMemoryRange instance for the specified memory address.
      • createSafe

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

        public static VkMappedMemoryRange callocStack()
        Returns a new VkMappedMemoryRange instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static VkMappedMemoryRange mallocStack​(MemoryStack stack)
        Returns a new VkMappedMemoryRange instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static VkMappedMemoryRange callocStack​(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
      • 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.