{-# language CPP #-}
module Graphics.Vulkan.Extensions.VK_EXT_depth_clip_enable ( PhysicalDeviceDepthClipEnableFeaturesEXT(..)
, PipelineRasterizationDepthClipStateCreateInfoEXT(..)
, PipelineRasterizationDepthClipStateCreateFlagsEXT(..)
, EXT_DEPTH_CLIP_ENABLE_SPEC_VERSION
, pattern EXT_DEPTH_CLIP_ENABLE_SPEC_VERSION
, EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME
, pattern EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME
) where
import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import Numeric (showHex)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Data.Bits (Bits)
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 Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import Text.Read.Lex (Lexeme(Ident))
import Data.Kind (Type)
import Graphics.Vulkan.Core10.BaseType (bool32ToBool)
import Graphics.Vulkan.Core10.BaseType (boolToBool32)
import Graphics.Vulkan.Core10.BaseType (Bool32)
import Graphics.Vulkan.Core10.BaseType (Flags)
import Graphics.Vulkan.CStruct (FromCStruct)
import Graphics.Vulkan.CStruct (FromCStruct(..))
import Graphics.Vulkan.Core10.Enums.StructureType (StructureType)
import Graphics.Vulkan.CStruct (ToCStruct)
import Graphics.Vulkan.CStruct (ToCStruct(..))
import Graphics.Vulkan.Zero (Zero)
import Graphics.Vulkan.Zero (Zero(..))
import Graphics.Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT))
import Graphics.Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT))
data PhysicalDeviceDepthClipEnableFeaturesEXT = PhysicalDeviceDepthClipEnableFeaturesEXT
{
depthClipEnable :: Bool }
deriving (Typeable)
deriving instance Show PhysicalDeviceDepthClipEnableFeaturesEXT
instance ToCStruct PhysicalDeviceDepthClipEnableFeaturesEXT where
withCStruct x f = allocaBytesAligned 24 8 $ \p -> pokeCStruct p x (f p)
pokeCStruct p PhysicalDeviceDepthClipEnableFeaturesEXT{..} f = do
poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT)
poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
poke ((p `plusPtr` 16 :: Ptr Bool32)) (boolToBool32 (depthClipEnable))
f
cStructSize = 24
cStructAlignment = 8
pokeZeroCStruct p f = do
poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_ENABLE_FEATURES_EXT)
poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
poke ((p `plusPtr` 16 :: Ptr Bool32)) (boolToBool32 (zero))
f
instance FromCStruct PhysicalDeviceDepthClipEnableFeaturesEXT where
peekCStruct p = do
depthClipEnable <- peek @Bool32 ((p `plusPtr` 16 :: Ptr Bool32))
pure $ PhysicalDeviceDepthClipEnableFeaturesEXT
(bool32ToBool depthClipEnable)
instance Storable PhysicalDeviceDepthClipEnableFeaturesEXT where
sizeOf ~_ = 24
alignment ~_ = 8
peek = peekCStruct
poke ptr poked = pokeCStruct ptr poked (pure ())
instance Zero PhysicalDeviceDepthClipEnableFeaturesEXT where
zero = PhysicalDeviceDepthClipEnableFeaturesEXT
zero
data PipelineRasterizationDepthClipStateCreateInfoEXT = PipelineRasterizationDepthClipStateCreateInfoEXT
{
flags :: PipelineRasterizationDepthClipStateCreateFlagsEXT
,
depthClipEnable :: Bool
}
deriving (Typeable)
deriving instance Show PipelineRasterizationDepthClipStateCreateInfoEXT
instance ToCStruct PipelineRasterizationDepthClipStateCreateInfoEXT where
withCStruct x f = allocaBytesAligned 24 8 $ \p -> pokeCStruct p x (f p)
pokeCStruct p PipelineRasterizationDepthClipStateCreateInfoEXT{..} f = do
poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT)
poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
poke ((p `plusPtr` 16 :: Ptr PipelineRasterizationDepthClipStateCreateFlagsEXT)) (flags)
poke ((p `plusPtr` 20 :: Ptr Bool32)) (boolToBool32 (depthClipEnable))
f
cStructSize = 24
cStructAlignment = 8
pokeZeroCStruct p f = do
poke ((p `plusPtr` 0 :: Ptr StructureType)) (STRUCTURE_TYPE_PIPELINE_RASTERIZATION_DEPTH_CLIP_STATE_CREATE_INFO_EXT)
poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) (nullPtr)
poke ((p `plusPtr` 20 :: Ptr Bool32)) (boolToBool32 (zero))
f
instance FromCStruct PipelineRasterizationDepthClipStateCreateInfoEXT where
peekCStruct p = do
flags <- peek @PipelineRasterizationDepthClipStateCreateFlagsEXT ((p `plusPtr` 16 :: Ptr PipelineRasterizationDepthClipStateCreateFlagsEXT))
depthClipEnable <- peek @Bool32 ((p `plusPtr` 20 :: Ptr Bool32))
pure $ PipelineRasterizationDepthClipStateCreateInfoEXT
flags (bool32ToBool depthClipEnable)
instance Storable PipelineRasterizationDepthClipStateCreateInfoEXT where
sizeOf ~_ = 24
alignment ~_ = 8
peek = peekCStruct
poke ptr poked = pokeCStruct ptr poked (pure ())
instance Zero PipelineRasterizationDepthClipStateCreateInfoEXT where
zero = PipelineRasterizationDepthClipStateCreateInfoEXT
zero
zero
newtype PipelineRasterizationDepthClipStateCreateFlagsEXT = PipelineRasterizationDepthClipStateCreateFlagsEXT Flags
deriving newtype (Eq, Ord, Storable, Zero, Bits)
instance Show PipelineRasterizationDepthClipStateCreateFlagsEXT where
showsPrec p = \case
PipelineRasterizationDepthClipStateCreateFlagsEXT x -> showParen (p >= 11) (showString "PipelineRasterizationDepthClipStateCreateFlagsEXT 0x" . showHex x)
instance Read PipelineRasterizationDepthClipStateCreateFlagsEXT where
readPrec = parens (choose []
+++
prec 10 (do
expectP (Ident "PipelineRasterizationDepthClipStateCreateFlagsEXT")
v <- step readPrec
pure (PipelineRasterizationDepthClipStateCreateFlagsEXT v)))
type EXT_DEPTH_CLIP_ENABLE_SPEC_VERSION = 1
pattern EXT_DEPTH_CLIP_ENABLE_SPEC_VERSION :: forall a . Integral a => a
pattern EXT_DEPTH_CLIP_ENABLE_SPEC_VERSION = 1
type EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME = "VK_EXT_depth_clip_enable"
pattern EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME = "VK_EXT_depth_clip_enable"