{-# language CPP #-}
-- No documentation found for Chapter "Promoted_From_VK_KHR_line_rasterizationRoadmap"
module Vulkan.Core14.Promoted_From_VK_KHR_line_rasterizationRoadmap  ( cmdSetLineStipple
                                                                     , PhysicalDeviceLineRasterizationFeatures(..)
                                                                     , PhysicalDeviceLineRasterizationProperties(..)
                                                                     , PipelineRasterizationLineStateCreateInfo(..)
                                                                     , StructureType(..)
                                                                     , DynamicState(..)
                                                                     , LineRasterizationMode(..)
                                                                     ) where

import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
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 Control.Monad.IO.Class (MonadIO)
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 GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word16)
import Data.Word (Word32)
import Data.Kind (Type)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer(CommandBuffer))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Dynamic (DeviceCmds(pVkCmdSetLineStipple))
import Vulkan.Core14.Enums.LineRasterizationMode (LineRasterizationMode)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO))
import Vulkan.Core10.Enums.DynamicState (DynamicState(..))
import Vulkan.Core14.Enums.LineRasterizationMode (LineRasterizationMode(..))
import Vulkan.Core10.Enums.StructureType (StructureType(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdSetLineStipple
  :: FunPtr (Ptr CommandBuffer_T -> Word32 -> Word16 -> IO ()) -> Ptr CommandBuffer_T -> Word32 -> Word16 -> IO ()

-- | vkCmdSetLineStipple - Set line stipple dynamically for a command buffer
--
-- = Description
--
-- This command sets the line stipple state for subsequent drawing commands
-- when drawing using
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#shaders-objects shader objects>,
-- or when the graphics pipeline is created with
-- 'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_LINE_STIPPLE' set in
-- 'Vulkan.Core10.GraphicsPipeline.PipelineDynamicStateCreateInfo'::@pDynamicStates@.
-- Otherwise, this state is specified by the
-- 'PipelineRasterizationLineStateCreateInfo'::@lineStippleFactor@ and
-- 'PipelineRasterizationLineStateCreateInfo'::@lineStipplePattern@ values
-- used to create the currently active pipeline.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdSetLineStipple-lineStippleFactor-02776#
--     @lineStippleFactor@ /must/ be in the range [1,256]
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdSetLineStipple-commandBuffer-parameter# @commandBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdSetLineStipple-commandBuffer-recording# @commandBuffer@
--     /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdSetLineStipple-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT' operations
--
-- -   #VUID-vkCmdSetLineStipple-videocoding# This command /must/ only be
--     called outside of a video coding scope
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Both                                                                                                                   | Outside                                                                                                                     | VK_QUEUE_GRAPHICS_BIT                                                                                                 | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             |                                                                                                                       |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- == Conditional Rendering
--
-- vkCmdSetLineStipple is not affected by
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#drawing-conditional-rendering conditional rendering>
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_line_rasterization VK_EXT_line_rasterization>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_line_rasterization VK_KHR_line_rasterization>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.Handles.CommandBuffer'
cmdSetLineStipple :: forall io
                   . (MonadIO io)
                  => -- | @commandBuffer@ is the command buffer into which the command will be
                     -- recorded.
                     CommandBuffer
                  -> -- | @lineStippleFactor@ is the repeat factor used in stippled line
                     -- rasterization.
                     ("lineStippleFactor" ::: Word32)
                  -> -- | @lineStipplePattern@ is the bit pattern used in stippled line
                     -- rasterization.
                     ("lineStipplePattern" ::: Word16)
                  -> io ()
cmdSetLineStipple :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer
-> ("lineStippleFactor" ::: Word32)
-> ("lineStipplePattern" ::: Word16)
-> io ()
cmdSetLineStipple CommandBuffer
commandBuffer
                    "lineStippleFactor" ::: Word32
lineStippleFactor
                    "lineStipplePattern" ::: Word16
lineStipplePattern = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ()) -> IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdSetLineStipplePtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("lineStippleFactor" ::: Word32)
   -> ("lineStipplePattern" ::: Word16)
   -> IO ())
vkCmdSetLineStipplePtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("lineStippleFactor" ::: Word32)
      -> ("lineStipplePattern" ::: Word16)
      -> IO ())
pVkCmdSetLineStipple (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> ("lineStippleFactor" ::: Word32)
   -> ("lineStipplePattern" ::: Word16)
   -> IO ())
vkCmdSetLineStipplePtr FunPtr
  (Ptr CommandBuffer_T
   -> ("lineStippleFactor" ::: Word32)
   -> ("lineStipplePattern" ::: Word16)
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("lineStippleFactor" ::: Word32)
      -> ("lineStipplePattern" ::: Word16)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("lineStippleFactor" ::: Word32)
   -> ("lineStipplePattern" ::: Word16)
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdSetLineStipple is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdSetLineStipple' :: Ptr CommandBuffer_T
-> ("lineStippleFactor" ::: Word32)
-> ("lineStipplePattern" ::: Word16)
-> IO ()
vkCmdSetLineStipple' = FunPtr
  (Ptr CommandBuffer_T
   -> ("lineStippleFactor" ::: Word32)
   -> ("lineStipplePattern" ::: Word16)
   -> IO ())
-> Ptr CommandBuffer_T
-> ("lineStippleFactor" ::: Word32)
-> ("lineStipplePattern" ::: Word16)
-> IO ()
mkVkCmdSetLineStipple FunPtr
  (Ptr CommandBuffer_T
   -> ("lineStippleFactor" ::: Word32)
   -> ("lineStipplePattern" ::: Word16)
   -> IO ())
vkCmdSetLineStipplePtr
  String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdSetLineStipple" (Ptr CommandBuffer_T
-> ("lineStippleFactor" ::: Word32)
-> ("lineStipplePattern" ::: Word16)
-> IO ()
vkCmdSetLineStipple'
                                            (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                            ("lineStippleFactor" ::: Word32
lineStippleFactor)
                                            ("lineStipplePattern" ::: Word16
lineStipplePattern))
  () -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ()


-- | VkPhysicalDeviceLineRasterizationFeatures - Structure describing the
-- line rasterization features that can be supported by an implementation
--
-- = Members
--
-- This structure describes the following features:
--
-- = Description
--
-- If the 'PhysicalDeviceLineRasterizationFeatures' structure is included
-- in the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2',
-- it is filled in to indicate whether each corresponding feature is
-- supported. If the application wishes to use a
-- 'Vulkan.Core10.Handles.Device' with any features described by
-- 'PhysicalDeviceLineRasterizationFeatures', it /must/ add an instance of
-- the structure, with the desired feature members set to
-- 'Vulkan.Core10.FundamentalTypes.TRUE', to the @pNext@ chain of
-- 'Vulkan.Core10.Device.DeviceCreateInfo' when creating the
-- 'Vulkan.Core10.Handles.Device'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_line_rasterization VK_EXT_line_rasterization>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_line_rasterization VK_KHR_line_rasterization>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceLineRasterizationFeatures = PhysicalDeviceLineRasterizationFeatures
  { -- | #extension-features-rectangularLines# @rectangularLines@ indicates
    -- whether the implementation supports
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#primsrast-lines rectangular line rasterization>.
    PhysicalDeviceLineRasterizationFeatures -> Bool
rectangularLines :: Bool
  , -- | #extension-features-bresenhamLines# @bresenhamLines@ indicates whether
    -- the implementation supports
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#primsrast-lines-bresenham Bresenham-style line rasterization>.
    PhysicalDeviceLineRasterizationFeatures -> Bool
bresenhamLines :: Bool
  , -- | #extension-features-smoothLines# @smoothLines@ indicates whether the
    -- implementation supports
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#primsrast-lines-smooth smooth line rasterization>.
    PhysicalDeviceLineRasterizationFeatures -> Bool
smoothLines :: Bool
  , -- | #extension-features-stippledRectangularLines# @stippledRectangularLines@
    -- indicates whether the implementation supports
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#primsrast-lines-stipple stippled line rasterization>
    -- with
    -- 'Vulkan.Core14.Enums.LineRasterizationMode.LINE_RASTERIZATION_MODE_RECTANGULAR'
    -- lines.
    PhysicalDeviceLineRasterizationFeatures -> Bool
stippledRectangularLines :: Bool
  , -- | #extension-features-stippledBresenhamLines# @stippledBresenhamLines@
    -- indicates whether the implementation supports
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#primsrast-lines-stipple stippled line rasterization>
    -- with
    -- 'Vulkan.Core14.Enums.LineRasterizationMode.LINE_RASTERIZATION_MODE_BRESENHAM'
    -- lines.
    PhysicalDeviceLineRasterizationFeatures -> Bool
stippledBresenhamLines :: Bool
  , -- | #extension-features-stippledSmoothLines# @stippledSmoothLines@ indicates
    -- whether the implementation supports
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#primsrast-lines-stipple stippled line rasterization>
    -- with
    -- 'Vulkan.Core14.Enums.LineRasterizationMode.LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH'
    -- lines.
    PhysicalDeviceLineRasterizationFeatures -> Bool
stippledSmoothLines :: Bool
  }
  deriving (Typeable, PhysicalDeviceLineRasterizationFeatures
-> PhysicalDeviceLineRasterizationFeatures -> Bool
(PhysicalDeviceLineRasterizationFeatures
 -> PhysicalDeviceLineRasterizationFeatures -> Bool)
-> (PhysicalDeviceLineRasterizationFeatures
    -> PhysicalDeviceLineRasterizationFeatures -> Bool)
-> Eq PhysicalDeviceLineRasterizationFeatures
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceLineRasterizationFeatures
-> PhysicalDeviceLineRasterizationFeatures -> Bool
== :: PhysicalDeviceLineRasterizationFeatures
-> PhysicalDeviceLineRasterizationFeatures -> Bool
$c/= :: PhysicalDeviceLineRasterizationFeatures
-> PhysicalDeviceLineRasterizationFeatures -> Bool
/= :: PhysicalDeviceLineRasterizationFeatures
-> PhysicalDeviceLineRasterizationFeatures -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceLineRasterizationFeatures)
#endif
deriving instance Show PhysicalDeviceLineRasterizationFeatures

instance ToCStruct PhysicalDeviceLineRasterizationFeatures where
  withCStruct :: forall b.
PhysicalDeviceLineRasterizationFeatures
-> (Ptr PhysicalDeviceLineRasterizationFeatures -> IO b) -> IO b
withCStruct PhysicalDeviceLineRasterizationFeatures
x Ptr PhysicalDeviceLineRasterizationFeatures -> IO b
f = Int
-> (Ptr PhysicalDeviceLineRasterizationFeatures -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr PhysicalDeviceLineRasterizationFeatures -> IO b) -> IO b)
-> (Ptr PhysicalDeviceLineRasterizationFeatures -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceLineRasterizationFeatures
p -> Ptr PhysicalDeviceLineRasterizationFeatures
-> PhysicalDeviceLineRasterizationFeatures -> IO b -> IO b
forall b.
Ptr PhysicalDeviceLineRasterizationFeatures
-> PhysicalDeviceLineRasterizationFeatures -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceLineRasterizationFeatures
p PhysicalDeviceLineRasterizationFeatures
x (Ptr PhysicalDeviceLineRasterizationFeatures -> IO b
f Ptr PhysicalDeviceLineRasterizationFeatures
p)
  pokeCStruct :: forall b.
Ptr PhysicalDeviceLineRasterizationFeatures
-> PhysicalDeviceLineRasterizationFeatures -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceLineRasterizationFeatures
p PhysicalDeviceLineRasterizationFeatures{Bool
rectangularLines :: PhysicalDeviceLineRasterizationFeatures -> Bool
bresenhamLines :: PhysicalDeviceLineRasterizationFeatures -> Bool
smoothLines :: PhysicalDeviceLineRasterizationFeatures -> Bool
stippledRectangularLines :: PhysicalDeviceLineRasterizationFeatures -> Bool
stippledBresenhamLines :: PhysicalDeviceLineRasterizationFeatures -> Bool
stippledSmoothLines :: PhysicalDeviceLineRasterizationFeatures -> Bool
rectangularLines :: Bool
bresenhamLines :: Bool
smoothLines :: Bool
stippledRectangularLines :: Bool
stippledBresenhamLines :: Bool
stippledSmoothLines :: Bool
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures -> 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 PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
rectangularLines))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
bresenhamLines))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
smoothLines))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
stippledRectangularLines))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
stippledBresenhamLines))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
stippledSmoothLines))
    IO b
f
  cStructSize :: Int
cStructSize = Int
40
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceLineRasterizationFeatures -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceLineRasterizationFeatures
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_FEATURES)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures -> 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 PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures -> 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))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct PhysicalDeviceLineRasterizationFeatures where
  peekCStruct :: Ptr PhysicalDeviceLineRasterizationFeatures
-> IO PhysicalDeviceLineRasterizationFeatures
peekCStruct Ptr PhysicalDeviceLineRasterizationFeatures
p = do
    rectangularLines <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceLineRasterizationFeatures
p Ptr PhysicalDeviceLineRasterizationFeatures -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    bresenhamLines <- peek @Bool32 ((p `plusPtr` 20 :: Ptr Bool32))
    smoothLines <- peek @Bool32 ((p `plusPtr` 24 :: Ptr Bool32))
    stippledRectangularLines <- peek @Bool32 ((p `plusPtr` 28 :: Ptr Bool32))
    stippledBresenhamLines <- peek @Bool32 ((p `plusPtr` 32 :: Ptr Bool32))
    stippledSmoothLines <- peek @Bool32 ((p `plusPtr` 36 :: Ptr Bool32))
    pure $ PhysicalDeviceLineRasterizationFeatures
             (bool32ToBool rectangularLines)
             (bool32ToBool bresenhamLines)
             (bool32ToBool smoothLines)
             (bool32ToBool stippledRectangularLines)
             (bool32ToBool stippledBresenhamLines)
             (bool32ToBool stippledSmoothLines)

instance Storable PhysicalDeviceLineRasterizationFeatures where
  sizeOf :: PhysicalDeviceLineRasterizationFeatures -> Int
sizeOf ~PhysicalDeviceLineRasterizationFeatures
_ = Int
40
  alignment :: PhysicalDeviceLineRasterizationFeatures -> Int
alignment ~PhysicalDeviceLineRasterizationFeatures
_ = Int
8
  peek :: Ptr PhysicalDeviceLineRasterizationFeatures
-> IO PhysicalDeviceLineRasterizationFeatures
peek = Ptr PhysicalDeviceLineRasterizationFeatures
-> IO PhysicalDeviceLineRasterizationFeatures
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr PhysicalDeviceLineRasterizationFeatures
-> PhysicalDeviceLineRasterizationFeatures -> IO ()
poke Ptr PhysicalDeviceLineRasterizationFeatures
ptr PhysicalDeviceLineRasterizationFeatures
poked = Ptr PhysicalDeviceLineRasterizationFeatures
-> PhysicalDeviceLineRasterizationFeatures -> IO () -> IO ()
forall b.
Ptr PhysicalDeviceLineRasterizationFeatures
-> PhysicalDeviceLineRasterizationFeatures -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceLineRasterizationFeatures
ptr PhysicalDeviceLineRasterizationFeatures
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero PhysicalDeviceLineRasterizationFeatures where
  zero :: PhysicalDeviceLineRasterizationFeatures
zero = Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> PhysicalDeviceLineRasterizationFeatures
PhysicalDeviceLineRasterizationFeatures
           Bool
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero


-- | VkPhysicalDeviceLineRasterizationProperties - Structure describing line
-- rasterization properties supported by an implementation
--
-- = Description
--
-- If the 'PhysicalDeviceLineRasterizationProperties' structure is included
-- in the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceProperties2',
-- it is filled in with each corresponding implementation-dependent
-- property.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_line_rasterization VK_EXT_line_rasterization>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_line_rasterization VK_KHR_line_rasterization>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceLineRasterizationProperties = PhysicalDeviceLineRasterizationProperties
  { -- | #extension-limits-lineSubPixelPrecisionBits# @lineSubPixelPrecisionBits@
    -- is the number of bits of subpixel precision in framebuffer coordinates
    -- xf and yf when rasterizing
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#primsrast-lines line segments>.
    PhysicalDeviceLineRasterizationProperties
-> "lineStippleFactor" ::: Word32
lineSubPixelPrecisionBits :: Word32 }
  deriving (Typeable, PhysicalDeviceLineRasterizationProperties
-> PhysicalDeviceLineRasterizationProperties -> Bool
(PhysicalDeviceLineRasterizationProperties
 -> PhysicalDeviceLineRasterizationProperties -> Bool)
-> (PhysicalDeviceLineRasterizationProperties
    -> PhysicalDeviceLineRasterizationProperties -> Bool)
-> Eq PhysicalDeviceLineRasterizationProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceLineRasterizationProperties
-> PhysicalDeviceLineRasterizationProperties -> Bool
== :: PhysicalDeviceLineRasterizationProperties
-> PhysicalDeviceLineRasterizationProperties -> Bool
$c/= :: PhysicalDeviceLineRasterizationProperties
-> PhysicalDeviceLineRasterizationProperties -> Bool
/= :: PhysicalDeviceLineRasterizationProperties
-> PhysicalDeviceLineRasterizationProperties -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceLineRasterizationProperties)
#endif
deriving instance Show PhysicalDeviceLineRasterizationProperties

instance ToCStruct PhysicalDeviceLineRasterizationProperties where
  withCStruct :: forall b.
PhysicalDeviceLineRasterizationProperties
-> (Ptr PhysicalDeviceLineRasterizationProperties -> IO b) -> IO b
withCStruct PhysicalDeviceLineRasterizationProperties
x Ptr PhysicalDeviceLineRasterizationProperties -> IO b
f = Int
-> (Ptr PhysicalDeviceLineRasterizationProperties -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceLineRasterizationProperties -> IO b) -> IO b)
-> (Ptr PhysicalDeviceLineRasterizationProperties -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceLineRasterizationProperties
p -> Ptr PhysicalDeviceLineRasterizationProperties
-> PhysicalDeviceLineRasterizationProperties -> IO b -> IO b
forall b.
Ptr PhysicalDeviceLineRasterizationProperties
-> PhysicalDeviceLineRasterizationProperties -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceLineRasterizationProperties
p PhysicalDeviceLineRasterizationProperties
x (Ptr PhysicalDeviceLineRasterizationProperties -> IO b
f Ptr PhysicalDeviceLineRasterizationProperties
p)
  pokeCStruct :: forall b.
Ptr PhysicalDeviceLineRasterizationProperties
-> PhysicalDeviceLineRasterizationProperties -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceLineRasterizationProperties
p PhysicalDeviceLineRasterizationProperties{"lineStippleFactor" ::: Word32
lineSubPixelPrecisionBits :: PhysicalDeviceLineRasterizationProperties
-> "lineStippleFactor" ::: Word32
lineSubPixelPrecisionBits :: "lineStippleFactor" ::: Word32
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationProperties
p Ptr PhysicalDeviceLineRasterizationProperties
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationProperties
p Ptr PhysicalDeviceLineRasterizationProperties
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("lineStippleFactor" ::: Word32)
-> ("lineStippleFactor" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationProperties
p Ptr PhysicalDeviceLineRasterizationProperties
-> Int -> Ptr ("lineStippleFactor" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ("lineStippleFactor" ::: Word32
lineSubPixelPrecisionBits)
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceLineRasterizationProperties -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceLineRasterizationProperties
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationProperties
p Ptr PhysicalDeviceLineRasterizationProperties
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_LINE_RASTERIZATION_PROPERTIES)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationProperties
p Ptr PhysicalDeviceLineRasterizationProperties
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("lineStippleFactor" ::: Word32)
-> ("lineStippleFactor" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceLineRasterizationProperties
p Ptr PhysicalDeviceLineRasterizationProperties
-> Int -> Ptr ("lineStippleFactor" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ("lineStippleFactor" ::: Word32
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct PhysicalDeviceLineRasterizationProperties where
  peekCStruct :: Ptr PhysicalDeviceLineRasterizationProperties
-> IO PhysicalDeviceLineRasterizationProperties
peekCStruct Ptr PhysicalDeviceLineRasterizationProperties
p = do
    lineSubPixelPrecisionBits <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceLineRasterizationProperties
p Ptr PhysicalDeviceLineRasterizationProperties
-> Int -> Ptr ("lineStippleFactor" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
    pure $ PhysicalDeviceLineRasterizationProperties
             lineSubPixelPrecisionBits

instance Storable PhysicalDeviceLineRasterizationProperties where
  sizeOf :: PhysicalDeviceLineRasterizationProperties -> Int
sizeOf ~PhysicalDeviceLineRasterizationProperties
_ = Int
24
  alignment :: PhysicalDeviceLineRasterizationProperties -> Int
alignment ~PhysicalDeviceLineRasterizationProperties
_ = Int
8
  peek :: Ptr PhysicalDeviceLineRasterizationProperties
-> IO PhysicalDeviceLineRasterizationProperties
peek = Ptr PhysicalDeviceLineRasterizationProperties
-> IO PhysicalDeviceLineRasterizationProperties
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr PhysicalDeviceLineRasterizationProperties
-> PhysicalDeviceLineRasterizationProperties -> IO ()
poke Ptr PhysicalDeviceLineRasterizationProperties
ptr PhysicalDeviceLineRasterizationProperties
poked = Ptr PhysicalDeviceLineRasterizationProperties
-> PhysicalDeviceLineRasterizationProperties -> IO () -> IO ()
forall b.
Ptr PhysicalDeviceLineRasterizationProperties
-> PhysicalDeviceLineRasterizationProperties -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceLineRasterizationProperties
ptr PhysicalDeviceLineRasterizationProperties
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero PhysicalDeviceLineRasterizationProperties where
  zero :: PhysicalDeviceLineRasterizationProperties
zero = ("lineStippleFactor" ::: Word32)
-> PhysicalDeviceLineRasterizationProperties
PhysicalDeviceLineRasterizationProperties
           "lineStippleFactor" ::: Word32
forall a. Zero a => a
zero


-- | VkPipelineRasterizationLineStateCreateInfo - Structure specifying
-- parameters of a newly created pipeline line rasterization state
--
-- = Description
--
-- If @stippledLineEnable@ is 'Vulkan.Core10.FundamentalTypes.FALSE', the
-- values of @lineStippleFactor@ and @lineStipplePattern@ are ignored.
--
-- == Valid Usage
--
-- -   #VUID-VkPipelineRasterizationLineStateCreateInfo-lineRasterizationMode-02768#
--     If @lineRasterizationMode@ is
--     'Vulkan.Core14.Enums.LineRasterizationMode.LINE_RASTERIZATION_MODE_RECTANGULAR',
--     then the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-rectangularLines rectangularLines>
--     feature /must/ be enabled
--
-- -   #VUID-VkPipelineRasterizationLineStateCreateInfo-lineRasterizationMode-02769#
--     If @lineRasterizationMode@ is
--     'Vulkan.Core14.Enums.LineRasterizationMode.LINE_RASTERIZATION_MODE_BRESENHAM',
--     then the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-bresenhamLines bresenhamLines>
--     feature /must/ be enabled
--
-- -   #VUID-VkPipelineRasterizationLineStateCreateInfo-lineRasterizationMode-02770#
--     If @lineRasterizationMode@ is
--     'Vulkan.Core14.Enums.LineRasterizationMode.LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH',
--     then the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-smoothLines smoothLines>
--     feature /must/ be enabled
--
-- -   #VUID-VkPipelineRasterizationLineStateCreateInfo-stippledLineEnable-02771#
--     If @stippledLineEnable@ is 'Vulkan.Core10.FundamentalTypes.TRUE' and
--     @lineRasterizationMode@ is
--     'Vulkan.Core14.Enums.LineRasterizationMode.LINE_RASTERIZATION_MODE_RECTANGULAR',
--     then the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-stippledRectangularLines stippledRectangularLines>
--     feature /must/ be enabled
--
-- -   #VUID-VkPipelineRasterizationLineStateCreateInfo-stippledLineEnable-02772#
--     If @stippledLineEnable@ is 'Vulkan.Core10.FundamentalTypes.TRUE' and
--     @lineRasterizationMode@ is
--     'Vulkan.Core14.Enums.LineRasterizationMode.LINE_RASTERIZATION_MODE_BRESENHAM',
--     then the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-stippledBresenhamLines stippledBresenhamLines>
--     feature /must/ be enabled
--
-- -   #VUID-VkPipelineRasterizationLineStateCreateInfo-stippledLineEnable-02773#
--     If @stippledLineEnable@ is 'Vulkan.Core10.FundamentalTypes.TRUE' and
--     @lineRasterizationMode@ is
--     'Vulkan.Core14.Enums.LineRasterizationMode.LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH',
--     then the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-stippledSmoothLines stippledSmoothLines>
--     feature /must/ be enabled
--
-- -   #VUID-VkPipelineRasterizationLineStateCreateInfo-stippledLineEnable-02774#
--     If @stippledLineEnable@ is 'Vulkan.Core10.FundamentalTypes.TRUE' and
--     @lineRasterizationMode@ is
--     'Vulkan.Core14.Enums.LineRasterizationMode.LINE_RASTERIZATION_MODE_DEFAULT',
--     then the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-stippledRectangularLines stippledRectangularLines>
--     feature /must/ be enabled and
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@strictLines@
--     /must/ be 'Vulkan.Core10.FundamentalTypes.TRUE'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkPipelineRasterizationLineStateCreateInfo-sType-sType#
--     @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO'
--
-- -   #VUID-VkPipelineRasterizationLineStateCreateInfo-lineRasterizationMode-parameter#
--     @lineRasterizationMode@ /must/ be a valid
--     'Vulkan.Core14.Enums.LineRasterizationMode.LineRasterizationMode'
--     value
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_line_rasterization VK_EXT_line_rasterization>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_line_rasterization VK_KHR_line_rasterization>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core14.Enums.LineRasterizationMode.LineRasterizationMode',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PipelineRasterizationLineStateCreateInfo = PipelineRasterizationLineStateCreateInfo
  { -- | @lineRasterizationMode@ is a
    -- 'Vulkan.Core14.Enums.LineRasterizationMode.LineRasterizationMode' value
    -- selecting the style of line rasterization.
    PipelineRasterizationLineStateCreateInfo -> LineRasterizationMode
lineRasterizationMode :: LineRasterizationMode
  , -- | @stippledLineEnable@ enables
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#primsrast-lines-stipple stippled line rasterization>.
    PipelineRasterizationLineStateCreateInfo -> Bool
stippledLineEnable :: Bool
  , -- | @lineStippleFactor@ is the repeat factor used in stippled line
    -- rasterization.
    PipelineRasterizationLineStateCreateInfo
-> "lineStippleFactor" ::: Word32
lineStippleFactor :: Word32
  , -- | @lineStipplePattern@ is the bit pattern used in stippled line
    -- rasterization.
    PipelineRasterizationLineStateCreateInfo
-> "lineStipplePattern" ::: Word16
lineStipplePattern :: Word16
  }
  deriving (Typeable, PipelineRasterizationLineStateCreateInfo
-> PipelineRasterizationLineStateCreateInfo -> Bool
(PipelineRasterizationLineStateCreateInfo
 -> PipelineRasterizationLineStateCreateInfo -> Bool)
-> (PipelineRasterizationLineStateCreateInfo
    -> PipelineRasterizationLineStateCreateInfo -> Bool)
-> Eq PipelineRasterizationLineStateCreateInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PipelineRasterizationLineStateCreateInfo
-> PipelineRasterizationLineStateCreateInfo -> Bool
== :: PipelineRasterizationLineStateCreateInfo
-> PipelineRasterizationLineStateCreateInfo -> Bool
$c/= :: PipelineRasterizationLineStateCreateInfo
-> PipelineRasterizationLineStateCreateInfo -> Bool
/= :: PipelineRasterizationLineStateCreateInfo
-> PipelineRasterizationLineStateCreateInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineRasterizationLineStateCreateInfo)
#endif
deriving instance Show PipelineRasterizationLineStateCreateInfo

instance ToCStruct PipelineRasterizationLineStateCreateInfo where
  withCStruct :: forall b.
PipelineRasterizationLineStateCreateInfo
-> (Ptr PipelineRasterizationLineStateCreateInfo -> IO b) -> IO b
withCStruct PipelineRasterizationLineStateCreateInfo
x Ptr PipelineRasterizationLineStateCreateInfo -> IO b
f = Int
-> (Ptr PipelineRasterizationLineStateCreateInfo -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr PipelineRasterizationLineStateCreateInfo -> IO b) -> IO b)
-> (Ptr PipelineRasterizationLineStateCreateInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PipelineRasterizationLineStateCreateInfo
p -> Ptr PipelineRasterizationLineStateCreateInfo
-> PipelineRasterizationLineStateCreateInfo -> IO b -> IO b
forall b.
Ptr PipelineRasterizationLineStateCreateInfo
-> PipelineRasterizationLineStateCreateInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineRasterizationLineStateCreateInfo
p PipelineRasterizationLineStateCreateInfo
x (Ptr PipelineRasterizationLineStateCreateInfo -> IO b
f Ptr PipelineRasterizationLineStateCreateInfo
p)
  pokeCStruct :: forall b.
Ptr PipelineRasterizationLineStateCreateInfo
-> PipelineRasterizationLineStateCreateInfo -> IO b -> IO b
pokeCStruct Ptr PipelineRasterizationLineStateCreateInfo
p PipelineRasterizationLineStateCreateInfo{Bool
"lineStipplePattern" ::: Word16
"lineStippleFactor" ::: Word32
LineRasterizationMode
lineRasterizationMode :: PipelineRasterizationLineStateCreateInfo -> LineRasterizationMode
stippledLineEnable :: PipelineRasterizationLineStateCreateInfo -> Bool
lineStippleFactor :: PipelineRasterizationLineStateCreateInfo
-> "lineStippleFactor" ::: Word32
lineStipplePattern :: PipelineRasterizationLineStateCreateInfo
-> "lineStipplePattern" ::: Word16
lineRasterizationMode :: LineRasterizationMode
stippledLineEnable :: Bool
lineStippleFactor :: "lineStippleFactor" ::: Word32
lineStipplePattern :: "lineStipplePattern" ::: Word16
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRasterizationLineStateCreateInfo
p Ptr PipelineRasterizationLineStateCreateInfo
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRasterizationLineStateCreateInfo
p Ptr PipelineRasterizationLineStateCreateInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr LineRasterizationMode -> LineRasterizationMode -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRasterizationLineStateCreateInfo
p Ptr PipelineRasterizationLineStateCreateInfo
-> Int -> Ptr LineRasterizationMode
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr LineRasterizationMode)) (LineRasterizationMode
lineRasterizationMode)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRasterizationLineStateCreateInfo
p Ptr PipelineRasterizationLineStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
stippledLineEnable))
    Ptr ("lineStippleFactor" ::: Word32)
-> ("lineStippleFactor" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRasterizationLineStateCreateInfo
p Ptr PipelineRasterizationLineStateCreateInfo
-> Int -> Ptr ("lineStippleFactor" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) ("lineStippleFactor" ::: Word32
lineStippleFactor)
    Ptr ("lineStipplePattern" ::: Word16)
-> ("lineStipplePattern" ::: Word16) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRasterizationLineStateCreateInfo
p Ptr PipelineRasterizationLineStateCreateInfo
-> Int -> Ptr ("lineStipplePattern" ::: Word16)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word16)) ("lineStipplePattern" ::: Word16
lineStipplePattern)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr PipelineRasterizationLineStateCreateInfo -> IO b -> IO b
pokeZeroCStruct Ptr PipelineRasterizationLineStateCreateInfo
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRasterizationLineStateCreateInfo
p Ptr PipelineRasterizationLineStateCreateInfo
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRasterizationLineStateCreateInfo
p Ptr PipelineRasterizationLineStateCreateInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr LineRasterizationMode -> LineRasterizationMode -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRasterizationLineStateCreateInfo
p Ptr PipelineRasterizationLineStateCreateInfo
-> Int -> Ptr LineRasterizationMode
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr LineRasterizationMode)) (LineRasterizationMode
forall a. Zero a => a
zero)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRasterizationLineStateCreateInfo
p Ptr PipelineRasterizationLineStateCreateInfo -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr ("lineStippleFactor" ::: Word32)
-> ("lineStippleFactor" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRasterizationLineStateCreateInfo
p Ptr PipelineRasterizationLineStateCreateInfo
-> Int -> Ptr ("lineStippleFactor" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) ("lineStippleFactor" ::: Word32
forall a. Zero a => a
zero)
    Ptr ("lineStipplePattern" ::: Word16)
-> ("lineStipplePattern" ::: Word16) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineRasterizationLineStateCreateInfo
p Ptr PipelineRasterizationLineStateCreateInfo
-> Int -> Ptr ("lineStipplePattern" ::: Word16)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word16)) ("lineStipplePattern" ::: Word16
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct PipelineRasterizationLineStateCreateInfo where
  peekCStruct :: Ptr PipelineRasterizationLineStateCreateInfo
-> IO PipelineRasterizationLineStateCreateInfo
peekCStruct Ptr PipelineRasterizationLineStateCreateInfo
p = do
    lineRasterizationMode <- forall a. Storable a => Ptr a -> IO a
peek @LineRasterizationMode ((Ptr PipelineRasterizationLineStateCreateInfo
p Ptr PipelineRasterizationLineStateCreateInfo
-> Int -> Ptr LineRasterizationMode
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr LineRasterizationMode))
    stippledLineEnable <- peek @Bool32 ((p `plusPtr` 20 :: Ptr Bool32))
    lineStippleFactor <- peek @Word32 ((p `plusPtr` 24 :: Ptr Word32))
    lineStipplePattern <- peek @Word16 ((p `plusPtr` 28 :: Ptr Word16))
    pure $ PipelineRasterizationLineStateCreateInfo
             lineRasterizationMode
             (bool32ToBool stippledLineEnable)
             lineStippleFactor
             lineStipplePattern

instance Storable PipelineRasterizationLineStateCreateInfo where
  sizeOf :: PipelineRasterizationLineStateCreateInfo -> Int
sizeOf ~PipelineRasterizationLineStateCreateInfo
_ = Int
32
  alignment :: PipelineRasterizationLineStateCreateInfo -> Int
alignment ~PipelineRasterizationLineStateCreateInfo
_ = Int
8
  peek :: Ptr PipelineRasterizationLineStateCreateInfo
-> IO PipelineRasterizationLineStateCreateInfo
peek = Ptr PipelineRasterizationLineStateCreateInfo
-> IO PipelineRasterizationLineStateCreateInfo
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr PipelineRasterizationLineStateCreateInfo
-> PipelineRasterizationLineStateCreateInfo -> IO ()
poke Ptr PipelineRasterizationLineStateCreateInfo
ptr PipelineRasterizationLineStateCreateInfo
poked = Ptr PipelineRasterizationLineStateCreateInfo
-> PipelineRasterizationLineStateCreateInfo -> IO () -> IO ()
forall b.
Ptr PipelineRasterizationLineStateCreateInfo
-> PipelineRasterizationLineStateCreateInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineRasterizationLineStateCreateInfo
ptr PipelineRasterizationLineStateCreateInfo
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero PipelineRasterizationLineStateCreateInfo where
  zero :: PipelineRasterizationLineStateCreateInfo
zero = LineRasterizationMode
-> Bool
-> ("lineStippleFactor" ::: Word32)
-> ("lineStipplePattern" ::: Word16)
-> PipelineRasterizationLineStateCreateInfo
PipelineRasterizationLineStateCreateInfo
           LineRasterizationMode
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero
           "lineStippleFactor" ::: Word32
forall a. Zero a => a
zero
           "lineStipplePattern" ::: Word16
forall a. Zero a => a
zero