module Data.SpirV.Reflect.DescriptorBinding
  ( DescriptorBinding(..)
  , WordOffset(..)
  ) where

import Data.Text (Text)
import Data.Word (Word32)
import GHC.Generics (Generic)

import Data.SpirV.Reflect.BlockVariable (BlockVariable)
import Data.SpirV.Reflect.Enums qualified as Enums
import Data.SpirV.Reflect.Traits qualified as Traits
import Data.SpirV.Reflect.TypeDescription (TypeDescription)

data DescriptorBinding = DescriptorBinding
  { DescriptorBinding -> Maybe Word32
spirv_id               :: Maybe Word32
  , DescriptorBinding -> Text
name                   :: Text
  , DescriptorBinding -> Word32
binding                :: Word32
  , DescriptorBinding -> Word32
input_attachment_index :: Word32
  , DescriptorBinding -> Word32
set                    :: Word32
  , DescriptorBinding -> DescriptorType
descriptor_type        :: Enums.DescriptorType
  , DescriptorBinding -> ResourceFlags
resource_type          :: Enums.ResourceFlags
  , DescriptorBinding -> Image
image                  :: Traits.Image
  , DescriptorBinding -> BlockVariable
block                  :: BlockVariable
  , DescriptorBinding -> Array
array                  :: Traits.Array
  , DescriptorBinding -> Maybe Word32
count                  :: Maybe Word32
  , DescriptorBinding -> Word32
accessed               :: Word32
  , DescriptorBinding -> Word32
uav_counter_id         :: Word32
  , DescriptorBinding -> Maybe DescriptorBinding
uav_counter_binding    :: Maybe DescriptorBinding
  , DescriptorBinding -> Maybe TypeDescription
type_description       :: Maybe TypeDescription
  , DescriptorBinding -> WordOffset
word_offset            :: WordOffset
  , DescriptorBinding -> DecorationFlags
decoration_flags       :: Enums.DecorationFlags
  }
  deriving (DescriptorBinding -> DescriptorBinding -> Bool
(DescriptorBinding -> DescriptorBinding -> Bool)
-> (DescriptorBinding -> DescriptorBinding -> Bool)
-> Eq DescriptorBinding
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescriptorBinding -> DescriptorBinding -> Bool
$c/= :: DescriptorBinding -> DescriptorBinding -> Bool
== :: DescriptorBinding -> DescriptorBinding -> Bool
$c== :: DescriptorBinding -> DescriptorBinding -> Bool
Eq, Int -> DescriptorBinding -> ShowS
[DescriptorBinding] -> ShowS
DescriptorBinding -> String
(Int -> DescriptorBinding -> ShowS)
-> (DescriptorBinding -> String)
-> ([DescriptorBinding] -> ShowS)
-> Show DescriptorBinding
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescriptorBinding] -> ShowS
$cshowList :: [DescriptorBinding] -> ShowS
show :: DescriptorBinding -> String
$cshow :: DescriptorBinding -> String
showsPrec :: Int -> DescriptorBinding -> ShowS
$cshowsPrec :: Int -> DescriptorBinding -> ShowS
Show, (forall x. DescriptorBinding -> Rep DescriptorBinding x)
-> (forall x. Rep DescriptorBinding x -> DescriptorBinding)
-> Generic DescriptorBinding
forall x. Rep DescriptorBinding x -> DescriptorBinding
forall x. DescriptorBinding -> Rep DescriptorBinding x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescriptorBinding x -> DescriptorBinding
$cfrom :: forall x. DescriptorBinding -> Rep DescriptorBinding x
Generic)

data WordOffset = WordOffset
  { WordOffset -> Word32
binding :: Word32
  , WordOffset -> Word32
set     :: Word32
  }
  deriving (WordOffset -> WordOffset -> Bool
(WordOffset -> WordOffset -> Bool)
-> (WordOffset -> WordOffset -> Bool) -> Eq WordOffset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WordOffset -> WordOffset -> Bool
$c/= :: WordOffset -> WordOffset -> Bool
== :: WordOffset -> WordOffset -> Bool
$c== :: WordOffset -> WordOffset -> Bool
Eq, Int -> WordOffset -> ShowS
[WordOffset] -> ShowS
WordOffset -> String
(Int -> WordOffset -> ShowS)
-> (WordOffset -> String)
-> ([WordOffset] -> ShowS)
-> Show WordOffset
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WordOffset] -> ShowS
$cshowList :: [WordOffset] -> ShowS
show :: WordOffset -> String
$cshow :: WordOffset -> String
showsPrec :: Int -> WordOffset -> ShowS
$cshowsPrec :: Int -> WordOffset -> ShowS
Show, (forall x. WordOffset -> Rep WordOffset x)
-> (forall x. Rep WordOffset x -> WordOffset) -> Generic WordOffset
forall x. Rep WordOffset x -> WordOffset
forall x. WordOffset -> Rep WordOffset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WordOffset x -> WordOffset
$cfrom :: forall x. WordOffset -> Rep WordOffset x
Generic)