{-# language CPP #-}
module Vulkan.Extensions.VK_EXT_border_color_swizzle ( SamplerBorderColorComponentMappingCreateInfoEXT(..)
, PhysicalDeviceBorderColorSwizzleFeaturesEXT(..)
, EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION
, pattern EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION
, EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME
, pattern EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME
) 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.String (IsString)
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.Core10.ImageView (ComponentMapping)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT))
data SamplerBorderColorComponentMappingCreateInfoEXT = SamplerBorderColorComponentMappingCreateInfoEXT
{
SamplerBorderColorComponentMappingCreateInfoEXT -> ComponentMapping
components :: ComponentMapping
,
SamplerBorderColorComponentMappingCreateInfoEXT -> Bool
srgb :: Bool
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SamplerBorderColorComponentMappingCreateInfoEXT)
#endif
deriving instance Show SamplerBorderColorComponentMappingCreateInfoEXT
instance ToCStruct SamplerBorderColorComponentMappingCreateInfoEXT where
withCStruct :: forall b.
SamplerBorderColorComponentMappingCreateInfoEXT
-> (Ptr SamplerBorderColorComponentMappingCreateInfoEXT -> IO b)
-> IO b
withCStruct SamplerBorderColorComponentMappingCreateInfoEXT
x Ptr SamplerBorderColorComponentMappingCreateInfoEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 forall a b. (a -> b) -> a -> b
$ \Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p SamplerBorderColorComponentMappingCreateInfoEXT
x (Ptr SamplerBorderColorComponentMappingCreateInfoEXT -> IO b
f Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p)
pokeCStruct :: forall b.
Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> SamplerBorderColorComponentMappingCreateInfoEXT -> IO b -> IO b
pokeCStruct Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p SamplerBorderColorComponentMappingCreateInfoEXT{Bool
ComponentMapping
srgb :: Bool
components :: ComponentMapping
$sel:srgb:SamplerBorderColorComponentMappingCreateInfoEXT :: SamplerBorderColorComponentMappingCreateInfoEXT -> Bool
$sel:components:SamplerBorderColorComponentMappingCreateInfoEXT :: SamplerBorderColorComponentMappingCreateInfoEXT -> ComponentMapping
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
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 SamplerBorderColorComponentMappingCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ComponentMapping)) (ComponentMapping
components)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
srgb))
IO b
f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr SamplerBorderColorComponentMappingCreateInfoEXT -> IO b -> IO b
pokeZeroCStruct Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SAMPLER_BORDER_COLOR_COMPONENT_MAPPING_CREATE_INFO_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
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 SamplerBorderColorComponentMappingCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ComponentMapping)) (forall a. Zero a => a
zero)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
IO b
f
instance FromCStruct SamplerBorderColorComponentMappingCreateInfoEXT where
peekCStruct :: Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> IO SamplerBorderColorComponentMappingCreateInfoEXT
peekCStruct Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p = do
ComponentMapping
components <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ComponentMapping ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ComponentMapping))
Bool32
srgb <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr SamplerBorderColorComponentMappingCreateInfoEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ComponentMapping
-> Bool -> SamplerBorderColorComponentMappingCreateInfoEXT
SamplerBorderColorComponentMappingCreateInfoEXT
ComponentMapping
components (Bool32 -> Bool
bool32ToBool Bool32
srgb)
instance Storable SamplerBorderColorComponentMappingCreateInfoEXT where
sizeOf :: SamplerBorderColorComponentMappingCreateInfoEXT -> Int
sizeOf ~SamplerBorderColorComponentMappingCreateInfoEXT
_ = Int
40
alignment :: SamplerBorderColorComponentMappingCreateInfoEXT -> Int
alignment ~SamplerBorderColorComponentMappingCreateInfoEXT
_ = Int
8
peek :: Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> IO SamplerBorderColorComponentMappingCreateInfoEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr SamplerBorderColorComponentMappingCreateInfoEXT
-> SamplerBorderColorComponentMappingCreateInfoEXT -> IO ()
poke Ptr SamplerBorderColorComponentMappingCreateInfoEXT
ptr SamplerBorderColorComponentMappingCreateInfoEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SamplerBorderColorComponentMappingCreateInfoEXT
ptr SamplerBorderColorComponentMappingCreateInfoEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero SamplerBorderColorComponentMappingCreateInfoEXT where
zero :: SamplerBorderColorComponentMappingCreateInfoEXT
zero = ComponentMapping
-> Bool -> SamplerBorderColorComponentMappingCreateInfoEXT
SamplerBorderColorComponentMappingCreateInfoEXT
forall a. Zero a => a
zero
forall a. Zero a => a
zero
data PhysicalDeviceBorderColorSwizzleFeaturesEXT = PhysicalDeviceBorderColorSwizzleFeaturesEXT
{
PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
borderColorSwizzle :: Bool
,
PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
borderColorSwizzleFromImage :: Bool
}
deriving (Typeable, PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
$c/= :: PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
== :: PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
$c== :: PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceBorderColorSwizzleFeaturesEXT)
#endif
deriving instance Show PhysicalDeviceBorderColorSwizzleFeaturesEXT
instance ToCStruct PhysicalDeviceBorderColorSwizzleFeaturesEXT where
withCStruct :: forall b.
PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> (Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO b)
-> IO b
withCStruct PhysicalDeviceBorderColorSwizzleFeaturesEXT
x Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p PhysicalDeviceBorderColorSwizzleFeaturesEXT
x (Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO b
f Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p PhysicalDeviceBorderColorSwizzleFeaturesEXT{Bool
borderColorSwizzleFromImage :: Bool
borderColorSwizzle :: Bool
$sel:borderColorSwizzleFromImage:PhysicalDeviceBorderColorSwizzleFeaturesEXT :: PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
$sel:borderColorSwizzle:PhysicalDeviceBorderColorSwizzleFeaturesEXT :: PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Bool
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
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 PhysicalDeviceBorderColorSwizzleFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
borderColorSwizzle))
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
borderColorSwizzleFromImage))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_BORDER_COLOR_SWIZZLE_FEATURES_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
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 PhysicalDeviceBorderColorSwizzleFeaturesEXT
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 PhysicalDeviceBorderColorSwizzleFeaturesEXT
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 PhysicalDeviceBorderColorSwizzleFeaturesEXT where
peekCStruct :: Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> IO PhysicalDeviceBorderColorSwizzleFeaturesEXT
peekCStruct Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p = do
Bool32
borderColorSwizzle <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
Bool32
borderColorSwizzleFromImage <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
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 -> PhysicalDeviceBorderColorSwizzleFeaturesEXT
PhysicalDeviceBorderColorSwizzleFeaturesEXT
(Bool32 -> Bool
bool32ToBool Bool32
borderColorSwizzle)
(Bool32 -> Bool
bool32ToBool Bool32
borderColorSwizzleFromImage)
instance Storable PhysicalDeviceBorderColorSwizzleFeaturesEXT where
sizeOf :: PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Int
sizeOf ~PhysicalDeviceBorderColorSwizzleFeaturesEXT
_ = Int
24
alignment :: PhysicalDeviceBorderColorSwizzleFeaturesEXT -> Int
alignment ~PhysicalDeviceBorderColorSwizzleFeaturesEXT
_ = Int
8
peek :: Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> IO PhysicalDeviceBorderColorSwizzleFeaturesEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
-> PhysicalDeviceBorderColorSwizzleFeaturesEXT -> IO ()
poke Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
ptr PhysicalDeviceBorderColorSwizzleFeaturesEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceBorderColorSwizzleFeaturesEXT where
zero :: PhysicalDeviceBorderColorSwizzleFeaturesEXT
zero = Bool -> Bool -> PhysicalDeviceBorderColorSwizzleFeaturesEXT
PhysicalDeviceBorderColorSwizzleFeaturesEXT
forall a. Zero a => a
zero
forall a. Zero a => a
zero
type EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION = 1
pattern EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION :: forall a. Integral a => a
$mEXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_BORDER_COLOR_SWIZZLE_SPEC_VERSION = 1
type EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME = "VK_EXT_border_color_swizzle"
pattern EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mEXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_BORDER_COLOR_SWIZZLE_EXTENSION_NAME = "VK_EXT_border_color_swizzle"