Class VulkanModuleLogicalDevice

java.lang.Object
io.codetoil.curved_spacetime.vulkan.VulkanModuleLogicalDevice

public class VulkanModuleLogicalDevice extends Object
A Vulkan logical device: the application's connection to a selected physical device.

Almost every other Vulkan object is created against a logical device, so this is the handle the rest of the renderer is built on. Every queue family the physical device reports is enabled, so that callers can retrieve whichever queue they need without the device having to be recreated.

On macOS the portability subset extension is enabled when present, which is what allows Vulkan to run there over MoltenVK.

  • Constructor Details

    • VulkanModuleLogicalDevice

      public VulkanModuleLogicalDevice(VulkanModulePhysicalDevice vulkanModulePhysicalDevice, Logger logger)
      Creates a logical device against the selected physical device.
      Parameters:
      vulkanModulePhysicalDevice - the physical device to open
      logger - the logger to write device diagnostics to
      Throws:
      AssertionError - if the device cannot be created
  • Method Details

    • cleanup

      public void cleanup()
      Destroys the device.

      Everything created against this device must already have been destroyed, and the device should be idle — see waitIdle().

    • getPhysicalDevice

      public VulkanModulePhysicalDevice getPhysicalDevice()
      Returns the physical device this logical device was created against.
      Returns:
      the underlying physical device
    • getVkDevice

      public org.lwjgl.vulkan.VkDevice getVkDevice()
      Returns the underlying Vulkan device.
      Returns:
      the VkDevice
    • waitIdle

      public void waitIdle()
      Blocks until every queue on this device has finished its outstanding work.