Class ktxVulkanDeviceInfo

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<ktxVulkanDeviceInfo>
org.lwjgl.util.ktx.ktxVulkanDeviceInfo
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class ktxVulkanDeviceInfo extends org.lwjgl.system.Struct<ktxVulkanDeviceInfo> implements org.lwjgl.system.NativeResource
Struct for passing information about the Vulkan device on which to create images to the texture image loading functions.

Avoids passing a large number of parameters to each loading function. Use of VulkanDeviceInfo_Create or VulkanDeviceInfo_Construct to populate this structure is highly recommended.


     ktxVulkanDeviceInfo vdi;
     ktxVulkanTexture texture;
  
     vdi = ktxVulkanDeviceInfo_create(physicalDevice,
                                      device,
                                      queue,
                                      cmdPool,
                                      &allocator);
     ktxLoadVkTextureN("texture_1.ktx", vdi, &texture, NULL, NULL);
     // ...
     ktxLoadVkTextureN("texture_n.ktx", vdi, &texture, NULL, NULL);
     ktxVulkanDeviceInfo_destroy(vdi);

Layout


 struct ktxVulkanDeviceInfo {
     VkInstance instance();
     VkPhysicalDevice physicalDevice();
     VkDevice device();
     VkQueue queue();
     VkCommandBuffer cmdBuffer();
     VkCommandPool cmdPool();
     VkAllocationCallbacks const * pAllocator();
     VkPhysicalDeviceMemoryProperties deviceMemoryProperties();
     ktxVulkanFunctions vkFuncs();
 }
  • Field Details

    • SIZEOF

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

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

      public static final int INSTANCE
      The struct member offsets.
    • PHYSICALDEVICE

      public static final int PHYSICALDEVICE
      The struct member offsets.
    • DEVICE

      public static final int DEVICE
      The struct member offsets.
    • QUEUE

      public static final int QUEUE
      The struct member offsets.
    • CMDBUFFER

      public static final int CMDBUFFER
      The struct member offsets.
    • CMDPOOL

      public static final int CMDPOOL
      The struct member offsets.
    • PALLOCATOR

      public static final int PALLOCATOR
      The struct member offsets.
    • DEVICEMEMORYPROPERTIES

      public static final int DEVICEMEMORYPROPERTIES
      The struct member offsets.
    • VKFUNCS

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

    • ktxVulkanDeviceInfo

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

      public long instance()
      instance used to communicate with vulkan
    • physicalDevice

      public long physicalDevice()
      handle of the physical device
    • device

      public long device()
      handle of the logical device
    • queue

      public long queue()
      handle to the queue to which to submit commands
    • cmdBuffer

      public long cmdBuffer()
      handle of the cmdBuffer to use
    • cmdPool

      public long cmdPool()
      handle of the command pool from which to allocate the command buffer
    • pAllocator

      public @Nullable org.lwjgl.vulkan.VkAllocationCallbacks pAllocator()
      pointer to the allocator to use for the command buffer and created images
    • deviceMemoryProperties

      public org.lwjgl.vulkan.VkPhysicalDeviceMemoryProperties deviceMemoryProperties()
      memory properties of the Vulkan physical device
    • vkFuncs

      public ktxVulkanFunctions vkFuncs()
      the functions needed to operate functions
    • instance

      public ktxVulkanDeviceInfo instance(org.lwjgl.vulkan.VkInstance value)
      Sets the specified value to the instance() field.
    • physicalDevice

      public ktxVulkanDeviceInfo physicalDevice(org.lwjgl.vulkan.VkPhysicalDevice value)
      Sets the specified value to the physicalDevice() field.
    • device

      public ktxVulkanDeviceInfo device(org.lwjgl.vulkan.VkDevice value)
      Sets the specified value to the device() field.
    • queue

      public ktxVulkanDeviceInfo queue(org.lwjgl.vulkan.VkQueue value)
      Sets the specified value to the queue() field.
    • cmdBuffer

      public ktxVulkanDeviceInfo cmdBuffer(org.lwjgl.vulkan.VkCommandBuffer value)
      Sets the specified value to the cmdBuffer() field.
    • cmdPool

      public ktxVulkanDeviceInfo cmdPool(long value)
      Sets the specified value to the cmdPool() field.
    • pAllocator

      public ktxVulkanDeviceInfo pAllocator(@Nullable org.lwjgl.vulkan.VkAllocationCallbacks value)
      Sets the address of the specified VkAllocationCallbacks to the pAllocator() field.
    • deviceMemoryProperties

      public ktxVulkanDeviceInfo deviceMemoryProperties(org.lwjgl.vulkan.VkPhysicalDeviceMemoryProperties value)
      Copies the specified VkPhysicalDeviceMemoryProperties to the deviceMemoryProperties() field.
    • vkFuncs

      public ktxVulkanDeviceInfo vkFuncs(ktxVulkanFunctions value)
      Copies the specified ktxVulkanFunctions to the vkFuncs() field.
    • vkFuncs

      public ktxVulkanDeviceInfo vkFuncs(Consumer<ktxVulkanFunctions> consumer)
      Passes the vkFuncs() field to the specified Consumer.
    • set

      public ktxVulkanDeviceInfo set(org.lwjgl.vulkan.VkInstance instance, org.lwjgl.vulkan.VkPhysicalDevice physicalDevice, org.lwjgl.vulkan.VkDevice device, org.lwjgl.vulkan.VkQueue queue, org.lwjgl.vulkan.VkCommandBuffer cmdBuffer, long cmdPool, @Nullable org.lwjgl.vulkan.VkAllocationCallbacks pAllocator, org.lwjgl.vulkan.VkPhysicalDeviceMemoryProperties deviceMemoryProperties, ktxVulkanFunctions vkFuncs)
      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 ktxVulkanDeviceInfo malloc()
      Returns a new ktxVulkanDeviceInfo instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static long ninstance(long struct)
      Unsafe version of instance().
    • nphysicalDevice

      public static long nphysicalDevice(long struct)
      Unsafe version of physicalDevice().
    • ndevice

      public static long ndevice(long struct)
      Unsafe version of device().
    • nqueue

      public static long nqueue(long struct)
      Unsafe version of queue().
    • ncmdBuffer

      public static long ncmdBuffer(long struct)
      Unsafe version of cmdBuffer().
    • ncmdPool

      public static long ncmdPool(long struct)
      Unsafe version of cmdPool().
    • npAllocator

      public static @Nullable org.lwjgl.vulkan.VkAllocationCallbacks npAllocator(long struct)
      Unsafe version of pAllocator().
    • ndeviceMemoryProperties

      public static org.lwjgl.vulkan.VkPhysicalDeviceMemoryProperties ndeviceMemoryProperties(long struct)
      Unsafe version of deviceMemoryProperties().
    • nvkFuncs

      public static ktxVulkanFunctions nvkFuncs(long struct)
      Unsafe version of vkFuncs().
    • ninstance

      public static void ninstance(long struct, org.lwjgl.vulkan.VkInstance value)
      Unsafe version of instance.
    • nphysicalDevice

      public static void nphysicalDevice(long struct, org.lwjgl.vulkan.VkPhysicalDevice value)
      Unsafe version of physicalDevice.
    • ndevice

      public static void ndevice(long struct, org.lwjgl.vulkan.VkDevice value)
      Unsafe version of device.
    • nqueue

      public static void nqueue(long struct, org.lwjgl.vulkan.VkQueue value)
      Unsafe version of queue.
    • ncmdBuffer

      public static void ncmdBuffer(long struct, org.lwjgl.vulkan.VkCommandBuffer value)
      Unsafe version of cmdBuffer.
    • ncmdPool

      public static void ncmdPool(long struct, long value)
      Unsafe version of cmdPool.
    • npAllocator

      public static void npAllocator(long struct, @Nullable org.lwjgl.vulkan.VkAllocationCallbacks value)
      Unsafe version of pAllocator.
    • ndeviceMemoryProperties

      public static void ndeviceMemoryProperties(long struct, org.lwjgl.vulkan.VkPhysicalDeviceMemoryProperties value)
      Unsafe version of deviceMemoryProperties.
    • nvkFuncs

      public static void nvkFuncs(long struct, ktxVulkanFunctions value)
      Unsafe version of vkFuncs.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate