{-# language CPP #-}
module Vulkan.Core12.Promoted_From_VK_EXT_sampler_filter_minmax ( PhysicalDeviceSamplerFilterMinmaxProperties(..)
, SamplerReductionModeCreateInfo(..)
, StructureType(..)
, FormatFeatureFlagBits(..)
, FormatFeatureFlags
, SamplerReductionMode(..)
) where
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import Foreign.Ptr (Ptr)
import Data.Kind (Type)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core12.Enums.SamplerReductionMode (SamplerReductionMode)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO))
import Vulkan.Core10.Enums.FormatFeatureFlagBits (FormatFeatureFlagBits(..))
import Vulkan.Core10.Enums.FormatFeatureFlagBits (FormatFeatureFlags)
import Vulkan.Core12.Enums.SamplerReductionMode (SamplerReductionMode(..))
import Vulkan.Core10.Enums.StructureType (StructureType(..))
data PhysicalDeviceSamplerFilterMinmaxProperties = PhysicalDeviceSamplerFilterMinmaxProperties
{
PhysicalDeviceSamplerFilterMinmaxProperties -> Bool
filterMinmaxSingleComponentFormats :: Bool
,
PhysicalDeviceSamplerFilterMinmaxProperties -> Bool
filterMinmaxImageComponentMapping :: Bool
}
deriving (Typeable, PhysicalDeviceSamplerFilterMinmaxProperties
-> PhysicalDeviceSamplerFilterMinmaxProperties -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceSamplerFilterMinmaxProperties
-> PhysicalDeviceSamplerFilterMinmaxProperties -> Bool
$c/= :: PhysicalDeviceSamplerFilterMinmaxProperties
-> PhysicalDeviceSamplerFilterMinmaxProperties -> Bool
== :: PhysicalDeviceSamplerFilterMinmaxProperties
-> PhysicalDeviceSamplerFilterMinmaxProperties -> Bool
$c== :: PhysicalDeviceSamplerFilterMinmaxProperties
-> PhysicalDeviceSamplerFilterMinmaxProperties -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceSamplerFilterMinmaxProperties)
#endif
deriving instance Show PhysicalDeviceSamplerFilterMinmaxProperties
instance ToCStruct PhysicalDeviceSamplerFilterMinmaxProperties where
withCStruct :: forall b.
PhysicalDeviceSamplerFilterMinmaxProperties
-> (Ptr PhysicalDeviceSamplerFilterMinmaxProperties -> IO b)
-> IO b
withCStruct PhysicalDeviceSamplerFilterMinmaxProperties
x Ptr PhysicalDeviceSamplerFilterMinmaxProperties -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceSamplerFilterMinmaxProperties
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceSamplerFilterMinmaxProperties
p PhysicalDeviceSamplerFilterMinmaxProperties
x (Ptr PhysicalDeviceSamplerFilterMinmaxProperties -> IO b
f Ptr PhysicalDeviceSamplerFilterMinmaxProperties
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceSamplerFilterMinmaxProperties
-> PhysicalDeviceSamplerFilterMinmaxProperties -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceSamplerFilterMinmaxProperties
p PhysicalDeviceSamplerFilterMinmaxProperties{Bool
filterMinmaxImageComponentMapping :: Bool
filterMinmaxSingleComponentFormats :: Bool
$sel:filterMinmaxImageComponentMapping:PhysicalDeviceSamplerFilterMinmaxProperties :: PhysicalDeviceSamplerFilterMinmaxProperties -> Bool
$sel:filterMinmaxSingleComponentFormats:PhysicalDeviceSamplerFilterMinmaxProperties :: PhysicalDeviceSamplerFilterMinmaxProperties -> Bool
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerFilterMinmaxProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerFilterMinmaxProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerFilterMinmaxProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
filterMinmaxSingleComponentFormats))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerFilterMinmaxProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
filterMinmaxImageComponentMapping))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceSamplerFilterMinmaxProperties -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceSamplerFilterMinmaxProperties
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerFilterMinmaxProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerFilterMinmaxProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerFilterMinmaxProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceSamplerFilterMinmaxProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceSamplerFilterMinmaxProperties where
peekCStruct :: Ptr PhysicalDeviceSamplerFilterMinmaxProperties
-> IO PhysicalDeviceSamplerFilterMinmaxProperties
peekCStruct Ptr PhysicalDeviceSamplerFilterMinmaxProperties
p = do
Bool32
filterMinmaxSingleComponentFormats <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceSamplerFilterMinmaxProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
Bool32
filterMinmaxImageComponentMapping <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceSamplerFilterMinmaxProperties
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Bool -> Bool -> PhysicalDeviceSamplerFilterMinmaxProperties
PhysicalDeviceSamplerFilterMinmaxProperties
(Bool32 -> Bool
bool32ToBool Bool32
filterMinmaxSingleComponentFormats)
(Bool32 -> Bool
bool32ToBool Bool32
filterMinmaxImageComponentMapping)
instance Storable PhysicalDeviceSamplerFilterMinmaxProperties where
sizeOf :: PhysicalDeviceSamplerFilterMinmaxProperties -> Int
sizeOf ~PhysicalDeviceSamplerFilterMinmaxProperties
_ = Int
24
alignment :: PhysicalDeviceSamplerFilterMinmaxProperties -> Int
alignment ~PhysicalDeviceSamplerFilterMinmaxProperties
_ = Int
8
peek :: Ptr PhysicalDeviceSamplerFilterMinmaxProperties
-> IO PhysicalDeviceSamplerFilterMinmaxProperties
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceSamplerFilterMinmaxProperties
-> PhysicalDeviceSamplerFilterMinmaxProperties -> IO ()
poke Ptr PhysicalDeviceSamplerFilterMinmaxProperties
ptr PhysicalDeviceSamplerFilterMinmaxProperties
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceSamplerFilterMinmaxProperties
ptr PhysicalDeviceSamplerFilterMinmaxProperties
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceSamplerFilterMinmaxProperties where
zero :: PhysicalDeviceSamplerFilterMinmaxProperties
zero = Bool -> Bool -> PhysicalDeviceSamplerFilterMinmaxProperties
PhysicalDeviceSamplerFilterMinmaxProperties
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data SamplerReductionModeCreateInfo = SamplerReductionModeCreateInfo
{
SamplerReductionModeCreateInfo -> SamplerReductionMode
reductionMode :: SamplerReductionMode }
deriving (Typeable, SamplerReductionModeCreateInfo
-> SamplerReductionModeCreateInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SamplerReductionModeCreateInfo
-> SamplerReductionModeCreateInfo -> Bool
$c/= :: SamplerReductionModeCreateInfo
-> SamplerReductionModeCreateInfo -> Bool
== :: SamplerReductionModeCreateInfo
-> SamplerReductionModeCreateInfo -> Bool
$c== :: SamplerReductionModeCreateInfo
-> SamplerReductionModeCreateInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SamplerReductionModeCreateInfo)
#endif
deriving instance Show SamplerReductionModeCreateInfo
instance ToCStruct SamplerReductionModeCreateInfo where
withCStruct :: forall b.
SamplerReductionModeCreateInfo
-> (Ptr SamplerReductionModeCreateInfo -> IO b) -> IO b
withCStruct SamplerReductionModeCreateInfo
x Ptr SamplerReductionModeCreateInfo -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr SamplerReductionModeCreateInfo
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SamplerReductionModeCreateInfo
p SamplerReductionModeCreateInfo
x (Ptr SamplerReductionModeCreateInfo -> IO b
f Ptr SamplerReductionModeCreateInfo
p)
pokeCStruct :: forall b.
Ptr SamplerReductionModeCreateInfo
-> SamplerReductionModeCreateInfo -> IO b -> IO b
pokeCStruct Ptr SamplerReductionModeCreateInfo
p SamplerReductionModeCreateInfo{SamplerReductionMode
reductionMode :: SamplerReductionMode
$sel:reductionMode:SamplerReductionModeCreateInfo :: SamplerReductionModeCreateInfo -> SamplerReductionMode
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerReductionModeCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerReductionModeCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerReductionModeCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SamplerReductionMode)) (SamplerReductionMode
reductionMode)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr SamplerReductionModeCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr SamplerReductionModeCreateInfo
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerReductionModeCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerReductionModeCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerReductionModeCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SamplerReductionMode)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct SamplerReductionModeCreateInfo where
peekCStruct :: Ptr SamplerReductionModeCreateInfo
-> IO SamplerReductionModeCreateInfo
peekCStruct Ptr SamplerReductionModeCreateInfo
p = do
SamplerReductionMode
reductionMode <- forall a. Storable a => Ptr a -> IO a
peek @SamplerReductionMode ((Ptr SamplerReductionModeCreateInfo
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SamplerReductionMode))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ SamplerReductionMode -> SamplerReductionModeCreateInfo
SamplerReductionModeCreateInfo
SamplerReductionMode
reductionMode
instance Storable SamplerReductionModeCreateInfo where
sizeOf :: SamplerReductionModeCreateInfo -> Int
sizeOf ~SamplerReductionModeCreateInfo
_ = Int
24
alignment :: SamplerReductionModeCreateInfo -> Int
alignment ~SamplerReductionModeCreateInfo
_ = Int
8
peek :: Ptr SamplerReductionModeCreateInfo
-> IO SamplerReductionModeCreateInfo
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr SamplerReductionModeCreateInfo
-> SamplerReductionModeCreateInfo -> IO ()
poke Ptr SamplerReductionModeCreateInfo
ptr SamplerReductionModeCreateInfo
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SamplerReductionModeCreateInfo
ptr SamplerReductionModeCreateInfo
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero SamplerReductionModeCreateInfo where
zero :: SamplerReductionModeCreateInfo
zero = SamplerReductionMode -> SamplerReductionModeCreateInfo
SamplerReductionModeCreateInfo
forall a. Zero a => a
zero