Class VkApplicationInfo

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

    public class VkApplicationInfo
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.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.

    Implicit layers must be disabled if they do not support a version at least as high as apiVersion. See the “Architecture of the Vulkan Loader Interfaces” document for additional information.

    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 Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • STYPE, PNEXT, PAPPLICATIONNAME, APPLICATIONVERSION, PENGINENAME, ENGINEVERSION, APIVERSION

        The struct member offsets.
    • Constructor Detail

      • VkApplicationInfo

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

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • sType

        public int sType()
        the type of this structure.
      • pNext

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

        @Nullable
        public java.nio.ByteBuffer pApplicationName()
        
        @Nullable
        public java.lang.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, pEngineNameString

        @Nullable
        public java.nio.ByteBuffer pEngineName()
        
        @Nullable
        public java.lang.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. Only the major and minor versions of the instance must match those requested in apiVersion.
      • pApplicationName

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

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

        public VkApplicationInfo set​(int sType,
                                     long pNext,
                                     @Nullable
                                     java.nio.ByteBuffer pApplicationName,
                                     int applicationVersion,
                                     @Nullable
                                     java.nio.ByteBuffer pEngineName,
                                     int engineVersion,
                                     int apiVersion)
        Initializes this struct with the specified values.
      • 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.
      • 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​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
      • callocStack

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

        public static VkApplicationInfo malloc​(org.lwjgl.system.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​(org.lwjgl.system.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,
                                                      org.lwjgl.system.MemoryStack stack)
        Returns a new VkApplicationInfo.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • calloc

        public static VkApplicationInfo.Buffer calloc​(int capacity,
                                                      org.lwjgl.system.MemoryStack stack)
        Returns a new VkApplicationInfo.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • 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 java.nio.ByteBuffer npApplicationName​(long struct)
        Unsafe version of pApplicationName().
      • npApplicationNameString

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

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

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

        @Nullable
        public static java.lang.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
                                             java.nio.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
                                        java.nio.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.