Package icyllis.modernui.core

# Class VulkanManager

java.lang.Object
icyllis.modernui.core.VulkanManager

All Implemented Interfaces:
  `AutoCloseable`

public final class VulkanManager extends Object implements AutoCloseable
This class contains the shared global Vulkan objects, such as VkInstance, VkDevice and VkQueue, which are re-used by CanvasContext. This class is created once and should be used by all vulkan windowing contexts. The VulkanManager must be initialized before use.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `@SharedPtr ImmediateContext`
  `createContext(ContextOptions options)`
  `static void`
  `freeFeaturesExtensionsStructs(org.lwjgl.vulkan.VkPhysicalDeviceFeatures2 features)`
  All Vulkan structs that could be part of the features chain will start with the structure type followed by the pNext pointer.
  `int`
  `getDriverVersion()`
  `static VulkanManager`
  `getInstance()`
  `void`
  `initialize()`
  Sets up the vulkan context that is shared among all clients of the VulkanManager.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### getInstance

    @NonNull public static VulkanManager getInstance()

  - ### initialize

    public void initialize()
    Sets up the vulkan context that is shared among all clients of the VulkanManager. This must be call once before use of the VulkanManager. Multiple calls after the first will simply return.

  - ### createContext

    @Nullable @SharedPtr public @SharedPtr ImmediateContext createContext(@NonNull ContextOptions options)

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`

  - ### getDriverVersion

    public int getDriverVersion()
    Returns:
      the vendor-specified version of the driver

  - ### freeFeaturesExtensionsStructs

    public static void freeFeaturesExtensionsStructs(@NonNull org.lwjgl.vulkan.VkPhysicalDeviceFeatures2 features)
    All Vulkan structs that could be part of the features chain will start with the structure type followed by the pNext pointer. We cast to the CommonVulkanHeader, so we can get access to the pNext for the next struct.

         struct CommonVulkanHeader {
                 VkStructureType sType;
                 void* pNext;
             };

    Parameters:
      `features` - the features whose chain structs to be freed