| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vulkan.Utils.VulkanContext
Description
Application-static Vulkan handles plus the recycle channel ends used by
the recycling Frame machinery.
Constructed once at boot, never modified. Sub-systems (swapchain, frame loop,
window loop) accept a VulkanContext so they don't need their own copies of
device/queues plumbing.
Synopsis
- data VulkanContext = VulkanContext {
- vcInstance :: Instance
- vcPhysicalDevice :: PhysicalDevice
- vcDevice :: Device
- vcQueues :: Queues (QueueFamilyIndex, Queue)
- vcRecycleBin :: RecycledResources -> IO ()
- vcRecycleNib :: IO (Either (IO RecycledResources) RecycledResources)
- data RecycledResources = RecycledResources {
- rrImageAvailable :: Semaphore
- rrCommandPool :: CommandPool
- mkVulkanContext :: Instance -> PhysicalDevice -> Device -> Queues (QueueFamilyIndex, Queue) -> IO VulkanContext
Documentation
data VulkanContext Source #
A bunch of long-lived handles that the application carries around. The
recycle channel ends carry per-frame RecycledResources between the frame
loop and the wait-and-recycle thread.
Constructors
| VulkanContext | |
Fields
| |
data RecycledResources Source #
The bits of state recycled between frames: a binary image-available semaphore (signalled by image acquisition, waited on by the frame's submit) and the command pool the frame's commands are recorded into.
The render-finished present-wait semaphore is not/ here — it is per
swapchain image (see sRenderFinished), because a
present-wait semaphore is only safe to reuse once its image is re-acquired,
not when the frame's render completes.
Constructors
| RecycledResources | |
Fields
| |
mkVulkanContext :: Instance -> PhysicalDevice -> Device -> Queues (QueueFamilyIndex, Queue) -> IO VulkanContext Source #
Assemble a VulkanContext from already-constructed handles. Builds the
recycle channel internally; the channel starts empty and is populated by
initialFrame.