Class VulkanModuleVulkanInstance
java.lang.Object
io.codetoil.curved_spacetime.vulkan.VulkanModuleVulkanInstance
The Vulkan instance: the application's connection to the Vulkan loader, and the object every
physical device is enumerated from.
When validation is enabled in configuration, this also installs a debug messenger that routes the validation layers' output into the module's logger, so driver complaints appear alongside the program's own diagnostics. Validation degrades gracefully: the preferred Khronos layer is used if present, then a LunarG fallback, then a set of individual Google and LunarG layers, and if none are available validation is switched off with a warning rather than failing.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe prefix every message forwarded from the validation layers carries.protected org.lwjgl.vulkan.VkDebugUtilsMessengerCreateInfoEXTThe debug messenger's creation info, retained so it can be freed, ornullwhen validation is disabled.protected final LoggerThe logger this instance, and the validation layers, write to.static final intWhich severities the debug messenger reports: errors and warnings only.static final intWhich message kinds the debug messenger reports: general, validation, and performance.static final StringThe extension that lets non-conformant implementations, such as MoltenVK, be enumerated.static final StringThe preferred validation layer.static final StringThe validation layer to try whenVALIDATION_DEFAULTis unavailable.The individual layers to fall back on when neither combined validation layer is available.protected longThe debug messenger handle, orVK_NULL_HANDLEwhen validation is disabled.protected org.lwjgl.vulkan.VkInstanceThe underlying Vulkan instance. -
Constructor Summary
ConstructorsConstructorDescriptionVulkanModuleVulkanInstance(VulkanModuleEntrypoint vulkanModuleEntrypoint, Logger logger) Creates the Vulkan instance, enabling validation if configuration asks for it and the layers are available. -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Destroys the debug messenger, if any, and then the instance.org.lwjgl.vulkan.VkInstanceReturns the underlying Vulkan instance.
-
Field Details
-
MESSAGE_SEVERITY_BITMASK
public static final int MESSAGE_SEVERITY_BITMASKWhich severities the debug messenger reports: errors and warnings only.- See Also:
-
MESSAGE_TYPE_BITMASK
public static final int MESSAGE_TYPE_BITMASKWhich message kinds the debug messenger reports: general, validation, and performance.- See Also:
-
VALIDATION_DEFAULT
-
VALIDATION_FALLBACK1
The validation layer to try whenVALIDATION_DEFAULTis unavailable.- See Also:
-
VALIDATION_FALLBACK2
-
PORTABILITY_EXTENSION
The extension that lets non-conformant implementations, such as MoltenVK, be enumerated.- See Also:
-
DBG_CALLBACK_PREF
The prefix every message forwarded from the validation layers carries.- See Also:
-
logger
The logger this instance, and the validation layers, write to. -
vkInstance
protected org.lwjgl.vulkan.VkInstance vkInstanceThe underlying Vulkan instance. -
debugUtils
protected org.lwjgl.vulkan.VkDebugUtilsMessengerCreateInfoEXT debugUtilsThe debug messenger's creation info, retained so it can be freed, ornullwhen validation is disabled. -
vkDebugHandle
protected long vkDebugHandleThe debug messenger handle, orVK_NULL_HANDLEwhen validation is disabled.
-
-
Constructor Details
-
VulkanModuleVulkanInstance
Creates the Vulkan instance, enabling validation if configuration asks for it and the layers are available.- Parameters:
vulkanModuleEntrypoint- the entrypoint supplying the Vulkan module's configurationlogger- the logger to write instance and validation output to- Throws:
AssertionError- if the instance or the debug messenger cannot be created
-
-
Method Details
-
cleanup
public void cleanup()Destroys the debug messenger, if any, and then the instance. -
getVkInstance
public org.lwjgl.vulkan.VkInstance getVkInstance()Returns the underlying Vulkan instance.- Returns:
- the
VkInstance
-