Package icyllis.modernui.core
Class VulkanManager
java.lang.Object
icyllis.modernui.core.VulkanManager
- All Implemented Interfaces:
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 TypeMethodDescriptionvoid
close()
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
static VulkanManager
void
Sets up the vulkan context that is shared among all clients of the VulkanManager.
-
Method Details
-
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 interfaceAutoCloseable
-
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
-