Class VulkanUtils

java.lang.Object
io.codetoil.curved_spacetime.vulkan.utils.VulkanUtils

public class VulkanUtils extends Object
Helpers shared across the Vulkan modules.
  • Method Details

    • getOS

      public static VulkanUtils.OSType 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.OTHER if it is not recognised
    • vkCheck

      public static void vkCheck(int err, String errMsg)
      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 than VK_SUCCESS raises an AssertionError carrying the numeric result.

      Parameters:
      err - the VkResult returned by the call
      errMsg - a description of what was being attempted
      Throws:
      AssertionError - if err is anything other than VK_SUCCESS