HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Modulevulkan-utils-0.5.11.0Haskell2010

Vulkan.Utils.Queues

A common physical-device + logical-device boot recipe: pick a device that exposes a graphicscomputetransfer queue triple (with the graphics family also presenting, when a surface is supplied), then create a logical device with one Queue allocated per slot.

This is the wheel every "draw a thing in Vulkan" application reinvents. The recipe here is opinionated:

  • The graphics slot doubles as the present queue.

  • The compute slot prefers a compute-only queue family (async compute); falls back to aliasing the graphics family.

  • The transfer slot prefers a transfer-only queue family (DMA-only hardware queue); falls back to aliasing the compute family.

  • Priorities are 1.0 0.5 0.2 for graphics compute transfer.

When two slots target the same family, two distinct Queue handles are still allocated within that shared family with the requested priorities.

If you need a different shape (compute-only, multiple graphics queues, custom priorities, …) reach for the lower-level assignQueues directly.

  • 1 type
  • 1 value
datadata Queues a
#

The GCT queue kit. Parametric in the slot contents so the same shape can carry priorities (Float), family indices (QueueFamilyIndex), queue specs (QueueSpec), or fully-resolved (QueueFamilyIndex, Queue) pairs.

Constructors

  • Queues
    • qGraphics :: a

      graphics + present, priority 1.0

    • qCompute :: a

      compute (prefers compute-only family), priority 0.5

    • qTransfer :: a

      transfer (prefers transfer-only family), priority 0.2

Instances5Functor, Applicative, Foldable, Traversable, Show
  • Functor QueuesDefined in vulkan-utils-0.5.11.0 · Vulkan.Utils.Queues
  • Applicative QueuesDefined in vulkan-utils-0.5.11.0 · Vulkan.Utils.Queues

    Elementwise zip — handy for combining priorities with family predicates.

  • Foldable QueuesDefined in vulkan-utils-0.5.11.0 · Vulkan.Utils.Queues
  • Traversable QueuesDefined in vulkan-utils-0.5.11.0 · Vulkan.Utils.Queues
  • Show a => Show (Queues a)Defined in vulkan-utils-0.5.11.0 · Vulkan.Utils.Queues

Pick a physical device that has the queue families needed for the caller, then create a logical device exposing one queue per GCT slot. Devices are scored by total memory.

Pass Just surface for windowed callers — the graphics family must also support presentation. Pass Nothing for headless callers — any graphics family will do.

Pass any extra device requirements (extensions, features, API version) in the third argument; they are forwarded to allocateDeviceFromRequirements.

Fails (via MonadFail) when no physical device satisfies the family requirements.