{-# language CPP #-}
module Vulkan.Extensions.VK_KHR_fragment_shading_rate  ( cmdSetFragmentShadingRateKHR
                                                       , getPhysicalDeviceFragmentShadingRatesKHR
                                                       , pattern IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR
                                                       , pattern ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR
                                                       , pattern IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR
                                                       , pattern PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR
                                                       , FragmentShadingRateAttachmentInfoKHR(..)
                                                       , PipelineFragmentShadingRateStateCreateInfoKHR(..)
                                                       , PhysicalDeviceFragmentShadingRateFeaturesKHR(..)
                                                       , PhysicalDeviceFragmentShadingRatePropertiesKHR(..)
                                                       , PhysicalDeviceFragmentShadingRateKHR(..)
                                                       , FragmentShadingRateCombinerOpKHR( FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR
                                                                                         , FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR
                                                                                         , FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR
                                                                                         , FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR
                                                                                         , FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR
                                                                                         , ..
                                                                                         )
                                                       , KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION
                                                       , pattern KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION
                                                       , KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME
                                                       , pattern KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME
                                                       ) where

import Vulkan.CStruct.Utils (FixedArray)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Read (choose)
import GHC.Read (expectP)
import GHC.Read (parens)
import GHC.Show (showParen)
import GHC.Show (showString)
import GHC.Show (showsPrec)
import Text.ParserCombinators.ReadPrec ((+++))
import Text.ParserCombinators.ReadPrec (prec)
import Text.ParserCombinators.ReadPrec (step)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
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 Data.Int (Int32)
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import Data.Word (Word32)
import Text.Read.Lex (Lexeme(Ident))
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.CStruct.Utils (lowerArrayPtr)
import Vulkan.CStruct.Extends (peekSomeCStruct)
import Vulkan.CStruct.Extends (withSomeCStruct)
import Vulkan.NamedType ((:::))
import Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2 (AttachmentReference2)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Dynamic (DeviceCmds(pVkCmdSetFragmentShadingRateKHR))
import Vulkan.Core10.FundamentalTypes (Extent2D)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.Dynamic (InstanceCmds(pVkGetPhysicalDeviceFragmentShadingRatesKHR))
import Vulkan.Core10.Handles (PhysicalDevice)
import Vulkan.Core10.Handles (PhysicalDevice(..))
import Vulkan.Core10.Handles (PhysicalDevice_T)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.SampleCountFlagBits (SampleCountFlagBits)
import Vulkan.Core10.Enums.SampleCountFlagBits (SampleCountFlags)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.CStruct.Extends (SomeStruct(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Exception (VulkanException(..))
import Vulkan.Zero (Zero)
import Vulkan.Zero (Zero(..))
import Vulkan.Core10.Enums.AccessFlagBits (AccessFlags)
import Vulkan.Core10.Enums.AccessFlagBits (AccessFlagBits(ACCESS_SHADING_RATE_IMAGE_READ_BIT_NV))
import Vulkan.Core10.Enums.ImageLayout (ImageLayout(IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV))
import Vulkan.Core10.Enums.ImageUsageFlagBits (ImageUsageFlags)
import Vulkan.Core10.Enums.ImageUsageFlagBits (ImageUsageFlagBits(IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV))
import Vulkan.Core10.Enums.PipelineStageFlagBits (PipelineStageFlags)
import Vulkan.Core10.Enums.PipelineStageFlagBits (PipelineStageFlagBits(PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdSetFragmentShadingRateKHR
  :: FunPtr (Ptr CommandBuffer_T -> Ptr Extent2D -> Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR) -> IO ()) -> Ptr CommandBuffer_T -> Ptr Extent2D -> Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR) -> IO ()

-- | vkCmdSetFragmentShadingRateKHR - Set pipeline fragment shading rate
-- dynamically
--
-- == Valid Usage
--
-- -   If
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-pipelineFragmentShadingRate pipelineFragmentShadingRate>
--     is not enabled, @pFragmentSize@->@width@ /must/ be @1@
--
-- -   If
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-pipelineFragmentShadingRate pipelineFragmentShadingRate>
--     is not enabled, @pFragmentSize@->@height@ /must/ be @1@
--
-- -   One of
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-pipelineFragmentShadingRate pipelineFragmentShadingRate>,
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-primitiveFragmentShadingRate primitiveFragmentShadingRate>,
--     or
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-attachmentFragmentShadingRate attachmentFragmentShadingRate>
--     /must/ be enabled
--
-- -   If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#feature-primitiveFragmentShadingRate primitiveFragmentShadingRate feature>
--     is not enabled, @combinerOps@[0] /must/ be
--     'FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR'
--
-- -   If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#feature-attachmentFragmentShadingRate attachmentFragmentShadingRate feature>
--     is not enabled, @combinerOps@[1] /must/ be
--     'FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR'
--
-- -   If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-fragmentShadingRateNonTrivialCombinerOps fragmentSizeNonTrivialCombinerOps>
--     limit is not supported, elements of @combinerOps@ /must/ be either
--     'FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR' or
--     'FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR'
--
-- -   @pFragmentSize@->@width@ /must/ be greater than or equal to @1@
--
-- -   @pFragmentSize@->@height@ /must/ be greater than or equal to @1@
--
-- -   @pFragmentSize@->@width@ /must/ be a power-of-two value
--
-- -   @pFragmentSize@->@height@ /must/ be a power-of-two value
--
-- -   @pFragmentSize@->@width@ /must/ be less than or equal to @4@
--
-- -   @pFragmentSize@->@height@ /must/ be less than or equal to @4@
--
-- == Valid Usage (Implicit)
--
-- -   @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   @pFragmentSize@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.FundamentalTypes.Extent2D' structure
--
-- -   Any given element of @combinerOps@ /must/ be a valid
--     'FragmentShadingRateCombinerOpKHR' value
--
-- -   @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   The 'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support graphics operations
--
-- == 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#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#synchronization-pipeline-stages-types Pipeline Type> |
-- +============================================================================================================================+========================================================================================================================+=======================================================================================================================+=====================================================================================================================================+
-- | Primary                                                                                                                    | Both                                                                                                                   | Graphics                                                                                                              |                                                                                                                                     |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                       |                                                                                                                                     |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------+
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'Vulkan.Core10.FundamentalTypes.Extent2D',
-- 'FragmentShadingRateCombinerOpKHR'
cmdSetFragmentShadingRateKHR :: forall io
                              . (MonadIO io)
                             => -- | @commandBuffer@ is the command buffer into which the command will be
                                -- recorded.
                                CommandBuffer
                             -> -- | @pFragmentSize@ specifies the pipeline fragment shading rate for
                                -- subsequent draw commands.
                                ("fragmentSize" ::: Extent2D)
                             -> -- | @combinerOps@ specifies a 'FragmentShadingRateCombinerOpKHR' determining
                                -- how the
                                -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-fragment-shading-rate-pipeline pipeline>,
                                -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-fragment-shading-rate-primitive primitive>,
                                -- and
                                -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-fragment-shading-rate-attachment attachment shading rates>
                                -- are
                                -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-fragment-shading-rate-combining combined>
                                -- for fragments generated by subsequent drawing commands.
                                ("combinerOps" ::: (FragmentShadingRateCombinerOpKHR, FragmentShadingRateCombinerOpKHR))
                             -> io ()
cmdSetFragmentShadingRateKHR :: CommandBuffer
-> ("fragmentSize" ::: Extent2D)
-> ("combinerOps"
    ::: (FragmentShadingRateCombinerOpKHR,
         FragmentShadingRateCombinerOpKHR))
-> io ()
cmdSetFragmentShadingRateKHR commandBuffer :: CommandBuffer
commandBuffer fragmentSize :: "fragmentSize" ::: Extent2D
fragmentSize combinerOps :: "combinerOps"
::: (FragmentShadingRateCombinerOpKHR,
     FragmentShadingRateCombinerOpKHR)
combinerOps = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdSetFragmentShadingRateKHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
   -> ("combinerOps"
       ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
   -> IO ())
vkCmdSetFragmentShadingRateKHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
      -> ("combinerOps"
          ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
      -> IO ())
pVkCmdSetFragmentShadingRateKHR (CommandBuffer -> DeviceCmds
deviceCmds (CommandBuffer
commandBuffer :: CommandBuffer))
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
   -> ("combinerOps"
       ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
   -> IO ())
vkCmdSetFragmentShadingRateKHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
   -> ("combinerOps"
       ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
      -> ("combinerOps"
          ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
   -> ("combinerOps"
       ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. 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 "" "The function pointer for vkCmdSetFragmentShadingRateKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdSetFragmentShadingRateKHR' :: Ptr CommandBuffer_T
-> ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> ("combinerOps"
    ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
-> IO ()
vkCmdSetFragmentShadingRateKHR' = FunPtr
  (Ptr CommandBuffer_T
   -> ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
   -> ("combinerOps"
       ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
   -> IO ())
-> Ptr CommandBuffer_T
-> ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> ("combinerOps"
    ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
-> IO ()
mkVkCmdSetFragmentShadingRateKHR FunPtr
  (Ptr CommandBuffer_T
   -> ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
   -> ("combinerOps"
       ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
   -> IO ())
vkCmdSetFragmentShadingRateKHRPtr
  "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
pFragmentSize <- ((("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)) -> IO ())
 -> IO ())
-> ContT
     () IO ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
   -> IO ())
  -> IO ())
 -> ContT
      () IO ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)))
-> ((("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
     -> IO ())
    -> IO ())
-> ContT
     () IO ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
forall a b. (a -> b) -> a -> b
$ ("fragmentSize" ::: Extent2D)
-> (("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
    -> IO ())
-> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct ("fragmentSize" ::: Extent2D
fragmentSize)
  "combinerOps"
::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR)
pCombinerOps <- ((("combinerOps"
   ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
  -> IO ())
 -> IO ())
-> ContT
     ()
     IO
     ("combinerOps"
      ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("combinerOps"
    ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
   -> IO ())
  -> IO ())
 -> ContT
      ()
      IO
      ("combinerOps"
       ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR)))
-> ((("combinerOps"
      ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
     -> IO ())
    -> IO ())
-> ContT
     ()
     IO
     ("combinerOps"
      ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
forall a b. (a -> b) -> a -> b
$ Int
-> Int
-> (("combinerOps"
     ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
    -> IO ())
-> IO ()
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned @(FixedArray 2 FragmentShadingRateCombinerOpKHR) 8 4
  let pCombinerOps' :: Ptr FragmentShadingRateCombinerOpKHR
pCombinerOps' = ("combinerOps"
 ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
-> Ptr FragmentShadingRateCombinerOpKHR
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr "combinerOps"
::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR)
pCombinerOps
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ case ("combinerOps"
::: (FragmentShadingRateCombinerOpKHR,
     FragmentShadingRateCombinerOpKHR)
combinerOps) of
    (e0 :: FragmentShadingRateCombinerOpKHR
e0, e1 :: FragmentShadingRateCombinerOpKHR
e1) -> do
      Ptr FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr FragmentShadingRateCombinerOpKHR
pCombinerOps' :: Ptr FragmentShadingRateCombinerOpKHR) (FragmentShadingRateCombinerOpKHR
e0)
      Ptr FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr FragmentShadingRateCombinerOpKHR
pCombinerOps' Ptr FragmentShadingRateCombinerOpKHR
-> Int -> Ptr FragmentShadingRateCombinerOpKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr FragmentShadingRateCombinerOpKHR) (FragmentShadingRateCombinerOpKHR
e1)
  IO () -> ContT () IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CommandBuffer_T
-> ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> ("combinerOps"
    ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
-> IO ()
vkCmdSetFragmentShadingRateKHR' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
pFragmentSize ("combinerOps"
::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR)
pCombinerOps)
  () -> ContT () IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> ContT () IO ()) -> () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetPhysicalDeviceFragmentShadingRatesKHR
  :: FunPtr (Ptr PhysicalDevice_T -> Ptr Word32 -> Ptr PhysicalDeviceFragmentShadingRateKHR -> IO Result) -> Ptr PhysicalDevice_T -> Ptr Word32 -> Ptr PhysicalDeviceFragmentShadingRateKHR -> IO Result

-- | vkGetPhysicalDeviceFragmentShadingRatesKHR - Get available shading rates
-- for a physical device
--
-- = Description
--
-- If @pFragmentShadingRates@ is @NULL@, then the number of fragment
-- shading rates available is returned in @pFragmentShadingRateCount@.
-- Otherwise, @pFragmentShadingRateCount@ /must/ point to a variable set by
-- the user to the number of elements in the @pFragmentShadingRates@ array,
-- and on return the variable is overwritten with the number of structures
-- actually written to @pFragmentShadingRates@. If
-- @pFragmentShadingRateCount@ is less than the number of fragment shading
-- rates available, at most @pFragmentShadingRateCount@ structures will be
-- written, and 'Vulkan.Core10.Enums.Result.INCOMPLETE' will be returned
-- instead of 'Vulkan.Core10.Enums.Result.SUCCESS', to indicate that not
-- all the available fragment shading rates were returned.
--
-- The returned array of fragment shading rates /must/ be ordered from
-- largest @fragmentSize.width@ value to smallest, and each set of fragment
-- shading rates with the same @fragmentSize.width@ value /must/ be ordered
-- from largest @fragmentSize.height@ to smallest. Any two entries in the
-- array /must/ not have the same @fragmentSize@ values.
--
-- For any entry in the array, the following rules also apply:
--
-- -   The value of @fragmentSize.width@ /must/ be less than or equal to
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-maxFragmentSize maxFragmentSize.width>.
--
-- -   The value of @fragmentSize.width@ /must/ be greater than or equal to
--     @1@.
--
-- -   The value of @fragmentSize.width@ /must/ be a power-of-two.
--
-- -   The value of @fragmentSize.height@ /must/ be less than or equal to
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-maxFragmentSize maxFragmentSize.height>.
--
-- -   The value of @fragmentSize.height@ /must/ be greater than or equal
--     to @1@.
--
-- -   The value of @fragmentSize.height@ /must/ be a power-of-two.
--
-- -   The highest sample count in @sampleCounts@ /must/ be less than or
--     equal to
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-maxFragmentShadingRateRasterizationSamples maxFragmentShadingRateRasterizationSamples>.
--
-- -   The product of @fragmentSize.width@, @fragmentSize.height@, and the
--     highest sample count in @sampleCounts@ /must/ be less than or equal
--     to
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-maxFragmentShadingRateCoverageSamples maxFragmentShadingRateCoverageSamples>.
--
-- Implementations /must/ support at least the following shading rates:
--
-- +--------------------------------------------------------------+-----------------------------------+
-- | @sampleCounts@                                               | @fragmentSize@                    |
-- +==============================================================+===================================+
-- | 'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_1_BIT' | {2,2}                             |
-- | |                                                            |                                   |
-- | 'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_4_BIT' |                                   |
-- +--------------------------------------------------------------+-----------------------------------+
-- | 'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_1_BIT' | {2,1}                             |
-- | |                                                            |                                   |
-- | 'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_4_BIT' |                                   |
-- +--------------------------------------------------------------+-----------------------------------+
-- | ~0                                                           | {1,1}                             |
-- +--------------------------------------------------------------+-----------------------------------+
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-framebufferColorSampleCounts framebufferColorSampleCounts>,
-- includes 'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_2_BIT',
-- the required rates /must/ also include
-- 'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_2_BIT'.
--
-- Note
--
-- Including the {1,1} fragment size is done for completeness; it has no
-- actual effect on the support of rendering without setting the fragment
-- size. All sample counts are supported for this rate.
--
-- == Valid Usage (Implicit)
--
-- -   @physicalDevice@ /must/ be a valid
--     'Vulkan.Core10.Handles.PhysicalDevice' handle
--
-- -   @pFragmentShadingRateCount@ /must/ be a valid pointer to a
--     @uint32_t@ value
--
-- -   If the value referenced by @pFragmentShadingRateCount@ is not @0@,
--     and @pFragmentShadingRates@ is not @NULL@, @pFragmentShadingRates@
--     /must/ be a valid pointer to an array of @pFragmentShadingRateCount@
--     'PhysicalDeviceFragmentShadingRateKHR' structures
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
--     -   'Vulkan.Core10.Enums.Result.INCOMPLETE'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
-- = See Also
--
-- 'Vulkan.Core10.Handles.PhysicalDevice',
-- 'PhysicalDeviceFragmentShadingRateKHR'
getPhysicalDeviceFragmentShadingRatesKHR :: forall io
                                          . (MonadIO io)
                                         => -- | @physicalDevice@ is the handle to the physical device whose properties
                                            -- will be queried.
                                            PhysicalDevice
                                         -> io (Result, ("fragmentShadingRates" ::: Vector PhysicalDeviceFragmentShadingRateKHR))
getPhysicalDeviceFragmentShadingRatesKHR :: PhysicalDevice
-> io
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
getPhysicalDeviceFragmentShadingRatesKHR physicalDevice :: PhysicalDevice
physicalDevice = IO
  (Result,
   "fragmentShadingRates"
   ::: Vector PhysicalDeviceFragmentShadingRateKHR)
-> io
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO
   (Result,
    "fragmentShadingRates"
    ::: Vector PhysicalDeviceFragmentShadingRateKHR)
 -> io
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> (ContT
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR)
      IO
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR)
    -> IO
         (Result,
          "fragmentShadingRates"
          ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
-> io
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  (Result,
   "fragmentShadingRates"
   ::: Vector PhysicalDeviceFragmentShadingRateKHR)
  IO
  (Result,
   "fragmentShadingRates"
   ::: Vector PhysicalDeviceFragmentShadingRateKHR)
-> IO
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   (Result,
    "fragmentShadingRates"
    ::: Vector PhysicalDeviceFragmentShadingRateKHR)
   IO
   (Result,
    "fragmentShadingRates"
    ::: Vector PhysicalDeviceFragmentShadingRateKHR)
 -> io
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
-> io
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetPhysicalDeviceFragmentShadingRatesKHRPtr :: FunPtr
  (Ptr PhysicalDevice_T
   -> ("pFragmentShadingRateCount" ::: Ptr Word32)
   -> ("pFragmentShadingRates"
       ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
   -> IO Result)
vkGetPhysicalDeviceFragmentShadingRatesKHRPtr = InstanceCmds
-> FunPtr
     (Ptr PhysicalDevice_T
      -> ("pFragmentShadingRateCount" ::: Ptr Word32)
      -> ("pFragmentShadingRates"
          ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
      -> IO Result)
pVkGetPhysicalDeviceFragmentShadingRatesKHR (PhysicalDevice -> InstanceCmds
instanceCmds (PhysicalDevice
physicalDevice :: PhysicalDevice))
  IO ()
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR)
      IO
      ())
-> IO ()
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr PhysicalDevice_T
   -> ("pFragmentShadingRateCount" ::: Ptr Word32)
   -> ("pFragmentShadingRates"
       ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
   -> IO Result)
vkGetPhysicalDeviceFragmentShadingRatesKHRPtr FunPtr
  (Ptr PhysicalDevice_T
   -> ("pFragmentShadingRateCount" ::: Ptr Word32)
   -> ("pFragmentShadingRates"
       ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
   -> IO Result)
-> FunPtr
     (Ptr PhysicalDevice_T
      -> ("pFragmentShadingRateCount" ::: Ptr Word32)
      -> ("pFragmentShadingRates"
          ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr PhysicalDevice_T
   -> ("pFragmentShadingRateCount" ::: Ptr Word32)
   -> ("pFragmentShadingRates"
       ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. 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 "" "The function pointer for vkGetPhysicalDeviceFragmentShadingRatesKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetPhysicalDeviceFragmentShadingRatesKHR' :: Ptr PhysicalDevice_T
-> ("pFragmentShadingRateCount" ::: Ptr Word32)
-> ("pFragmentShadingRates"
    ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> IO Result
vkGetPhysicalDeviceFragmentShadingRatesKHR' = FunPtr
  (Ptr PhysicalDevice_T
   -> ("pFragmentShadingRateCount" ::: Ptr Word32)
   -> ("pFragmentShadingRates"
       ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
   -> IO Result)
-> Ptr PhysicalDevice_T
-> ("pFragmentShadingRateCount" ::: Ptr Word32)
-> ("pFragmentShadingRates"
    ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> IO Result
mkVkGetPhysicalDeviceFragmentShadingRatesKHR FunPtr
  (Ptr PhysicalDevice_T
   -> ("pFragmentShadingRateCount" ::: Ptr Word32)
   -> ("pFragmentShadingRates"
       ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
   -> IO Result)
vkGetPhysicalDeviceFragmentShadingRatesKHRPtr
  let physicalDevice' :: Ptr PhysicalDevice_T
physicalDevice' = PhysicalDevice -> Ptr PhysicalDevice_T
physicalDeviceHandle (PhysicalDevice
physicalDevice)
  "pFragmentShadingRateCount" ::: Ptr Word32
pPFragmentShadingRateCount <- ((("pFragmentShadingRateCount" ::: Ptr Word32)
  -> IO
       (Result,
        "fragmentShadingRates"
        ::: Vector PhysicalDeviceFragmentShadingRateKHR))
 -> IO
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     ("pFragmentShadingRateCount" ::: Ptr Word32)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pFragmentShadingRateCount" ::: Ptr Word32)
   -> IO
        (Result,
         "fragmentShadingRates"
         ::: Vector PhysicalDeviceFragmentShadingRateKHR))
  -> IO
       (Result,
        "fragmentShadingRates"
        ::: Vector PhysicalDeviceFragmentShadingRateKHR))
 -> ContT
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR)
      IO
      ("pFragmentShadingRateCount" ::: Ptr Word32))
-> ((("pFragmentShadingRateCount" ::: Ptr Word32)
     -> IO
          (Result,
           "fragmentShadingRates"
           ::: Vector PhysicalDeviceFragmentShadingRateKHR))
    -> IO
         (Result,
          "fragmentShadingRates"
          ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     ("pFragmentShadingRateCount" ::: Ptr Word32)
forall a b. (a -> b) -> a -> b
$ IO ("pFragmentShadingRateCount" ::: Ptr Word32)
-> (("pFragmentShadingRateCount" ::: Ptr Word32) -> IO ())
-> (("pFragmentShadingRateCount" ::: Ptr Word32)
    -> IO
         (Result,
          "fragmentShadingRates"
          ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> IO
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("pFragmentShadingRateCount" ::: Ptr Word32)
forall a. Int -> IO (Ptr a)
callocBytes @Word32 4) ("pFragmentShadingRateCount" ::: Ptr Word32) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result
 -> ContT
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR)
      IO
      Result)
-> IO Result
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     Result
forall a b. (a -> b) -> a -> b
$ Ptr PhysicalDevice_T
-> ("pFragmentShadingRateCount" ::: Ptr Word32)
-> ("pFragmentShadingRates"
    ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> IO Result
vkGetPhysicalDeviceFragmentShadingRatesKHR' Ptr PhysicalDevice_T
physicalDevice' ("pFragmentShadingRateCount" ::: Ptr Word32
pPFragmentShadingRateCount) ("pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
forall a. Ptr a
nullPtr)
  IO ()
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR)
      IO
      ())
-> IO ()
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  Word32
pFragmentShadingRateCount <- IO Word32
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     Word32
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Word32
 -> ContT
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR)
      IO
      Word32)
-> IO Word32
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     Word32
forall a b. (a -> b) -> a -> b
$ ("pFragmentShadingRateCount" ::: Ptr Word32) -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 "pFragmentShadingRateCount" ::: Ptr Word32
pPFragmentShadingRateCount
  "pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
pPFragmentShadingRates <- ((("pFragmentShadingRates"
   ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
  -> IO
       (Result,
        "fragmentShadingRates"
        ::: Vector PhysicalDeviceFragmentShadingRateKHR))
 -> IO
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     ("pFragmentShadingRates"
      ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("pFragmentShadingRates"
    ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
   -> IO
        (Result,
         "fragmentShadingRates"
         ::: Vector PhysicalDeviceFragmentShadingRateKHR))
  -> IO
       (Result,
        "fragmentShadingRates"
        ::: Vector PhysicalDeviceFragmentShadingRateKHR))
 -> ContT
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR)
      IO
      ("pFragmentShadingRates"
       ::: Ptr PhysicalDeviceFragmentShadingRateKHR))
-> ((("pFragmentShadingRates"
      ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
     -> IO
          (Result,
           "fragmentShadingRates"
           ::: Vector PhysicalDeviceFragmentShadingRateKHR))
    -> IO
         (Result,
          "fragmentShadingRates"
          ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     ("pFragmentShadingRates"
      ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
forall a b. (a -> b) -> a -> b
$ IO
  ("pFragmentShadingRates"
   ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> (("pFragmentShadingRates"
     ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
    -> IO ())
-> (("pFragmentShadingRates"
     ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
    -> IO
         (Result,
          "fragmentShadingRates"
          ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> IO
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int
-> IO
     ("pFragmentShadingRates"
      ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
forall a. Int -> IO (Ptr a)
callocBytes @PhysicalDeviceFragmentShadingRateKHR ((Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pFragmentShadingRateCount)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* 32)) ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> IO ()
forall a. Ptr a -> IO ()
free
  [()]
_ <- (Int
 -> ContT
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR)
      IO
      ())
-> [Int]
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     [()]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (\i :: Int
i -> ((()
  -> IO
       (Result,
        "fragmentShadingRates"
        ::: Vector PhysicalDeviceFragmentShadingRateKHR))
 -> IO
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((()
   -> IO
        (Result,
         "fragmentShadingRates"
         ::: Vector PhysicalDeviceFragmentShadingRateKHR))
  -> IO
       (Result,
        "fragmentShadingRates"
        ::: Vector PhysicalDeviceFragmentShadingRateKHR))
 -> ContT
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR)
      IO
      ())
-> ((()
     -> IO
          (Result,
           "fragmentShadingRates"
           ::: Vector PhysicalDeviceFragmentShadingRateKHR))
    -> IO
         (Result,
          "fragmentShadingRates"
          ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> IO
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
-> IO
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
forall a b. ToCStruct a => Ptr a -> IO b -> IO b
pokeZeroCStruct ("pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
pPFragmentShadingRates ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> Int
-> "pFragmentShadingRates"
   ::: Ptr PhysicalDeviceFragmentShadingRateKHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
i Int -> Int -> Int
forall a. Num a => a -> a -> a
* 32) :: Ptr PhysicalDeviceFragmentShadingRateKHR) (IO
   (Result,
    "fragmentShadingRates"
    ::: Vector PhysicalDeviceFragmentShadingRateKHR)
 -> IO
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> ((()
     -> IO
          (Result,
           "fragmentShadingRates"
           ::: Vector PhysicalDeviceFragmentShadingRateKHR))
    -> IO
         (Result,
          "fragmentShadingRates"
          ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> (()
    -> IO
         (Result,
          "fragmentShadingRates"
          ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> IO
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((()
 -> IO
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> ()
-> IO
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
forall a b. (a -> b) -> a -> b
$ ())) [0..(Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pFragmentShadingRateCount)) Int -> Int -> Int
forall a. Num a => a -> a -> a
- 1]
  Result
r' <- IO Result
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result
 -> ContT
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR)
      IO
      Result)
-> IO Result
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     Result
forall a b. (a -> b) -> a -> b
$ Ptr PhysicalDevice_T
-> ("pFragmentShadingRateCount" ::: Ptr Word32)
-> ("pFragmentShadingRates"
    ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> IO Result
vkGetPhysicalDeviceFragmentShadingRatesKHR' Ptr PhysicalDevice_T
physicalDevice' ("pFragmentShadingRateCount" ::: Ptr Word32
pPFragmentShadingRateCount) (("pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
pPFragmentShadingRates))
  IO ()
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR)
      IO
      ())
-> IO ()
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r' Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (VulkanException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r'))
  Word32
pFragmentShadingRateCount' <- IO Word32
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     Word32
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Word32
 -> ContT
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR)
      IO
      Word32)
-> IO Word32
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     Word32
forall a b. (a -> b) -> a -> b
$ ("pFragmentShadingRateCount" ::: Ptr Word32) -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 "pFragmentShadingRateCount" ::: Ptr Word32
pPFragmentShadingRateCount
  "fragmentShadingRates"
::: Vector PhysicalDeviceFragmentShadingRateKHR
pFragmentShadingRates' <- IO
  ("fragmentShadingRates"
   ::: Vector PhysicalDeviceFragmentShadingRateKHR)
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     ("fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO
   ("fragmentShadingRates"
    ::: Vector PhysicalDeviceFragmentShadingRateKHR)
 -> ContT
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR)
      IO
      ("fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> IO
     ("fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     ("fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
forall a b. (a -> b) -> a -> b
$ Int
-> (Int -> IO PhysicalDeviceFragmentShadingRateKHR)
-> IO
     ("fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Word32
pFragmentShadingRateCount')) (\i :: Int
i -> ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> IO PhysicalDeviceFragmentShadingRateKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @PhysicalDeviceFragmentShadingRateKHR ((("pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
pPFragmentShadingRates) ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> Int
-> "pFragmentShadingRates"
   ::: Ptr PhysicalDeviceFragmentShadingRateKHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (32 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr PhysicalDeviceFragmentShadingRateKHR)))
  (Result,
 "fragmentShadingRates"
 ::: Vector PhysicalDeviceFragmentShadingRateKHR)
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Result,
  "fragmentShadingRates"
  ::: Vector PhysicalDeviceFragmentShadingRateKHR)
 -> ContT
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR)
      IO
      (Result,
       "fragmentShadingRates"
       ::: Vector PhysicalDeviceFragmentShadingRateKHR))
-> (Result,
    "fragmentShadingRates"
    ::: Vector PhysicalDeviceFragmentShadingRateKHR)
-> ContT
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
     IO
     (Result,
      "fragmentShadingRates"
      ::: Vector PhysicalDeviceFragmentShadingRateKHR)
forall a b. (a -> b) -> a -> b
$ ((Result
r'), "fragmentShadingRates"
::: Vector PhysicalDeviceFragmentShadingRateKHR
pFragmentShadingRates')


-- No documentation found for TopLevel "VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR"
pattern $bIMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR :: ImageLayout
$mIMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR :: forall r. ImageLayout -> (Void# -> r) -> (Void# -> r) -> r
IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR = IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV


-- No documentation found for TopLevel "VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR"
pattern $bACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR :: AccessFlagBits
$mACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR :: forall r. AccessFlagBits -> (Void# -> r) -> (Void# -> r) -> r
ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR = ACCESS_SHADING_RATE_IMAGE_READ_BIT_NV


-- No documentation found for TopLevel "VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"
pattern $bIMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR :: ImageUsageFlagBits
$mIMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR :: forall r. ImageUsageFlagBits -> (Void# -> r) -> (Void# -> r) -> r
IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV


-- No documentation found for TopLevel "VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR"
pattern $bPIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR :: PipelineStageFlagBits
$mPIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR :: forall r.
PipelineStageFlagBits -> (Void# -> r) -> (Void# -> r) -> r
PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV


-- | VkFragmentShadingRateAttachmentInfoKHR - Structure specifying a fragment
-- shading rate attachment for a subpass
--
-- = Description
--
-- If no shading rate attachment is specified, or if this structure isn’t
-- specified, the implementation behaves as if a valid shading rate
-- attachment was specified with all texels specifying a single pixel per
-- fragment.
--
-- == Valid Usage
--
-- -   If @pFragmentShadingRateAttachment@ is not @NULL@ and its
--     @attachment@ member is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' then it /must/ have a
--     format whose features contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR'
--
-- -   If @pFragmentShadingRateAttachment@ is not @NULL@ and its
--     @attachment@ member is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', its @layout@ member
--     /must/ be equal to
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_GENERAL' or
--     'IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR'
--
-- -   If @pFragmentShadingRateAttachment@ is not @NULL@ and its
--     @attachment@ member is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED',
--     @shadingRateAttachmentTexelSize.width@ /must/ be a power of two
--     value
--
-- -   If @pFragmentShadingRateAttachment@ is not @NULL@ and its
--     @attachment@ member is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED',
--     @shadingRateAttachmentTexelSize.width@ /must/ be less than or equal
--     to
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-maxFragmentShadingRateAttachmentTexelSize maxFragmentShadingRateAttachmentTexelSize.width>
--
-- -   If @pFragmentShadingRateAttachment@ is not @NULL@ and its
--     @attachment@ member is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED',
--     @shadingRateAttachmentTexelSize.width@ /must/ be greater than or
--     equal to
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-minFragmentShadingRateAttachmentTexelSize minFragmentShadingRateAttachmentTexelSize.width>
--
-- -   If @pFragmentShadingRateAttachment@ is not @NULL@ and its
--     @attachment@ member is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED',
--     @shadingRateAttachmentTexelSize.height@ /must/ be a power of two
--     value
--
-- -   If @pFragmentShadingRateAttachment@ is not @NULL@ and its
--     @attachment@ member is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED',
--     @shadingRateAttachmentTexelSize.height@ /must/ be less than or equal
--     to
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-maxFragmentShadingRateAttachmentTexelSize maxFragmentShadingRateAttachmentTexelSize.height>
--
-- -   If @pFragmentShadingRateAttachment@ is not @NULL@ and its
--     @attachment@ member is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED',
--     @shadingRateAttachmentTexelSize.height@ /must/ be greater than or
--     equal to
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-minFragmentShadingRateAttachmentTexelSize minFragmentShadingRateAttachmentTexelSize.height>
--
-- -   If @pFragmentShadingRateAttachment@ is not @NULL@ and its
--     @attachment@ member is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', the quotient of
--     @shadingRateAttachmentTexelSize.width@ and
--     @shadingRateAttachmentTexelSize.height@ /must/ be less than or equal
--     to
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-maxFragmentShadingRateAttachmentTexelSizeAspectRatio maxFragmentShadingRateAttachmentTexelSizeAspectRatio>
--
-- -   If @pFragmentShadingRateAttachment@ is not @NULL@ and its
--     @attachment@ member is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', the quotient of
--     @shadingRateAttachmentTexelSize.height@ and
--     @shadingRateAttachmentTexelSize.width@ /must/ be less than or equal
--     to
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-maxFragmentShadingRateAttachmentTexelSizeAspectRatio maxFragmentShadingRateAttachmentTexelSizeAspectRatio>
--
-- == Valid Usage (Implicit)
--
-- -   @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR'
--
-- -   @pFragmentShadingRateAttachment@ /must/ be a valid pointer to a
--     valid
--     'Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2.AttachmentReference2'
--     structure
--
-- = See Also
--
-- 'Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2.AttachmentReference2',
-- 'Vulkan.Core10.FundamentalTypes.Extent2D',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data FragmentShadingRateAttachmentInfoKHR = FragmentShadingRateAttachmentInfoKHR
  { -- | @pFragmentShadingRateAttachment@ is an optional
    -- 'Vulkan.Extensions.VK_KHR_create_renderpass2.AttachmentReference2KHR'
    -- structure defining the fragment shading rate attachment for this
    -- subpass.
    FragmentShadingRateAttachmentInfoKHR
-> SomeStruct AttachmentReference2
fragmentShadingRateAttachment :: SomeStruct AttachmentReference2
  , -- | @shadingRateAttachmentTexelSize@ specifies the size of the portion of
    -- the framebuffer corresponding to each texel in
    -- @pFragmentShadingRateAttachment@.
    FragmentShadingRateAttachmentInfoKHR -> "fragmentSize" ::: Extent2D
shadingRateAttachmentTexelSize :: Extent2D
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (FragmentShadingRateAttachmentInfoKHR)
#endif
deriving instance Show FragmentShadingRateAttachmentInfoKHR

instance ToCStruct FragmentShadingRateAttachmentInfoKHR where
  withCStruct :: FragmentShadingRateAttachmentInfoKHR
-> (Ptr FragmentShadingRateAttachmentInfoKHR -> IO b) -> IO b
withCStruct x :: FragmentShadingRateAttachmentInfoKHR
x f :: Ptr FragmentShadingRateAttachmentInfoKHR -> IO b
f = Int
-> Int
-> (Ptr FragmentShadingRateAttachmentInfoKHR -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr FragmentShadingRateAttachmentInfoKHR -> IO b) -> IO b)
-> (Ptr FragmentShadingRateAttachmentInfoKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr FragmentShadingRateAttachmentInfoKHR
p -> Ptr FragmentShadingRateAttachmentInfoKHR
-> FragmentShadingRateAttachmentInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr FragmentShadingRateAttachmentInfoKHR
p FragmentShadingRateAttachmentInfoKHR
x (Ptr FragmentShadingRateAttachmentInfoKHR -> IO b
f Ptr FragmentShadingRateAttachmentInfoKHR
p)
  pokeCStruct :: Ptr FragmentShadingRateAttachmentInfoKHR
-> FragmentShadingRateAttachmentInfoKHR -> IO b -> IO b
pokeCStruct p :: Ptr FragmentShadingRateAttachmentInfoKHR
p FragmentShadingRateAttachmentInfoKHR{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FragmentShadingRateAttachmentInfoKHR
p Ptr FragmentShadingRateAttachmentInfoKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FragmentShadingRateAttachmentInfoKHR
p Ptr FragmentShadingRateAttachmentInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr (AttachmentReference2 '[])
pFragmentShadingRateAttachment'' <- ((Ptr (AttachmentReference2 '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (AttachmentReference2 '[]))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (AttachmentReference2 '[])) (((Ptr (AttachmentReference2 '[]) -> IO b) -> IO b)
 -> ContT b IO (Ptr (AttachmentReference2 '[])))
-> ((Ptr (AttachmentReference2 '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (AttachmentReference2 '[]))
forall a b. (a -> b) -> a -> b
$ \cont :: Ptr (AttachmentReference2 '[]) -> IO b
cont -> SomeStruct AttachmentReference2
-> (forall (es :: [*]).
    (Extendss AttachmentReference2 es, PokeChain es) =>
    Ptr (AttachmentReference2 es) -> IO b)
-> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
    (Extendss a es, PokeChain es) =>
    Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @AttachmentReference2 (SomeStruct AttachmentReference2
fragmentShadingRateAttachment) (Ptr (AttachmentReference2 '[]) -> IO b
cont (Ptr (AttachmentReference2 '[]) -> IO b)
-> (Ptr (AttachmentReference2 es)
    -> Ptr (AttachmentReference2 '[]))
-> Ptr (AttachmentReference2 es)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (AttachmentReference2 es) -> Ptr (AttachmentReference2 '[])
forall a b. Ptr a -> Ptr b
castPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr (AttachmentReference2 '[]))
-> Ptr (AttachmentReference2 '[]) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FragmentShadingRateAttachmentInfoKHR
p Ptr FragmentShadingRateAttachmentInfoKHR
-> Int -> Ptr (Ptr (AttachmentReference2 _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr (AttachmentReference2 _)))) Ptr (AttachmentReference2 '[])
pFragmentShadingRateAttachment''
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> ("fragmentSize" ::: Extent2D) -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr FragmentShadingRateAttachmentInfoKHR
p Ptr FragmentShadingRateAttachmentInfoKHR
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Extent2D)) ("fragmentSize" ::: Extent2D
shadingRateAttachmentTexelSize) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr FragmentShadingRateAttachmentInfoKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr FragmentShadingRateAttachmentInfoKHR
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FragmentShadingRateAttachmentInfoKHR
p Ptr FragmentShadingRateAttachmentInfoKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FragmentShadingRateAttachmentInfoKHR
p Ptr FragmentShadingRateAttachmentInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr (AttachmentReference2 '[])
pFragmentShadingRateAttachment'' <- ((Ptr (AttachmentReference2 '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (AttachmentReference2 '[]))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT @_ @_ @(Ptr (AttachmentReference2 '[])) (((Ptr (AttachmentReference2 '[]) -> IO b) -> IO b)
 -> ContT b IO (Ptr (AttachmentReference2 '[])))
-> ((Ptr (AttachmentReference2 '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (AttachmentReference2 '[]))
forall a b. (a -> b) -> a -> b
$ \cont :: Ptr (AttachmentReference2 '[]) -> IO b
cont -> SomeStruct AttachmentReference2
-> (forall (es :: [*]).
    (Extendss AttachmentReference2 es, PokeChain es) =>
    Ptr (AttachmentReference2 es) -> IO b)
-> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
SomeStruct a
-> (forall (es :: [*]).
    (Extendss a es, PokeChain es) =>
    Ptr (a es) -> IO b)
-> IO b
withSomeCStruct @AttachmentReference2 ((AttachmentReference2 '[] -> SomeStruct AttachmentReference2
forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct AttachmentReference2 '[]
forall a. Zero a => a
zero)) (Ptr (AttachmentReference2 '[]) -> IO b
cont (Ptr (AttachmentReference2 '[]) -> IO b)
-> (Ptr (AttachmentReference2 es)
    -> Ptr (AttachmentReference2 '[]))
-> Ptr (AttachmentReference2 es)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (AttachmentReference2 es) -> Ptr (AttachmentReference2 '[])
forall a b. Ptr a -> Ptr b
castPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr (AttachmentReference2 '[]))
-> Ptr (AttachmentReference2 '[]) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr FragmentShadingRateAttachmentInfoKHR
p Ptr FragmentShadingRateAttachmentInfoKHR
-> Int -> Ptr (Ptr (AttachmentReference2 _))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr (AttachmentReference2 _)))) Ptr (AttachmentReference2 '[])
pFragmentShadingRateAttachment''
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> ("fragmentSize" ::: Extent2D) -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr FragmentShadingRateAttachmentInfoKHR
p Ptr FragmentShadingRateAttachmentInfoKHR
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Extent2D)) ("fragmentSize" ::: Extent2D
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct FragmentShadingRateAttachmentInfoKHR where
  peekCStruct :: Ptr FragmentShadingRateAttachmentInfoKHR
-> IO FragmentShadingRateAttachmentInfoKHR
peekCStruct p :: Ptr FragmentShadingRateAttachmentInfoKHR
p = do
    SomeStruct AttachmentReference2
pFragmentShadingRateAttachment <- Ptr (SomeStruct AttachmentReference2)
-> IO (SomeStruct AttachmentReference2)
forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (SomeStruct AttachmentReference2)
 -> IO (SomeStruct AttachmentReference2))
-> (Ptr (AttachmentReference2 Any)
    -> Ptr (SomeStruct AttachmentReference2))
-> Ptr (AttachmentReference2 Any)
-> IO (SomeStruct AttachmentReference2)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (AttachmentReference2 Any)
-> Ptr (SomeStruct AttachmentReference2)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (AttachmentReference2 Any)
 -> IO (SomeStruct AttachmentReference2))
-> IO (Ptr (AttachmentReference2 Any))
-> IO (SomeStruct AttachmentReference2)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr (Ptr (AttachmentReference2 Any))
-> IO (Ptr (AttachmentReference2 Any))
forall a. Storable a => Ptr a -> IO a
peek ((Ptr FragmentShadingRateAttachmentInfoKHR
p Ptr FragmentShadingRateAttachmentInfoKHR
-> Int -> Ptr (Ptr (AttachmentReference2 a))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr (AttachmentReference2 a))))
    "fragmentSize" ::: Extent2D
shadingRateAttachmentTexelSize <- ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> IO ("fragmentSize" ::: Extent2D)
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D ((Ptr FragmentShadingRateAttachmentInfoKHR
p Ptr FragmentShadingRateAttachmentInfoKHR
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Extent2D))
    FragmentShadingRateAttachmentInfoKHR
-> IO FragmentShadingRateAttachmentInfoKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (FragmentShadingRateAttachmentInfoKHR
 -> IO FragmentShadingRateAttachmentInfoKHR)
-> FragmentShadingRateAttachmentInfoKHR
-> IO FragmentShadingRateAttachmentInfoKHR
forall a b. (a -> b) -> a -> b
$ SomeStruct AttachmentReference2
-> ("fragmentSize" ::: Extent2D)
-> FragmentShadingRateAttachmentInfoKHR
FragmentShadingRateAttachmentInfoKHR
             SomeStruct AttachmentReference2
pFragmentShadingRateAttachment "fragmentSize" ::: Extent2D
shadingRateAttachmentTexelSize

instance Zero FragmentShadingRateAttachmentInfoKHR where
  zero :: FragmentShadingRateAttachmentInfoKHR
zero = SomeStruct AttachmentReference2
-> ("fragmentSize" ::: Extent2D)
-> FragmentShadingRateAttachmentInfoKHR
FragmentShadingRateAttachmentInfoKHR
           (AttachmentReference2 '[] -> SomeStruct AttachmentReference2
forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct AttachmentReference2 '[]
forall a. Zero a => a
zero)
           "fragmentSize" ::: Extent2D
forall a. Zero a => a
zero


-- | VkPipelineFragmentShadingRateStateCreateInfoKHR - Structure specifying
-- parameters controlling the fragment shading rate
--
-- = Description
--
-- If the @pNext@ chain of
-- 'Vulkan.Core10.Pipeline.GraphicsPipelineCreateInfo' includes a
-- 'PipelineFragmentShadingRateStateCreateInfoKHR' structure, then that
-- structure includes parameters that control the pipeline fragment shading
-- rate.
--
-- If this structure is not present, @fragmentSize@ is considered to be
-- equal to (1,1), and both elements of @combinerOps@ are considered to be
-- equal to 'FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR'.
--
-- == Valid Usage (Implicit)
--
-- -   @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR'
--
-- -   Any given element of @combinerOps@ /must/ be a valid
--     'FragmentShadingRateCombinerOpKHR' value
--
-- = See Also
--
-- 'Vulkan.Core10.FundamentalTypes.Extent2D',
-- 'FragmentShadingRateCombinerOpKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PipelineFragmentShadingRateStateCreateInfoKHR = PipelineFragmentShadingRateStateCreateInfoKHR
  { -- | @fragmentSize@ specifies a 'Vulkan.Core10.FundamentalTypes.Extent2D'
    -- structure containing the fragment size used to define the pipeline
    -- fragment shading rate for draw commands using this pipeline.
    PipelineFragmentShadingRateStateCreateInfoKHR
-> "fragmentSize" ::: Extent2D
fragmentSize :: Extent2D
  , -- | @combinerOps@ specifies a 'FragmentShadingRateCombinerOpKHR' value
    -- determining how the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-fragment-shading-rate-pipeline pipeline>,
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-fragment-shading-rate-primitive primitive>,
    -- and
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-fragment-shading-rate-attachment attachment shading rates>
    -- are
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-fragment-shading-rate-combining combined>
    -- for fragments generated by drawing commands using the created pipeline.
    PipelineFragmentShadingRateStateCreateInfoKHR
-> "combinerOps"
   ::: (FragmentShadingRateCombinerOpKHR,
        FragmentShadingRateCombinerOpKHR)
combinerOps :: (FragmentShadingRateCombinerOpKHR, FragmentShadingRateCombinerOpKHR)
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineFragmentShadingRateStateCreateInfoKHR)
#endif
deriving instance Show PipelineFragmentShadingRateStateCreateInfoKHR

instance ToCStruct PipelineFragmentShadingRateStateCreateInfoKHR where
  withCStruct :: PipelineFragmentShadingRateStateCreateInfoKHR
-> (Ptr PipelineFragmentShadingRateStateCreateInfoKHR -> IO b)
-> IO b
withCStruct x :: PipelineFragmentShadingRateStateCreateInfoKHR
x f :: Ptr PipelineFragmentShadingRateStateCreateInfoKHR -> IO b
f = Int
-> Int
-> (Ptr PipelineFragmentShadingRateStateCreateInfoKHR -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr PipelineFragmentShadingRateStateCreateInfoKHR -> IO b)
 -> IO b)
-> (Ptr PipelineFragmentShadingRateStateCreateInfoKHR -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PipelineFragmentShadingRateStateCreateInfoKHR
p -> Ptr PipelineFragmentShadingRateStateCreateInfoKHR
-> PipelineFragmentShadingRateStateCreateInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineFragmentShadingRateStateCreateInfoKHR
p PipelineFragmentShadingRateStateCreateInfoKHR
x (Ptr PipelineFragmentShadingRateStateCreateInfoKHR -> IO b
f Ptr PipelineFragmentShadingRateStateCreateInfoKHR
p)
  pokeCStruct :: Ptr PipelineFragmentShadingRateStateCreateInfoKHR
-> PipelineFragmentShadingRateStateCreateInfoKHR -> IO b -> IO b
pokeCStruct p :: Ptr PipelineFragmentShadingRateStateCreateInfoKHR
p PipelineFragmentShadingRateStateCreateInfoKHR{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineFragmentShadingRateStateCreateInfoKHR
p Ptr PipelineFragmentShadingRateStateCreateInfoKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineFragmentShadingRateStateCreateInfoKHR
p Ptr PipelineFragmentShadingRateStateCreateInfoKHR
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> ("fragmentSize" ::: Extent2D) -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr PipelineFragmentShadingRateStateCreateInfoKHR
p Ptr PipelineFragmentShadingRateStateCreateInfoKHR
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D)) ("fragmentSize" ::: Extent2D
fragmentSize) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    let pCombinerOps' :: Ptr FragmentShadingRateCombinerOpKHR
pCombinerOps' = ("combinerOps"
 ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
-> Ptr FragmentShadingRateCombinerOpKHR
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr PipelineFragmentShadingRateStateCreateInfoKHR
p Ptr PipelineFragmentShadingRateStateCreateInfoKHR
-> Int
-> "combinerOps"
   ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR)))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ case ("combinerOps"
::: (FragmentShadingRateCombinerOpKHR,
     FragmentShadingRateCombinerOpKHR)
combinerOps) of
      (e0 :: FragmentShadingRateCombinerOpKHR
e0, e1 :: FragmentShadingRateCombinerOpKHR
e1) -> do
        Ptr FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr FragmentShadingRateCombinerOpKHR
pCombinerOps' :: Ptr FragmentShadingRateCombinerOpKHR) (FragmentShadingRateCombinerOpKHR
e0)
        Ptr FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr FragmentShadingRateCombinerOpKHR
pCombinerOps' Ptr FragmentShadingRateCombinerOpKHR
-> Int -> Ptr FragmentShadingRateCombinerOpKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr FragmentShadingRateCombinerOpKHR) (FragmentShadingRateCombinerOpKHR
e1)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr PipelineFragmentShadingRateStateCreateInfoKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr PipelineFragmentShadingRateStateCreateInfoKHR
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineFragmentShadingRateStateCreateInfoKHR
p Ptr PipelineFragmentShadingRateStateCreateInfoKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineFragmentShadingRateStateCreateInfoKHR
p Ptr PipelineFragmentShadingRateStateCreateInfoKHR
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> ("fragmentSize" ::: Extent2D) -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr PipelineFragmentShadingRateStateCreateInfoKHR
p Ptr PipelineFragmentShadingRateStateCreateInfoKHR
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D)) ("fragmentSize" ::: Extent2D
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    let pCombinerOps' :: Ptr FragmentShadingRateCombinerOpKHR
pCombinerOps' = ("combinerOps"
 ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
-> Ptr FragmentShadingRateCombinerOpKHR
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr PipelineFragmentShadingRateStateCreateInfoKHR
p Ptr PipelineFragmentShadingRateStateCreateInfoKHR
-> Int
-> "combinerOps"
   ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR)))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ case ((FragmentShadingRateCombinerOpKHR
forall a. Zero a => a
zero, FragmentShadingRateCombinerOpKHR
forall a. Zero a => a
zero)) of
      (e0 :: FragmentShadingRateCombinerOpKHR
e0, e1 :: FragmentShadingRateCombinerOpKHR
e1) -> do
        Ptr FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr FragmentShadingRateCombinerOpKHR
pCombinerOps' :: Ptr FragmentShadingRateCombinerOpKHR) (FragmentShadingRateCombinerOpKHR
e0)
        Ptr FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr FragmentShadingRateCombinerOpKHR
pCombinerOps' Ptr FragmentShadingRateCombinerOpKHR
-> Int -> Ptr FragmentShadingRateCombinerOpKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 4 :: Ptr FragmentShadingRateCombinerOpKHR) (FragmentShadingRateCombinerOpKHR
e1)
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct PipelineFragmentShadingRateStateCreateInfoKHR where
  peekCStruct :: Ptr PipelineFragmentShadingRateStateCreateInfoKHR
-> IO PipelineFragmentShadingRateStateCreateInfoKHR
peekCStruct p :: Ptr PipelineFragmentShadingRateStateCreateInfoKHR
p = do
    "fragmentSize" ::: Extent2D
fragmentSize <- ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> IO ("fragmentSize" ::: Extent2D)
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D ((Ptr PipelineFragmentShadingRateStateCreateInfoKHR
p Ptr PipelineFragmentShadingRateStateCreateInfoKHR
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D))
    let pcombinerOps :: Ptr FragmentShadingRateCombinerOpKHR
pcombinerOps = ("combinerOps"
 ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR))
-> Ptr FragmentShadingRateCombinerOpKHR
forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @FragmentShadingRateCombinerOpKHR ((Ptr PipelineFragmentShadingRateStateCreateInfoKHR
p Ptr PipelineFragmentShadingRateStateCreateInfoKHR
-> Int
-> "combinerOps"
   ::: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (FixedArray 2 FragmentShadingRateCombinerOpKHR)))
    FragmentShadingRateCombinerOpKHR
combinerOps0 <- Ptr FragmentShadingRateCombinerOpKHR
-> IO FragmentShadingRateCombinerOpKHR
forall a. Storable a => Ptr a -> IO a
peek @FragmentShadingRateCombinerOpKHR ((Ptr FragmentShadingRateCombinerOpKHR
pcombinerOps Ptr FragmentShadingRateCombinerOpKHR
-> Int -> Ptr FragmentShadingRateCombinerOpKHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 0 :: Ptr FragmentShadingRateCombinerOpKHR))
    FragmentShadingRateCombinerOpKHR
combinerOps1 <- Ptr FragmentShadingRateCombinerOpKHR
-> IO FragmentShadingRateCombinerOpKHR
forall a. Storable a => Ptr a -> IO a
peek @FragmentShadingRateCombinerOpKHR ((Ptr FragmentShadingRateCombinerOpKHR
pcombinerOps Ptr FragmentShadingRateCombinerOpKHR
-> Int -> Ptr FragmentShadingRateCombinerOpKHR
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` 4 :: Ptr FragmentShadingRateCombinerOpKHR))
    PipelineFragmentShadingRateStateCreateInfoKHR
-> IO PipelineFragmentShadingRateStateCreateInfoKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PipelineFragmentShadingRateStateCreateInfoKHR
 -> IO PipelineFragmentShadingRateStateCreateInfoKHR)
-> PipelineFragmentShadingRateStateCreateInfoKHR
-> IO PipelineFragmentShadingRateStateCreateInfoKHR
forall a b. (a -> b) -> a -> b
$ ("fragmentSize" ::: Extent2D)
-> ("combinerOps"
    ::: (FragmentShadingRateCombinerOpKHR,
         FragmentShadingRateCombinerOpKHR))
-> PipelineFragmentShadingRateStateCreateInfoKHR
PipelineFragmentShadingRateStateCreateInfoKHR
             "fragmentSize" ::: Extent2D
fragmentSize ((FragmentShadingRateCombinerOpKHR
combinerOps0, FragmentShadingRateCombinerOpKHR
combinerOps1))

instance Zero PipelineFragmentShadingRateStateCreateInfoKHR where
  zero :: PipelineFragmentShadingRateStateCreateInfoKHR
zero = ("fragmentSize" ::: Extent2D)
-> ("combinerOps"
    ::: (FragmentShadingRateCombinerOpKHR,
         FragmentShadingRateCombinerOpKHR))
-> PipelineFragmentShadingRateStateCreateInfoKHR
PipelineFragmentShadingRateStateCreateInfoKHR
           "fragmentSize" ::: Extent2D
forall a. Zero a => a
zero
           (FragmentShadingRateCombinerOpKHR
forall a. Zero a => a
zero, FragmentShadingRateCombinerOpKHR
forall a. Zero a => a
zero)


-- | VkPhysicalDeviceFragmentShadingRateFeaturesKHR - Structure indicating
-- support for variable rate fragment shading
--
-- = Members
--
-- The members of the 'PhysicalDeviceFragmentShadingRateFeaturesKHR'
-- structure describe the following features:
--
-- = Description
--
-- If the 'PhysicalDeviceFragmentShadingRateFeaturesKHR' structure is
-- included in the @pNext@ chain of
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
-- it is filled with values indicating whether each feature is supported.
-- 'PhysicalDeviceFragmentShadingRateFeaturesKHR' /can/ also be used in the
-- @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to enable these
-- features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceFragmentShadingRateFeaturesKHR = PhysicalDeviceFragmentShadingRateFeaturesKHR
  { -- | @pipelineFragmentShadingRate@ indicates that the implementation supports
    -- the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-fragment-shading-rate-pipeline pipeline fragment shading rate>.
    PhysicalDeviceFragmentShadingRateFeaturesKHR -> Bool
pipelineFragmentShadingRate :: Bool
  , -- | @primitiveFragmentShadingRate@ indicates that the implementation
    -- supports the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-fragment-shading-rate-primitive primitive fragment shading rate>.
    PhysicalDeviceFragmentShadingRateFeaturesKHR -> Bool
primitiveFragmentShadingRate :: Bool
  , -- | @attachmentFragmentShadingRate@ indicates that the implementation
    -- supports the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-fragment-shading-rate-attachment attachment fragment shading rate>.
    PhysicalDeviceFragmentShadingRateFeaturesKHR -> Bool
attachmentFragmentShadingRate :: Bool
  }
  deriving (Typeable, PhysicalDeviceFragmentShadingRateFeaturesKHR
-> PhysicalDeviceFragmentShadingRateFeaturesKHR -> Bool
(PhysicalDeviceFragmentShadingRateFeaturesKHR
 -> PhysicalDeviceFragmentShadingRateFeaturesKHR -> Bool)
-> (PhysicalDeviceFragmentShadingRateFeaturesKHR
    -> PhysicalDeviceFragmentShadingRateFeaturesKHR -> Bool)
-> Eq PhysicalDeviceFragmentShadingRateFeaturesKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceFragmentShadingRateFeaturesKHR
-> PhysicalDeviceFragmentShadingRateFeaturesKHR -> Bool
$c/= :: PhysicalDeviceFragmentShadingRateFeaturesKHR
-> PhysicalDeviceFragmentShadingRateFeaturesKHR -> Bool
== :: PhysicalDeviceFragmentShadingRateFeaturesKHR
-> PhysicalDeviceFragmentShadingRateFeaturesKHR -> Bool
$c== :: PhysicalDeviceFragmentShadingRateFeaturesKHR
-> PhysicalDeviceFragmentShadingRateFeaturesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceFragmentShadingRateFeaturesKHR)
#endif
deriving instance Show PhysicalDeviceFragmentShadingRateFeaturesKHR

instance ToCStruct PhysicalDeviceFragmentShadingRateFeaturesKHR where
  withCStruct :: PhysicalDeviceFragmentShadingRateFeaturesKHR
-> (Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR -> IO b)
-> IO b
withCStruct x :: PhysicalDeviceFragmentShadingRateFeaturesKHR
x f :: Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR -> IO b)
 -> IO b)
-> (Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
p -> Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
-> PhysicalDeviceFragmentShadingRateFeaturesKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
p PhysicalDeviceFragmentShadingRateFeaturesKHR
x (Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR -> IO b
f Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
p)
  pokeCStruct :: Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
-> PhysicalDeviceFragmentShadingRateFeaturesKHR -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
p PhysicalDeviceFragmentShadingRateFeaturesKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
p Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
p Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
p Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
pipelineFragmentShadingRate))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
p Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
primitiveFragmentShadingRate))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
p Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
attachmentFragmentShadingRate))
    IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
p Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
p Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
p Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 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 PhysicalDeviceFragmentShadingRateFeaturesKHR
p Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 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 PhysicalDeviceFragmentShadingRateFeaturesKHR
p Ptr PhysicalDeviceFragmentShadingRateFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

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

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

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


-- | VkPhysicalDeviceFragmentShadingRatePropertiesKHR - Structure describing
-- variable fragment shading rate limits that can be supported by an
-- implementation
--
-- = Members
--
-- The members of the 'PhysicalDeviceFragmentShadingRatePropertiesKHR'
-- structure describe the following implementation-dependent properties
-- related to
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-primsrast-fragment-shading-rate fragment shading rates>:
--
-- = Description
--
-- Note
--
-- Multiplication of the combiner rates using the fragment width\/height in
-- linear space is equivalent to an addition of those values in log2 space.
-- Some implementations inadvertently implemented an addition in linear
-- space due to unclear requirements originating outside of this
-- specification. This resulted in
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-fragmentShadingRateStrictMultiplyCombiner fragmentShadingRateStrictMultiplyCombiner>
-- being added. Fortunately, this only affects situations where a rate of 1
-- in either dimension is combined with another rate of 1. All other
-- combinations result in the exact same result as if multiplication was
-- performed in linear space due to the clamping logic, and the fact that
-- both the sum and product of 2 and 2 are equal. In many cases, this limit
-- will not affect the correct operation of applications.
--
-- If the 'PhysicalDeviceFragmentShadingRatePropertiesKHR' structure is
-- included in the @pNext@ chain of
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2',
-- it is filled with the implementation-dependent limits.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.FundamentalTypes.Extent2D',
-- 'Vulkan.Core10.Enums.SampleCountFlagBits.SampleCountFlagBits',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceFragmentShadingRatePropertiesKHR = PhysicalDeviceFragmentShadingRatePropertiesKHR
  { -- | @minFragmentShadingRateAttachmentTexelSize@ indicates minimum supported
    -- width and height of the portion of the framebuffer corresponding to each
    -- texel in a fragment shading rate attachment. Each value /must/ be less
    -- than or equal to the values in
    -- @maxFragmentShadingRateAttachmentTexelSize@. Each value /must/ be a
    -- power-of-two. It /must/ be (0,0) if the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-attachmentFragmentShadingRate attachmentFragmentShadingRate>
    -- feature is not supported.
    PhysicalDeviceFragmentShadingRatePropertiesKHR
-> "fragmentSize" ::: Extent2D
minFragmentShadingRateAttachmentTexelSize :: Extent2D
  , -- | @maxFragmentShadingRateAttachmentTexelSize@ indicates maximum supported
    -- width and height of the portion of the framebuffer corresponding to each
    -- texel in a fragment shading rate attachment. Each value /must/ be
    -- greater than or equal to the values in
    -- @minFragmentShadingRateAttachmentTexelSize@. Each value /must/ be a
    -- power-of-two. It /must/ be (0,0) if the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-attachmentFragmentShadingRate attachmentFragmentShadingRate>
    -- feature is not supported.
    PhysicalDeviceFragmentShadingRatePropertiesKHR
-> "fragmentSize" ::: Extent2D
maxFragmentShadingRateAttachmentTexelSize :: Extent2D
  , -- | @maxFragmentShadingRateAttachmentTexelSizeAspectRatio@ indicates the
    -- maximum ratio between the width and height of the portion of the
    -- framebuffer corresponding to each texel in a fragment shading rate
    -- attachment. @maxFragmentShadingRateAttachmentTexelSizeAspectRatio@
    -- /must/ be a power-of-two value, and /must/ be less than or equal to
    -- max(@maxFragmentShadingRateAttachmentTexelSize.width@ \/
    -- minFragmentShadingRateAttachmentTexelSize.height,
    -- @maxFragmentShadingRateAttachmentTexelSize.height@ \/
    -- minFragmentShadingRateAttachmentTexelSize.width). It /must/ be 0 if the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-attachmentFragmentShadingRate attachmentFragmentShadingRate>
    -- feature is not supported.
    PhysicalDeviceFragmentShadingRatePropertiesKHR -> Word32
maxFragmentShadingRateAttachmentTexelSizeAspectRatio :: Word32
  , -- | @primitiveFragmentShadingRateWithMultipleViewports@ specifies whether
    -- the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-fragment-shading-rate-primitive primitive fragment shading rate>
    -- /can/ be used when multiple viewports are used. If this value is
    -- 'Vulkan.Core10.FundamentalTypes.FALSE', only a single viewport /must/ be
    -- used, and applications /must/ not write to the @ViewportMaskNV@ or
    -- @ViewportIndex@ built-in when setting @PrimitiveShadingRateKHR@. It
    -- /must/ be 'Vulkan.Core10.FundamentalTypes.FALSE' if the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-shaderOutputViewportIndex shaderOutputViewportIndex>
    -- feature, the
    -- <VK_EXT_shader_viewport_index_layer.html VK_EXT_shader_viewport_index_layer>
    -- extension, or the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-geometryShader geometryShader>
    -- feature is not supported, or if the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-primitiveFragmentShadingRate primitiveFragmentShadingRate>
    -- feature is not supported.
    PhysicalDeviceFragmentShadingRatePropertiesKHR -> Bool
primitiveFragmentShadingRateWithMultipleViewports :: Bool
  , -- | @layeredShadingRateAttachments@ specifies whether a shading rate
    -- attachment image view /can/ be created with multiple layers. If this
    -- value is 'Vulkan.Core10.FundamentalTypes.FALSE', when creating an image
    -- view with a @usage@ that includes
    -- 'IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR', @layerCount@
    -- /must/ be @1@. It /must/ be 'Vulkan.Core10.FundamentalTypes.FALSE' if
    -- the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-multiview multiview>
    -- feature, the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-shaderOutputViewportIndex shaderOutputViewportIndex>
    -- feature, the
    -- <VK_EXT_shader_viewport_index_layer.html VK_EXT_shader_viewport_index_layer>
    -- extension, or the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-geometryShader geometryShader>
    -- feature is not supported, or if the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-attachmentFragmentShadingRate attachmentFragmentShadingRate>
    -- feature is not supported.
    PhysicalDeviceFragmentShadingRatePropertiesKHR -> Bool
layeredShadingRateAttachments :: Bool
  , -- | @fragmentShadingRateNonTrivialCombinerOps@ specifies whether
    -- 'FragmentShadingRateCombinerOpKHR' enums other than
    -- 'FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR' or
    -- 'FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR' /can/ be used. It /must/
    -- be 'Vulkan.Core10.FundamentalTypes.FALSE' unless either the
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-primitiveFragmentShadingRate primitiveFragmentShadingRate>
    -- or
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-attachmentFragmentShadingRate attachmentFragmentShadingRate>
    -- feature is supported.
    PhysicalDeviceFragmentShadingRatePropertiesKHR -> Bool
fragmentShadingRateNonTrivialCombinerOps :: Bool
  , -- | @maxFragmentSize@ indicates the maximum supported width and height of a
    -- fragment. Its @width@ and @height@ members /must/ both be power-of-two
    -- values. This limit is purely informational, and is not validated.
    PhysicalDeviceFragmentShadingRatePropertiesKHR
-> "fragmentSize" ::: Extent2D
maxFragmentSize :: Extent2D
  , -- | @maxFragmentSizeAspectRatio@ indicates the maximum ratio between the
    -- width and height of a fragment. @maxFragmentSizeAspectRatio@ /must/ be a
    -- power-of-two value, and /must/ be less than or equal to the maximum of
    -- the @width@ and @height@ members of @maxFragmentSize@. This limit is
    -- purely informational, and is not validated.
    PhysicalDeviceFragmentShadingRatePropertiesKHR -> Word32
maxFragmentSizeAspectRatio :: Word32
  , -- | @maxFragmentShadingRateCoverageSamples@ specifies the maximum number of
    -- coverage samples supported in a single fragment.
    -- @maxFragmentShadingRateCoverageSamples@ /must/ be less than or equal to
    -- the product of the @width@ and @height@ members of @maxFragmentSize@,
    -- and the sample count reported by
    -- @maxFragmentShadingRateRasterizationSamples@.
    -- @maxFragmentShadingRateCoverageSamples@ /must/ be less than or equal to
    -- @maxSampleMaskWords@ * 32 if @fragmentShadingRateWithShaderSampleMask@
    -- is supported. This limit is purely informational, and is not validated.
    PhysicalDeviceFragmentShadingRatePropertiesKHR -> Word32
maxFragmentShadingRateCoverageSamples :: Word32
  , -- | @maxFragmentShadingRateRasterizationSamples@ specifies the maximum
    -- sample rate supported when a fragment covers multiple pixels. This limit
    -- is purely informational, and is not validated.
    PhysicalDeviceFragmentShadingRatePropertiesKHR
-> SampleCountFlagBits
maxFragmentShadingRateRasterizationSamples :: SampleCountFlagBits
  , -- | @fragmentShadingRateWithShaderDepthStencilWrites@ specifies whether the
    -- implementation supports writing @FragDepth@ or @FragStencilRefEXT@ from
    -- a fragment shader for multi-pixel fragments. If this value is
    -- 'Vulkan.Core10.FundamentalTypes.FALSE', writing to those built-ins will
    -- clamp the fragment shading rate to (1,1).
    PhysicalDeviceFragmentShadingRatePropertiesKHR -> Bool
fragmentShadingRateWithShaderDepthStencilWrites :: Bool
  , -- | @fragmentShadingRateWithSampleMask@ specifies whether the the
    -- implementation supports setting valid bits of
    -- 'Vulkan.Core10.Pipeline.PipelineMultisampleStateCreateInfo'::pSampleMask
    -- to @0@ for multi-pixel fragments. If this value is
    -- 'Vulkan.Core10.FundamentalTypes.FALSE', zeroing valid bits in the sample
    -- mask will clamp the fragment shading rate to (1,1).
    PhysicalDeviceFragmentShadingRatePropertiesKHR -> Bool
fragmentShadingRateWithSampleMask :: Bool
  , -- | @fragmentShadingRateWithShaderSampleMask@ specifies whether the
    -- implementation supports reading or writing
    -- 'Vulkan.Core10.FundamentalTypes.SampleMask' for multi-pixel fragments.
    -- If this value is 'Vulkan.Core10.FundamentalTypes.FALSE', using that
    -- built-in will clamp the fragment shading rate to (1,1).
    PhysicalDeviceFragmentShadingRatePropertiesKHR -> Bool
fragmentShadingRateWithShaderSampleMask :: Bool
  , -- | @fragmentShadingRateWithConservativeRasterization@ specifies whether
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-conservativeraster conservative rasterization>
    -- is supported for multi-pixel fragments. It /must/ be
    -- 'Vulkan.Core10.FundamentalTypes.FALSE' if
    -- <VK_EXT_conservative_rasterization.html VK_EXT_conservative_rasterization>
    -- is not supported. If this value is
    -- 'Vulkan.Core10.FundamentalTypes.FALSE', using
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-conservativeraster conservative rasterization>
    -- will clamp the fragment shading rate to (1,1).
    PhysicalDeviceFragmentShadingRatePropertiesKHR -> Bool
fragmentShadingRateWithConservativeRasterization :: Bool
  , -- | @fragmentShadingRateWithFragmentShaderInterlock@ specifies whether
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#shaders-fragment-shader-interlock fragment shader interlock>
    -- is supported for multi-pixel fragments. It /must/ be
    -- 'Vulkan.Core10.FundamentalTypes.FALSE' if
    -- <VK_EXT_fragment_shader_interlock.html VK_EXT_fragment_shader_interlock>
    -- is not supported. If this value is
    -- 'Vulkan.Core10.FundamentalTypes.FALSE', using
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#shaders-fragment-shader-interlock fragment shader interlock>
    -- will clamp the fragment shading rate to (1,1).
    PhysicalDeviceFragmentShadingRatePropertiesKHR -> Bool
fragmentShadingRateWithFragmentShaderInterlock :: Bool
  , -- | @fragmentShadingRateWithCustomSampleLocations@ specifies whether
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primrast-samplelocations custom sample locations>
    -- are supported for multi-pixel fragments. It /must/ be
    -- 'Vulkan.Core10.FundamentalTypes.FALSE' if
    -- <VK_EXT_sample_locations.html VK_EXT_sample_locations> is not supported.
    -- If this value is 'Vulkan.Core10.FundamentalTypes.FALSE', using
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primrast-samplelocations custom sample locations>
    -- will clamp the fragment shading rate to (1,1).
    PhysicalDeviceFragmentShadingRatePropertiesKHR -> Bool
fragmentShadingRateWithCustomSampleLocations :: Bool
  , -- | @fragmentShadingRateStrictMultiplyCombiner@ specifies whether
    -- VK_FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR accurately performs a
    -- multiplication or not. Implementations where this value is
    -- 'Vulkan.Core10.FundamentalTypes.FALSE' will instead combine rates with
    -- an addition. If @fragmentShadingRateNonTrivialCombinerOps@ is
    -- 'Vulkan.Core10.FundamentalTypes.FALSE', implementations /must/ report
    -- this as 'Vulkan.Core10.FundamentalTypes.FALSE'. If
    -- @fragmentShadingRateNonTrivialCombinerOps@ is
    -- 'Vulkan.Core10.FundamentalTypes.TRUE', implementations /should/ report
    -- this as 'Vulkan.Core10.FundamentalTypes.TRUE'.
    PhysicalDeviceFragmentShadingRatePropertiesKHR -> Bool
fragmentShadingRateStrictMultiplyCombiner :: Bool
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceFragmentShadingRatePropertiesKHR)
#endif
deriving instance Show PhysicalDeviceFragmentShadingRatePropertiesKHR

instance ToCStruct PhysicalDeviceFragmentShadingRatePropertiesKHR where
  withCStruct :: PhysicalDeviceFragmentShadingRatePropertiesKHR
-> (Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR -> IO b)
-> IO b
withCStruct x :: PhysicalDeviceFragmentShadingRatePropertiesKHR
x f :: Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 96 8 ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR -> IO b)
 -> IO b)
-> (Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p -> Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> PhysicalDeviceFragmentShadingRatePropertiesKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p PhysicalDeviceFragmentShadingRatePropertiesKHR
x (Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR -> IO b
f Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p)
  pokeCStruct :: Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> PhysicalDeviceFragmentShadingRatePropertiesKHR -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p PhysicalDeviceFragmentShadingRatePropertiesKHR{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> ("fragmentSize" ::: Extent2D) -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D)) ("fragmentSize" ::: Extent2D
minFragmentShadingRateAttachmentTexelSize) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> ("fragmentSize" ::: Extent2D) -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Extent2D)) ("fragmentSize" ::: Extent2D
maxFragmentShadingRateAttachmentTexelSize) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentShadingRateCount" ::: Ptr Word32) -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentShadingRateCount" ::: Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word32)) (Word32
maxFragmentShadingRateAttachmentTexelSizeAspectRatio)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 36 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
primitiveFragmentShadingRateWithMultipleViewports))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
layeredShadingRateAttachments))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentShadingRateNonTrivialCombinerOps))
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> ("fragmentSize" ::: Extent2D) -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Extent2D)) ("fragmentSize" ::: Extent2D
maxFragmentSize) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentShadingRateCount" ::: Ptr Word32) -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentShadingRateCount" ::: Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Word32)) (Word32
maxFragmentSizeAspectRatio)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentShadingRateCount" ::: Ptr Word32) -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentShadingRateCount" ::: Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Word32)) (Word32
maxFragmentShadingRateCoverageSamples)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr SampleCountFlagBits -> SampleCountFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr SampleCountFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 64 :: Ptr SampleCountFlagBits)) (SampleCountFlagBits
maxFragmentShadingRateRasterizationSamples)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 68 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentShadingRateWithShaderDepthStencilWrites))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentShadingRateWithSampleMask))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 76 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentShadingRateWithShaderSampleMask))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 80 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentShadingRateWithConservativeRasterization))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 84 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentShadingRateWithFragmentShaderInterlock))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 88 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentShadingRateWithCustomSampleLocations))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 92 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentShadingRateStrictMultiplyCombiner))
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 96
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> ("fragmentSize" ::: Extent2D) -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D)) ("fragmentSize" ::: Extent2D
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> ("fragmentSize" ::: Extent2D) -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Extent2D)) ("fragmentSize" ::: Extent2D
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentShadingRateCount" ::: Ptr Word32) -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentShadingRateCount" ::: Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 36 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> ("fragmentSize" ::: Extent2D) -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Extent2D)) ("fragmentSize" ::: Extent2D
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentShadingRateCount" ::: Ptr Word32) -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentShadingRateCount" ::: Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentShadingRateCount" ::: Ptr Word32) -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentShadingRateCount" ::: Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr SampleCountFlagBits -> SampleCountFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr SampleCountFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 64 :: Ptr SampleCountFlagBits)) (SampleCountFlagBits
forall a. Zero a => a
zero)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 68 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 76 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 80 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 84 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 88 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 92 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct PhysicalDeviceFragmentShadingRatePropertiesKHR where
  peekCStruct :: Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> IO PhysicalDeviceFragmentShadingRatePropertiesKHR
peekCStruct p :: Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p = do
    "fragmentSize" ::: Extent2D
minFragmentShadingRateAttachmentTexelSize <- ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> IO ("fragmentSize" ::: Extent2D)
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D))
    "fragmentSize" ::: Extent2D
maxFragmentShadingRateAttachmentTexelSize <- ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> IO ("fragmentSize" ::: Extent2D)
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Extent2D))
    Word32
maxFragmentShadingRateAttachmentTexelSizeAspectRatio <- ("pFragmentShadingRateCount" ::: Ptr Word32) -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentShadingRateCount" ::: Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Word32))
    Bool32
primitiveFragmentShadingRateWithMultipleViewports <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 36 :: Ptr Bool32))
    Bool32
layeredShadingRateAttachments <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Bool32))
    Bool32
fragmentShadingRateNonTrivialCombinerOps <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Bool32))
    "fragmentSize" ::: Extent2D
maxFragmentSize <- ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> IO ("fragmentSize" ::: Extent2D)
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 48 :: Ptr Extent2D))
    Word32
maxFragmentSizeAspectRatio <- ("pFragmentShadingRateCount" ::: Ptr Word32) -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentShadingRateCount" ::: Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 56 :: Ptr Word32))
    Word32
maxFragmentShadingRateCoverageSamples <- ("pFragmentShadingRateCount" ::: Ptr Word32) -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> "pFragmentShadingRateCount" ::: Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 60 :: Ptr Word32))
    SampleCountFlagBits
maxFragmentShadingRateRasterizationSamples <- Ptr SampleCountFlagBits -> IO SampleCountFlagBits
forall a. Storable a => Ptr a -> IO a
peek @SampleCountFlagBits ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr SampleCountFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 64 :: Ptr SampleCountFlagBits))
    Bool32
fragmentShadingRateWithShaderDepthStencilWrites <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 68 :: Ptr Bool32))
    Bool32
fragmentShadingRateWithSampleMask <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 72 :: Ptr Bool32))
    Bool32
fragmentShadingRateWithShaderSampleMask <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 76 :: Ptr Bool32))
    Bool32
fragmentShadingRateWithConservativeRasterization <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 80 :: Ptr Bool32))
    Bool32
fragmentShadingRateWithFragmentShaderInterlock <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 84 :: Ptr Bool32))
    Bool32
fragmentShadingRateWithCustomSampleLocations <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 88 :: Ptr Bool32))
    Bool32
fragmentShadingRateStrictMultiplyCombiner <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
p Ptr PhysicalDeviceFragmentShadingRatePropertiesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 92 :: Ptr Bool32))
    PhysicalDeviceFragmentShadingRatePropertiesKHR
-> IO PhysicalDeviceFragmentShadingRatePropertiesKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceFragmentShadingRatePropertiesKHR
 -> IO PhysicalDeviceFragmentShadingRatePropertiesKHR)
-> PhysicalDeviceFragmentShadingRatePropertiesKHR
-> IO PhysicalDeviceFragmentShadingRatePropertiesKHR
forall a b. (a -> b) -> a -> b
$ ("fragmentSize" ::: Extent2D)
-> ("fragmentSize" ::: Extent2D)
-> Word32
-> Bool
-> Bool
-> Bool
-> ("fragmentSize" ::: Extent2D)
-> Word32
-> Word32
-> SampleCountFlagBits
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> PhysicalDeviceFragmentShadingRatePropertiesKHR
PhysicalDeviceFragmentShadingRatePropertiesKHR
             "fragmentSize" ::: Extent2D
minFragmentShadingRateAttachmentTexelSize "fragmentSize" ::: Extent2D
maxFragmentShadingRateAttachmentTexelSize Word32
maxFragmentShadingRateAttachmentTexelSizeAspectRatio (Bool32 -> Bool
bool32ToBool Bool32
primitiveFragmentShadingRateWithMultipleViewports) (Bool32 -> Bool
bool32ToBool Bool32
layeredShadingRateAttachments) (Bool32 -> Bool
bool32ToBool Bool32
fragmentShadingRateNonTrivialCombinerOps) "fragmentSize" ::: Extent2D
maxFragmentSize Word32
maxFragmentSizeAspectRatio Word32
maxFragmentShadingRateCoverageSamples SampleCountFlagBits
maxFragmentShadingRateRasterizationSamples (Bool32 -> Bool
bool32ToBool Bool32
fragmentShadingRateWithShaderDepthStencilWrites) (Bool32 -> Bool
bool32ToBool Bool32
fragmentShadingRateWithSampleMask) (Bool32 -> Bool
bool32ToBool Bool32
fragmentShadingRateWithShaderSampleMask) (Bool32 -> Bool
bool32ToBool Bool32
fragmentShadingRateWithConservativeRasterization) (Bool32 -> Bool
bool32ToBool Bool32
fragmentShadingRateWithFragmentShaderInterlock) (Bool32 -> Bool
bool32ToBool Bool32
fragmentShadingRateWithCustomSampleLocations) (Bool32 -> Bool
bool32ToBool Bool32
fragmentShadingRateStrictMultiplyCombiner)

instance Zero PhysicalDeviceFragmentShadingRatePropertiesKHR where
  zero :: PhysicalDeviceFragmentShadingRatePropertiesKHR
zero = ("fragmentSize" ::: Extent2D)
-> ("fragmentSize" ::: Extent2D)
-> Word32
-> Bool
-> Bool
-> Bool
-> ("fragmentSize" ::: Extent2D)
-> Word32
-> Word32
-> SampleCountFlagBits
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> Bool
-> PhysicalDeviceFragmentShadingRatePropertiesKHR
PhysicalDeviceFragmentShadingRatePropertiesKHR
           "fragmentSize" ::: Extent2D
forall a. Zero a => a
zero
           "fragmentSize" ::: Extent2D
forall a. Zero a => a
zero
           Word32
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
           "fragmentSize" ::: Extent2D
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           SampleCountFlagBits
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
           Bool
forall a. Zero a => a
zero
           Bool
forall a. Zero a => a
zero


-- | VkPhysicalDeviceFragmentShadingRateKHR - Structure returning information
-- about sample count specific additional multisampling capabilities
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.FundamentalTypes.Extent2D',
-- 'Vulkan.Core10.Enums.SampleCountFlagBits.SampleCountFlags',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getPhysicalDeviceFragmentShadingRatesKHR'
data PhysicalDeviceFragmentShadingRateKHR = PhysicalDeviceFragmentShadingRateKHR
  { -- | @sampleCounts@ is a bitmask of sample counts for which the shading rate
    -- described by @fragmentSize@ is supported.
    PhysicalDeviceFragmentShadingRateKHR -> SampleCountFlagBits
sampleCounts :: SampleCountFlags
  , -- | @fragmentSize@ is a 'Vulkan.Core10.FundamentalTypes.Extent2D' describing
    -- the width and height of a supported shading rate.
    PhysicalDeviceFragmentShadingRateKHR -> "fragmentSize" ::: Extent2D
fragmentSize :: Extent2D
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceFragmentShadingRateKHR)
#endif
deriving instance Show PhysicalDeviceFragmentShadingRateKHR

instance ToCStruct PhysicalDeviceFragmentShadingRateKHR where
  withCStruct :: PhysicalDeviceFragmentShadingRateKHR
-> (("pFragmentShadingRates"
     ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
    -> IO b)
-> IO b
withCStruct x :: PhysicalDeviceFragmentShadingRateKHR
x f :: ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> IO b
f = Int
-> Int
-> (("pFragmentShadingRates"
     ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
    -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((("pFragmentShadingRates"
   ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
  -> IO b)
 -> IO b)
-> (("pFragmentShadingRates"
     ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
    -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: "pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
p -> ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> PhysicalDeviceFragmentShadingRateKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
p PhysicalDeviceFragmentShadingRateKHR
x (("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> IO b
f "pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
p)
  pokeCStruct :: ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> PhysicalDeviceFragmentShadingRateKHR -> IO b -> IO b
pokeCStruct p :: "pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
p PhysicalDeviceFragmentShadingRateKHR{..} f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
p ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
p ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr SampleCountFlagBits -> SampleCountFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
p ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> Int -> Ptr SampleCountFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr SampleCountFlags)) (SampleCountFlagBits
sampleCounts)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> ("fragmentSize" ::: Extent2D) -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (("pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
p ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Extent2D)) ("fragmentSize" ::: Extent2D
fragmentSize) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> IO b -> IO b
pokeZeroCStruct p :: "pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
p f :: IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
p ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_KHR)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
p ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr SampleCountFlagBits -> SampleCountFlagBits -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (("pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
p ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> Int -> Ptr SampleCountFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr SampleCountFlags)) (SampleCountFlagBits
forall a. Zero a => a
zero)
    ((() -> IO b) -> IO b) -> ContT b IO ()
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((() -> IO b) -> IO b) -> ContT b IO ())
-> ((() -> IO b) -> IO b) -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> ("fragmentSize" ::: Extent2D) -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (("pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
p ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Extent2D)) ("fragmentSize" ::: Extent2D
forall a. Zero a => a
zero) (IO b -> IO b) -> ((() -> IO b) -> IO b) -> (() -> IO b) -> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((() -> IO b) -> () -> IO b
forall a b. (a -> b) -> a -> b
$ ())
    IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct PhysicalDeviceFragmentShadingRateKHR where
  peekCStruct :: ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> IO PhysicalDeviceFragmentShadingRateKHR
peekCStruct p :: "pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
p = do
    SampleCountFlagBits
sampleCounts <- Ptr SampleCountFlagBits -> IO SampleCountFlagBits
forall a. Storable a => Ptr a -> IO a
peek @SampleCountFlags (("pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
p ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> Int -> Ptr SampleCountFlagBits
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr SampleCountFlags))
    "fragmentSize" ::: Extent2D
fragmentSize <- ("pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D))
-> IO ("fragmentSize" ::: Extent2D)
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D (("pFragmentShadingRates"
::: Ptr PhysicalDeviceFragmentShadingRateKHR
p ("pFragmentShadingRates"
 ::: Ptr PhysicalDeviceFragmentShadingRateKHR)
-> Int -> "pFragmentSize" ::: Ptr ("fragmentSize" ::: Extent2D)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Extent2D))
    PhysicalDeviceFragmentShadingRateKHR
-> IO PhysicalDeviceFragmentShadingRateKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceFragmentShadingRateKHR
 -> IO PhysicalDeviceFragmentShadingRateKHR)
-> PhysicalDeviceFragmentShadingRateKHR
-> IO PhysicalDeviceFragmentShadingRateKHR
forall a b. (a -> b) -> a -> b
$ SampleCountFlagBits
-> ("fragmentSize" ::: Extent2D)
-> PhysicalDeviceFragmentShadingRateKHR
PhysicalDeviceFragmentShadingRateKHR
             SampleCountFlagBits
sampleCounts "fragmentSize" ::: Extent2D
fragmentSize

instance Zero PhysicalDeviceFragmentShadingRateKHR where
  zero :: PhysicalDeviceFragmentShadingRateKHR
zero = SampleCountFlagBits
-> ("fragmentSize" ::: Extent2D)
-> PhysicalDeviceFragmentShadingRateKHR
PhysicalDeviceFragmentShadingRateKHR
           SampleCountFlagBits
forall a. Zero a => a
zero
           "fragmentSize" ::: Extent2D
forall a. Zero a => a
zero


-- | VkFragmentShadingRateCombinerOpKHR - Control how fragment shading rates
-- are combined
--
-- = Description
--
-- where combine(Axy,Bxy) is the combine operation, and Axy and Bxy are the
-- inputs to the operation.
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-fragmentShadingRateStrictMultiplyCombiner fragmentShadingRateStrictMultiplyCombiner>
-- is 'Vulkan.Core10.FundamentalTypes.FALSE', using
-- 'FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR' with values of 1 for both A
-- and B in the same dimension results in the value 2 being produced for
-- that dimension. See the definition of
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-fragmentShadingRateStrictMultiplyCombiner fragmentShadingRateStrictMultiplyCombiner>
-- for more information.
--
-- These operations are performed in a component-wise fashion.
--
-- = See Also
--
-- 'PipelineFragmentShadingRateStateCreateInfoKHR',
-- 'cmdSetFragmentShadingRateKHR'
newtype FragmentShadingRateCombinerOpKHR = FragmentShadingRateCombinerOpKHR Int32
  deriving newtype (FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Bool
(FragmentShadingRateCombinerOpKHR
 -> FragmentShadingRateCombinerOpKHR -> Bool)
-> (FragmentShadingRateCombinerOpKHR
    -> FragmentShadingRateCombinerOpKHR -> Bool)
-> Eq FragmentShadingRateCombinerOpKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Bool
$c/= :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Bool
== :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Bool
$c== :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Bool
Eq, Eq FragmentShadingRateCombinerOpKHR
Eq FragmentShadingRateCombinerOpKHR =>
(FragmentShadingRateCombinerOpKHR
 -> FragmentShadingRateCombinerOpKHR -> Ordering)
-> (FragmentShadingRateCombinerOpKHR
    -> FragmentShadingRateCombinerOpKHR -> Bool)
-> (FragmentShadingRateCombinerOpKHR
    -> FragmentShadingRateCombinerOpKHR -> Bool)
-> (FragmentShadingRateCombinerOpKHR
    -> FragmentShadingRateCombinerOpKHR -> Bool)
-> (FragmentShadingRateCombinerOpKHR
    -> FragmentShadingRateCombinerOpKHR -> Bool)
-> (FragmentShadingRateCombinerOpKHR
    -> FragmentShadingRateCombinerOpKHR
    -> FragmentShadingRateCombinerOpKHR)
-> (FragmentShadingRateCombinerOpKHR
    -> FragmentShadingRateCombinerOpKHR
    -> FragmentShadingRateCombinerOpKHR)
-> Ord FragmentShadingRateCombinerOpKHR
FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Bool
FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Ordering
FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR
$cmin :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR
max :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR
$cmax :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR
>= :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Bool
$c>= :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Bool
> :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Bool
$c> :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Bool
<= :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Bool
$c<= :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Bool
< :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Bool
$c< :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Bool
compare :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Ordering
$ccompare :: FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> Ordering
$cp1Ord :: Eq FragmentShadingRateCombinerOpKHR
Ord, Ptr b -> Int -> IO FragmentShadingRateCombinerOpKHR
Ptr b -> Int -> FragmentShadingRateCombinerOpKHR -> IO ()
Ptr FragmentShadingRateCombinerOpKHR
-> IO FragmentShadingRateCombinerOpKHR
Ptr FragmentShadingRateCombinerOpKHR
-> Int -> IO FragmentShadingRateCombinerOpKHR
Ptr FragmentShadingRateCombinerOpKHR
-> Int -> FragmentShadingRateCombinerOpKHR -> IO ()
Ptr FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> IO ()
FragmentShadingRateCombinerOpKHR -> Int
(FragmentShadingRateCombinerOpKHR -> Int)
-> (FragmentShadingRateCombinerOpKHR -> Int)
-> (Ptr FragmentShadingRateCombinerOpKHR
    -> Int -> IO FragmentShadingRateCombinerOpKHR)
-> (Ptr FragmentShadingRateCombinerOpKHR
    -> Int -> FragmentShadingRateCombinerOpKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO FragmentShadingRateCombinerOpKHR)
-> (forall b.
    Ptr b -> Int -> FragmentShadingRateCombinerOpKHR -> IO ())
-> (Ptr FragmentShadingRateCombinerOpKHR
    -> IO FragmentShadingRateCombinerOpKHR)
-> (Ptr FragmentShadingRateCombinerOpKHR
    -> FragmentShadingRateCombinerOpKHR -> IO ())
-> Storable FragmentShadingRateCombinerOpKHR
forall b. Ptr b -> Int -> IO FragmentShadingRateCombinerOpKHR
forall b. Ptr b -> Int -> FragmentShadingRateCombinerOpKHR -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> IO ()
$cpoke :: Ptr FragmentShadingRateCombinerOpKHR
-> FragmentShadingRateCombinerOpKHR -> IO ()
peek :: Ptr FragmentShadingRateCombinerOpKHR
-> IO FragmentShadingRateCombinerOpKHR
$cpeek :: Ptr FragmentShadingRateCombinerOpKHR
-> IO FragmentShadingRateCombinerOpKHR
pokeByteOff :: Ptr b -> Int -> FragmentShadingRateCombinerOpKHR -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> FragmentShadingRateCombinerOpKHR -> IO ()
peekByteOff :: Ptr b -> Int -> IO FragmentShadingRateCombinerOpKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO FragmentShadingRateCombinerOpKHR
pokeElemOff :: Ptr FragmentShadingRateCombinerOpKHR
-> Int -> FragmentShadingRateCombinerOpKHR -> IO ()
$cpokeElemOff :: Ptr FragmentShadingRateCombinerOpKHR
-> Int -> FragmentShadingRateCombinerOpKHR -> IO ()
peekElemOff :: Ptr FragmentShadingRateCombinerOpKHR
-> Int -> IO FragmentShadingRateCombinerOpKHR
$cpeekElemOff :: Ptr FragmentShadingRateCombinerOpKHR
-> Int -> IO FragmentShadingRateCombinerOpKHR
alignment :: FragmentShadingRateCombinerOpKHR -> Int
$calignment :: FragmentShadingRateCombinerOpKHR -> Int
sizeOf :: FragmentShadingRateCombinerOpKHR -> Int
$csizeOf :: FragmentShadingRateCombinerOpKHR -> Int
Storable, FragmentShadingRateCombinerOpKHR
FragmentShadingRateCombinerOpKHR
-> Zero FragmentShadingRateCombinerOpKHR
forall a. a -> Zero a
zero :: FragmentShadingRateCombinerOpKHR
$czero :: FragmentShadingRateCombinerOpKHR
Zero)

-- | 'FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR' specifies a combiner
-- operation of combine(Axy,Bxy) = Axy.
pattern $bFRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR :: FragmentShadingRateCombinerOpKHR
$mFRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR :: forall r.
FragmentShadingRateCombinerOpKHR
-> (Void# -> r) -> (Void# -> r) -> r
FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR = FragmentShadingRateCombinerOpKHR 0
-- | 'FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR' specifies a combiner
-- operation of combine(Axy,Bxy) = Bxy.
pattern $bFRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR :: FragmentShadingRateCombinerOpKHR
$mFRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR :: forall r.
FragmentShadingRateCombinerOpKHR
-> (Void# -> r) -> (Void# -> r) -> r
FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR = FragmentShadingRateCombinerOpKHR 1
-- | 'FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR' specifies a combiner
-- operation of combine(Axy,Bxy) = min(Axy,Bxy).
pattern $bFRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR :: FragmentShadingRateCombinerOpKHR
$mFRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR :: forall r.
FragmentShadingRateCombinerOpKHR
-> (Void# -> r) -> (Void# -> r) -> r
FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR = FragmentShadingRateCombinerOpKHR 2
-- | 'FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR' specifies a combiner
-- operation of combine(Axy,Bxy) = max(Axy,Bxy).
pattern $bFRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR :: FragmentShadingRateCombinerOpKHR
$mFRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR :: forall r.
FragmentShadingRateCombinerOpKHR
-> (Void# -> r) -> (Void# -> r) -> r
FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR = FragmentShadingRateCombinerOpKHR 3
-- | 'FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR' combiner operation of
-- combine(Axy,Bxy) = Axy*Bxy.
pattern $bFRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR :: FragmentShadingRateCombinerOpKHR
$mFRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR :: forall r.
FragmentShadingRateCombinerOpKHR
-> (Void# -> r) -> (Void# -> r) -> r
FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR = FragmentShadingRateCombinerOpKHR 4
{-# complete FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR,
             FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR,
             FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR,
             FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR,
             FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR :: FragmentShadingRateCombinerOpKHR #-}

instance Show FragmentShadingRateCombinerOpKHR where
  showsPrec :: Int -> FragmentShadingRateCombinerOpKHR -> ShowS
showsPrec p :: Int
p = \case
    FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR -> String -> ShowS
showString "FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR"
    FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR -> String -> ShowS
showString "FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR"
    FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR -> String -> ShowS
showString "FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR"
    FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR -> String -> ShowS
showString "FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR"
    FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR -> String -> ShowS
showString "FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR"
    FragmentShadingRateCombinerOpKHR x :: Int32
x -> Bool -> ShowS -> ShowS
showParen (Int
p Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 11) (String -> ShowS
showString "FragmentShadingRateCombinerOpKHR " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec 11 Int32
x)

instance Read FragmentShadingRateCombinerOpKHR where
  readPrec :: ReadPrec FragmentShadingRateCombinerOpKHR
readPrec = ReadPrec FragmentShadingRateCombinerOpKHR
-> ReadPrec FragmentShadingRateCombinerOpKHR
forall a. ReadPrec a -> ReadPrec a
parens ([(String, ReadPrec FragmentShadingRateCombinerOpKHR)]
-> ReadPrec FragmentShadingRateCombinerOpKHR
forall a. [(String, ReadPrec a)] -> ReadPrec a
choose [("FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR", FragmentShadingRateCombinerOpKHR
-> ReadPrec FragmentShadingRateCombinerOpKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure FragmentShadingRateCombinerOpKHR
FRAGMENT_SHADING_RATE_COMBINER_OP_KEEP_KHR)
                            , ("FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR", FragmentShadingRateCombinerOpKHR
-> ReadPrec FragmentShadingRateCombinerOpKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure FragmentShadingRateCombinerOpKHR
FRAGMENT_SHADING_RATE_COMBINER_OP_REPLACE_KHR)
                            , ("FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR", FragmentShadingRateCombinerOpKHR
-> ReadPrec FragmentShadingRateCombinerOpKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure FragmentShadingRateCombinerOpKHR
FRAGMENT_SHADING_RATE_COMBINER_OP_MIN_KHR)
                            , ("FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR", FragmentShadingRateCombinerOpKHR
-> ReadPrec FragmentShadingRateCombinerOpKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure FragmentShadingRateCombinerOpKHR
FRAGMENT_SHADING_RATE_COMBINER_OP_MAX_KHR)
                            , ("FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR", FragmentShadingRateCombinerOpKHR
-> ReadPrec FragmentShadingRateCombinerOpKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure FragmentShadingRateCombinerOpKHR
FRAGMENT_SHADING_RATE_COMBINER_OP_MUL_KHR)]
                     ReadPrec FragmentShadingRateCombinerOpKHR
-> ReadPrec FragmentShadingRateCombinerOpKHR
-> ReadPrec FragmentShadingRateCombinerOpKHR
forall a. ReadPrec a -> ReadPrec a -> ReadPrec a
+++
                     Int
-> ReadPrec FragmentShadingRateCombinerOpKHR
-> ReadPrec FragmentShadingRateCombinerOpKHR
forall a. Int -> ReadPrec a -> ReadPrec a
prec 10 (do
                       Lexeme -> ReadPrec ()
expectP (String -> Lexeme
Ident "FragmentShadingRateCombinerOpKHR")
                       Int32
v <- ReadPrec Int32 -> ReadPrec Int32
forall a. ReadPrec a -> ReadPrec a
step ReadPrec Int32
forall a. Read a => ReadPrec a
readPrec
                       FragmentShadingRateCombinerOpKHR
-> ReadPrec FragmentShadingRateCombinerOpKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Int32 -> FragmentShadingRateCombinerOpKHR
FragmentShadingRateCombinerOpKHR Int32
v)))


type KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION"
pattern KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_FRAGMENT_SHADING_RATE_SPEC_VERSION :: a
$mKHR_FRAGMENT_SHADING_RATE_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION = 1


type KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME = "VK_KHR_fragment_shading_rate"

-- No documentation found for TopLevel "VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME"
pattern KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME :: a
$mKHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME = "VK_KHR_fragment_shading_rate"