Class VkApplicationInfo

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class VkApplicationInfo extends Struct<VkApplicationInfo> implements NativeResource
Structure specifying application information.
Description

Vulkan 1.0 implementations were required to return ERROR_INCOMPATIBLE_DRIVER if apiVersion was larger than 1.0. Implementations that support Vulkan 1.1 or later must not return ERROR_INCOMPATIBLE_DRIVER for any value of apiVersion .

Note

Because Vulkan 1.0 implementations may fail with ERROR_INCOMPATIBLE_DRIVER, applications should determine the version of Vulkan available before calling CreateInstance. If the GetInstanceProcAddr returns NULL for EnumerateInstanceVersion, it is a Vulkan 1.0 implementation. Otherwise, the application can call EnumerateInstanceVersion to determine the version of Vulkan.

As long as the instance supports at least Vulkan 1.1, an application can use different versions of Vulkan with an instance than it does with a device or physical device.

Note

The Khronos validation layers will treat apiVersion as the highest API version the application targets, and will validate API usage against the minimum of that version and the implementation version (instance or device, depending on context). If an application tries to use functionality from a greater version than this, a validation error will be triggered.

For example, if the instance supports Vulkan 1.1 and three physical devices support Vulkan 1.0, Vulkan 1.1, and Vulkan 1.2, respectively, and if the application sets apiVersion to 1.2, the application can use the following versions of Vulkan:

  • Vulkan 1.0 can be used with the instance and with all physical devices.
  • Vulkan 1.1 can be used with the instance and with the physical devices that support Vulkan 1.1 and Vulkan 1.2.
  • Vulkan 1.2 can be used with the physical device that supports Vulkan 1.2.

If we modify the above example so that the application sets apiVersion to 1.1, then the application must not use Vulkan 1.2 functionality on the physical device that supports Vulkan 1.2.

Note

Providing a NULL VkInstanceCreateInfo::pApplicationInfo or providing an apiVersion of 0 is equivalent to providing an apiVersion of VK_MAKE_API_VERSION(0,1,0,0).

Valid Usage
  • If apiVersion is not 0, then it must be greater than or equal to API_VERSION_1_0
Valid Usage (Implicit)
  • sType must be STRUCTURE_TYPE_APPLICATION_INFO
  • pNext must be NULL
  • If pApplicationName is not NULL, pApplicationName must be a null-terminated UTF-8 string
  • If pEngineName is not NULL, pEngineName must be a null-terminated UTF-8 string
See Also

VkInstanceCreateInfo

Layout


 struct VkApplicationInfo {
     VkStructureType sType();
     void const * pNext();
     char const * pApplicationName();
     uint32_t applicationVersion();
     char const * pEngineName();
     uint32_t engineVersion();
     uint32_t apiVersion();
 }
  • 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.
    • PAPPLICATIONNAME

      public static final int PAPPLICATIONNAME
      The struct member offsets.
    • APPLICATIONVERSION

      public static final int APPLICATIONVERSION
      The struct member offsets.
    • PENGINENAME

      public static final int PENGINENAME
      The struct member offsets.
    • ENGINEVERSION

      public static final int ENGINEVERSION
      The struct member offsets.
    • APIVERSION

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

    • VkApplicationInfo

      public VkApplicationInfo(ByteBuffer container)
      Creates a VkApplicationInfo 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()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<VkApplicationInfo>
    • sType

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

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

      @Nullable public ByteBuffer pApplicationName()
      NULL or is a pointer to a null-terminated UTF-8 string containing the name of the application.
    • pApplicationNameString

      @Nullable public String pApplicationNameString()
      NULL or is a pointer to a null-terminated UTF-8 string containing the name of the application.
    • applicationVersion

      public int applicationVersion()
      an unsigned integer variable containing the developer-supplied version number of the application.
    • pEngineName

      @Nullable public ByteBuffer pEngineName()
      NULL or is a pointer to a null-terminated UTF-8 string containing the name of the engine (if any) used to create the application.
    • pEngineNameString

      @Nullable public String pEngineNameString()
      NULL or is a pointer to a null-terminated UTF-8 string containing the name of the engine (if any) used to create the application.
    • engineVersion

      public int engineVersion()
      an unsigned integer variable containing the developer-supplied version number of the engine used to create the application.
    • apiVersion

      public int apiVersion()
      must be the highest version of Vulkan that the application is designed to use, encoded as described in Version Numbers. The patch version number specified in apiVersion is ignored when creating an instance object. The variant version of the instance must match that requested in apiVersion.
    • sType

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

      public VkApplicationInfo sType$Default()
      Sets the STRUCTURE_TYPE_APPLICATION_INFO value to the sType() field.
    • pNext

      public VkApplicationInfo pNext(long value)
      Sets the specified value to the pNext() field.
    • pApplicationName

      public VkApplicationInfo pApplicationName(@Nullable ByteBuffer value)
      Sets the address of the specified encoded string to the pApplicationName() field.
    • applicationVersion

      public VkApplicationInfo applicationVersion(int value)
      Sets the specified value to the applicationVersion() field.
    • pEngineName

      public VkApplicationInfo pEngineName(@Nullable ByteBuffer value)
      Sets the address of the specified encoded string to the pEngineName() field.
    • engineVersion

      public VkApplicationInfo engineVersion(int value)
      Sets the specified value to the engineVersion() field.
    • apiVersion

      public VkApplicationInfo apiVersion(int value)
      Sets the specified value to the apiVersion() field.
    • set

      public VkApplicationInfo set(int sType, long pNext, @Nullable ByteBuffer pApplicationName, int applicationVersion, @Nullable ByteBuffer pEngineName, int engineVersion, int apiVersion)
      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 VkApplicationInfo malloc()
      Returns a new VkApplicationInfo instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static VkApplicationInfo.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new VkApplicationInfo.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().
    • npApplicationName

      @Nullable public static ByteBuffer npApplicationName(long struct)
      Unsafe version of pApplicationName().
    • npApplicationNameString

      @Nullable public static String npApplicationNameString(long struct)
      Unsafe version of pApplicationNameString().
    • napplicationVersion

      public static int napplicationVersion(long struct)
      Unsafe version of applicationVersion().
    • npEngineName

      @Nullable public static ByteBuffer npEngineName(long struct)
      Unsafe version of pEngineName().
    • npEngineNameString

      @Nullable public static String npEngineNameString(long struct)
      Unsafe version of pEngineNameString().
    • nengineVersion

      public static int nengineVersion(long struct)
      Unsafe version of engineVersion().
    • napiVersion

      public static int napiVersion(long struct)
      Unsafe version of apiVersion().
    • 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.
    • npApplicationName

      public static void npApplicationName(long struct, @Nullable ByteBuffer value)
      Unsafe version of pApplicationName.
    • napplicationVersion

      public static void napplicationVersion(long struct, int value)
      Unsafe version of applicationVersion.
    • npEngineName

      public static void npEngineName(long struct, @Nullable ByteBuffer value)
      Unsafe version of pEngineName.
    • nengineVersion

      public static void nengineVersion(long struct, int value)
      Unsafe version of engineVersion.
    • napiVersion

      public static void napiVersion(long struct, int value)
      Unsafe version of apiVersion.