| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Vulkan.Utils.Swapchain
Description
Swapchain creation, recreation, and the small helper for catching swapchain-out-of-date exceptions thrown elsewhere.
Opinionated choices (storage-image usage, FIFO_RELAXED preference, surface
format selection) are exposed via SwapchainConfig. defaultSwapchainConfig
gives a color-attachment-only swapchain prefering FIFO_RELAXED then FIFO;
compute-shader callers add IMAGE_USAGE_STORAGE_BIT etc.
Synopsis
- data Swapchain = Swapchain {
- sSwapchain :: SwapchainKHR
- sSurface :: SurfaceKHR
- sFormat :: SurfaceFormatKHR
- sExtent :: Extent2D
- sPresentMode :: PresentModeKHR
- sImages :: Vector Image
- sImageViews :: Vector ImageView
- sRenderFinished :: Vector Semaphore
- sRelease :: RefCounted
- sConfig :: SwapchainConfig
- data SwapchainConfig = SwapchainConfig {
- scRequiredUsageFlags :: [ImageUsageFlagBits]
- scRequiredFormatFeatures :: [FormatFeatureFlagBits]
- scDesiredPresentModes :: [PresentModeKHR]
- scSurfaceFormatPreferences :: [SurfaceFormatKHR -> Bool]
- defaultSwapchainConfig :: SwapchainConfig
- allocateSwapchain :: MonadResource m => PhysicalDevice -> Device -> SwapchainConfig -> SwapchainKHR -> Extent2D -> SurfaceKHR -> m Swapchain
- recreateSwapchain :: MonadResource m => PhysicalDevice -> Device -> Extent2D -> Swapchain -> m Swapchain
- threwSwapchainError :: IO b -> IO Bool
Documentation
Constructors
| Swapchain | |
Fields
| |
Instances
data SwapchainConfig Source #
Opinionated knobs for swapchain creation. Use defaultSwapchainConfig as
a starting point and override the bits you care about.
Constructors
| SwapchainConfig | |
Fields
| |
Instances
| Generic SwapchainConfig Source # | |||||
Defined in Vulkan.Utils.Swapchain Associated Types
Methods from :: SwapchainConfig -> Rep SwapchainConfig x # to :: Rep SwapchainConfig x -> SwapchainConfig # | |||||
| type Rep SwapchainConfig Source # | |||||
Defined in Vulkan.Utils.Swapchain type Rep SwapchainConfig = D1 ('MetaData "SwapchainConfig" "Vulkan.Utils.Swapchain" "vulkan-utils-0.5.11.0-inplace" 'False) (C1 ('MetaCons "SwapchainConfig" 'PrefixI 'True) ((S1 ('MetaSel ('Just "scRequiredUsageFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [ImageUsageFlagBits]) :*: S1 ('MetaSel ('Just "scRequiredFormatFeatures") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [FormatFeatureFlagBits])) :*: (S1 ('MetaSel ('Just "scDesiredPresentModes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [PresentModeKHR]) :*: S1 ('MetaSel ('Just "scSurfaceFormatPreferences") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [SurfaceFormatKHR -> Bool])))) | |||||
Arguments
| :: MonadResource m | |
| => PhysicalDevice | |
| -> Device | |
| -> SwapchainConfig | |
| -> SwapchainKHR | Previous swapchain ( |
| -> Extent2D | Fallback size when the surface lets us pick |
| -> SurfaceKHR | |
| -> m Swapchain |
Allocate a new swapchain plus its image views.
Arguments
| :: MonadResource m | |
| => PhysicalDevice | |
| -> Device | |
| -> Extent2D | New window size |
| -> Swapchain | |
| -> m Swapchain |
Build a new swapchain at a new size, dropping the reference to the old one so its resources can be released once in-flight frames complete.