{-# language CPP #-}
-- | = Name
--
-- VK_EXT_extended_dynamic_state2 - device extension
--
-- == VK_EXT_extended_dynamic_state2
--
-- [__Name String__]
--     @VK_EXT_extended_dynamic_state2@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     378
--
-- [__Revision__]
--     1
--
-- [__Ratification Status__]
--     Not ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_physical_device_properties2 VK_KHR_get_physical_device_properties2>
--     or
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.1 Version 1.1>
--
-- [__Deprecation State__]
--
--     -   /Promoted/ to
--         <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.3-promotions Vulkan 1.3>
--
-- [__Contact__]
--
--     -   Vikram Kushwaha
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_EXT_extended_dynamic_state2] @vkushwaha-nv%0A*Here describe the issue or question you have about the VK_EXT_extended_dynamic_state2 extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2021-04-12
--
-- [__Interactions and External Dependencies__]
--
--     -   Promoted to Vulkan 1.3 Core
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Vikram Kushwaha, NVIDIA
--
--     -   Piers Daniell, NVIDIA
--
--     -   Jeff Bolz, NVIDIA
--
-- == Description
--
-- This extension adds some more dynamic state to support applications that
-- need to reduce the number of pipeline state objects they compile and
-- bind.
--
-- == New Commands
--
-- -   'cmdSetDepthBiasEnableEXT'
--
-- -   'cmdSetLogicOpEXT'
--
-- -   'cmdSetPatchControlPointsEXT'
--
-- -   'cmdSetPrimitiveRestartEnableEXT'
--
-- -   'cmdSetRasterizerDiscardEnableEXT'
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceExtendedDynamicState2FeaturesEXT'
--
-- == New Enum Constants
--
-- -   'EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME'
--
-- -   'EXT_EXTENDED_DYNAMIC_STATE_2_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.DynamicState.DynamicState':
--
--     -   'DYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT'
--
--     -   'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_LOGIC_OP_EXT'
--
--     -   'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT'
--
--     -   'DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT'
--
--     -   'DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT'
--
-- == Promotion to Vulkan 1.3
--
-- This extension has been partially promoted. The dynamic state enumerants
-- 'DYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT',
-- 'DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT', and
-- 'DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT'; and the corresponding
-- entry points in this extension are included in core Vulkan 1.3, with the
-- EXT suffix omitted. The enumerants and entry points for dynamic logic
-- operation and patch control points are not promoted, nor is the feature
-- structure. Extension interfaces that were promoted remain available as
-- aliases of the core functionality.
--
-- == Version History
--
-- -   Revision 1, 2021-04-12 (Vikram Kushwaha)
--
--     -   Internal revisions
--
-- == See Also
--
-- 'PhysicalDeviceExtendedDynamicState2FeaturesEXT',
-- 'cmdSetDepthBiasEnableEXT', 'cmdSetLogicOpEXT',
-- 'cmdSetPatchControlPointsEXT', 'cmdSetPrimitiveRestartEnableEXT',
-- 'cmdSetRasterizerDiscardEnableEXT'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_EXT_extended_dynamic_state2 Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_EXT_extended_dynamic_state2  ( cmdSetPatchControlPointsEXT
                                                         , cmdSetLogicOpEXT
                                                         , pattern DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT
                                                         , pattern DYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT
                                                         , pattern DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT
                                                         , cmdSetRasterizerDiscardEnableEXT
                                                         , cmdSetDepthBiasEnableEXT
                                                         , cmdSetPrimitiveRestartEnableEXT
                                                         , PhysicalDeviceExtendedDynamicState2FeaturesEXT(..)
                                                         , EXT_EXTENDED_DYNAMIC_STATE_2_SPEC_VERSION
                                                         , pattern EXT_EXTENDED_DYNAMIC_STATE_2_SPEC_VERSION
                                                         , EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME
                                                         , pattern EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME
                                                         ) 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.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 GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Kind (Type)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core13.Promoted_From_VK_EXT_extended_dynamic_state2 (cmdSetDepthBiasEnable)
import Vulkan.Core13.Promoted_From_VK_EXT_extended_dynamic_state2 (cmdSetPrimitiveRestartEnable)
import Vulkan.Core13.Promoted_From_VK_EXT_extended_dynamic_state2 (cmdSetRasterizerDiscardEnable)
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(pVkCmdSetLogicOpEXT))
import Vulkan.Dynamic (DeviceCmds(pVkCmdSetPatchControlPointsEXT))
import Vulkan.Core10.Enums.LogicOp (LogicOp)
import Vulkan.Core10.Enums.LogicOp (LogicOp(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.DynamicState (DynamicState(DYNAMIC_STATE_DEPTH_BIAS_ENABLE))
import Vulkan.Core10.Enums.DynamicState (DynamicState(DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE))
import Vulkan.Core10.Enums.DynamicState (DynamicState(DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdSetPatchControlPointsEXT
  :: FunPtr (Ptr CommandBuffer_T -> Word32 -> IO ()) -> Ptr CommandBuffer_T -> Word32 -> IO ()

-- | vkCmdSetPatchControlPointsEXT - Specify the number of control points per
-- patch dynamically for a command buffer
--
-- = Description
--
-- This command sets the number of control points per patch for subsequent
-- drawing commands when drawing using
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#shaders-objects shader objects>,
-- or when the graphics pipeline is created with
-- 'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT'
-- set in
-- 'Vulkan.Core10.Pipeline.PipelineDynamicStateCreateInfo'::@pDynamicStates@.
-- Otherwise, this state is specified by the
-- 'Vulkan.Core10.Pipeline.PipelineTessellationStateCreateInfo'::@patchControlPoints@
-- value used to create the currently active pipeline.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdSetPatchControlPointsEXT-None-08574# Either the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-extendedDynamicState2PatchControlPoints extendedDynamicState2PatchControlPoints>
--     feature or the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-shaderObject shaderObject>
--     feature or both /must/ be enabled
--
-- -   #VUID-vkCmdSetPatchControlPointsEXT-patchControlPoints-04874#
--     @patchControlPoints@ /must/ be greater than zero and less than or
--     equal to
--     'Vulkan.Core10.DeviceInitialization.PhysicalDeviceLimits'::@maxTessellationPatchSize@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdSetPatchControlPointsEXT-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdSetPatchControlPointsEXT-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-vkCmdSetPatchControlPointsEXT-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics operations
--
-- -   #VUID-vkCmdSetPatchControlPointsEXT-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                                                                                                                     | Graphics                                                                                                              | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             |                                                                                                                       |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_extended_dynamic_state2 VK_EXT_extended_dynamic_state2>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_shader_object VK_EXT_shader_object>,
-- 'Vulkan.Core10.Handles.CommandBuffer'
cmdSetPatchControlPointsEXT :: forall io
                             . (MonadIO io)
                            => -- | @commandBuffer@ is the command buffer into which the command will be
                               -- recorded.
                               CommandBuffer
                            -> -- | @patchControlPoints@ specifies the number of control points per patch.
                               ("patchControlPoints" ::: Word32)
                            -> io ()
cmdSetPatchControlPointsEXT :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer -> ("patchControlPoints" ::: Word32) -> io ()
cmdSetPatchControlPointsEXT CommandBuffer
commandBuffer "patchControlPoints" ::: Word32
patchControlPoints = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
  let vkCmdSetPatchControlPointsEXTPtr :: FunPtr
  (Ptr CommandBuffer_T -> ("patchControlPoints" ::: Word32) -> IO ())
vkCmdSetPatchControlPointsEXTPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T -> ("patchControlPoints" ::: Word32) -> IO ())
pVkCmdSetPatchControlPointsEXT (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T -> ("patchControlPoints" ::: Word32) -> IO ())
vkCmdSetPatchControlPointsEXTPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdSetPatchControlPointsEXT is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkCmdSetPatchControlPointsEXT' :: Ptr CommandBuffer_T -> ("patchControlPoints" ::: Word32) -> IO ()
vkCmdSetPatchControlPointsEXT' = FunPtr
  (Ptr CommandBuffer_T -> ("patchControlPoints" ::: Word32) -> IO ())
-> Ptr CommandBuffer_T
-> ("patchControlPoints" ::: Word32)
-> IO ()
mkVkCmdSetPatchControlPointsEXT FunPtr
  (Ptr CommandBuffer_T -> ("patchControlPoints" ::: Word32) -> IO ())
vkCmdSetPatchControlPointsEXTPtr
  forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdSetPatchControlPointsEXT" (Ptr CommandBuffer_T -> ("patchControlPoints" ::: Word32) -> IO ()
vkCmdSetPatchControlPointsEXT'
                                                      (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                                      ("patchControlPoints" ::: Word32
patchControlPoints))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdSetLogicOpEXT
  :: FunPtr (Ptr CommandBuffer_T -> LogicOp -> IO ()) -> Ptr CommandBuffer_T -> LogicOp -> IO ()

-- | vkCmdSetLogicOpEXT - Select which logical operation to apply for blend
-- state dynamically for a command buffer
--
-- = Description
--
-- This command sets the logical operation for blend state for subsequent
-- drawing commands when drawing using
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#shaders-objects shader objects>,
-- or when the graphics pipeline is created with
-- 'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_LOGIC_OP_EXT' set in
-- 'Vulkan.Core10.Pipeline.PipelineDynamicStateCreateInfo'::@pDynamicStates@.
-- Otherwise, this state is specified by the
-- 'Vulkan.Core10.Pipeline.PipelineColorBlendStateCreateInfo'::@logicOp@
-- value used to create the currently active pipeline.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdSetLogicOpEXT-None-08544# Either the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-extendedDynamicState2LogicOp extendedDynamicState2LogicOp>
--     feature or the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-shaderObject shaderObject>
--     feature or both /must/ be enabled
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdSetLogicOpEXT-commandBuffer-parameter# @commandBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdSetLogicOpEXT-logicOp-parameter# @logicOp@ /must/ be a
--     valid 'Vulkan.Core10.Enums.LogicOp.LogicOp' value
--
-- -   #VUID-vkCmdSetLogicOpEXT-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-vkCmdSetLogicOpEXT-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics operations
--
-- -   #VUID-vkCmdSetLogicOpEXT-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                                                                                                                     | Graphics                                                                                                              | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             |                                                                                                                       |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_extended_dynamic_state2 VK_EXT_extended_dynamic_state2>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_shader_object VK_EXT_shader_object>,
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'Vulkan.Core10.Enums.LogicOp.LogicOp'
cmdSetLogicOpEXT :: forall io
                  . (MonadIO io)
                 => -- | @commandBuffer@ is the command buffer into which the command will be
                    -- recorded.
                    CommandBuffer
                 -> -- | @logicOp@ specifies the logical operation to apply for blend state.
                    LogicOp
                 -> io ()
cmdSetLogicOpEXT :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer -> LogicOp -> io ()
cmdSetLogicOpEXT CommandBuffer
commandBuffer LogicOp
logicOp = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
  let vkCmdSetLogicOpEXTPtr :: FunPtr (Ptr CommandBuffer_T -> LogicOp -> IO ())
vkCmdSetLogicOpEXTPtr = DeviceCmds -> FunPtr (Ptr CommandBuffer_T -> LogicOp -> IO ())
pVkCmdSetLogicOpEXT (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr CommandBuffer_T -> LogicOp -> IO ())
vkCmdSetLogicOpEXTPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdSetLogicOpEXT is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkCmdSetLogicOpEXT' :: Ptr CommandBuffer_T -> LogicOp -> IO ()
vkCmdSetLogicOpEXT' = FunPtr (Ptr CommandBuffer_T -> LogicOp -> IO ())
-> Ptr CommandBuffer_T -> LogicOp -> IO ()
mkVkCmdSetLogicOpEXT FunPtr (Ptr CommandBuffer_T -> LogicOp -> IO ())
vkCmdSetLogicOpEXTPtr
  forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdSetLogicOpEXT" (Ptr CommandBuffer_T -> LogicOp -> IO ()
vkCmdSetLogicOpEXT'
                                           (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                           (LogicOp
logicOp))
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()


-- No documentation found for TopLevel "VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT"
pattern $bDYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT :: DynamicState
$mDYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT :: forall {r}. DynamicState -> ((# #) -> r) -> ((# #) -> r) -> r
DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT = DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE


-- No documentation found for TopLevel "VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT"
pattern $bDYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT :: DynamicState
$mDYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT :: forall {r}. DynamicState -> ((# #) -> r) -> ((# #) -> r) -> r
DYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT = DYNAMIC_STATE_DEPTH_BIAS_ENABLE


-- No documentation found for TopLevel "VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT"
pattern $bDYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT :: DynamicState
$mDYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT :: forall {r}. DynamicState -> ((# #) -> r) -> ((# #) -> r) -> r
DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT = DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE


-- No documentation found for TopLevel "vkCmdSetRasterizerDiscardEnableEXT"
cmdSetRasterizerDiscardEnableEXT :: CommandBuffer -> Bool -> io ()
cmdSetRasterizerDiscardEnableEXT = forall (io :: * -> *). MonadIO io => CommandBuffer -> Bool -> io ()
cmdSetRasterizerDiscardEnable


-- No documentation found for TopLevel "vkCmdSetDepthBiasEnableEXT"
cmdSetDepthBiasEnableEXT :: CommandBuffer -> Bool -> io ()
cmdSetDepthBiasEnableEXT = forall (io :: * -> *). MonadIO io => CommandBuffer -> Bool -> io ()
cmdSetDepthBiasEnable


-- No documentation found for TopLevel "vkCmdSetPrimitiveRestartEnableEXT"
cmdSetPrimitiveRestartEnableEXT :: CommandBuffer -> Bool -> io ()
cmdSetPrimitiveRestartEnableEXT = forall (io :: * -> *). MonadIO io => CommandBuffer -> Bool -> io ()
cmdSetPrimitiveRestartEnable


-- | VkPhysicalDeviceExtendedDynamicState2FeaturesEXT - Structure describing
-- what extended dynamic state can be used
--
-- = Members
--
-- This structure describes the following features:
--
-- = Description
--
-- If the 'PhysicalDeviceExtendedDynamicState2FeaturesEXT' 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. 'PhysicalDeviceExtendedDynamicState2FeaturesEXT' /can/ also
-- be used in the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo'
-- to selectively enable these features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_extended_dynamic_state2 VK_EXT_extended_dynamic_state2>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceExtendedDynamicState2FeaturesEXT = PhysicalDeviceExtendedDynamicState2FeaturesEXT
  { -- | #features-extendedDynamicState2# @extendedDynamicState2@ indicates that
    -- the implementation supports the following dynamic states:
    --
    -- -   'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_DEPTH_BIAS_ENABLE'
    --
    -- -   'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE'
    --
    -- -   'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE'
    PhysicalDeviceExtendedDynamicState2FeaturesEXT -> Bool
extendedDynamicState2 :: Bool
  , -- | #features-extendedDynamicState2LogicOp# @extendedDynamicState2LogicOp@
    -- indicates that the implementation supports the following dynamic state:
    --
    -- -   'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_LOGIC_OP_EXT'
    PhysicalDeviceExtendedDynamicState2FeaturesEXT -> Bool
extendedDynamicState2LogicOp :: Bool
  , -- | #features-extendedDynamicState2PatchControlPoints#
    -- @extendedDynamicState2PatchControlPoints@ indicates that the
    -- implementation supports the following dynamic state:
    --
    -- -   'Vulkan.Core10.Enums.DynamicState.DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT'
    PhysicalDeviceExtendedDynamicState2FeaturesEXT -> Bool
extendedDynamicState2PatchControlPoints :: Bool
  }
  deriving (Typeable, PhysicalDeviceExtendedDynamicState2FeaturesEXT
-> PhysicalDeviceExtendedDynamicState2FeaturesEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceExtendedDynamicState2FeaturesEXT
-> PhysicalDeviceExtendedDynamicState2FeaturesEXT -> Bool
$c/= :: PhysicalDeviceExtendedDynamicState2FeaturesEXT
-> PhysicalDeviceExtendedDynamicState2FeaturesEXT -> Bool
== :: PhysicalDeviceExtendedDynamicState2FeaturesEXT
-> PhysicalDeviceExtendedDynamicState2FeaturesEXT -> Bool
$c== :: PhysicalDeviceExtendedDynamicState2FeaturesEXT
-> PhysicalDeviceExtendedDynamicState2FeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceExtendedDynamicState2FeaturesEXT)
#endif
deriving instance Show PhysicalDeviceExtendedDynamicState2FeaturesEXT

instance ToCStruct PhysicalDeviceExtendedDynamicState2FeaturesEXT where
  withCStruct :: forall b.
PhysicalDeviceExtendedDynamicState2FeaturesEXT
-> (Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT -> IO b)
-> IO b
withCStruct PhysicalDeviceExtendedDynamicState2FeaturesEXT
x Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
p PhysicalDeviceExtendedDynamicState2FeaturesEXT
x (Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT -> IO b
f Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
p)
  pokeCStruct :: forall b.
Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
-> PhysicalDeviceExtendedDynamicState2FeaturesEXT -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
p PhysicalDeviceExtendedDynamicState2FeaturesEXT{Bool
extendedDynamicState2PatchControlPoints :: Bool
extendedDynamicState2LogicOp :: Bool
extendedDynamicState2 :: Bool
$sel:extendedDynamicState2PatchControlPoints:PhysicalDeviceExtendedDynamicState2FeaturesEXT :: PhysicalDeviceExtendedDynamicState2FeaturesEXT -> Bool
$sel:extendedDynamicState2LogicOp:PhysicalDeviceExtendedDynamicState2FeaturesEXT :: PhysicalDeviceExtendedDynamicState2FeaturesEXT -> Bool
$sel:extendedDynamicState2:PhysicalDeviceExtendedDynamicState2FeaturesEXT :: PhysicalDeviceExtendedDynamicState2FeaturesEXT -> Bool
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
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 PhysicalDeviceExtendedDynamicState2FeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
extendedDynamicState2))
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
extendedDynamicState2LogicOp))
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
extendedDynamicState2PatchControlPoints))
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
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 PhysicalDeviceExtendedDynamicState2FeaturesEXT
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 PhysicalDeviceExtendedDynamicState2FeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct PhysicalDeviceExtendedDynamicState2FeaturesEXT where
  peekCStruct :: Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
-> IO PhysicalDeviceExtendedDynamicState2FeaturesEXT
peekCStruct Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
p = do
    Bool32
extendedDynamicState2 <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    Bool32
extendedDynamicState2LogicOp <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32))
    Bool32
extendedDynamicState2PatchControlPoints <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceExtendedDynamicState2FeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Bool
-> Bool -> Bool -> PhysicalDeviceExtendedDynamicState2FeaturesEXT
PhysicalDeviceExtendedDynamicState2FeaturesEXT
             (Bool32 -> Bool
bool32ToBool Bool32
extendedDynamicState2)
             (Bool32 -> Bool
bool32ToBool Bool32
extendedDynamicState2LogicOp)
             (Bool32 -> Bool
bool32ToBool Bool32
extendedDynamicState2PatchControlPoints)

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

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


type EXT_EXTENDED_DYNAMIC_STATE_2_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_EXT_EXTENDED_DYNAMIC_STATE_2_SPEC_VERSION"
pattern EXT_EXTENDED_DYNAMIC_STATE_2_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_EXTENDED_DYNAMIC_STATE_2_SPEC_VERSION :: forall a. Integral a => a
$mEXT_EXTENDED_DYNAMIC_STATE_2_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_EXTENDED_DYNAMIC_STATE_2_SPEC_VERSION = 1


type EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME = "VK_EXT_extended_dynamic_state2"

-- No documentation found for TopLevel "VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME"
pattern EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mEXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME = "VK_EXT_extended_dynamic_state2"