Class VulkanCommandPoolHandler
java.lang.Object
com.io7m.jcoronado.utility.command_pools.VulkanCommandPoolHandler
- All Implemented Interfaces:
AutoCloseable
A command-pool handler that provides per-frame command pools and enforces a
correct reset and free discipline for command buffers.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA command pool frame. -
Method Summary
Modifier and TypeMethodDescriptionbeginFrame(int frameIndex) Begin a frame.voidclose()static VulkanCommandPoolHandlercreate(VulkanLogicalDeviceType device, Function<Integer, String> poolNamer, Set<VulkanCommandPoolCreateFlag> poolFlags, VulkanQueueFamilyIndex poolQueueIndex, int framesInFlight) Create a new pool handler.
-
Method Details
-
create
public static VulkanCommandPoolHandler create(VulkanLogicalDeviceType device, Function<Integer, String> poolNamer, Set<VulkanCommandPoolCreateFlag> poolFlags, VulkanQueueFamilyIndex poolQueueIndex, int framesInFlight) throws VulkanExceptionCreate a new pool handler.- Parameters:
device- The devicepoolNamer- A function that returns a pool name given a frame indexpoolFlags- The pool creation flagspoolQueueIndex- The pool queue indexframesInFlight- The number of frames in flight- Returns:
- The pool handler
- Throws:
VulkanException- On errors
-
beginFrame
public VulkanCommandPoolHandler.VulkanPoolFrameType beginFrame(int frameIndex) throws VulkanException Begin a frame. This will reset the command pool and free any unused command buffers.- Parameters:
frameIndex- The frame index- Returns:
- The frame
- Throws:
VulkanException- On errors
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
VulkanException
-