lwjgl-vma-3.3.3.jar

Download file
    package org.lwjgl.util.vma;

import java.nio.ByteBuffer;
import javax.annotation.Nullable;
import org.lwjgl.BufferUtils;
import org.lwjgl.system.MemoryStack;
import org.lwjgl.system.MemoryUtil;
import org.lwjgl.system.NativeResource;
import org.lwjgl.system.NativeType;
import org.lwjgl.system.Struct;
import org.lwjgl.system.StructBuffer;
import org.lwjgl.vulkan.VkDedicatedAllocationMemoryAllocateInfoNV;
import org.lwjgl.vulkan.VkExportMemoryAllocateInfo;
import org.lwjgl.vulkan.VkExportMemoryAllocateInfoKHR;
import org.lwjgl.vulkan.VkExportMemoryAllocateInfoNV;
import org.lwjgl.vulkan.VkExportMemoryWin32HandleInfoKHR;
import org.lwjgl.vulkan.VkExportMemoryWin32HandleInfoNV;
import org.lwjgl.vulkan.VkExportMetalObjectCreateInfoEXT;
import org.lwjgl.vulkan.VkImportAndroidHardwareBufferInfoANDROID;
import org.lwjgl.vulkan.VkImportMemoryFdInfoKHR;
import org.lwjgl.vulkan.VkImportMemoryHostPointerInfoEXT;
import org.lwjgl.vulkan.VkImportMemoryWin32HandleInfoKHR;
import org.lwjgl.vulkan.VkImportMemoryWin32HandleInfoNV;
import org.lwjgl.vulkan.VkImportMetalBufferInfoEXT;
import org.lwjgl.vulkan.VkMemoryAllocateFlagsInfo;
import org.lwjgl.vulkan.VkMemoryAllocateFlagsInfoKHR;
import org.lwjgl.vulkan.VkMemoryDedicatedAllocateInfo;
import org.lwjgl.vulkan.VkMemoryDedicatedAllocateInfoKHR;
import org.lwjgl.vulkan.VkMemoryOpaqueCaptureAddressAllocateInfo;
import org.lwjgl.vulkan.VkMemoryOpaqueCaptureAddressAllocateInfoKHR;
import org.lwjgl.vulkan.VkMemoryPriorityAllocateInfoEXT;

public class VmaPoolCreateInfo extends Struct<VmaPoolCreateInfo> implements NativeResource {
   public static final int SIZEOF;
   public static final int ALIGNOF;
   public static final int MEMORYTYPEINDEX;
   public static final int FLAGS;
   public static final int BLOCKSIZE;
   public static final int MINBLOCKCOUNT;
   public static final int MAXBLOCKCOUNT;
   public static final int PRIORITY;
   public static final int MINALLOCATIONALIGNMENT;
   public static final int PMEMORYALLOCATENEXT;

   protected VmaPoolCreateInfo(long address, @Nullable ByteBuffer container) {
      super(address, container);
   }

   protected VmaPoolCreateInfo create(long address, @Nullable ByteBuffer container) {
      return new VmaPoolCreateInfo(address, container);
   }

   public VmaPoolCreateInfo(ByteBuffer container) {
      super(MemoryUtil.memAddress(container), __checkContainer(container, SIZEOF));
   }

   public int sizeof() {
      return SIZEOF;
   }

   @NativeType("uint32_t")
   public int memoryTypeIndex() {
      return nmemoryTypeIndex(this.address());
   }

   @NativeType("VmaPoolCreateFlags")
   public int flags() {
      return nflags(this.address());
   }

   @NativeType("VkDeviceSize")
   public long blockSize() {
      return nblockSize(this.address());
   }

   @NativeType("size_t")
   public long minBlockCount() {
      return nminBlockCount(this.address());
   }

   @NativeType("size_t")
   public long maxBlockCount() {
      return nmaxBlockCount(this.address());
   }

   public float priority() {
      return npriority(this.address());
   }

   @NativeType("VkDeviceSize")
   public long minAllocationAlignment() {
      return nminAllocationAlignment(this.address());
   }

   @NativeType("void *")
   public long pMemoryAllocateNext() {
      return npMemoryAllocateNext(this.address());
   }

   public VmaPoolCreateInfo memoryTypeIndex(@NativeType("uint32_t") int value) {
      nmemoryTypeIndex(this.address(), value);
      return this;
   }

   public VmaPoolCreateInfo flags(@NativeType("VmaPoolCreateFlags") int value) {
      nflags(this.address(), value);
      return this;
   }

   public VmaPoolCreateInfo blockSize(@NativeType("VkDeviceSize") long value) {
      nblockSize(this.address(), value);
      return this;
   }

   public VmaPoolCreateInfo minBlockCount(@NativeType("size_t") long value) {
      nminBlockCount(this.address(), value);
      return this;
   }

   public VmaPoolCreateInfo maxBlockCount(@NativeType("size_t") long value) {
      nmaxBlockCount(this.address(), value);
      return this;
   }

   public VmaPoolCreateInfo priority(float value) {
      npriority(this.address(), value);
      return this;
   }

   public VmaPoolCreateInfo minAllocationAlignment(@NativeType("VkDeviceSize") long value) {
      nminAllocationAlignment(this.address(), value);
      return this;
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(@NativeType("void *") long value) {
      npMemoryAllocateNext(this.address(), value);
      return this;
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkDedicatedAllocationMemoryAllocateInfoNV value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkExportMemoryAllocateInfo value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkExportMemoryAllocateInfoKHR value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkExportMemoryAllocateInfoNV value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkExportMemoryWin32HandleInfoKHR value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkExportMemoryWin32HandleInfoNV value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkExportMetalObjectCreateInfoEXT value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkImportAndroidHardwareBufferInfoANDROID value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkImportMemoryFdInfoKHR value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkImportMemoryHostPointerInfoEXT value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkImportMemoryWin32HandleInfoKHR value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkImportMemoryWin32HandleInfoNV value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkImportMetalBufferInfoEXT value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkMemoryAllocateFlagsInfo value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkMemoryAllocateFlagsInfoKHR value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkMemoryDedicatedAllocateInfo value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkMemoryDedicatedAllocateInfoKHR value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkMemoryOpaqueCaptureAddressAllocateInfo value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkMemoryOpaqueCaptureAddressAllocateInfoKHR value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo pMemoryAllocateNext(VkMemoryPriorityAllocateInfoEXT value) {
      return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
   }

   public VmaPoolCreateInfo set(int memoryTypeIndex, int flags, long blockSize, long minBlockCount, long maxBlockCount, float priority, long minAllocationAlignment, long pMemoryAllocateNext) {
      this.memoryTypeIndex(memoryTypeIndex);
      this.flags(flags);
      this.blockSize(blockSize);
      this.minBlockCount(minBlockCount);
      this.maxBlockCount(maxBlockCount);
      this.priority(priority);
      this.minAllocationAlignment(minAllocationAlignment);
      this.pMemoryAllocateNext(pMemoryAllocateNext);
      return this;
   }

   public VmaPoolCreateInfo set(VmaPoolCreateInfo src) {
      MemoryUtil.memCopy(src.address(), this.address(), (long)SIZEOF);
      return this;
   }

   public static VmaPoolCreateInfo malloc() {
      return new VmaPoolCreateInfo(MemoryUtil.nmemAllocChecked((long)SIZEOF), (ByteBuffer)null);
   }

   public static VmaPoolCreateInfo calloc() {
      return new VmaPoolCreateInfo(MemoryUtil.nmemCallocChecked(1L, (long)SIZEOF), (ByteBuffer)null);
   }

   public static VmaPoolCreateInfo create() {
      ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
      return new VmaPoolCreateInfo(MemoryUtil.memAddress(container), container);
   }

   public static VmaPoolCreateInfo create(long address) {
      return new VmaPoolCreateInfo(address, (ByteBuffer)null);
   }

   @Nullable
   public static VmaPoolCreateInfo createSafe(long address) {
      return address == 0L ? null : new VmaPoolCreateInfo(address, (ByteBuffer)null);
   }

   public static Buffer malloc(int capacity) {
      return new Buffer(MemoryUtil.nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
   }

   public static Buffer calloc(int capacity) {
      return new Buffer(MemoryUtil.nmemCallocChecked((long)capacity, (long)SIZEOF), capacity);
   }

   public static Buffer create(int capacity) {
      ByteBuffer container = __create(capacity, SIZEOF);
      return new Buffer(MemoryUtil.memAddress(container), container, -1, 0, capacity, capacity);
   }

   public static Buffer create(long address, int capacity) {
      return new Buffer(address, capacity);
   }

   @Nullable
   public static Buffer createSafe(long address, int capacity) {
      return address == 0L ? null : new Buffer(address, capacity);
   }

   /** @deprecated */
   @Deprecated
   public static VmaPoolCreateInfo mallocStack() {
      return malloc(MemoryStack.stackGet());
   }

   /** @deprecated */
   @Deprecated
   public static VmaPoolCreateInfo callocStack() {
      return calloc(MemoryStack.stackGet());
   }

   /** @deprecated */
   @Deprecated
   public static VmaPoolCreateInfo mallocStack(MemoryStack stack) {
      return malloc(stack);
   }

   /** @deprecated */
   @Deprecated
   public static VmaPoolCreateInfo callocStack(MemoryStack stack) {
      return calloc(stack);
   }

   /** @deprecated */
   @Deprecated
   public static Buffer mallocStack(int capacity) {
      return malloc(capacity, MemoryStack.stackGet());
   }

   /** @deprecated */
   @Deprecated
   public static Buffer callocStack(int capacity) {
      return calloc(capacity, MemoryStack.stackGet());
   }

   /** @deprecated */
   @Deprecated
   public static Buffer mallocStack(int capacity, MemoryStack stack) {
      return malloc(capacity, stack);
   }

   /** @deprecated */
   @Deprecated
   public static Buffer callocStack(int capacity, MemoryStack stack) {
      return calloc(capacity, stack);
   }

   public static VmaPoolCreateInfo malloc(MemoryStack stack) {
      return new VmaPoolCreateInfo(stack.nmalloc(ALIGNOF, SIZEOF), (ByteBuffer)null);
   }

   public static VmaPoolCreateInfo calloc(MemoryStack stack) {
      return new VmaPoolCreateInfo(stack.ncalloc(ALIGNOF, 1, SIZEOF), (ByteBuffer)null);
   }

   public static Buffer malloc(int capacity, MemoryStack stack) {
      return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
   }

   public static Buffer calloc(int capacity, MemoryStack stack) {
      return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
   }

   public static int nmemoryTypeIndex(long struct) {
      return UNSAFE.getInt((Object)null, struct + (long)MEMORYTYPEINDEX);
   }

   public static int nflags(long struct) {
      return UNSAFE.getInt((Object)null, struct + (long)FLAGS);
   }

   public static long nblockSize(long struct) {
      return UNSAFE.getLong((Object)null, struct + (long)BLOCKSIZE);
   }

   public static long nminBlockCount(long struct) {
      return MemoryUtil.memGetAddress(struct + (long)MINBLOCKCOUNT);
   }

   public static long nmaxBlockCount(long struct) {
      return MemoryUtil.memGetAddress(struct + (long)MAXBLOCKCOUNT);
   }

   public static float npriority(long struct) {
      return UNSAFE.getFloat((Object)null, struct + (long)PRIORITY);
   }

   public static long nminAllocationAlignment(long struct) {
      return UNSAFE.getLong((Object)null, struct + (long)MINALLOCATIONALIGNMENT);
   }

   public static long npMemoryAllocateNext(long struct) {
      return MemoryUtil.memGetAddress(struct + (long)PMEMORYALLOCATENEXT);
   }

   public static void nmemoryTypeIndex(long struct, int value) {
      UNSAFE.putInt((Object)null, struct + (long)MEMORYTYPEINDEX, value);
   }

   public static void nflags(long struct, int value) {
      UNSAFE.putInt((Object)null, struct + (long)FLAGS, value);
   }

   public static void nblockSize(long struct, long value) {
      UNSAFE.putLong((Object)null, struct + (long)BLOCKSIZE, value);
   }

   public static void nminBlockCount(long struct, long value) {
      MemoryUtil.memPutAddress(struct + (long)MINBLOCKCOUNT, value);
   }

   public static void nmaxBlockCount(long struct, long value) {
      MemoryUtil.memPutAddress(struct + (long)MAXBLOCKCOUNT, value);
   }

   public static void npriority(long struct, float value) {
      UNSAFE.putFloat((Object)null, struct + (long)PRIORITY, value);
   }

   public static void nminAllocationAlignment(long struct, long value) {
      UNSAFE.putLong((Object)null, struct + (long)MINALLOCATIONALIGNMENT, value);
   }

   public static void npMemoryAllocateNext(long struct, long value) {
      MemoryUtil.memPutAddress(struct + (long)PMEMORYALLOCATENEXT, value);
   }

   static {
      Struct.Layout layout = __struct(new Struct.Member[]{__member(4), __member(4), __member(8), __member(POINTER_SIZE), __member(POINTER_SIZE), __member(4), __member(8), __member(POINTER_SIZE)});
      SIZEOF = layout.getSize();
      ALIGNOF = layout.getAlignment();
      MEMORYTYPEINDEX = layout.offsetof(0);
      FLAGS = layout.offsetof(1);
      BLOCKSIZE = layout.offsetof(2);
      MINBLOCKCOUNT = layout.offsetof(3);
      MAXBLOCKCOUNT = layout.offsetof(4);
      PRIORITY = layout.offsetof(5);
      MINALLOCATIONALIGNMENT = layout.offsetof(6);
      PMEMORYALLOCATENEXT = layout.offsetof(7);
   }

   public static class Buffer extends StructBuffer<VmaPoolCreateInfo, Buffer> implements NativeResource {
      private static final VmaPoolCreateInfo ELEMENT_FACTORY = VmaPoolCreateInfo.create(-1L);

      public Buffer(ByteBuffer container) {
         super(container, container.remaining() / VmaPoolCreateInfo.SIZEOF);
      }

      public Buffer(long address, int cap) {
         super(address, (ByteBuffer)null, -1, 0, cap, cap);
      }

      Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
         super(address, container, mark, pos, lim, cap);
      }

      protected Buffer self() {
         return this;
      }

      protected VmaPoolCreateInfo getElementFactory() {
         return ELEMENT_FACTORY;
      }

      @NativeType("uint32_t")
      public int memoryTypeIndex() {
         return VmaPoolCreateInfo.nmemoryTypeIndex(this.address());
      }

      @NativeType("VmaPoolCreateFlags")
      public int flags() {
         return VmaPoolCreateInfo.nflags(this.address());
      }

      @NativeType("VkDeviceSize")
      public long blockSize() {
         return VmaPoolCreateInfo.nblockSize(this.address());
      }

      @NativeType("size_t")
      public long minBlockCount() {
         return VmaPoolCreateInfo.nminBlockCount(this.address());
      }

      @NativeType("size_t")
      public long maxBlockCount() {
         return VmaPoolCreateInfo.nmaxBlockCount(this.address());
      }

      public float priority() {
         return VmaPoolCreateInfo.npriority(this.address());
      }

      @NativeType("VkDeviceSize")
      public long minAllocationAlignment() {
         return VmaPoolCreateInfo.nminAllocationAlignment(this.address());
      }

      @NativeType("void *")
      public long pMemoryAllocateNext() {
         return VmaPoolCreateInfo.npMemoryAllocateNext(this.address());
      }

      public Buffer memoryTypeIndex(@NativeType("uint32_t") int value) {
         VmaPoolCreateInfo.nmemoryTypeIndex(this.address(), value);
         return this;
      }

      public Buffer flags(@NativeType("VmaPoolCreateFlags") int value) {
         VmaPoolCreateInfo.nflags(this.address(), value);
         return this;
      }

      public Buffer blockSize(@NativeType("VkDeviceSize") long value) {
         VmaPoolCreateInfo.nblockSize(this.address(), value);
         return this;
      }

      public Buffer minBlockCount(@NativeType("size_t") long value) {
         VmaPoolCreateInfo.nminBlockCount(this.address(), value);
         return this;
      }

      public Buffer maxBlockCount(@NativeType("size_t") long value) {
         VmaPoolCreateInfo.nmaxBlockCount(this.address(), value);
         return this;
      }

      public Buffer priority(float value) {
         VmaPoolCreateInfo.npriority(this.address(), value);
         return this;
      }

      public Buffer minAllocationAlignment(@NativeType("VkDeviceSize") long value) {
         VmaPoolCreateInfo.nminAllocationAlignment(this.address(), value);
         return this;
      }

      public Buffer pMemoryAllocateNext(@NativeType("void *") long value) {
         VmaPoolCreateInfo.npMemoryAllocateNext(this.address(), value);
         return this;
      }

      public Buffer pMemoryAllocateNext(VkDedicatedAllocationMemoryAllocateInfoNV value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkExportMemoryAllocateInfo value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkExportMemoryAllocateInfoKHR value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkExportMemoryAllocateInfoNV value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkExportMemoryWin32HandleInfoKHR value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkExportMemoryWin32HandleInfoNV value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkExportMetalObjectCreateInfoEXT value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkImportAndroidHardwareBufferInfoANDROID value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkImportMemoryFdInfoKHR value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkImportMemoryHostPointerInfoEXT value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkImportMemoryWin32HandleInfoKHR value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkImportMemoryWin32HandleInfoNV value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkImportMetalBufferInfoEXT value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkMemoryAllocateFlagsInfo value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkMemoryAllocateFlagsInfoKHR value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkMemoryDedicatedAllocateInfo value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkMemoryDedicatedAllocateInfoKHR value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkMemoryOpaqueCaptureAddressAllocateInfo value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkMemoryOpaqueCaptureAddressAllocateInfoKHR value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }

      public Buffer pMemoryAllocateNext(VkMemoryPriorityAllocateInfoEXT value) {
         return this.pMemoryAllocateNext(value.pNext(this.pMemoryAllocateNext()).address());
      }
   }
}
    
Download file