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 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

    • 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