{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE ScopedTypeVariables, TypeApplications #-}
{-# LANGUAGE MonoLocalBinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE KindSignatures, TypeOperators #-}
{-# LANGUAGE PatternSynonyms #-}
{-# OPTIONS_GHC -Wall -fno-warn-tabs #-}
module Gpu.Vulkan.Attachment (
Description(..), DescriptionListToMiddle(..),
M.Reference(..), M.A,
module Gpu.Vulkan.Attachment.Enum
) where
import qualified Data.HeteroParList as HeteroParList
import Data.HeteroParList (pattern (:**))
import Gpu.Vulkan.Attachment.Enum
import qualified Gpu.Vulkan.TypeEnum as T
import qualified Gpu.Vulkan.Sample.Enum as Sample
import qualified Gpu.Vulkan.Image.Enum as Image
import Gpu.Vulkan.Attachment.Middle qualified as M
data Description (fmt :: T.Format) = Description {
forall (fmt :: Format). Description fmt -> DescriptionFlags
descriptionFlags :: DescriptionFlags,
forall (fmt :: Format). Description fmt -> CountFlagBits
descriptionSamples :: Sample.CountFlagBits,
forall (fmt :: Format). Description fmt -> LoadOp
descriptionLoadOp :: LoadOp,
forall (fmt :: Format). Description fmt -> StoreOp
descriptionStoreOp :: StoreOp,
forall (fmt :: Format). Description fmt -> LoadOp
descriptionStencilLoadOp :: LoadOp,
forall (fmt :: Format). Description fmt -> StoreOp
descriptionStencilStoreOp :: StoreOp,
forall (fmt :: Format). Description fmt -> Layout
descriptionInitialLayout :: Image.Layout,
forall (fmt :: Format). Description fmt -> Layout
descriptionFinalLayout :: Image.Layout }
deriving Int -> Description fmt -> ShowS
[Description fmt] -> ShowS
Description fmt -> String
(Int -> Description fmt -> ShowS)
-> (Description fmt -> String)
-> ([Description fmt] -> ShowS)
-> Show (Description fmt)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall (fmt :: Format). Int -> Description fmt -> ShowS
forall (fmt :: Format). [Description fmt] -> ShowS
forall (fmt :: Format). Description fmt -> String
$cshowsPrec :: forall (fmt :: Format). Int -> Description fmt -> ShowS
showsPrec :: Int -> Description fmt -> ShowS
$cshow :: forall (fmt :: Format). Description fmt -> String
show :: Description fmt -> String
$cshowList :: forall (fmt :: Format). [Description fmt] -> ShowS
showList :: [Description fmt] -> ShowS
Show
class DescriptionListToMiddle fmts where
descriptionListToMiddle ::
HeteroParList.PL Description fmts -> [M.Description]
instance DescriptionListToMiddle '[] where descriptionListToMiddle :: PL Description '[] -> [Description]
descriptionListToMiddle PL Description '[]
HeteroParList.Nil = []
instance (T.FormatToValue fmt, DescriptionListToMiddle fmts) =>
DescriptionListToMiddle (fmt ': fmts) where
descriptionListToMiddle :: PL Description (fmt : fmts) -> [Description]
descriptionListToMiddle (Description s
d :** PL Description ss1
ds) =
Description s -> Description
forall (fmt :: Format).
FormatToValue fmt =>
Description fmt -> Description
descriptionToMiddle Description s
d Description -> [Description] -> [Description]
forall a. a -> [a] -> [a]
: PL Description ss1 -> [Description]
forall (fmts :: [Format]).
DescriptionListToMiddle fmts =>
PL Description fmts -> [Description]
descriptionListToMiddle PL Description ss1
ds
descriptionToMiddle :: forall fmt . T.FormatToValue fmt => Description fmt -> M.Description
descriptionToMiddle :: forall (fmt :: Format).
FormatToValue fmt =>
Description fmt -> Description
descriptionToMiddle Description {
descriptionFlags :: forall (fmt :: Format). Description fmt -> DescriptionFlags
descriptionFlags = DescriptionFlags
flgs,
descriptionSamples :: forall (fmt :: Format). Description fmt -> CountFlagBits
descriptionSamples = CountFlagBits
smpls,
descriptionLoadOp :: forall (fmt :: Format). Description fmt -> LoadOp
descriptionLoadOp = LoadOp
lop,
descriptionStoreOp :: forall (fmt :: Format). Description fmt -> StoreOp
descriptionStoreOp = StoreOp
sop,
descriptionStencilLoadOp :: forall (fmt :: Format). Description fmt -> LoadOp
descriptionStencilLoadOp = LoadOp
slop,
descriptionStencilStoreOp :: forall (fmt :: Format). Description fmt -> StoreOp
descriptionStencilStoreOp = StoreOp
ssop,
descriptionInitialLayout :: forall (fmt :: Format). Description fmt -> Layout
descriptionInitialLayout = Layout
ilyt,
descriptionFinalLayout :: forall (fmt :: Format). Description fmt -> Layout
descriptionFinalLayout = Layout
flyt
} = M.Description {
descriptionFlags :: DescriptionFlags
M.descriptionFlags = DescriptionFlags
flgs,
descriptionFormat :: Format
M.descriptionFormat = forall (t :: Format). FormatToValue t => Format
T.formatToValue @fmt,
descriptionSamples :: CountFlagBits
M.descriptionSamples = CountFlagBits
smpls,
descriptionLoadOp :: LoadOp
M.descriptionLoadOp = LoadOp
lop,
descriptionStoreOp :: StoreOp
M.descriptionStoreOp = StoreOp
sop,
descriptionStencilLoadOp :: LoadOp
M.descriptionStencilLoadOp = LoadOp
slop,
descriptionStencilStoreOp :: StoreOp
M.descriptionStencilStoreOp = StoreOp
ssop,
descriptionInitialLayout :: Layout
M.descriptionInitialLayout = Layout
ilyt,
descriptionFinalLayout :: Layout
M.descriptionFinalLayout = Layout
flyt }