Class VulkanUtils
java.lang.Object
io.codetoil.curved_spacetime.vulkan.utils.VulkanUtils
Helpers shared across the Vulkan modules.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe host operating systems distinguished bygetOS(). -
Method Summary
Modifier and TypeMethodDescriptionstatic VulkanUtils.OSTypegetOS()Identifies the host operating system.static voidThrows unless a Vulkan call succeeded.
-
Method Details
-
getOS
Identifies the host operating system.Used to decide whether the portability extensions apply, since Vulkan on macOS runs over MoltenVK rather than a conformant driver.
- Returns:
- the host operating system, or
VulkanUtils.OSType.OTHERif it is not recognised
-
vkCheck
Throws unless a Vulkan call succeeded.Every Vulkan entry point returns a
VkResult, and almost none of them are worth handling individually, so calls are wrapped in this instead. Anything other thanVK_SUCCESSraises anAssertionErrorcarrying the numeric result.- Parameters:
err- theVkResultreturned by the callerrMsg- a description of what was being attempted- Throws:
AssertionError- iferris anything other thanVK_SUCCESS
-