{-# language CPP #-}
module Vulkan.Extensions.VK_IMG_relaxed_line_rasterization ( PhysicalDeviceRelaxedLineRasterizationFeaturesIMG(..)
, IMG_RELAXED_LINE_RASTERIZATION_SPEC_VERSION
, pattern IMG_RELAXED_LINE_RASTERIZATION_SPEC_VERSION
, IMG_RELAXED_LINE_RASTERIZATION_EXTENSION_NAME
, pattern IMG_RELAXED_LINE_RASTERIZATION_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_RELAXED_LINE_RASTERIZATION_FEATURES_IMG))
data PhysicalDeviceRelaxedLineRasterizationFeaturesIMG = PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
{
PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> Bool
relaxedLineRasterization :: Bool }
deriving (Typeable, PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> Bool
(PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> Bool)
-> (PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> Bool)
-> Eq PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> Bool
== :: PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> Bool
$c/= :: PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> Bool
/= :: PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceRelaxedLineRasterizationFeaturesIMG)
#endif
deriving instance Show PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
instance ToCStruct PhysicalDeviceRelaxedLineRasterizationFeaturesIMG where
withCStruct :: forall b.
PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> (Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> IO b)
-> IO b
withCStruct PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
x Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> IO b
f = Int
-> (Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> IO b)
-> IO b)
-> (Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
p -> Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> IO b
-> IO b
forall b.
Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> IO b
-> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
p PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
x (Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> IO b
f Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> IO b
-> IO b
pokeCStruct Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
p PhysicalDeviceRelaxedLineRasterizationFeaturesIMG{Bool
$sel:relaxedLineRasterization:PhysicalDeviceRelaxedLineRasterizationFeaturesIMG :: PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> Bool
relaxedLineRasterization :: Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
p Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
p Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> 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 PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
p Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
relaxedLineRasterization))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
p Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_RELAXED_LINE_RASTERIZATION_FEATURES_IMG)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
p Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> 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 PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
p Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> 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 PhysicalDeviceRelaxedLineRasterizationFeaturesIMG where
peekCStruct :: Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> IO PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
peekCStruct Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
p = do
Bool32
relaxedLineRasterization <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
p Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> IO PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> IO PhysicalDeviceRelaxedLineRasterizationFeaturesIMG)
-> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> IO PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
(Bool32 -> Bool
bool32ToBool Bool32
relaxedLineRasterization)
instance Storable PhysicalDeviceRelaxedLineRasterizationFeaturesIMG where
sizeOf :: PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> Int
sizeOf ~PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
_ = Int
24
alignment :: PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> Int
alignment ~PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
_ = Int
8
peek :: Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> IO PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
peek = Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> IO PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG -> IO ()
poke Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
poked = Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> IO ()
-> IO ()
forall b.
Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
-> IO b
-> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
ptr PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceRelaxedLineRasterizationFeaturesIMG where
zero :: PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
zero = Bool -> PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
PhysicalDeviceRelaxedLineRasterizationFeaturesIMG
Bool
forall a. Zero a => a
zero
type IMG_RELAXED_LINE_RASTERIZATION_SPEC_VERSION = 1
pattern IMG_RELAXED_LINE_RASTERIZATION_SPEC_VERSION :: forall a . Integral a => a
pattern $bIMG_RELAXED_LINE_RASTERIZATION_SPEC_VERSION :: forall a. Integral a => a
$mIMG_RELAXED_LINE_RASTERIZATION_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
IMG_RELAXED_LINE_RASTERIZATION_SPEC_VERSION = 1
type IMG_RELAXED_LINE_RASTERIZATION_EXTENSION_NAME = "VK_IMG_relaxed_line_rasterization"
pattern IMG_RELAXED_LINE_RASTERIZATION_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bIMG_RELAXED_LINE_RASTERIZATION_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mIMG_RELAXED_LINE_RASTERIZATION_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
IMG_RELAXED_LINE_RASTERIZATION_EXTENSION_NAME = "VK_IMG_relaxed_line_rasterization"