{-# language CPP #-}
module Vulkan.Extensions.VK_NV_linear_color_attachment ( PhysicalDeviceLinearColorAttachmentFeaturesNV(..)
, NV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION
, pattern NV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION
, NV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME
, pattern NV_LINEAR_COLOR_ATTACHMENT_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.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV))
data PhysicalDeviceLinearColorAttachmentFeaturesNV = PhysicalDeviceLinearColorAttachmentFeaturesNV
{
PhysicalDeviceLinearColorAttachmentFeaturesNV -> Bool
linearColorAttachment :: Bool }
deriving (Typeable, PhysicalDeviceLinearColorAttachmentFeaturesNV
-> PhysicalDeviceLinearColorAttachmentFeaturesNV -> Bool
(PhysicalDeviceLinearColorAttachmentFeaturesNV
-> PhysicalDeviceLinearColorAttachmentFeaturesNV -> Bool)
-> (PhysicalDeviceLinearColorAttachmentFeaturesNV
-> PhysicalDeviceLinearColorAttachmentFeaturesNV -> Bool)
-> Eq PhysicalDeviceLinearColorAttachmentFeaturesNV
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceLinearColorAttachmentFeaturesNV
-> PhysicalDeviceLinearColorAttachmentFeaturesNV -> Bool
$c/= :: PhysicalDeviceLinearColorAttachmentFeaturesNV
-> PhysicalDeviceLinearColorAttachmentFeaturesNV -> Bool
== :: PhysicalDeviceLinearColorAttachmentFeaturesNV
-> PhysicalDeviceLinearColorAttachmentFeaturesNV -> Bool
$c== :: PhysicalDeviceLinearColorAttachmentFeaturesNV
-> PhysicalDeviceLinearColorAttachmentFeaturesNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceLinearColorAttachmentFeaturesNV)
#endif
deriving instance Show PhysicalDeviceLinearColorAttachmentFeaturesNV
instance ToCStruct PhysicalDeviceLinearColorAttachmentFeaturesNV where
withCStruct :: forall b.
PhysicalDeviceLinearColorAttachmentFeaturesNV
-> (Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV -> IO b)
-> IO b
withCStruct PhysicalDeviceLinearColorAttachmentFeaturesNV
x Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV -> IO b
f = Int
-> (Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV -> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV -> IO b)
-> IO b)
-> (Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
p -> Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
-> PhysicalDeviceLinearColorAttachmentFeaturesNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
p PhysicalDeviceLinearColorAttachmentFeaturesNV
x (Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV -> IO b
f Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
-> PhysicalDeviceLinearColorAttachmentFeaturesNV -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
p PhysicalDeviceLinearColorAttachmentFeaturesNV{Bool
linearColorAttachment :: Bool
$sel:linearColorAttachment:PhysicalDeviceLinearColorAttachmentFeaturesNV :: PhysicalDeviceLinearColorAttachmentFeaturesNV -> Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
p Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
p Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
p Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
linearColorAttachment))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
p Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
p Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
p Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceLinearColorAttachmentFeaturesNV where
peekCStruct :: Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
-> IO PhysicalDeviceLinearColorAttachmentFeaturesNV
peekCStruct Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
p = do
Bool32
linearColorAttachment <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
p Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
PhysicalDeviceLinearColorAttachmentFeaturesNV
-> IO PhysicalDeviceLinearColorAttachmentFeaturesNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceLinearColorAttachmentFeaturesNV
-> IO PhysicalDeviceLinearColorAttachmentFeaturesNV)
-> PhysicalDeviceLinearColorAttachmentFeaturesNV
-> IO PhysicalDeviceLinearColorAttachmentFeaturesNV
forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceLinearColorAttachmentFeaturesNV
PhysicalDeviceLinearColorAttachmentFeaturesNV
(Bool32 -> Bool
bool32ToBool Bool32
linearColorAttachment)
instance Storable PhysicalDeviceLinearColorAttachmentFeaturesNV where
sizeOf :: PhysicalDeviceLinearColorAttachmentFeaturesNV -> Int
sizeOf ~PhysicalDeviceLinearColorAttachmentFeaturesNV
_ = Int
24
alignment :: PhysicalDeviceLinearColorAttachmentFeaturesNV -> Int
alignment ~PhysicalDeviceLinearColorAttachmentFeaturesNV
_ = Int
8
peek :: Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
-> IO PhysicalDeviceLinearColorAttachmentFeaturesNV
peek = Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
-> IO PhysicalDeviceLinearColorAttachmentFeaturesNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
-> PhysicalDeviceLinearColorAttachmentFeaturesNV -> IO ()
poke Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
poked = Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
-> PhysicalDeviceLinearColorAttachmentFeaturesNV -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
ptr PhysicalDeviceLinearColorAttachmentFeaturesNV
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceLinearColorAttachmentFeaturesNV where
zero :: PhysicalDeviceLinearColorAttachmentFeaturesNV
zero = Bool -> PhysicalDeviceLinearColorAttachmentFeaturesNV
PhysicalDeviceLinearColorAttachmentFeaturesNV
Bool
forall a. Zero a => a
zero
type NV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION = 1
pattern NV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION :: forall a . Integral a => a
pattern $bNV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION :: forall a. Integral a => a
$mNV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> (Void# -> r) -> (Void# -> r) -> r
NV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION = 1
type NV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME = "VK_NV_linear_color_attachment"
pattern NV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bNV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mNV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
NV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME = "VK_NV_linear_color_attachment"