Class VulkanRenderModuleForwardRenderActivity

java.lang.Object
io.codetoil.curved_spacetime.render.vulkan.VulkanRenderModuleForwardRenderActivity

public class VulkanRenderModuleForwardRenderActivity extends Object
Forward rendering into the swap chain: a render pass, and the per-image resources that feed it.

Builds one framebuffer, command buffer, and fence per swap chain image, so consecutive frames do not contend for the same resources. The command buffers are recorded once up front, since the work is currently just a clear; anything view-dependent would have to be re-recorded per frame.

The fences start signalled so the first frame does not wait for work that never happened.

  • Constructor Details

    • VulkanRenderModuleForwardRenderActivity

      public VulkanRenderModuleForwardRenderActivity(VulkanRenderModuleSwapChain vulkanRenderModuleSwapChain, VulkanModuleCommandPool vulkanModuleCommandPool, Logger logger)
      Creates the render pass and per-image resources, and records the command buffers.
      Parameters:
      vulkanRenderModuleSwapChain - the swap chain whose images will be drawn into
      vulkanModuleCommandPool - the pool to allocate command buffers from
      logger - the logger to write render diagnostics to
      Throws:
      AssertionError - if any Vulkan object cannot be created or recorded
  • Method Details

    • cleanup

      public void cleanup()
      Destroys the framebuffers, render pass, command buffers, and fences.
    • waitForVulkanFence

      public void waitForVulkanFence()
      Blocks until the current frame's previously submitted work has finished.

      Called before reusing that frame's command buffer, so it is not re-recorded while still in flight.

    • submit

      public void submit(VulkanRenderModuleGraphicsQueue vulkanGraphicsQueue)
      Submits the current frame's command buffer to the given queue.
      Parameters:
      vulkanGraphicsQueue - the queue to submit the frame's work to