module Data.SpirV.Reflect.Traits where

import Data.Vector.Storable qualified as Storable
import Data.Word (Word32)
import GHC.Generics (Generic)

import Data.SpirV.Reflect.Enums qualified as Enums

data Numeric = Numeric
  { Numeric -> Scalar
scalar :: Scalar
  , Numeric -> Vector
vector :: Vector
  , Numeric -> Matrix
matrix :: Matrix
  }
  deriving (Numeric -> Numeric -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Numeric -> Numeric -> Bool
$c/= :: Numeric -> Numeric -> Bool
== :: Numeric -> Numeric -> Bool
$c== :: Numeric -> Numeric -> Bool
Eq, Eq Numeric
Numeric -> Numeric -> Bool
Numeric -> Numeric -> Ordering
Numeric -> Numeric -> Numeric
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Numeric -> Numeric -> Numeric
$cmin :: Numeric -> Numeric -> Numeric
max :: Numeric -> Numeric -> Numeric
$cmax :: Numeric -> Numeric -> Numeric
>= :: Numeric -> Numeric -> Bool
$c>= :: Numeric -> Numeric -> Bool
> :: Numeric -> Numeric -> Bool
$c> :: Numeric -> Numeric -> Bool
<= :: Numeric -> Numeric -> Bool
$c<= :: Numeric -> Numeric -> Bool
< :: Numeric -> Numeric -> Bool
$c< :: Numeric -> Numeric -> Bool
compare :: Numeric -> Numeric -> Ordering
$ccompare :: Numeric -> Numeric -> Ordering
Ord, Int -> Numeric -> ShowS
[Numeric] -> ShowS
Numeric -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Numeric] -> ShowS
$cshowList :: [Numeric] -> ShowS
show :: Numeric -> String
$cshow :: Numeric -> String
showsPrec :: Int -> Numeric -> ShowS
$cshowsPrec :: Int -> Numeric -> ShowS
Show, forall x. Rep Numeric x -> Numeric
forall x. Numeric -> Rep Numeric x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Numeric x -> Numeric
$cfrom :: forall x. Numeric -> Rep Numeric x
Generic)

data Scalar = Scalar
  { Scalar -> Word32
width      :: Word32
  , Scalar -> Word32
signedness :: Word32
  }
  deriving (Scalar -> Scalar -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Scalar -> Scalar -> Bool
$c/= :: Scalar -> Scalar -> Bool
== :: Scalar -> Scalar -> Bool
$c== :: Scalar -> Scalar -> Bool
Eq, Eq Scalar
Scalar -> Scalar -> Bool
Scalar -> Scalar -> Ordering
Scalar -> Scalar -> Scalar
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Scalar -> Scalar -> Scalar
$cmin :: Scalar -> Scalar -> Scalar
max :: Scalar -> Scalar -> Scalar
$cmax :: Scalar -> Scalar -> Scalar
>= :: Scalar -> Scalar -> Bool
$c>= :: Scalar -> Scalar -> Bool
> :: Scalar -> Scalar -> Bool
$c> :: Scalar -> Scalar -> Bool
<= :: Scalar -> Scalar -> Bool
$c<= :: Scalar -> Scalar -> Bool
< :: Scalar -> Scalar -> Bool
$c< :: Scalar -> Scalar -> Bool
compare :: Scalar -> Scalar -> Ordering
$ccompare :: Scalar -> Scalar -> Ordering
Ord, Int -> Scalar -> ShowS
[Scalar] -> ShowS
Scalar -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Scalar] -> ShowS
$cshowList :: [Scalar] -> ShowS
show :: Scalar -> String
$cshow :: Scalar -> String
showsPrec :: Int -> Scalar -> ShowS
$cshowsPrec :: Int -> Scalar -> ShowS
Show, forall x. Rep Scalar x -> Scalar
forall x. Scalar -> Rep Scalar x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Scalar x -> Scalar
$cfrom :: forall x. Scalar -> Rep Scalar x
Generic)

data Vector = Vector
  { Vector -> Word32
component_count :: Word32
  }
  deriving (Vector -> Vector -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Vector -> Vector -> Bool
$c/= :: Vector -> Vector -> Bool
== :: Vector -> Vector -> Bool
$c== :: Vector -> Vector -> Bool
Eq, Eq Vector
Vector -> Vector -> Bool
Vector -> Vector -> Ordering
Vector -> Vector -> Vector
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Vector -> Vector -> Vector
$cmin :: Vector -> Vector -> Vector
max :: Vector -> Vector -> Vector
$cmax :: Vector -> Vector -> Vector
>= :: Vector -> Vector -> Bool
$c>= :: Vector -> Vector -> Bool
> :: Vector -> Vector -> Bool
$c> :: Vector -> Vector -> Bool
<= :: Vector -> Vector -> Bool
$c<= :: Vector -> Vector -> Bool
< :: Vector -> Vector -> Bool
$c< :: Vector -> Vector -> Bool
compare :: Vector -> Vector -> Ordering
$ccompare :: Vector -> Vector -> Ordering
Ord, Int -> Vector -> ShowS
[Vector] -> ShowS
Vector -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Vector] -> ShowS
$cshowList :: [Vector] -> ShowS
show :: Vector -> String
$cshow :: Vector -> String
showsPrec :: Int -> Vector -> ShowS
$cshowsPrec :: Int -> Vector -> ShowS
Show, forall x. Rep Vector x -> Vector
forall x. Vector -> Rep Vector x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Vector x -> Vector
$cfrom :: forall x. Vector -> Rep Vector x
Generic)

data Matrix = Matrix
  { Matrix -> Word32
column_count :: Word32
  , Matrix -> Word32
row_count    :: Word32
  , Matrix -> Word32
stride       :: Word32 -- ^ Measured in bytes
  }
  deriving (Matrix -> Matrix -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Matrix -> Matrix -> Bool
$c/= :: Matrix -> Matrix -> Bool
== :: Matrix -> Matrix -> Bool
$c== :: Matrix -> Matrix -> Bool
Eq, Eq Matrix
Matrix -> Matrix -> Bool
Matrix -> Matrix -> Ordering
Matrix -> Matrix -> Matrix
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Matrix -> Matrix -> Matrix
$cmin :: Matrix -> Matrix -> Matrix
max :: Matrix -> Matrix -> Matrix
$cmax :: Matrix -> Matrix -> Matrix
>= :: Matrix -> Matrix -> Bool
$c>= :: Matrix -> Matrix -> Bool
> :: Matrix -> Matrix -> Bool
$c> :: Matrix -> Matrix -> Bool
<= :: Matrix -> Matrix -> Bool
$c<= :: Matrix -> Matrix -> Bool
< :: Matrix -> Matrix -> Bool
$c< :: Matrix -> Matrix -> Bool
compare :: Matrix -> Matrix -> Ordering
$ccompare :: Matrix -> Matrix -> Ordering
Ord, Int -> Matrix -> ShowS
[Matrix] -> ShowS
Matrix -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Matrix] -> ShowS
$cshowList :: [Matrix] -> ShowS
show :: Matrix -> String
$cshow :: Matrix -> String
showsPrec :: Int -> Matrix -> ShowS
$cshowsPrec :: Int -> Matrix -> ShowS
Show, forall x. Rep Matrix x -> Matrix
forall x. Matrix -> Rep Matrix x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Matrix x -> Matrix
$cfrom :: forall x. Matrix -> Rep Matrix x
Generic)

data Array = Array
  { Array -> Word32
dims_count :: Word32
  , Array -> Vector Word32
dims       :: Storable.Vector Word32
  , Array -> Maybe Word32
stride     :: Maybe Word32
  }
  deriving (Array -> Array -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Array -> Array -> Bool
$c/= :: Array -> Array -> Bool
== :: Array -> Array -> Bool
$c== :: Array -> Array -> Bool
Eq, Eq Array
Array -> Array -> Bool
Array -> Array -> Ordering
Array -> Array -> Array
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Array -> Array -> Array
$cmin :: Array -> Array -> Array
max :: Array -> Array -> Array
$cmax :: Array -> Array -> Array
>= :: Array -> Array -> Bool
$c>= :: Array -> Array -> Bool
> :: Array -> Array -> Bool
$c> :: Array -> Array -> Bool
<= :: Array -> Array -> Bool
$c<= :: Array -> Array -> Bool
< :: Array -> Array -> Bool
$c< :: Array -> Array -> Bool
compare :: Array -> Array -> Ordering
$ccompare :: Array -> Array -> Ordering
Ord, Int -> Array -> ShowS
[Array] -> ShowS
Array -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Array] -> ShowS
$cshowList :: [Array] -> ShowS
show :: Array -> String
$cshow :: Array -> String
showsPrec :: Int -> Array -> ShowS
$cshowsPrec :: Int -> Array -> ShowS
Show, forall x. Rep Array x -> Array
forall x. Array -> Rep Array x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Array x -> Array
$cfrom :: forall x. Array -> Rep Array x
Generic)

data Image = Image
  { Image -> Dim
dim          :: Enums.Dim
  , Image -> Word32
depth        :: Word32
  , Image -> Word32
arrayed      :: Word32
  , Image -> Word32
ms           :: Word32 -- ^ 0: single-sampled, 1: multisampled
  , Image -> Word32
sampled      :: Word32
  , Image -> ImageFormat
image_format :: Enums.ImageFormat
  }
  deriving (Image -> Image -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Image -> Image -> Bool
$c/= :: Image -> Image -> Bool
== :: Image -> Image -> Bool
$c== :: Image -> Image -> Bool
Eq, Eq Image
Image -> Image -> Bool
Image -> Image -> Ordering
Image -> Image -> Image
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Image -> Image -> Image
$cmin :: Image -> Image -> Image
max :: Image -> Image -> Image
$cmax :: Image -> Image -> Image
>= :: Image -> Image -> Bool
$c>= :: Image -> Image -> Bool
> :: Image -> Image -> Bool
$c> :: Image -> Image -> Bool
<= :: Image -> Image -> Bool
$c<= :: Image -> Image -> Bool
< :: Image -> Image -> Bool
$c< :: Image -> Image -> Bool
compare :: Image -> Image -> Ordering
$ccompare :: Image -> Image -> Ordering
Ord, Int -> Image -> ShowS
[Image] -> ShowS
Image -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Image] -> ShowS
$cshowList :: [Image] -> ShowS
show :: Image -> String
$cshow :: Image -> String
showsPrec :: Int -> Image -> ShowS
$cshowsPrec :: Int -> Image -> ShowS
Show, forall x. Rep Image x -> Image
forall x. Image -> Rep Image x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Image x -> Image
$cfrom :: forall x. Image -> Rep Image x
Generic)