{-# language CPP #-}
-- No documentation found for Chapter "Promoted_From_VK_KHR_create_renderpass2"
module Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2  ( createRenderPass2
                                                              , cmdBeginRenderPass2
                                                              , cmdUseRenderPass2
                                                              , cmdNextSubpass2
                                                              , cmdEndRenderPass2
                                                              , AttachmentDescription2(..)
                                                              , AttachmentReference2(..)
                                                              , SubpassDescription2(..)
                                                              , SubpassDependency2(..)
                                                              , RenderPassCreateInfo2(..)
                                                              , SubpassBeginInfo(..)
                                                              , SubpassEndInfo(..)
                                                              , StructureType(..)
                                                              ) where

import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import Foreign.Marshal.Utils (maybePeek)
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 Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import qualified Data.Vector (null)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.Type.Equality ((:~:)(Refl))
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 Data.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.CStruct.Extends (peekSomeCStruct)
import Vulkan.CStruct.Extends (pokeSomeCStruct)
import Vulkan.CStruct.Extends (withSomeCStruct)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.Enums.AccessFlagBits (AccessFlags)
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.Enums.AttachmentDescriptionFlagBits (AttachmentDescriptionFlags)
import {-# SOURCE #-} Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts (AttachmentDescriptionStencilLayout)
import Vulkan.Core10.Enums.AttachmentLoadOp (AttachmentLoadOp)
import {-# SOURCE #-} Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts (AttachmentReferenceStencilLayout)
import Vulkan.Core10.Enums.AttachmentStoreOp (AttachmentStoreOp)
import Vulkan.CStruct.Extends (Chain)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer(CommandBuffer))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Core10.Enums.DependencyFlagBits (DependencyFlags)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkCmdBeginRenderPass2))
import Vulkan.Dynamic (DeviceCmds(pVkCmdEndRenderPass2))
import Vulkan.Dynamic (DeviceCmds(pVkCmdNextSubpass2))
import Vulkan.Dynamic (DeviceCmds(pVkCreateRenderPass2))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import {-# SOURCE #-} Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer (ExternalFormatANDROID)
import Vulkan.Core10.Enums.Format (Format)
import {-# SOURCE #-} Vulkan.Extensions.VK_KHR_fragment_shading_rate (FragmentShadingRateAttachmentInfoKHR)
import Vulkan.Core10.Enums.ImageAspectFlagBits (ImageAspectFlags)
import Vulkan.Core10.Enums.ImageLayout (ImageLayout)
import {-# SOURCE #-} Vulkan.Core13.Promoted_From_VK_KHR_synchronization2 (MemoryBarrier2)
import {-# SOURCE #-} Vulkan.Extensions.VK_KHR_maintenance8 (MemoryBarrierAccessFlags3KHR)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_multisampled_render_to_single_sampled (MultisampledRenderToSingleSampledInfoEXT)
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.Core10.Enums.PipelineBindPoint (PipelineBindPoint)
import Vulkan.Core10.Enums.PipelineStageFlagBits (PipelineStageFlags)
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import Vulkan.Core10.Handles (RenderPass)
import Vulkan.Core10.Handles (RenderPass(..))
import Vulkan.Core10.CommandBufferBuilding (RenderPassBeginInfo)
import Vulkan.Core10.Enums.RenderPassCreateFlagBits (RenderPassCreateFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_subpass_merge_feedback (RenderPassCreationControlEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_subpass_merge_feedback (RenderPassCreationFeedbackCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_fragment_density_map (RenderPassFragmentDensityMapCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_fragment_density_map_offset (RenderPassFragmentDensityMapOffsetEndInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_subpass_merge_feedback (RenderPassSubpassFeedbackCreateInfoEXT)
import {-# SOURCE #-} Vulkan.Extensions.VK_QCOM_tile_shading (RenderPassTileShadingCreateInfoQCOM)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Enums.SampleCountFlagBits (SampleCountFlagBits)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.SubpassContents (SubpassContents)
import {-# SOURCE #-} Vulkan.Core12.Promoted_From_VK_KHR_depth_stencil_resolve (SubpassDescriptionDepthStencilResolve)
import Vulkan.Core10.Enums.SubpassDescriptionFlagBits (SubpassDescriptionFlags)
import {-# SOURCE #-} Vulkan.Extensions.VK_QCOM_tile_memory_heap (TileMemorySizeInfoQCOM)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SUBPASS_BEGIN_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SUBPASS_END_INFO))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Core10.Enums.StructureType (StructureType(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCreateRenderPass2
  :: FunPtr (Ptr Device_T -> Ptr (SomeStruct RenderPassCreateInfo2) -> Ptr AllocationCallbacks -> Ptr RenderPass -> IO Result) -> Ptr Device_T -> Ptr (SomeStruct RenderPassCreateInfo2) -> Ptr AllocationCallbacks -> Ptr RenderPass -> IO Result

-- | vkCreateRenderPass2 - Create a new render pass object
--
-- = Description
--
-- This command is functionally identical to
-- 'Vulkan.Core10.Pass.createRenderPass', but includes extensible
-- sub-structures that include @sType@ and @pNext@ parameters, allowing
-- them to be more easily extended.
--
-- == Valid Usage
--
-- -   #VUID-vkCreateRenderPass2-device-10001# @device@ /must/ support at
--     least one queue family with the
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT' capability
--
-- -   #VUID-vkCreateRenderPass2-flags-10649#
--     'Vulkan.Extensions.VK_QCOM_tile_shading.RenderPassTileShadingCreateInfoQCOM'::@flags@
--     /must/ not include
--     'Vulkan.Extensions.VK_QCOM_tile_shading.TILE_SHADING_RENDER_PASS_PER_TILE_EXECUTION_BIT_QCOM'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreateRenderPass2-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCreateRenderPass2-pCreateInfo-parameter# @pCreateInfo@
--     /must/ be a valid pointer to a valid 'RenderPassCreateInfo2'
--     structure
--
-- -   #VUID-vkCreateRenderPass2-pAllocator-parameter# If @pAllocator@ is
--     not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkCreateRenderPass2-pRenderPass-parameter# @pRenderPass@
--     /must/ be a valid pointer to a 'Vulkan.Core10.Handles.RenderPass'
--     handle
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_DEVICE_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_create_renderpass2 VK_KHR_create_renderpass2>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Core10.Handles.Device', 'Vulkan.Core10.Handles.RenderPass',
-- 'RenderPassCreateInfo2'
createRenderPass2 :: forall a io
                   . (Extendss RenderPassCreateInfo2 a, PokeChain a, MonadIO io)
                  => -- | @device@ is the logical device that creates the render pass.
                     Device
                  -> -- | @pCreateInfo@ is a pointer to a 'RenderPassCreateInfo2' structure
                     -- describing the parameters of the render pass.
                     (RenderPassCreateInfo2 a)
                  -> -- | @pAllocator@ controls host memory allocation as described in the
                     -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#memory-allocation Memory Allocation>
                     -- chapter.
                     ("allocator" ::: Maybe AllocationCallbacks)
                  -> io (RenderPass)
createRenderPass2 :: forall (a :: [*]) (io :: * -> *).
(Extendss RenderPassCreateInfo2 a, PokeChain a, MonadIO io) =>
Device
-> RenderPassCreateInfo2 a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io RenderPass
createRenderPass2 Device
device RenderPassCreateInfo2 a
createInfo "allocator" ::: Maybe AllocationCallbacks
allocator = IO RenderPass -> io RenderPass
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RenderPass -> io RenderPass)
-> (ContT RenderPass IO RenderPass -> IO RenderPass)
-> ContT RenderPass IO RenderPass
-> io RenderPass
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT RenderPass IO RenderPass -> IO RenderPass
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT RenderPass IO RenderPass -> io RenderPass)
-> ContT RenderPass IO RenderPass -> io RenderPass
forall a b. (a -> b) -> a -> b
$ do
  let vkCreateRenderPass2Ptr :: FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct RenderPassCreateInfo2)
   -> Ptr AllocationCallbacks
   -> Ptr RenderPass
   -> IO Result)
vkCreateRenderPass2Ptr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> Ptr (SomeStruct RenderPassCreateInfo2)
      -> Ptr AllocationCallbacks
      -> Ptr RenderPass
      -> IO Result)
pVkCreateRenderPass2 (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT RenderPass IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT RenderPass m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT RenderPass IO ())
-> IO () -> ContT RenderPass IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct RenderPassCreateInfo2)
   -> Ptr AllocationCallbacks
   -> Ptr RenderPass
   -> IO Result)
vkCreateRenderPass2Ptr FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct RenderPassCreateInfo2)
   -> Ptr AllocationCallbacks
   -> Ptr RenderPass
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> Ptr (SomeStruct RenderPassCreateInfo2)
      -> Ptr AllocationCallbacks
      -> Ptr RenderPass
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct RenderPassCreateInfo2)
   -> Ptr AllocationCallbacks
   -> Ptr RenderPass
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCreateRenderPass2 is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCreateRenderPass2' :: Ptr Device_T
-> Ptr (SomeStruct RenderPassCreateInfo2)
-> Ptr AllocationCallbacks
-> Ptr RenderPass
-> IO Result
vkCreateRenderPass2' = FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct RenderPassCreateInfo2)
   -> Ptr AllocationCallbacks
   -> Ptr RenderPass
   -> IO Result)
-> Ptr Device_T
-> Ptr (SomeStruct RenderPassCreateInfo2)
-> Ptr AllocationCallbacks
-> Ptr RenderPass
-> IO Result
mkVkCreateRenderPass2 FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct RenderPassCreateInfo2)
   -> Ptr AllocationCallbacks
   -> Ptr RenderPass
   -> IO Result)
vkCreateRenderPass2Ptr
  pCreateInfo <- ((Ptr (RenderPassCreateInfo2 a) -> IO RenderPass) -> IO RenderPass)
-> ContT RenderPass IO (Ptr (RenderPassCreateInfo2 a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (RenderPassCreateInfo2 a) -> IO RenderPass)
  -> IO RenderPass)
 -> ContT RenderPass IO (Ptr (RenderPassCreateInfo2 a)))
-> ((Ptr (RenderPassCreateInfo2 a) -> IO RenderPass)
    -> IO RenderPass)
-> ContT RenderPass IO (Ptr (RenderPassCreateInfo2 a))
forall a b. (a -> b) -> a -> b
$ RenderPassCreateInfo2 a
-> (Ptr (RenderPassCreateInfo2 a) -> IO RenderPass)
-> IO RenderPass
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
RenderPassCreateInfo2 a
-> (Ptr (RenderPassCreateInfo2 a) -> IO b) -> IO b
withCStruct (RenderPassCreateInfo2 a
createInfo)
  pAllocator <- case (allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> Ptr AllocationCallbacks
-> ContT RenderPass IO (Ptr AllocationCallbacks)
forall a. a -> ContT RenderPass IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> ((Ptr AllocationCallbacks -> IO RenderPass) -> IO RenderPass)
-> ContT RenderPass IO (Ptr AllocationCallbacks)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AllocationCallbacks -> IO RenderPass) -> IO RenderPass)
 -> ContT RenderPass IO (Ptr AllocationCallbacks))
-> ((Ptr AllocationCallbacks -> IO RenderPass) -> IO RenderPass)
-> ContT RenderPass IO (Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (Ptr AllocationCallbacks -> IO RenderPass) -> IO RenderPass
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
AllocationCallbacks -> (Ptr AllocationCallbacks -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  pPRenderPass <- ContT $ bracket (callocBytes @RenderPass 8) free
  r <- lift $ traceAroundEvent "vkCreateRenderPass2" (vkCreateRenderPass2'
                                                        (deviceHandle (device))
                                                        (forgetExtensions pCreateInfo)
                                                        pAllocator
                                                        (pPRenderPass))
  lift $ when (r < SUCCESS) (throwIO (VulkanException r))
  pRenderPass <- lift $ peek @RenderPass pPRenderPass
  pure $ (pRenderPass)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdBeginRenderPass2
  :: FunPtr (Ptr CommandBuffer_T -> Ptr (SomeStruct RenderPassBeginInfo) -> Ptr SubpassBeginInfo -> IO ()) -> Ptr CommandBuffer_T -> Ptr (SomeStruct RenderPassBeginInfo) -> Ptr SubpassBeginInfo -> IO ()

-- | vkCmdBeginRenderPass2 - Begin a new render pass
--
-- = Description
--
-- After beginning a render pass instance, the command buffer is ready to
-- record the commands for the first subpass of that render pass.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdBeginRenderPass2-framebuffer-02779# Both the
--     @framebuffer@ and @renderPass@ members of @pRenderPassBegin@ /must/
--     have been created on the same 'Vulkan.Core10.Handles.Device' that
--     @commandBuffer@ was allocated on
--
-- -   #VUID-vkCmdBeginRenderPass2-initialLayout-03094# If any of the
--     @initialLayout@ or @finalLayout@ member of the
--     'Vulkan.Core10.Pass.AttachmentDescription' structures or the
--     @layout@ member of the 'Vulkan.Core10.Pass.AttachmentReference'
--     structures specified when creating the render pass specified in the
--     @renderPass@ member of @pRenderPassBegin@ is
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL'
--     then the corresponding attachment image view of the framebuffer
--     specified in the @framebuffer@ member of @pRenderPassBegin@ /must/
--     have been created with the
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_COLOR_ATTACHMENT_BIT'
--     usage flag set
--
-- -   #VUID-vkCmdBeginRenderPass2-initialLayout-03096# If any of the
--     @initialLayout@ or @finalLayout@ member of the
--     'Vulkan.Core10.Pass.AttachmentDescription' structures or the
--     @layout@ member of the 'Vulkan.Core10.Pass.AttachmentReference'
--     structures specified when creating the render pass specified in the
--     @renderPass@ member of @pRenderPassBegin@ is
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL',
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL'
--     then the corresponding attachment image view of the framebuffer
--     specified in the @framebuffer@ member of @pRenderPassBegin@ /must/
--     have been created with the
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT'
--     usage flag set
--
-- -   #VUID-vkCmdBeginRenderPass2-initialLayout-02844# If any of the
--     @initialLayout@ or @finalLayout@ member of the
--     'Vulkan.Core10.Pass.AttachmentDescription' structures or the
--     @layout@ member of the 'Vulkan.Core10.Pass.AttachmentReference'
--     structures specified when creating the render pass specified in the
--     @renderPass@ member of @pRenderPassBegin@ is
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL',
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL',
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL'
--     then the corresponding attachment image view of the framebuffer
--     specified in the @framebuffer@ member of @pRenderPassBegin@ /must/
--     have been created with the
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT'
--     usage flag set
--
-- -   #VUID-vkCmdBeginRenderPass2-stencilInitialLayout-02845# If any of
--     the @stencilInitialLayout@ or @stencilFinalLayout@ member of the
--     'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentDescriptionStencilLayout'
--     structures or the @stencilLayout@ member of the
--     'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentReferenceStencilLayout'
--     structures specified when creating the render pass specified in the
--     @renderPass@ member of @pRenderPassBegin@ is
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL',
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL'
--     then the corresponding attachment image view of the framebuffer
--     specified in the @framebuffer@ member of @pRenderPassBegin@ /must/
--     have been created with the
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT'
--     usage flag set
--
-- -   #VUID-vkCmdBeginRenderPass2-initialLayout-03097# If any of the
--     @initialLayout@ or @finalLayout@ member of the
--     'Vulkan.Core10.Pass.AttachmentDescription' structures or the
--     @layout@ member of the 'Vulkan.Core10.Pass.AttachmentReference'
--     structures specified when creating the render pass specified in the
--     @renderPass@ member of @pRenderPassBegin@ is
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL'
--     then the corresponding attachment image view of the framebuffer
--     specified in the @framebuffer@ member of @pRenderPassBegin@ /must/
--     have been created with the
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_SAMPLED_BIT' or
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_INPUT_ATTACHMENT_BIT'
--     usage flags set
--
-- -   #VUID-vkCmdBeginRenderPass2-initialLayout-03098# If any of the
--     @initialLayout@ or @finalLayout@ member of the
--     'Vulkan.Core10.Pass.AttachmentDescription' structures or the
--     @layout@ member of the 'Vulkan.Core10.Pass.AttachmentReference'
--     structures specified when creating the render pass specified in the
--     @renderPass@ member of @pRenderPassBegin@ is
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL'
--     then the corresponding attachment image view of the framebuffer
--     specified in the @framebuffer@ member of @pRenderPassBegin@ /must/
--     have been created with the
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_TRANSFER_SRC_BIT'
--     usage flag set
--
-- -   #VUID-vkCmdBeginRenderPass2-initialLayout-03099# If any of the
--     @initialLayout@ or @finalLayout@ member of the
--     'Vulkan.Core10.Pass.AttachmentDescription' structures or the
--     @layout@ member of the 'Vulkan.Core10.Pass.AttachmentReference'
--     structures specified when creating the render pass specified in the
--     @renderPass@ member of @pRenderPassBegin@ is
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL'
--     then the corresponding attachment image view of the framebuffer
--     specified in the @framebuffer@ member of @pRenderPassBegin@ /must/
--     have been created with the
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_TRANSFER_DST_BIT'
--     usage flag set
--
-- -   #VUID-vkCmdBeginRenderPass2-initialLayout-03100# If the
--     @initialLayout@ member of any of the
--     'Vulkan.Core10.Pass.AttachmentDescription' structures specified when
--     creating the render pass specified in the @renderPass@ member of
--     @pRenderPassBegin@ is not
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_UNDEFINED', then each
--     such @initialLayout@ /must/ be equal to the current layout of the
--     corresponding attachment image subresource of the framebuffer
--     specified in the @framebuffer@ member of @pRenderPassBegin@
--
-- -   #VUID-vkCmdBeginRenderPass2-srcStageMask-06453# The @srcStageMask@
--     members of any element of the @pDependencies@ member of
--     'Vulkan.Core10.Pass.RenderPassCreateInfo' used to create
--     @renderPass@ /must/ be supported by the capabilities of the queue
--     family identified by the @queueFamilyIndex@ member of the
--     'Vulkan.Core10.CommandPool.CommandPoolCreateInfo' used to create the
--     command pool which @commandBuffer@ was allocated from
--
-- -   #VUID-vkCmdBeginRenderPass2-dstStageMask-06454# The @dstStageMask@
--     members of any element of the @pDependencies@ member of
--     'Vulkan.Core10.Pass.RenderPassCreateInfo' used to create
--     @renderPass@ /must/ be supported by the capabilities of the queue
--     family identified by the @queueFamilyIndex@ member of the
--     'Vulkan.Core10.CommandPool.CommandPoolCreateInfo' used to create the
--     command pool which @commandBuffer@ was allocated from
--
-- -   #VUID-vkCmdBeginRenderPass2-framebuffer-02533# For any attachment in
--     @framebuffer@ that is used by @renderPass@ and is bound to memory
--     locations that are also bound to another attachment used by
--     @renderPass@, and if at least one of those uses causes either
--     attachment to be written to, both attachments /must/ have had the
--     'Vulkan.Core10.Enums.AttachmentDescriptionFlagBits.ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT'
--     set
--
-- -   #VUID-vkCmdBeginRenderPass2-framebuffer-09046# If any attachments
--     specified in @framebuffer@ are used by @renderPass@ and are bound to
--     overlapping memory locations, there /must/ be only one that is used
--     as a color attachment, depth\/stencil, or resolve attachment in any
--     subpass
--
-- -   #VUID-vkCmdBeginRenderPass2-initialLayout-07002# If any of the
--     @initialLayout@ or @finalLayout@ member of the
--     'Vulkan.Core10.Pass.AttachmentDescription' structures or the
--     @layout@ member of the 'Vulkan.Core10.Pass.AttachmentReference'
--     structures specified when creating the render pass specified in the
--     @renderPass@ member of @pRenderPassBegin@ is
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT'
--     then the corresponding attachment image view of the framebuffer
--     specified in the @framebuffer@ member of @pRenderPassBegin@ /must/
--     have been created with either the
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_COLOR_ATTACHMENT_BIT'
--     or
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT'
--     usage flags set, and either the
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_INPUT_ATTACHMENT_BIT'
--     or 'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_SAMPLED_BIT'
--     usage flags set
--
-- -   #VUID-vkCmdBeginRenderPass2-initialLayout-07003# If any of the
--     @initialLayout@ or @finalLayout@ member of the
--     'Vulkan.Core10.Pass.AttachmentDescription' structures or the
--     @layout@ member of the 'Vulkan.Core10.Pass.AttachmentReference'
--     structures specified when creating the render pass specified in the
--     @renderPass@ member of @pRenderPassBegin@ is
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT'
--     then the corresponding attachment image view of the framebuffer
--     specified in the @framebuffer@ member of @pRenderPassBegin@ /must/
--     have been created with the
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT'
--     usage flag set
--
-- -   #VUID-vkCmdBeginRenderPass2-initialLayout-09538# If any of the
--     @initialLayout@ or @finalLayout@ member of the
--     'Vulkan.Core10.Pass.AttachmentDescription' structures or the
--     @layout@ member of the 'Vulkan.Core10.Pass.AttachmentReference'
--     structures specified when creating the render pass specified in the
--     @renderPass@ member of @pRenderPassBegin@ is
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_RENDERING_LOCAL_READ'
--     then the corresponding attachment image view of the framebuffer
--     specified in the @framebuffer@ member of @pRenderPassBegin@ /must/
--     have been created with either the
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_STORAGE_BIT'
--     usage flag set, or both the
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_INPUT_ATTACHMENT_BIT'
--     and either of the
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_COLOR_ATTACHMENT_BIT'
--     or
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT'
--     usage flags set
--
-- -   #VUID-vkCmdBeginRenderPass2-flags-10652# If
--     'Vulkan.Extensions.VK_QCOM_tile_shading.TILE_SHADING_RENDER_PASS_ENABLE_BIT_QCOM'
--     was included in the
--     'Vulkan.Extensions.VK_QCOM_tile_shading.RenderPassTileShadingCreateInfoQCOM'::@flags@
--     used to create the @renderPass@, @commandBuffer@ /must/ not have
--     been recorded with
--     'Vulkan.Core10.Enums.CommandBufferUsageFlagBits.COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdBeginRenderPass2-commandBuffer-parameter# @commandBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdBeginRenderPass2-pRenderPassBegin-parameter#
--     @pRenderPassBegin@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.CommandBufferBuilding.RenderPassBeginInfo' structure
--
-- -   #VUID-vkCmdBeginRenderPass2-pSubpassBeginInfo-parameter#
--     @pSubpassBeginInfo@ /must/ be a valid pointer to a valid
--     'SubpassBeginInfo' structure
--
-- -   #VUID-vkCmdBeginRenderPass2-commandBuffer-recording# @commandBuffer@
--     /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdBeginRenderPass2-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT' operations
--
-- -   #VUID-vkCmdBeginRenderPass2-renderpass# This command /must/ only be
--     called outside of a render pass instance
--
-- -   #VUID-vkCmdBeginRenderPass2-suspended# This command /must/ not be
--     called between suspended render pass instances
--
-- -   #VUID-vkCmdBeginRenderPass2-videocoding# This command /must/ only be
--     called outside of a video coding scope
--
-- -   #VUID-vkCmdBeginRenderPass2-bufferlevel# @commandBuffer@ /must/ be a
--     primary 'Vulkan.Core10.Handles.CommandBuffer'
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Outside                                                                                                                     | VK_QUEUE_GRAPHICS_BIT                                                                                                 | Action                                                                                                                                 |
-- |                                                                                                                            |                                                                                                                        |                                                                                                                             |                                                                                                                       | State                                                                                                                                  |
-- |                                                                                                                            |                                                                                                                        |                                                                                                                             |                                                                                                                       | Synchronization                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- == Conditional Rendering
--
-- vkCmdBeginRenderPass2 is not affected by
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#drawing-conditional-rendering conditional rendering>
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_create_renderpass2 VK_KHR_create_renderpass2>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'Vulkan.Core10.CommandBufferBuilding.RenderPassBeginInfo',
-- 'SubpassBeginInfo'
cmdBeginRenderPass2 :: forall a io
                     . (Extendss RenderPassBeginInfo a, PokeChain a, MonadIO io)
                    => -- | @commandBuffer@ is the command buffer in which to record the command.
                       CommandBuffer
                    -> -- | @pRenderPassBegin@ is a pointer to a
                       -- 'Vulkan.Core10.CommandBufferBuilding.RenderPassBeginInfo' structure
                       -- specifying the render pass to begin an instance of, and the framebuffer
                       -- the instance uses. After recording this command, the render pass and
                       -- framebuffer /may/ be accessed at any point that @commandBuffer@ is in
                       -- the recording or pending state until it is reset.
                       (RenderPassBeginInfo a)
                    -> -- | @pSubpassBeginInfo@ is a pointer to a 'SubpassBeginInfo' structure
                       -- containing information about the subpass which is about to begin
                       -- rendering.
                       SubpassBeginInfo
                    -> io ()
cmdBeginRenderPass2 :: forall (a :: [*]) (io :: * -> *).
(Extendss RenderPassBeginInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> RenderPassBeginInfo a -> SubpassBeginInfo -> io ()
cmdBeginRenderPass2 CommandBuffer
commandBuffer
                      RenderPassBeginInfo a
renderPassBegin
                      SubpassBeginInfo
subpassBeginInfo = IO () -> io ()
forall a. IO a -> io a
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 vkCmdBeginRenderPass2Ptr :: FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct RenderPassBeginInfo)
   -> Ptr SubpassBeginInfo
   -> IO ())
vkCmdBeginRenderPass2Ptr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct RenderPassBeginInfo)
      -> Ptr SubpassBeginInfo
      -> IO ())
pVkCmdBeginRenderPass2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
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
   -> Ptr (SomeStruct RenderPassBeginInfo)
   -> Ptr SubpassBeginInfo
   -> IO ())
vkCmdBeginRenderPass2Ptr FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct RenderPassBeginInfo)
   -> Ptr SubpassBeginInfo
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr (SomeStruct RenderPassBeginInfo)
      -> Ptr SubpassBeginInfo
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct RenderPassBeginInfo)
   -> Ptr SubpassBeginInfo
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdBeginRenderPass2 is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdBeginRenderPass2' :: Ptr CommandBuffer_T
-> Ptr (SomeStruct RenderPassBeginInfo)
-> Ptr SubpassBeginInfo
-> IO ()
vkCmdBeginRenderPass2' = FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct RenderPassBeginInfo)
   -> Ptr SubpassBeginInfo
   -> IO ())
-> Ptr CommandBuffer_T
-> Ptr (SomeStruct RenderPassBeginInfo)
-> Ptr SubpassBeginInfo
-> IO ()
mkVkCmdBeginRenderPass2 FunPtr
  (Ptr CommandBuffer_T
   -> Ptr (SomeStruct RenderPassBeginInfo)
   -> Ptr SubpassBeginInfo
   -> IO ())
vkCmdBeginRenderPass2Ptr
  pRenderPassBegin <- ((Ptr (RenderPassBeginInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (RenderPassBeginInfo a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (RenderPassBeginInfo a) -> IO ()) -> IO ())
 -> ContT () IO (Ptr (RenderPassBeginInfo a)))
-> ((Ptr (RenderPassBeginInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (RenderPassBeginInfo a))
forall a b. (a -> b) -> a -> b
$ RenderPassBeginInfo a
-> (Ptr (RenderPassBeginInfo a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
RenderPassBeginInfo a
-> (Ptr (RenderPassBeginInfo a) -> IO b) -> IO b
withCStruct (RenderPassBeginInfo a
renderPassBegin)
  pSubpassBeginInfo <- ContT $ withCStruct (subpassBeginInfo)
  lift $ traceAroundEvent "vkCmdBeginRenderPass2" (vkCmdBeginRenderPass2'
                                                     (commandBufferHandle (commandBuffer))
                                                     (forgetExtensions pRenderPassBegin)
                                                     pSubpassBeginInfo)
  pure $ ()

-- | This function will call the supplied action between calls to
-- 'cmdBeginRenderPass2' and 'cmdEndRenderPass2'
--
-- Note that 'cmdEndRenderPass2' is *not* called if an exception is thrown
-- by the inner action.
cmdUseRenderPass2 :: forall a io r . (Extendss RenderPassBeginInfo a, Extendss SubpassEndInfo a, PokeChain a, PokeChain a, MonadIO io) => CommandBuffer -> RenderPassBeginInfo a -> SubpassBeginInfo -> SubpassEndInfo a -> io r -> io r
cmdUseRenderPass2 :: forall (a :: [*]) (io :: * -> *) r.
(Extendss RenderPassBeginInfo a, Extendss SubpassEndInfo a,
 PokeChain a, PokeChain a, MonadIO io) =>
CommandBuffer
-> RenderPassBeginInfo a
-> SubpassBeginInfo
-> SubpassEndInfo a
-> io r
-> io r
cmdUseRenderPass2 CommandBuffer
commandBuffer
                    RenderPassBeginInfo a
pRenderPassBegin
                    SubpassBeginInfo
pSubpassBeginInfo
                    SubpassEndInfo a
pSubpassEndInfo
                    io r
a =
  (CommandBuffer -> RenderPassBeginInfo a -> SubpassBeginInfo -> io ()
forall (a :: [*]) (io :: * -> *).
(Extendss RenderPassBeginInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> RenderPassBeginInfo a -> SubpassBeginInfo -> io ()
cmdBeginRenderPass2 CommandBuffer
commandBuffer
                         RenderPassBeginInfo a
pRenderPassBegin
                         SubpassBeginInfo
pSubpassBeginInfo) io () -> io r -> io r
forall a b. io a -> io b -> io b
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f b
*> io r
a io r -> io () -> io r
forall a b. io a -> io b -> io a
forall (f :: * -> *) a b. Applicative f => f a -> f b -> f a
<* (CommandBuffer -> SubpassEndInfo a -> io ()
forall (a :: [*]) (io :: * -> *).
(Extendss SubpassEndInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> SubpassEndInfo a -> io ()
cmdEndRenderPass2 CommandBuffer
commandBuffer
                                                                         SubpassEndInfo a
pSubpassEndInfo)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdNextSubpass2
  :: FunPtr (Ptr CommandBuffer_T -> Ptr SubpassBeginInfo -> Ptr (SomeStruct SubpassEndInfo) -> IO ()) -> Ptr CommandBuffer_T -> Ptr SubpassBeginInfo -> Ptr (SomeStruct SubpassEndInfo) -> IO ()

-- | vkCmdNextSubpass2 - Transition to the next subpass of a render pass
--
-- = Description
--
-- 'cmdNextSubpass2' is semantically identical to
-- 'Vulkan.Core10.CommandBufferBuilding.cmdNextSubpass', except that it is
-- extensible, and that @contents@ is provided as part of an extensible
-- structure instead of as a flat parameter.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdNextSubpass2-None-03102# The current subpass index /must/
--     be less than the number of subpasses in the render pass minus one
--
-- -   #VUID-vkCmdNextSubpass2-None-02350# This command /must/ not be
--     recorded when transform feedback is active
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdNextSubpass2-commandBuffer-parameter# @commandBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdNextSubpass2-pSubpassBeginInfo-parameter#
--     @pSubpassBeginInfo@ /must/ be a valid pointer to a valid
--     'SubpassBeginInfo' structure
--
-- -   #VUID-vkCmdNextSubpass2-pSubpassEndInfo-parameter# @pSubpassEndInfo@
--     /must/ be a valid pointer to a valid 'SubpassEndInfo' structure
--
-- -   #VUID-vkCmdNextSubpass2-commandBuffer-recording# @commandBuffer@
--     /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdNextSubpass2-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT' operations
--
-- -   #VUID-vkCmdNextSubpass2-renderpass# This command /must/ only be
--     called inside of a render pass instance
--
-- -   #VUID-vkCmdNextSubpass2-suspended# This command /must/ not be called
--     between suspended render pass instances
--
-- -   #VUID-vkCmdNextSubpass2-videocoding# This command /must/ only be
--     called outside of a video coding scope
--
-- -   #VUID-vkCmdNextSubpass2-bufferlevel# @commandBuffer@ /must/ be a
--     primary 'Vulkan.Core10.Handles.CommandBuffer'
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Inside                                                                                                                 | Outside                                                                                                                     | VK_QUEUE_GRAPHICS_BIT                                                                                                 | Action                                                                                                                                 |
-- |                                                                                                                            |                                                                                                                        |                                                                                                                             |                                                                                                                       | State                                                                                                                                  |
-- |                                                                                                                            |                                                                                                                        |                                                                                                                             |                                                                                                                       | Synchronization                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- == Conditional Rendering
--
-- vkCmdNextSubpass2 is not affected by
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#drawing-conditional-rendering conditional rendering>
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_create_renderpass2 VK_KHR_create_renderpass2>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'Vulkan.Core10.Handles.CommandBuffer', 'SubpassBeginInfo',
-- 'SubpassEndInfo'
cmdNextSubpass2 :: forall a io
                 . (Extendss SubpassEndInfo a, PokeChain a, MonadIO io)
                => -- | @commandBuffer@ is the command buffer in which to record the command.
                   CommandBuffer
                -> -- | @pSubpassBeginInfo@ is a pointer to a 'SubpassBeginInfo' structure
                   -- containing information about the subpass which is about to begin
                   -- rendering.
                   SubpassBeginInfo
                -> -- | @pSubpassEndInfo@ is a pointer to a 'SubpassEndInfo' structure
                   -- containing information about how the previous subpass will be ended.
                   (SubpassEndInfo a)
                -> io ()
cmdNextSubpass2 :: forall (a :: [*]) (io :: * -> *).
(Extendss SubpassEndInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> SubpassBeginInfo -> SubpassEndInfo a -> io ()
cmdNextSubpass2 CommandBuffer
commandBuffer
                  SubpassBeginInfo
subpassBeginInfo
                  SubpassEndInfo a
subpassEndInfo = IO () -> io ()
forall a. IO a -> io a
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 vkCmdNextSubpass2Ptr :: FunPtr
  (Ptr CommandBuffer_T
   -> Ptr SubpassBeginInfo
   -> Ptr (SomeStruct SubpassEndInfo)
   -> IO ())
vkCmdNextSubpass2Ptr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr SubpassBeginInfo
      -> Ptr (SomeStruct SubpassEndInfo)
      -> IO ())
pVkCmdNextSubpass2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
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
   -> Ptr SubpassBeginInfo
   -> Ptr (SomeStruct SubpassEndInfo)
   -> IO ())
vkCmdNextSubpass2Ptr FunPtr
  (Ptr CommandBuffer_T
   -> Ptr SubpassBeginInfo
   -> Ptr (SomeStruct SubpassEndInfo)
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr SubpassBeginInfo
      -> Ptr (SomeStruct SubpassEndInfo)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> Ptr SubpassBeginInfo
   -> Ptr (SomeStruct SubpassEndInfo)
   -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdNextSubpass2 is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdNextSubpass2' :: Ptr CommandBuffer_T
-> Ptr SubpassBeginInfo -> Ptr (SomeStruct SubpassEndInfo) -> IO ()
vkCmdNextSubpass2' = FunPtr
  (Ptr CommandBuffer_T
   -> Ptr SubpassBeginInfo
   -> Ptr (SomeStruct SubpassEndInfo)
   -> IO ())
-> Ptr CommandBuffer_T
-> Ptr SubpassBeginInfo
-> Ptr (SomeStruct SubpassEndInfo)
-> IO ()
mkVkCmdNextSubpass2 FunPtr
  (Ptr CommandBuffer_T
   -> Ptr SubpassBeginInfo
   -> Ptr (SomeStruct SubpassEndInfo)
   -> IO ())
vkCmdNextSubpass2Ptr
  pSubpassBeginInfo <- ((Ptr SubpassBeginInfo -> IO ()) -> IO ())
-> ContT () IO (Ptr SubpassBeginInfo)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr SubpassBeginInfo -> IO ()) -> IO ())
 -> ContT () IO (Ptr SubpassBeginInfo))
-> ((Ptr SubpassBeginInfo -> IO ()) -> IO ())
-> ContT () IO (Ptr SubpassBeginInfo)
forall a b. (a -> b) -> a -> b
$ SubpassBeginInfo -> (Ptr SubpassBeginInfo -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
SubpassBeginInfo -> (Ptr SubpassBeginInfo -> IO b) -> IO b
withCStruct (SubpassBeginInfo
subpassBeginInfo)
  pSubpassEndInfo <- ContT $ withCStruct (subpassEndInfo)
  lift $ traceAroundEvent "vkCmdNextSubpass2" (vkCmdNextSubpass2'
                                                 (commandBufferHandle (commandBuffer))
                                                 pSubpassBeginInfo
                                                 (forgetExtensions pSubpassEndInfo))
  pure $ ()


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

-- | vkCmdEndRenderPass2 - End the current render pass
--
-- = Description
--
-- 'cmdEndRenderPass2' is semantically identical to
-- 'Vulkan.Core10.CommandBufferBuilding.cmdEndRenderPass', except that it
-- is extensible.
--
-- There is no implicit ordering between separate render passes, even in
-- the same command buffer, and even when the attachments match. Some
-- applications rely on the continuation of
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#primsrast-order rasterization order>
-- between multiple render passes with attachments defined in the same way,
-- in order to perform non-rendering operations (such as copies or compute
-- operations) between draw calls, but this has never been required by the
-- specification. There is also no explicit barrier currently in the API
-- that provides the guarantee that applications rely on without additional
-- performance penalties.
--
-- New applications should avoid relying on this ordering until an
-- appropriate barrier is added to the API.
--
-- Implementations where applications are performing this splitting are
-- encouraged to continue supporting this guarantee until a suitable
-- barrier is added to the API.
--
-- Existing applications relying on this ordering should expect that it
-- will continue working on platforms where it currently does. Once a new
-- extension adds support for a new barrier, developers are encouraged to
-- adapt their applications to use this when available.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdEndRenderPass2-None-03103# The current subpass index
--     /must/ be equal to the number of subpasses in the render pass minus
--     one
--
-- -   #VUID-vkCmdEndRenderPass2-None-02352# This command /must/ not be
--     recorded when transform feedback is active
--
-- -   #VUID-vkCmdEndRenderPass2-None-06171# The current render pass
--     instance /must/ not have been begun with
--     'Vulkan.Core13.Promoted_From_VK_KHR_dynamic_rendering.cmdBeginRendering'
--
-- -   #VUID-vkCmdEndRenderPass2-None-07005# If
--     'Vulkan.Core10.CommandBufferBuilding.cmdBeginQuery'* was called
--     within a subpass of the render pass, the corresponding
--     'Vulkan.Core10.CommandBufferBuilding.cmdEndQuery'* /must/ have been
--     called subsequently within the same subpass
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdEndRenderPass2-commandBuffer-parameter# @commandBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdEndRenderPass2-pSubpassEndInfo-parameter#
--     @pSubpassEndInfo@ /must/ be a valid pointer to a valid
--     'SubpassEndInfo' structure
--
-- -   #VUID-vkCmdEndRenderPass2-commandBuffer-recording# @commandBuffer@
--     /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdEndRenderPass2-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT' operations
--
-- -   #VUID-vkCmdEndRenderPass2-renderpass# This command /must/ only be
--     called inside of a render pass instance
--
-- -   #VUID-vkCmdEndRenderPass2-suspended# This command /must/ not be
--     called between suspended render pass instances
--
-- -   #VUID-vkCmdEndRenderPass2-videocoding# This command /must/ only be
--     called outside of a video coding scope
--
-- -   #VUID-vkCmdEndRenderPass2-bufferlevel# @commandBuffer@ /must/ be a
--     primary 'Vulkan.Core10.Handles.CommandBuffer'
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Inside                                                                                                                 | Outside                                                                                                                     | VK_QUEUE_GRAPHICS_BIT                                                                                                 | Action                                                                                                                                 |
-- |                                                                                                                            |                                                                                                                        |                                                                                                                             |                                                                                                                       | State                                                                                                                                  |
-- |                                                                                                                            |                                                                                                                        |                                                                                                                             |                                                                                                                       | Synchronization                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- == Conditional Rendering
--
-- vkCmdEndRenderPass2 is not affected by
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#drawing-conditional-rendering conditional rendering>
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_create_renderpass2 VK_KHR_create_renderpass2>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'Vulkan.Core10.Handles.CommandBuffer', 'SubpassEndInfo'
cmdEndRenderPass2 :: forall a io
                   . (Extendss SubpassEndInfo a, PokeChain a, MonadIO io)
                  => -- | @commandBuffer@ is the command buffer in which to end the current render
                     -- pass instance.
                     CommandBuffer
                  -> -- | @pSubpassEndInfo@ is a pointer to a 'SubpassEndInfo' structure
                     -- containing information about how the last subpass will be ended.
                     (SubpassEndInfo a)
                  -> io ()
cmdEndRenderPass2 :: forall (a :: [*]) (io :: * -> *).
(Extendss SubpassEndInfo a, PokeChain a, MonadIO io) =>
CommandBuffer -> SubpassEndInfo a -> io ()
cmdEndRenderPass2 CommandBuffer
commandBuffer SubpassEndInfo a
subpassEndInfo = IO () -> io ()
forall a. IO a -> io a
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 vkCmdEndRenderPass2Ptr :: FunPtr
  (Ptr CommandBuffer_T -> Ptr (SomeStruct SubpassEndInfo) -> IO ())
vkCmdEndRenderPass2Ptr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T -> Ptr (SomeStruct SubpassEndInfo) -> IO ())
pVkCmdEndRenderPass2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
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 -> Ptr (SomeStruct SubpassEndInfo) -> IO ())
vkCmdEndRenderPass2Ptr FunPtr
  (Ptr CommandBuffer_T -> Ptr (SomeStruct SubpassEndInfo) -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T -> Ptr (SomeStruct SubpassEndInfo) -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T -> Ptr (SomeStruct SubpassEndInfo) -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, Exception e) => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdEndRenderPass2 is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdEndRenderPass2' :: Ptr CommandBuffer_T -> Ptr (SomeStruct SubpassEndInfo) -> IO ()
vkCmdEndRenderPass2' = FunPtr
  (Ptr CommandBuffer_T -> Ptr (SomeStruct SubpassEndInfo) -> IO ())
-> Ptr CommandBuffer_T -> Ptr (SomeStruct SubpassEndInfo) -> IO ()
mkVkCmdEndRenderPass2 FunPtr
  (Ptr CommandBuffer_T -> Ptr (SomeStruct SubpassEndInfo) -> IO ())
vkCmdEndRenderPass2Ptr
  pSubpassEndInfo <- ((Ptr (SubpassEndInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (SubpassEndInfo a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (SubpassEndInfo a) -> IO ()) -> IO ())
 -> ContT () IO (Ptr (SubpassEndInfo a)))
-> ((Ptr (SubpassEndInfo a) -> IO ()) -> IO ())
-> ContT () IO (Ptr (SubpassEndInfo a))
forall a b. (a -> b) -> a -> b
$ SubpassEndInfo a -> (Ptr (SubpassEndInfo a) -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
SubpassEndInfo a -> (Ptr (SubpassEndInfo a) -> IO b) -> IO b
withCStruct (SubpassEndInfo a
subpassEndInfo)
  lift $ traceAroundEvent "vkCmdEndRenderPass2" (vkCmdEndRenderPass2'
                                                   (commandBufferHandle (commandBuffer))
                                                   (forgetExtensions pSubpassEndInfo))
  pure $ ()


-- | VkAttachmentDescription2 - Structure specifying an attachment
-- description
--
-- = Description
--
-- Parameters defined by this structure with the same name as those in
-- 'Vulkan.Core10.Pass.AttachmentDescription' have the identical effect to
-- those parameters.
--
-- If the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-separateDepthStencilLayouts separateDepthStencilLayouts>
-- feature is enabled, and @format@ is a depth\/stencil format,
-- @initialLayout@ and @finalLayout@ /can/ be set to a layout that only
-- specifies the layout of the depth aspect.
--
-- If the @pNext@ chain includes a
-- 'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentDescriptionStencilLayout'
-- structure, then the @stencilInitialLayout@ and @stencilFinalLayout@
-- members specify the initial and final layouts of the stencil aspect of a
-- depth\/stencil format, and @initialLayout@ and @finalLayout@ only apply
-- to the depth aspect. For depth-only formats, the
-- 'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentDescriptionStencilLayout'
-- structure is ignored. For stencil-only formats, the initial and final
-- layouts of the stencil aspect are taken from the
-- 'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentDescriptionStencilLayout'
-- structure if present, or @initialLayout@ and @finalLayout@ if not
-- present.
--
-- If @format@ is a depth\/stencil format, and either @initialLayout@ or
-- @finalLayout@ does not specify a layout for the stencil aspect, then the
-- application /must/ specify the initial and final layouts of the stencil
-- aspect by including a
-- 'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentDescriptionStencilLayout'
-- structure in the @pNext@ chain.
--
-- @loadOp@ and @storeOp@ are ignored for fragment shading rate
-- attachments. No access to the shading rate attachment is performed in
-- @loadOp@ and @storeOp@. Instead, access to
-- 'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR'
-- is performed as fragments are rasterized.
--
-- == Valid Usage
--
-- -   #VUID-VkAttachmentDescription2-format-06699# If @format@ includes a
--     color or depth component and @loadOp@ is
--     'Vulkan.Core10.Enums.AttachmentLoadOp.ATTACHMENT_LOAD_OP_LOAD', then
--     @initialLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_UNDEFINED'
--
-- -   #VUID-VkAttachmentDescription2-finalLayout-00843# @finalLayout@
--     /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_UNDEFINED' or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_ZERO_INITIALIZED_EXT'
--     or 'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_PREINITIALIZED'
--
-- -   #VUID-VkAttachmentDescription2-format-03280# If @format@ is a color
--     format, @initialLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkAttachmentDescription2-format-03281# If @format@ is a
--     depth\/stencil format, @initialLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL'
--
-- -   #VUID-VkAttachmentDescription2-format-03282# If @format@ is a color
--     format, @finalLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkAttachmentDescription2-format-03283# If @format@ is a
--     depth\/stencil format, @finalLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL'
--
-- -   #VUID-VkAttachmentDescription2-format-06487# If @format@ is a color
--     format, @initialLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL'
--
-- -   #VUID-VkAttachmentDescription2-format-06488# If @format@ is a color
--     format, @finalLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL'
--
-- -   #VUID-VkAttachmentDescription2-separateDepthStencilLayouts-03284# If
--     the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-separateDepthStencilLayouts separateDepthStencilLayouts>
--     feature is not enabled, @initialLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL',
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL',
--
-- -   #VUID-VkAttachmentDescription2-separateDepthStencilLayouts-03285# If
--     the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-separateDepthStencilLayouts separateDepthStencilLayouts>
--     feature is not enabled, @finalLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL',
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL',
--
-- -   #VUID-VkAttachmentDescription2-format-03286# If @format@ is a color
--     format, @initialLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL',
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkAttachmentDescription2-format-03287# If @format@ is a color
--     format, @finalLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL',
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkAttachmentDescription2-format-06906# If @format@ is a
--     depth\/stencil format which includes both depth and stencil
--     components, @initialLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkAttachmentDescription2-format-06907# If @format@ is a
--     depth\/stencil format which includes both depth and stencil
--     components, @finalLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkAttachmentDescription2-format-03290# If @format@ is a
--     depth\/stencil format which includes only the depth component,
--     @initialLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkAttachmentDescription2-format-03291# If @format@ is a
--     depth\/stencil format which includes only the depth component,
--     @finalLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkAttachmentDescription2-synchronization2-06908# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-synchronization2 synchronization2>
--     feature is not enabled, @initialLayout@ /must/ not be
--     'Vulkan.Extensions.VK_KHR_synchronization2.IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR'
--     or
--     'Vulkan.Extensions.VK_KHR_synchronization2.IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR'
--
-- -   #VUID-VkAttachmentDescription2-synchronization2-06909# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-synchronization2 synchronization2>
--     feature is not enabled, @finalLayout@ /must/ not be
--     'Vulkan.Extensions.VK_KHR_synchronization2.IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR'
--     or
--     'Vulkan.Extensions.VK_KHR_synchronization2.IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR'
--
-- -   #VUID-VkAttachmentDescription2-attachmentFeedbackLoopLayout-07309#
--     If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-attachmentFeedbackLoopLayout attachmentFeedbackLoopLayout>
--     feature is not enabled, @initialLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT'
--
-- -   #VUID-VkAttachmentDescription2-attachmentFeedbackLoopLayout-07310#
--     If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-attachmentFeedbackLoopLayout attachmentFeedbackLoopLayout>
--     feature is not enabled, @finalLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT'
--
-- -   #VUID-VkAttachmentDescription2-samples-08745# @samples@ /must/ be a
--     valid 'Vulkan.Core10.Enums.SampleCountFlagBits.SampleCountFlagBits'
--     value that is set in @imageCreateSampleCounts@ (as defined in
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#resources-image-creation-limits Image Creation Limits>)
--     for the given @format@
--
-- -   #VUID-VkAttachmentDescription2-dynamicRenderingLocalRead-09544# If
--     the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-dynamicRenderingLocalRead dynamicRenderingLocalRead>
--     feature is not enabled, @initialLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_RENDERING_LOCAL_READ'
--
-- -   #VUID-VkAttachmentDescription2-dynamicRenderingLocalRead-09545# If
--     the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-dynamicRenderingLocalRead dynamicRenderingLocalRead>
--     feature is not enabled, @finalLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_RENDERING_LOCAL_READ'
--
-- -   #VUID-VkAttachmentDescription2-flags-11773# If @flags@ includes
--     'Vulkan.Core10.Enums.AttachmentDescriptionFlagBits.ATTACHMENT_DESCRIPTION_RESOLVE_SKIP_TRANSFER_FUNCTION_BIT_KHR',
--     @flags@ /must/ not include
--     'Vulkan.Core10.Enums.AttachmentDescriptionFlagBits.ATTACHMENT_DESCRIPTION_RESOLVE_ENABLE_TRANSFER_FUNCTION_BIT_KHR'
--
-- -   #VUID-VkAttachmentDescription2-flags-11774# If @flags@ includes
--     'Vulkan.Core10.Enums.AttachmentDescriptionFlagBits.ATTACHMENT_DESCRIPTION_RESOLVE_SKIP_TRANSFER_FUNCTION_BIT_KHR'
--     or
--     'Vulkan.Core10.Enums.AttachmentDescriptionFlagBits.ATTACHMENT_DESCRIPTION_RESOLVE_ENABLE_TRANSFER_FUNCTION_BIT_KHR',
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-resolveSrgbFormatSupportsTransferFunctionControl resolveSrgbFormatSupportsTransferFunctionControl>
--     /must/ be 'Vulkan.Core10.FundamentalTypes.TRUE'
--
-- -   #VUID-VkAttachmentDescription2-flags-11775# If @flags@ includes
--     'Vulkan.Core10.Enums.AttachmentDescriptionFlagBits.ATTACHMENT_DESCRIPTION_RESOLVE_SKIP_TRANSFER_FUNCTION_BIT_KHR'
--     or
--     'Vulkan.Core10.Enums.AttachmentDescriptionFlagBits.ATTACHMENT_DESCRIPTION_RESOLVE_ENABLE_TRANSFER_FUNCTION_BIT_KHR',
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-maintenance10 maintenance10>
--     /must/ be enabled
--
-- -   #VUID-VkAttachmentDescription2-flags-11776# If @flags@ includes
--     'Vulkan.Core10.Enums.AttachmentDescriptionFlagBits.ATTACHMENT_DESCRIPTION_RESOLVE_SKIP_TRANSFER_FUNCTION_BIT_KHR'
--     or
--     'Vulkan.Core10.Enums.AttachmentDescriptionFlagBits.ATTACHMENT_DESCRIPTION_RESOLVE_ENABLE_TRANSFER_FUNCTION_BIT_KHR',
--     @format@ /must/ use sRGB encoding
--
-- -   #VUID-VkAttachmentDescription2-flags-11777# If @flags@ includes
--     'Vulkan.Core10.Enums.AttachmentDescriptionFlagBits.ATTACHMENT_DESCRIPTION_RESOLVE_SKIP_TRANSFER_FUNCTION_BIT_KHR'
--     or
--     'Vulkan.Core10.Enums.AttachmentDescriptionFlagBits.ATTACHMENT_DESCRIPTION_RESOLVE_ENABLE_TRANSFER_FUNCTION_BIT_KHR',
--     @samples@ /must/ be
--     'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_1_BIT'
--
-- -   #VUID-VkAttachmentDescription2-pNext-06704# If the @pNext@ chain
--     does not include a
--     'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentDescriptionStencilLayout'
--     structure, @format@ includes a stencil component, and
--     @stencilLoadOp@ is
--     'Vulkan.Core10.Enums.AttachmentLoadOp.ATTACHMENT_LOAD_OP_LOAD', then
--     @initialLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_UNDEFINED'
--
-- -   #VUID-VkAttachmentDescription2-pNext-06705# If the @pNext@ chain
--     includes a
--     'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentDescriptionStencilLayout'
--     structure, @format@ includes a stencil component, and
--     @stencilLoadOp@ is
--     'Vulkan.Core10.Enums.AttachmentLoadOp.ATTACHMENT_LOAD_OP_LOAD', then
--     'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentDescriptionStencilLayout'::@stencilInitialLayout@
--     /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_UNDEFINED'
--
-- -   #VUID-VkAttachmentDescription2-format-06249# If @format@ is a
--     depth\/stencil format which includes both depth and stencil
--     components, and @initialLayout@ is
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL',
--     the @pNext@ chain /must/ include a
--     'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentDescriptionStencilLayout'
--     structure
--
-- -   #VUID-VkAttachmentDescription2-format-06250# If @format@ is a
--     depth\/stencil format which includes both depth and stencil
--     components, and @finalLayout@ is
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL',
--     the @pNext@ chain /must/ include a
--     'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentDescriptionStencilLayout'
--     structure
--
-- -   #VUID-VkAttachmentDescription2-format-06247# If the @pNext@ chain
--     does not include a
--     'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentDescriptionStencilLayout'
--     structure and @format@ only includes a stencil component,
--     @initialLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkAttachmentDescription2-format-06248# If the @pNext@ chain
--     does not include a
--     'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentDescriptionStencilLayout'
--     structure and @format@ only includes a stencil component,
--     @finalLayout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkAttachmentDescription2-format-09332# If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-externalFormatResolve externalFormatResolve>
--     feature is not enabled, @format@ /must/ not be
--     'Vulkan.Core10.Enums.Format.FORMAT_UNDEFINED'
--
-- -   #VUID-VkAttachmentDescription2-format-09334# If @format@ is
--     'Vulkan.Core10.Enums.Format.FORMAT_UNDEFINED', there /must/ be a
--     'Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer.ExternalFormatANDROID'
--     structure in the @pNext@ chain with a @externalFormat@ that is not
--     equal to @0@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkAttachmentDescription2-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2'
--
-- -   #VUID-VkAttachmentDescription2-pNext-pNext# Each @pNext@ member of
--     any structure (including this one) in the @pNext@ chain /must/ be
--     either @NULL@ or a pointer to a valid instance of
--     'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentDescriptionStencilLayout',
--     'Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer.ExternalFormatANDROID',
--     or
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkExternalFormatOHOS VkExternalFormatOHOS>
--
-- -   #VUID-VkAttachmentDescription2-sType-unique# The @sType@ value of
--     each structure in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkAttachmentDescription2-flags-parameter# @flags@ /must/ be a
--     valid combination of
--     'Vulkan.Core10.Enums.AttachmentDescriptionFlagBits.AttachmentDescriptionFlagBits'
--     values
--
-- -   #VUID-VkAttachmentDescription2-format-parameter# @format@ /must/ be
--     a valid 'Vulkan.Core10.Enums.Format.Format' value
--
-- -   #VUID-VkAttachmentDescription2-samples-parameter# @samples@ /must/
--     be a valid
--     'Vulkan.Core10.Enums.SampleCountFlagBits.SampleCountFlagBits' value
--
-- -   #VUID-VkAttachmentDescription2-loadOp-parameter# @loadOp@ /must/ be
--     a valid 'Vulkan.Core10.Enums.AttachmentLoadOp.AttachmentLoadOp'
--     value
--
-- -   #VUID-VkAttachmentDescription2-storeOp-parameter# @storeOp@ /must/
--     be a valid 'Vulkan.Core10.Enums.AttachmentStoreOp.AttachmentStoreOp'
--     value
--
-- -   #VUID-VkAttachmentDescription2-stencilLoadOp-parameter#
--     @stencilLoadOp@ /must/ be a valid
--     'Vulkan.Core10.Enums.AttachmentLoadOp.AttachmentLoadOp' value
--
-- -   #VUID-VkAttachmentDescription2-stencilStoreOp-parameter#
--     @stencilStoreOp@ /must/ be a valid
--     'Vulkan.Core10.Enums.AttachmentStoreOp.AttachmentStoreOp' value
--
-- -   #VUID-VkAttachmentDescription2-initialLayout-parameter#
--     @initialLayout@ /must/ be a valid
--     'Vulkan.Core10.Enums.ImageLayout.ImageLayout' value
--
-- -   #VUID-VkAttachmentDescription2-finalLayout-parameter# @finalLayout@
--     /must/ be a valid 'Vulkan.Core10.Enums.ImageLayout.ImageLayout'
--     value
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_create_renderpass2 VK_KHR_create_renderpass2>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'Vulkan.Core10.Enums.AttachmentDescriptionFlagBits.AttachmentDescriptionFlags',
-- 'Vulkan.Core10.Enums.AttachmentLoadOp.AttachmentLoadOp',
-- 'Vulkan.Core10.Enums.AttachmentStoreOp.AttachmentStoreOp',
-- 'Vulkan.Core10.Enums.Format.Format',
-- 'Vulkan.Core10.Enums.ImageLayout.ImageLayout', 'RenderPassCreateInfo2',
-- 'Vulkan.Core10.Enums.SampleCountFlagBits.SampleCountFlagBits',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data AttachmentDescription2 (es :: [Type]) = AttachmentDescription2
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). AttachmentDescription2 es -> Chain es
next :: Chain es
  , -- | @flags@ is a bitmask of
    -- 'Vulkan.Core10.Enums.AttachmentDescriptionFlagBits.AttachmentDescriptionFlagBits'
    -- specifying additional properties of the attachment.
    forall (es :: [*]).
AttachmentDescription2 es -> AttachmentDescriptionFlags
flags :: AttachmentDescriptionFlags
  , -- | @format@ is a 'Vulkan.Core10.Enums.Format.Format' value specifying the
    -- format of the image that will be used for the attachment.
    forall (es :: [*]). AttachmentDescription2 es -> Format
format :: Format
  , -- | @samples@ is a
    -- 'Vulkan.Core10.Enums.SampleCountFlagBits.SampleCountFlagBits' value
    -- specifying the number of samples of the image.
    forall (es :: [*]).
AttachmentDescription2 es -> SampleCountFlagBits
samples :: SampleCountFlagBits
  , -- | @loadOp@ is a 'Vulkan.Core10.Enums.AttachmentLoadOp.AttachmentLoadOp'
    -- value specifying how the contents of color and depth components of the
    -- attachment are treated at the beginning of the subpass where it is first
    -- used.
    forall (es :: [*]). AttachmentDescription2 es -> AttachmentLoadOp
loadOp :: AttachmentLoadOp
  , -- | @storeOp@ is a 'Vulkan.Core10.Enums.AttachmentStoreOp.AttachmentStoreOp'
    -- value specifying how the contents of color and depth components of the
    -- attachment are treated at the end of the subpass where it is last used.
    forall (es :: [*]). AttachmentDescription2 es -> AttachmentStoreOp
storeOp :: AttachmentStoreOp
  , -- | @stencilLoadOp@ is a
    -- 'Vulkan.Core10.Enums.AttachmentLoadOp.AttachmentLoadOp' value specifying
    -- how the contents of stencil components of the attachment are treated at
    -- the beginning of the subpass where it is first used.
    forall (es :: [*]). AttachmentDescription2 es -> AttachmentLoadOp
stencilLoadOp :: AttachmentLoadOp
  , -- | @stencilStoreOp@ is a
    -- 'Vulkan.Core10.Enums.AttachmentStoreOp.AttachmentStoreOp' value
    -- specifying how the contents of stencil components of the attachment are
    -- treated at the end of the last subpass where it is used.
    forall (es :: [*]). AttachmentDescription2 es -> AttachmentStoreOp
stencilStoreOp :: AttachmentStoreOp
  , -- | @initialLayout@ is the layout the attachment image subresource will be
    -- in when a render pass instance begins.
    forall (es :: [*]). AttachmentDescription2 es -> ImageLayout
initialLayout :: ImageLayout
  , -- | @finalLayout@ is the layout the attachment image subresource will be
    -- transitioned to when a render pass instance ends.
    forall (es :: [*]). AttachmentDescription2 es -> ImageLayout
finalLayout :: ImageLayout
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AttachmentDescription2 (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (AttachmentDescription2 es)

instance Extensible AttachmentDescription2 where
  extensibleTypeName :: String
extensibleTypeName = String
"AttachmentDescription2"
  setNext :: forall (ds :: [*]) (es :: [*]).
AttachmentDescription2 ds -> Chain es -> AttachmentDescription2 es
setNext AttachmentDescription2{SampleCountFlagBits
ImageLayout
Format
AttachmentStoreOp
AttachmentLoadOp
AttachmentDescriptionFlags
Chain ds
next :: forall (es :: [*]). AttachmentDescription2 es -> Chain es
flags :: forall (es :: [*]).
AttachmentDescription2 es -> AttachmentDescriptionFlags
format :: forall (es :: [*]). AttachmentDescription2 es -> Format
samples :: forall (es :: [*]).
AttachmentDescription2 es -> SampleCountFlagBits
loadOp :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentLoadOp
storeOp :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentStoreOp
stencilLoadOp :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentLoadOp
stencilStoreOp :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentStoreOp
initialLayout :: forall (es :: [*]). AttachmentDescription2 es -> ImageLayout
finalLayout :: forall (es :: [*]). AttachmentDescription2 es -> ImageLayout
next :: Chain ds
flags :: AttachmentDescriptionFlags
format :: Format
samples :: SampleCountFlagBits
loadOp :: AttachmentLoadOp
storeOp :: AttachmentStoreOp
stencilLoadOp :: AttachmentLoadOp
stencilStoreOp :: AttachmentStoreOp
initialLayout :: ImageLayout
finalLayout :: ImageLayout
..} Chain es
next' = AttachmentDescription2{next :: Chain es
next = Chain es
next', SampleCountFlagBits
ImageLayout
Format
AttachmentStoreOp
AttachmentLoadOp
AttachmentDescriptionFlags
flags :: AttachmentDescriptionFlags
format :: Format
samples :: SampleCountFlagBits
loadOp :: AttachmentLoadOp
storeOp :: AttachmentStoreOp
stencilLoadOp :: AttachmentLoadOp
stencilStoreOp :: AttachmentStoreOp
initialLayout :: ImageLayout
finalLayout :: ImageLayout
flags :: AttachmentDescriptionFlags
format :: Format
samples :: SampleCountFlagBits
loadOp :: AttachmentLoadOp
storeOp :: AttachmentStoreOp
stencilLoadOp :: AttachmentLoadOp
stencilStoreOp :: AttachmentStoreOp
initialLayout :: ImageLayout
finalLayout :: ImageLayout
..}
  getNext :: forall (es :: [*]). AttachmentDescription2 es -> Chain es
getNext AttachmentDescription2{SampleCountFlagBits
ImageLayout
Format
AttachmentStoreOp
AttachmentLoadOp
AttachmentDescriptionFlags
Chain es
next :: forall (es :: [*]). AttachmentDescription2 es -> Chain es
flags :: forall (es :: [*]).
AttachmentDescription2 es -> AttachmentDescriptionFlags
format :: forall (es :: [*]). AttachmentDescription2 es -> Format
samples :: forall (es :: [*]).
AttachmentDescription2 es -> SampleCountFlagBits
loadOp :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentLoadOp
storeOp :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentStoreOp
stencilLoadOp :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentLoadOp
stencilStoreOp :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentStoreOp
initialLayout :: forall (es :: [*]). AttachmentDescription2 es -> ImageLayout
finalLayout :: forall (es :: [*]). AttachmentDescription2 es -> ImageLayout
next :: Chain es
flags :: AttachmentDescriptionFlags
format :: Format
samples :: SampleCountFlagBits
loadOp :: AttachmentLoadOp
storeOp :: AttachmentStoreOp
stencilLoadOp :: AttachmentLoadOp
stencilStoreOp :: AttachmentStoreOp
initialLayout :: ImageLayout
finalLayout :: ImageLayout
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends AttachmentDescription2 e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends AttachmentDescription2 e => b) -> Maybe b
extends proxy e
_ Extends AttachmentDescription2 e => b
f
    | Just e :~: AttachmentDescriptionStencilLayout
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @AttachmentDescriptionStencilLayout = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends AttachmentDescription2 e => b
f
    | Just e :~: ExternalFormatANDROID
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @ExternalFormatANDROID = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends AttachmentDescription2 e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss AttachmentDescription2 es
         , PokeChain es ) => ToCStruct (AttachmentDescription2 es) where
  withCStruct :: forall b.
AttachmentDescription2 es
-> (Ptr (AttachmentDescription2 es) -> IO b) -> IO b
withCStruct AttachmentDescription2 es
x Ptr (AttachmentDescription2 es) -> IO b
f = Int -> (Ptr (AttachmentDescription2 es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 ((Ptr (AttachmentDescription2 es) -> IO b) -> IO b)
-> (Ptr (AttachmentDescription2 es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (AttachmentDescription2 es)
p -> Ptr (AttachmentDescription2 es)
-> AttachmentDescription2 es -> IO b -> IO b
forall b.
Ptr (AttachmentDescription2 es)
-> AttachmentDescription2 es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (AttachmentDescription2 es)
p AttachmentDescription2 es
x (Ptr (AttachmentDescription2 es) -> IO b
f Ptr (AttachmentDescription2 es)
p)
  pokeCStruct :: forall b.
Ptr (AttachmentDescription2 es)
-> AttachmentDescription2 es -> IO b -> IO b
pokeCStruct Ptr (AttachmentDescription2 es)
p AttachmentDescription2{SampleCountFlagBits
ImageLayout
Format
AttachmentStoreOp
AttachmentLoadOp
AttachmentDescriptionFlags
Chain es
next :: forall (es :: [*]). AttachmentDescription2 es -> Chain es
flags :: forall (es :: [*]).
AttachmentDescription2 es -> AttachmentDescriptionFlags
format :: forall (es :: [*]). AttachmentDescription2 es -> Format
samples :: forall (es :: [*]).
AttachmentDescription2 es -> SampleCountFlagBits
loadOp :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentLoadOp
storeOp :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentStoreOp
stencilLoadOp :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentLoadOp
stencilStoreOp :: forall (es :: [*]). AttachmentDescription2 es -> AttachmentStoreOp
initialLayout :: forall (es :: [*]). AttachmentDescription2 es -> ImageLayout
finalLayout :: forall (es :: [*]). AttachmentDescription2 es -> ImageLayout
next :: Chain es
flags :: AttachmentDescriptionFlags
format :: Format
samples :: SampleCountFlagBits
loadOp :: AttachmentLoadOp
storeOp :: AttachmentStoreOp
stencilLoadOp :: AttachmentLoadOp
stencilStoreOp :: AttachmentStoreOp
initialLayout :: ImageLayout
finalLayout :: ImageLayout
..} 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
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 (AttachmentDescription2 es)
p Ptr (AttachmentDescription2 es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2)
    pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext''
    lift $ poke ((p `plusPtr` 16 :: Ptr AttachmentDescriptionFlags)) (flags)
    lift $ poke ((p `plusPtr` 20 :: Ptr Format)) (format)
    lift $ poke ((p `plusPtr` 24 :: Ptr SampleCountFlagBits)) (samples)
    lift $ poke ((p `plusPtr` 28 :: Ptr AttachmentLoadOp)) (loadOp)
    lift $ poke ((p `plusPtr` 32 :: Ptr AttachmentStoreOp)) (storeOp)
    lift $ poke ((p `plusPtr` 36 :: Ptr AttachmentLoadOp)) (stencilLoadOp)
    lift $ poke ((p `plusPtr` 40 :: Ptr AttachmentStoreOp)) (stencilStoreOp)
    lift $ poke ((p `plusPtr` 44 :: Ptr ImageLayout)) (initialLayout)
    lift $ poke ((p `plusPtr` 48 :: Ptr ImageLayout)) (finalLayout)
    lift $ f
  cStructSize :: Int
cStructSize = Int
56
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (AttachmentDescription2 es) -> IO b -> IO b
pokeZeroCStruct Ptr (AttachmentDescription2 es)
p 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
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 (AttachmentDescription2 es)
p Ptr (AttachmentDescription2 es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_2)
    pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext'
    lift $ poke ((p `plusPtr` 20 :: Ptr Format)) (zero)
    lift $ poke ((p `plusPtr` 24 :: Ptr SampleCountFlagBits)) (zero)
    lift $ poke ((p `plusPtr` 28 :: Ptr AttachmentLoadOp)) (zero)
    lift $ poke ((p `plusPtr` 32 :: Ptr AttachmentStoreOp)) (zero)
    lift $ poke ((p `plusPtr` 36 :: Ptr AttachmentLoadOp)) (zero)
    lift $ poke ((p `plusPtr` 40 :: Ptr AttachmentStoreOp)) (zero)
    lift $ poke ((p `plusPtr` 44 :: Ptr ImageLayout)) (zero)
    lift $ poke ((p `plusPtr` 48 :: Ptr ImageLayout)) (zero)
    lift $ f

instance ( Extendss AttachmentDescription2 es
         , PeekChain es ) => FromCStruct (AttachmentDescription2 es) where
  peekCStruct :: Ptr (AttachmentDescription2 es) -> IO (AttachmentDescription2 es)
peekCStruct Ptr (AttachmentDescription2 es)
p = do
    pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (AttachmentDescription2 es)
p Ptr (AttachmentDescription2 es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    next <- peekChain (castPtr pNext)
    flags <- peek @AttachmentDescriptionFlags ((p `plusPtr` 16 :: Ptr AttachmentDescriptionFlags))
    format <- peek @Format ((p `plusPtr` 20 :: Ptr Format))
    samples <- peek @SampleCountFlagBits ((p `plusPtr` 24 :: Ptr SampleCountFlagBits))
    loadOp <- peek @AttachmentLoadOp ((p `plusPtr` 28 :: Ptr AttachmentLoadOp))
    storeOp <- peek @AttachmentStoreOp ((p `plusPtr` 32 :: Ptr AttachmentStoreOp))
    stencilLoadOp <- peek @AttachmentLoadOp ((p `plusPtr` 36 :: Ptr AttachmentLoadOp))
    stencilStoreOp <- peek @AttachmentStoreOp ((p `plusPtr` 40 :: Ptr AttachmentStoreOp))
    initialLayout <- peek @ImageLayout ((p `plusPtr` 44 :: Ptr ImageLayout))
    finalLayout <- peek @ImageLayout ((p `plusPtr` 48 :: Ptr ImageLayout))
    pure $ AttachmentDescription2
             next
             flags
             format
             samples
             loadOp
             storeOp
             stencilLoadOp
             stencilStoreOp
             initialLayout
             finalLayout

instance es ~ '[] => Zero (AttachmentDescription2 es) where
  zero :: AttachmentDescription2 es
zero = Chain es
-> AttachmentDescriptionFlags
-> Format
-> SampleCountFlagBits
-> AttachmentLoadOp
-> AttachmentStoreOp
-> AttachmentLoadOp
-> AttachmentStoreOp
-> ImageLayout
-> ImageLayout
-> AttachmentDescription2 es
forall (es :: [*]).
Chain es
-> AttachmentDescriptionFlags
-> Format
-> SampleCountFlagBits
-> AttachmentLoadOp
-> AttachmentStoreOp
-> AttachmentLoadOp
-> AttachmentStoreOp
-> ImageLayout
-> ImageLayout
-> AttachmentDescription2 es
AttachmentDescription2
           ()
           AttachmentDescriptionFlags
forall a. Zero a => a
zero
           Format
forall a. Zero a => a
zero
           SampleCountFlagBits
forall a. Zero a => a
zero
           AttachmentLoadOp
forall a. Zero a => a
zero
           AttachmentStoreOp
forall a. Zero a => a
zero
           AttachmentLoadOp
forall a. Zero a => a
zero
           AttachmentStoreOp
forall a. Zero a => a
zero
           ImageLayout
forall a. Zero a => a
zero
           ImageLayout
forall a. Zero a => a
zero


-- | VkAttachmentReference2 - Structure specifying an attachment reference
--
-- = Description
--
-- Parameters defined by this structure with the same name as those in
-- 'Vulkan.Core10.Pass.AttachmentReference' have the identical effect to
-- those parameters.
--
-- @aspectMask@ is ignored when this structure is used to describe anything
-- other than an input attachment reference.
--
-- If the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-separateDepthStencilLayouts separateDepthStencilLayouts>
-- feature is enabled, and @attachment@ has a depth\/stencil format,
-- @layout@ /can/ be set to a layout that only specifies the layout of the
-- depth aspect.
--
-- If @layout@ only specifies the layout of the depth aspect of the
-- attachment, the layout of the stencil aspect is specified by the
-- @stencilLayout@ member of a
-- 'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentReferenceStencilLayout'
-- structure included in the @pNext@ chain. Otherwise, @layout@ describes
-- the layout for all relevant image aspects.
--
-- == Valid Usage
--
-- -   #VUID-VkAttachmentReference2-layout-03077# If @attachment@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', @layout@ /must/ not
--     be 'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_UNDEFINED',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_ZERO_INITIALIZED_EXT',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_PREINITIALIZED', or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_PRESENT_SRC_KHR'
--
-- -   #VUID-VkAttachmentReference2-separateDepthStencilLayouts-03313# If
--     the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-separateDepthStencilLayouts separateDepthStencilLayouts>
--     feature is not enabled, and @attachment@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', @layout@ /must/ not
--     be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL',
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL',
--
-- -   #VUID-VkAttachmentReference2-synchronization2-06910# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-synchronization2 synchronization2>
--     feature is not enabled, @layout@ /must/ not be
--     'Vulkan.Extensions.VK_KHR_synchronization2.IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR'
--     or
--     'Vulkan.Extensions.VK_KHR_synchronization2.IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR'
--
-- -   #VUID-VkAttachmentReference2-attachmentFeedbackLoopLayout-07311# If
--     the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-attachmentFeedbackLoopLayout attachmentFeedbackLoopLayout>
--     feature is not enabled, @layout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT'
--
-- -   #VUID-VkAttachmentReference2-dynamicRenderingLocalRead-09546# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-dynamicRenderingLocalRead dynamicRenderingLocalRead>
--     feature is not enabled, @layout@ /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_RENDERING_LOCAL_READ'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkAttachmentReference2-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2'
--
-- -   #VUID-VkAttachmentReference2-pNext-pNext# @pNext@ /must/ be @NULL@
--     or a pointer to a valid instance of
--     'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentReferenceStencilLayout'
--
-- -   #VUID-VkAttachmentReference2-sType-unique# The @sType@ value of each
--     structure in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkAttachmentReference2-layout-parameter# @layout@ /must/ be a
--     valid 'Vulkan.Core10.Enums.ImageLayout.ImageLayout' value
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_create_renderpass2 VK_KHR_create_renderpass2>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'Vulkan.Extensions.VK_KHR_fragment_shading_rate.FragmentShadingRateAttachmentInfoKHR',
-- 'Vulkan.Core10.Enums.ImageAspectFlagBits.ImageAspectFlags',
-- 'Vulkan.Core10.Enums.ImageLayout.ImageLayout',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'SubpassDescription2',
-- 'Vulkan.Core12.Promoted_From_VK_KHR_depth_stencil_resolve.SubpassDescriptionDepthStencilResolve'
data AttachmentReference2 (es :: [Type]) = AttachmentReference2
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). AttachmentReference2 es -> Chain es
next :: Chain es
  , -- | @attachment@ is either an integer value identifying an attachment at the
    -- corresponding index in 'RenderPassCreateInfo2'::@pAttachments@, or
    -- 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' to signify that this
    -- attachment is not used.
    forall (es :: [*]). AttachmentReference2 es -> Word32
attachment :: Word32
  , -- | @layout@ is a 'Vulkan.Core10.Enums.ImageLayout.ImageLayout' value
    -- specifying the layout the attachment uses during the subpass.
    forall (es :: [*]). AttachmentReference2 es -> ImageLayout
layout :: ImageLayout
  , -- | @aspectMask@ is a mask of which aspect(s) /can/ be accessed within the
    -- specified subpass as an input attachment.
    forall (es :: [*]). AttachmentReference2 es -> ImageAspectFlags
aspectMask :: ImageAspectFlags
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (AttachmentReference2 (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (AttachmentReference2 es)

instance Extensible AttachmentReference2 where
  extensibleTypeName :: String
extensibleTypeName = String
"AttachmentReference2"
  setNext :: forall (ds :: [*]) (es :: [*]).
AttachmentReference2 ds -> Chain es -> AttachmentReference2 es
setNext AttachmentReference2{Word32
ImageLayout
ImageAspectFlags
Chain ds
next :: forall (es :: [*]). AttachmentReference2 es -> Chain es
attachment :: forall (es :: [*]). AttachmentReference2 es -> Word32
layout :: forall (es :: [*]). AttachmentReference2 es -> ImageLayout
aspectMask :: forall (es :: [*]). AttachmentReference2 es -> ImageAspectFlags
next :: Chain ds
attachment :: Word32
layout :: ImageLayout
aspectMask :: ImageAspectFlags
..} Chain es
next' = AttachmentReference2{next :: Chain es
next = Chain es
next', Word32
ImageLayout
ImageAspectFlags
attachment :: Word32
layout :: ImageLayout
aspectMask :: ImageAspectFlags
attachment :: Word32
layout :: ImageLayout
aspectMask :: ImageAspectFlags
..}
  getNext :: forall (es :: [*]). AttachmentReference2 es -> Chain es
getNext AttachmentReference2{Word32
ImageLayout
ImageAspectFlags
Chain es
next :: forall (es :: [*]). AttachmentReference2 es -> Chain es
attachment :: forall (es :: [*]). AttachmentReference2 es -> Word32
layout :: forall (es :: [*]). AttachmentReference2 es -> ImageLayout
aspectMask :: forall (es :: [*]). AttachmentReference2 es -> ImageAspectFlags
next :: Chain es
attachment :: Word32
layout :: ImageLayout
aspectMask :: ImageAspectFlags
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends AttachmentReference2 e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends AttachmentReference2 e => b) -> Maybe b
extends proxy e
_ Extends AttachmentReference2 e => b
f
    | Just e :~: AttachmentReferenceStencilLayout
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @AttachmentReferenceStencilLayout = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends AttachmentReference2 e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss AttachmentReference2 es
         , PokeChain es ) => ToCStruct (AttachmentReference2 es) where
  withCStruct :: forall b.
AttachmentReference2 es
-> (Ptr (AttachmentReference2 es) -> IO b) -> IO b
withCStruct AttachmentReference2 es
x Ptr (AttachmentReference2 es) -> IO b
f = Int -> (Ptr (AttachmentReference2 es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr (AttachmentReference2 es) -> IO b) -> IO b)
-> (Ptr (AttachmentReference2 es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (AttachmentReference2 es)
p -> Ptr (AttachmentReference2 es)
-> AttachmentReference2 es -> IO b -> IO b
forall b.
Ptr (AttachmentReference2 es)
-> AttachmentReference2 es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (AttachmentReference2 es)
p AttachmentReference2 es
x (Ptr (AttachmentReference2 es) -> IO b
f Ptr (AttachmentReference2 es)
p)
  pokeCStruct :: forall b.
Ptr (AttachmentReference2 es)
-> AttachmentReference2 es -> IO b -> IO b
pokeCStruct Ptr (AttachmentReference2 es)
p AttachmentReference2{Word32
ImageLayout
ImageAspectFlags
Chain es
next :: forall (es :: [*]). AttachmentReference2 es -> Chain es
attachment :: forall (es :: [*]). AttachmentReference2 es -> Word32
layout :: forall (es :: [*]). AttachmentReference2 es -> ImageLayout
aspectMask :: forall (es :: [*]). AttachmentReference2 es -> ImageAspectFlags
next :: Chain es
attachment :: Word32
layout :: ImageLayout
aspectMask :: ImageAspectFlags
..} 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
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 (AttachmentReference2 es)
p Ptr (AttachmentReference2 es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2)
    pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext''
    lift $ poke ((p `plusPtr` 16 :: Ptr Word32)) (attachment)
    lift $ poke ((p `plusPtr` 20 :: Ptr ImageLayout)) (layout)
    lift $ poke ((p `plusPtr` 24 :: Ptr ImageAspectFlags)) (aspectMask)
    lift $ f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (AttachmentReference2 es) -> IO b -> IO b
pokeZeroCStruct Ptr (AttachmentReference2 es)
p 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
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 (AttachmentReference2 es)
p Ptr (AttachmentReference2 es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_ATTACHMENT_REFERENCE_2)
    pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext'
    lift $ poke ((p `plusPtr` 16 :: Ptr Word32)) (zero)
    lift $ poke ((p `plusPtr` 20 :: Ptr ImageLayout)) (zero)
    lift $ poke ((p `plusPtr` 24 :: Ptr ImageAspectFlags)) (zero)
    lift $ f

instance ( Extendss AttachmentReference2 es
         , PeekChain es ) => FromCStruct (AttachmentReference2 es) where
  peekCStruct :: Ptr (AttachmentReference2 es) -> IO (AttachmentReference2 es)
peekCStruct Ptr (AttachmentReference2 es)
p = do
    pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (AttachmentReference2 es)
p Ptr (AttachmentReference2 es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    next <- peekChain (castPtr pNext)
    attachment <- peek @Word32 ((p `plusPtr` 16 :: Ptr Word32))
    layout <- peek @ImageLayout ((p `plusPtr` 20 :: Ptr ImageLayout))
    aspectMask <- peek @ImageAspectFlags ((p `plusPtr` 24 :: Ptr ImageAspectFlags))
    pure $ AttachmentReference2
             next attachment layout aspectMask

instance es ~ '[] => Zero (AttachmentReference2 es) where
  zero :: AttachmentReference2 es
zero = Chain es
-> Word32
-> ImageLayout
-> ImageAspectFlags
-> AttachmentReference2 es
forall (es :: [*]).
Chain es
-> Word32
-> ImageLayout
-> ImageAspectFlags
-> AttachmentReference2 es
AttachmentReference2
           ()
           Word32
forall a. Zero a => a
zero
           ImageLayout
forall a. Zero a => a
zero
           ImageAspectFlags
forall a. Zero a => a
zero


-- | VkSubpassDescription2 - Structure specifying a subpass description
--
-- = Description
--
-- Parameters defined by this structure with the same name as those in
-- 'Vulkan.Core10.Pass.SubpassDescription' have the identical effect to
-- those parameters.
--
-- @viewMask@ has the same effect for the described subpass as
-- 'Vulkan.Core11.Promoted_From_VK_KHR_multiview.RenderPassMultiviewCreateInfo'::@pViewMasks@
-- has on each corresponding subpass.
--
-- If a
-- 'Vulkan.Extensions.VK_KHR_fragment_shading_rate.FragmentShadingRateAttachmentInfoKHR'
-- structure is included in the @pNext@ chain,
-- @pFragmentShadingRateAttachment@ is not @NULL@, and its @attachment@
-- member is not 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', the
-- identified attachment defines a fragment shading rate attachment for
-- that subpass.
--
-- If any element of @pResolveAttachments@ is an image specified with an
-- 'Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer.ExternalFormatANDROID',
-- values in the corresponding color attachment will be resolved to the
-- resolve attachment in the same manner as specified for
-- <VkResolveModeFlagBits.html >.
--
-- If the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#limits-nullColorAttachmentWithExternalFormatResolve nullColorAttachmentWithExternalFormatResolve>
-- limit is 'Vulkan.Core10.FundamentalTypes.TRUE', values in the color
-- attachment will be loaded from the resolve attachment at the start of
-- rendering, and /may/ also be reloaded any time after a resolve occurs or
-- the resolve attachment is written to; if this occurs it /must/
-- happen-before any writes to the color attachment are performed which
-- happen-after the resolve that triggers this. If any color component in
-- the external format is subsampled, values will be read from the nearest
-- sample in the image when they are loaded. If the color attachment is
-- also used as an input attachment, the same behavior applies.
--
-- Setting the color attachment to
-- 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' when an external resolve
-- attachment is used and the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#limits-nullColorAttachmentWithExternalFormatResolve nullColorAttachmentWithExternalFormatResolve>
-- limit is 'Vulkan.Core10.FundamentalTypes.TRUE' will not result in color
-- attachment writes to be discarded for that attachment.
--
-- When
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#limits-nullColorAttachmentWithExternalFormatResolve nullColorAttachmentWithExternalFormatResolve>
-- is 'Vulkan.Core10.FundamentalTypes.TRUE', the color output from the
-- subpass can still be read via an input attachment; but the application
-- cannot bind an image view for the color attachment as there is no such
-- image view bound. Instead to access the data as an input attachment
-- applications /can/ use the resolve attachment in its place - using the
-- resolve attachment image for the descriptor, and setting the
-- corresponding element of @pInputAttachments@ to the index of the resolve
-- attachment.
--
-- Loads or input attachment reads from the resolve attachment are
-- performed as if using a
-- 'Vulkan.Core11.Promoted_From_VK_KHR_sampler_ycbcr_conversion.SamplerYcbcrConversionCreateInfo'
-- with the following parameters:
--
-- > VkSamplerYcbcrConversionCreateInfo createInfo = {
-- >     .sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO,
-- >     .pNext = NULL,
-- >     .format = VK_FORMAT_UNDEFINED,
-- >     .ycbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY,
-- >     .ycbcrRange = VK_SAMPLER_YCBCR_RANGE_ITU_FULL,
-- >     .components = {
-- >         .r = VK_COMPONENT_SWIZZLE_B
-- >         .g = VK_COMPONENT_SWIZZLE_R
-- >         .b = VK_COMPONENT_SWIZZLE_G
-- >         .a = VK_COMPONENT_SWIZZLE_IDENTITY},
-- >     .xChromaOffset = properties.chromaOffsetX,
-- >     .yChromaOffset = properties.chromaOffsetY,
-- >     .chromaFilter = VK_FILTER_NEAREST,
-- >     .forceExplicitReconstruction = ... };
--
-- where @properties@ is equal to
-- 'Vulkan.Extensions.VK_ANDROID_external_format_resolve.PhysicalDeviceExternalFormatResolvePropertiesANDROID'
-- returned by the device and @forceExplicitReconstruction@ is effectively
-- ignored as the
-- 'Vulkan.Core11.Enums.SamplerYcbcrModelConversion.SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY'
-- model is used. The applied swizzle is the same effective swizzle that
-- would be applied by the
-- 'Vulkan.Core11.Enums.SamplerYcbcrModelConversion.SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_IDENTITY'
-- model, but no range expansion is applied.
--
-- == Valid Usage
--
-- -   #VUID-VkSubpassDescription2-attachment-06912# If the @attachment@
--     member of an element of @pInputAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', its @layout@ member
--     /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL'
--
-- -   #VUID-VkSubpassDescription2-attachment-06913# If the @attachment@
--     member of an element of @pColorAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', its @layout@ member
--     /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkSubpassDescription2-attachment-06914# If the @attachment@
--     member of an element of @pResolveAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', its @layout@ member
--     /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkSubpassDescription2-attachment-06915# If the @attachment@
--     member of @pDepthStencilAttachment@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', its @layout@ member
--     /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkSubpassDescription2-attachment-06916# If the @attachment@
--     member of an element of @pColorAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', its @layout@ member
--     /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL'
--
-- -   #VUID-VkSubpassDescription2-attachment-06917# If the @attachment@
--     member of an element of @pResolveAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', its @layout@ member
--     /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL'
--
-- -   #VUID-VkSubpassDescription2-attachment-06918# If the @attachment@
--     member of an element of @pInputAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', its @layout@ member
--     /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL'
--
-- -   #VUID-VkSubpassDescription2-attachment-06919# If the @attachment@
--     member of an element of @pColorAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', its @layout@ member
--     /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL',
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkSubpassDescription2-attachment-06920# If the @attachment@
--     member of an element of @pResolveAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', its @layout@ member
--     /must/ not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL',
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkSubpassDescription2-attachment-06921# If the @attachment@
--     member of an element of @pInputAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', its @layout@ member
--     /must/ not be
--     'Vulkan.Extensions.VK_KHR_synchronization2.IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR'
--
-- -   #VUID-VkSubpassDescription2-attachment-06922# If the @attachment@
--     member of an element of @pColorAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', its @layout@ member
--     /must/ not be
--     'Vulkan.Extensions.VK_KHR_synchronization2.IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR'
--
-- -   #VUID-VkSubpassDescription2-attachment-06923# If the @attachment@
--     member of an element of @pResolveAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', its @layout@ member
--     /must/ not be
--     'Vulkan.Extensions.VK_KHR_synchronization2.IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR'
--
-- -   #VUID-VkSubpassDescription2-flags-10683# If @flags@ includes
--     'Vulkan.Core10.Enums.SubpassDescriptionFlagBits.SUBPASS_DESCRIPTION_TILE_SHADING_APRON_BIT_QCOM',
--     the render pass /must/ have been created with a
--     'Vulkan.Extensions.VK_QCOM_tile_shading.RenderPassTileShadingCreateInfoQCOM'::@tileApronSize@
--     greater than @(0,0)@
--
-- -   #VUID-VkSubpassDescription2-inputAttachmentCount-12293#
--     @inputAttachmentCount@ /must/ be less than or equal to
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-maxPerStageDescriptorInputAttachments maxPerStageDescriptorInputAttachments>
--
-- -   #VUID-VkSubpassDescription2-colorAttachmentCount-00845#
--     @colorAttachmentCount@ /must/ be less than or equal to
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#limits-maxColorAttachments maxColorAttachments>
--
-- -   #VUID-VkSubpassDescription2-loadOp-00846# If the first use of an
--     attachment in this render pass is as an input attachment, and the
--     attachment is not also used as a color or depth\/stencil attachment
--     in the same subpass, then @loadOp@ /must/ not be
--     'Vulkan.Core10.Enums.AttachmentLoadOp.ATTACHMENT_LOAD_OP_CLEAR'
--
-- -   #VUID-VkSubpassDescription2-attachment-06251# If the @attachment@
--     member of @pDepthStencilAttachment@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' and its @pNext@ chain
--     includes a
--     'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentReferenceStencilLayout'
--     structure, the @layout@ member of @pDepthStencilAttachment@ /must/
--     not be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkSubpassDescription2-pipelineBindPoint-04953#
--     @pipelineBindPoint@ /must/ be
--     'Vulkan.Core10.Enums.PipelineBindPoint.PIPELINE_BIND_POINT_GRAPHICS'
--     or
--     'Vulkan.Core10.Enums.PipelineBindPoint.PIPELINE_BIND_POINT_SUBPASS_SHADING_HUAWEI'
--
-- -   #VUID-VkSubpassDescription2-pResolveAttachments-03067# If
--     @pResolveAttachments@ is not @NULL@, each resolve attachment that is
--     not 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' /must/ have a
--     sample count of
--     'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_1_BIT'
--
-- -   #VUID-VkSubpassDescription2-externalFormatResolve-09335# If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-externalFormatResolve externalFormatResolve>
--     feature is not enabled and @pResolveAttachments@ is not @NULL@, for
--     each resolve attachment that does not have the value
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', the corresponding
--     color attachment /must/ not have the value
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED'
--
-- -   #VUID-VkSubpassDescription2-nullColorAttachmentWithExternalFormatResolve-09336#
--     If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#limits-nullColorAttachmentWithExternalFormatResolve nullColorAttachmentWithExternalFormatResolve>
--     property is 'Vulkan.Core10.FundamentalTypes.FALSE' and
--     @pResolveAttachments@ is not @NULL@, for each resolve attachment
--     that has a format of 'Vulkan.Core10.Enums.Format.FORMAT_UNDEFINED',
--     the corresponding color attachment /must/ not have the value
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED'
--
-- -   #VUID-VkSubpassDescription2-nullColorAttachmentWithExternalFormatResolve-09337#
--     If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#limits-nullColorAttachmentWithExternalFormatResolve nullColorAttachmentWithExternalFormatResolve>
--     property is 'Vulkan.Core10.FundamentalTypes.TRUE' and
--     @pResolveAttachments@ is not @NULL@, for each resolve attachment
--     that has a format of 'Vulkan.Core10.Enums.Format.FORMAT_UNDEFINED',
--     the corresponding color attachment /must/ have the value
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED'
--
-- -   #VUID-VkSubpassDescription2-externalFormatResolve-09338# If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-externalFormatResolve externalFormatResolve>
--     feature is not enabled and @pResolveAttachments@ is not @NULL@, for
--     each resolve attachment that is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', the corresponding
--     color attachment /must/ not have a sample count of
--     'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_1_BIT'
--
-- -   #VUID-VkSubpassDescription2-externalFormatResolve-09339# If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-externalFormatResolve externalFormatResolve>
--     feature is not enabled, each element of @pResolveAttachments@ /must/
--     have the same 'Vulkan.Core10.Enums.Format.Format' as its
--     corresponding color attachment
--
-- -   #VUID-VkSubpassDescription2-multisampledRenderToSingleSampled-06869#
--     If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-multisampledRenderToSingleSampled multisampledRenderToSingleSampled>
--     feature is not enabled, all attachments in @pColorAttachments@ that
--     are not 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' /must/ have
--     the same sample count
--
-- -   #VUID-VkSubpassDescription2-pInputAttachments-02897# All attachments
--     in @pInputAttachments@ that are not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' and any of the
--     following is true:
--
--     -   the
--         <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-externalFormatResolve externalFormatResolve>
--         feature is not enabled
--
--     -   the
--         <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#limits-nullColorAttachmentWithExternalFormatResolve nullColorAttachmentWithExternalFormatResolve>
--         property is 'Vulkan.Core10.FundamentalTypes.FALSE'
--
--     -   does not have a non-zero value of
--         'Vulkan.Extensions.VK_ANDROID_external_memory_android_hardware_buffer.ExternalFormatANDROID'::@externalFormat@
--
--     /must/ have image formats whose
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#potential-format-features potential format features>
--     contain at least
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_COLOR_ATTACHMENT_BIT'
--     or
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT'
--
-- -   #VUID-VkSubpassDescription2-pColorAttachments-02898# All attachments
--     in @pColorAttachments@ that are not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' /must/ have image
--     formats whose
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#potential-format-features potential format features>
--     contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_COLOR_ATTACHMENT_BIT'
--
-- -   #VUID-VkSubpassDescription2-pResolveAttachments-09343# All
--     attachments in @pResolveAttachments@ that are not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' and do not have an
--     image format of 'Vulkan.Core10.Enums.Format.FORMAT_UNDEFINED' /must/
--     have image formats whose
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#potential-format-features potential format features>
--     contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_COLOR_ATTACHMENT_BIT'
--
-- -   #VUID-VkSubpassDescription2-pDepthStencilAttachment-02900# If
--     @pDepthStencilAttachment@ is not @NULL@ and the attachment is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' then it /must/ have
--     an image format whose
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#potential-format-features potential format features>
--     contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT'
--
-- -   #VUID-VkSubpassDescription2-linearColorAttachment-06499# If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-linearColorAttachment linearColorAttachment>
--     feature is enabled and the image is created with
--     'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_LINEAR', all
--     attachments in @pInputAttachments@ that are not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' /must/ have image
--     formats whose
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#potential-format-features potential format features>
--     /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV'
--
-- -   #VUID-VkSubpassDescription2-linearColorAttachment-06500# If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-linearColorAttachment linearColorAttachment>
--     feature is enabled and the image is created with
--     'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_LINEAR', all
--     attachments in @pColorAttachments@ that are not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' /must/ have image
--     formats whose
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#potential-format-features potential format features>
--     /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV'
--
-- -   #VUID-VkSubpassDescription2-linearColorAttachment-06501# If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-linearColorAttachment linearColorAttachment>
--     feature is enabled and the image is created with
--     'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_LINEAR', all
--     attachments in @pResolveAttachments@ that are not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' /must/ have image
--     formats whose
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#potential-format-features potential format features>
--     /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV'
--
-- -   #VUID-VkSubpassDescription2-None-09456# If either of the following
--     is enabled:
--
--     -   The @VK_AMD_mixed_attachment_samples@ extension
--
--     -   The @VK_NV_framebuffer_mixed_samples@ extension
--
--     all attachments in @pColorAttachments@ that are not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' /must/ have a sample
--     count that is smaller than or equal to the sample count of
--     @pDepthStencilAttachment@ if it is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED'
--
-- -   #VUID-VkSubpassDescription2-pNext-06870# If the @pNext@ chain
--     includes a
--     'Vulkan.Extensions.VK_EXT_multisampled_render_to_single_sampled.MultisampledRenderToSingleSampledInfoEXT'
--     structure with @multisampledRenderToSingleSampledEnable@ equal to
--     'Vulkan.Core10.FundamentalTypes.TRUE', then all attachments in
--     @pColorAttachments@ and @pDepthStencilAttachment@ that are not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' /must/ have a sample
--     count that is either
--     'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_1_BIT' or
--     equal to
--     'Vulkan.Extensions.VK_EXT_multisampled_render_to_single_sampled.MultisampledRenderToSingleSampledInfoEXT'::@rasterizationSamples@
--
-- -   #VUID-VkSubpassDescription2-pNext-06871# If the @pNext@ chain
--     includes a
--     'Vulkan.Extensions.VK_EXT_multisampled_render_to_single_sampled.MultisampledRenderToSingleSampledInfoEXT'
--     structure with @multisampledRenderToSingleSampledEnable@ equal to
--     'Vulkan.Core10.FundamentalTypes.TRUE', and @pDepthStencilAttachment@
--     is not @NULL@, does not have the value
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', and has a sample
--     count of
--     'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_1_BIT', the
--     @pNext@ chain /must/ also include a
--     'Vulkan.Core12.Promoted_From_VK_KHR_depth_stencil_resolve.SubpassDescriptionDepthStencilResolve'
--     structure with @pDepthStencilResolveAttachment@ that is either
--     @NULL@ or has the value
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED'
--
-- -   #VUID-VkSubpassDescription2-multisampledRenderToSingleSampled-06872#
--     If none of the following are enabled:
--
--     -   The @VK_AMD_mixed_attachment_samples@ extension
--
--     -   The @VK_NV_framebuffer_mixed_samples@ extension
--
--     -   The
--         <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-multisampledRenderToSingleSampled multisampledRenderToSingleSampled>
--         feature
--
--     all attachments in @pDepthStencilAttachment@ and @pColorAttachments@
--     that are not 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' /must/
--     have the same sample count
--
-- -   #VUID-VkSubpassDescription2-attachment-03073# Each element of
--     @pPreserveAttachments@ /must/ not be
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED'
--
-- -   #VUID-VkSubpassDescription2-pPreserveAttachments-03074# Each element
--     of @pPreserveAttachments@ /must/ not also be an element of any other
--     member of the subpass description
--
-- -   #VUID-VkSubpassDescription2-layout-02528# If any attachment is used
--     by more than one 'AttachmentReference2' member, then each use /must/
--     use the same @layout@
--
-- -   #VUID-VkSubpassDescription2-flags-03076# If @flags@ includes
--     'Vulkan.Core10.Enums.SubpassDescriptionFlagBits.SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX',
--     it /must/ also include
--     'Vulkan.Core10.Enums.SubpassDescriptionFlagBits.SUBPASS_DESCRIPTION_PER_VIEW_ATTRIBUTES_BIT_NVX'
--
-- -   #VUID-VkSubpassDescription2-attachment-02799# If the @attachment@
--     member of any element of @pInputAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', then the
--     @aspectMask@ member /must/ be a valid combination of
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.ImageAspectFlagBits'
--
-- -   #VUID-VkSubpassDescription2-attachment-02800# If the @attachment@
--     member of any element of @pInputAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', then the
--     @aspectMask@ member /must/ not be @0@
--
-- -   #VUID-VkSubpassDescription2-attachment-02801# If the @attachment@
--     member of any element of @pInputAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', then the
--     @aspectMask@ member /must/ not include
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_METADATA_BIT'
--
-- -   #VUID-VkSubpassDescription2-attachment-04563# If the @attachment@
--     member of any element of @pInputAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', then the
--     @aspectMask@ member /must/ not include
--     @VK_IMAGE_ASPECT_MEMORY_PLANE_i_BIT_EXT@ for any index /i/
--
-- -   #VUID-VkSubpassDescription2-pDepthStencilAttachment-04440# An
--     attachment /must/ not be used in both @pDepthStencilAttachment@ and
--     @pColorAttachments@
--
-- -   #VUID-VkSubpassDescription2-multiview-06558# If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-multiview multiview>
--     feature is not enabled, @viewMask@ /must/ be @0@
--
-- -   #VUID-VkSubpassDescription2-viewMask-06706# The index of the most
--     significant bit in @viewMask@ /must/ be less than
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#limits-maxMultiviewViewCount maxMultiviewViewCount>
--
-- -   #VUID-VkSubpassDescription2-externalFormatResolve-09344# If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-externalFormatResolve externalFormatResolve>
--     feature is enabled, @pResolveAttachments@ is not @NULL@, and
--     @colorAttachmentCount@ is not @1@, any element of
--     @pResolveAttachments@ that is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', /must/ not have a
--     format of 'Vulkan.Core10.Enums.Format.FORMAT_UNDEFINED'
--
-- -   #VUID-VkSubpassDescription2-externalFormatResolve-09345# If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-externalFormatResolve externalFormatResolve>
--     feature is enabled, @pResolveAttachments@ is not @NULL@, any element
--     of @pResolveAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' and has a format of
--     'Vulkan.Core10.Enums.Format.FORMAT_UNDEFINED', and the corresponding
--     element of @pColorAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', the color attachment
--     /must/ have a @samples@ value of @1@
--
-- -   #VUID-VkSubpassDescription2-externalFormatResolve-09346# If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-externalFormatResolve externalFormatResolve>
--     feature is enabled, @pResolveAttachments@ is not @NULL@, and any
--     element of @pResolveAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' and has a format of
--     'Vulkan.Core10.Enums.Format.FORMAT_UNDEFINED', @viewMask@ /must/ be
--     @0@
--
-- -   #VUID-VkSubpassDescription2-externalFormatResolve-09347# If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-externalFormatResolve externalFormatResolve>
--     feature is enabled, @pResolveAttachments@ is not @NULL@, and any
--     element of @pResolveAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' and has a format of
--     'Vulkan.Core10.Enums.Format.FORMAT_UNDEFINED',
--     'Vulkan.Extensions.VK_KHR_fragment_shading_rate.FragmentShadingRateAttachmentInfoKHR'::@pFragmentShadingRateAttachment@
--     /must/ either be @NULL@ or a 'AttachmentReference2' structure with
--     an @attachment@ value of
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED'
--
-- -   #VUID-VkSubpassDescription2-externalFormatResolve-09348# If the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-externalFormatResolve externalFormatResolve>
--     feature is enabled, @pResolveAttachments@ is not @NULL@, and any
--     element of @pResolveAttachments@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' and has a format of
--     'Vulkan.Core10.Enums.Format.FORMAT_UNDEFINED', elements of
--     @pInputAttachments@ referencing either a color attachment or resolve
--     attachment used in this subpass /must/ not include
--     @VK_IMAGE_ASPECT_PLANE_i_BIT@ for any index /i/ in its @aspectMask@
--
-- -   #VUID-VkSubpassDescription2-flags-04907# If @flags@ includes
--     'Vulkan.Core10.Enums.SubpassDescriptionFlagBits.SUBPASS_DESCRIPTION_CUSTOM_RESOLVE_BIT_EXT',
--     and if @pResolveAttachments@ is not @NULL@, then each resolve
--     attachment /must/ be 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED'
--
-- -   #VUID-VkSubpassDescription2-flags-04908# If @flags@ includes
--     'Vulkan.Core10.Enums.SubpassDescriptionFlagBits.SUBPASS_DESCRIPTION_CUSTOM_RESOLVE_BIT_EXT',
--     and if @pDepthStencilResolveAttachment@ is not @NULL@, then the
--     depth\/stencil resolve attachment /must/ be
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED'
--
-- -   #VUID-VkSubpassDescription2-flags-04909# If @flags@ includes
--     'Vulkan.Core10.Enums.SubpassDescriptionFlagBits.SUBPASS_DESCRIPTION_CUSTOM_RESOLVE_BIT_EXT',
--     then the subpass /must/ be the last subpass in a subpass dependency
--     chain
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkSubpassDescription2-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2'
--
-- -   #VUID-VkSubpassDescription2-pNext-pNext# Each @pNext@ member of any
--     structure (including this one) in the @pNext@ chain /must/ be either
--     @NULL@ or a pointer to a valid instance of
--     'Vulkan.Extensions.VK_KHR_fragment_shading_rate.FragmentShadingRateAttachmentInfoKHR',
--     'Vulkan.Extensions.VK_EXT_multisampled_render_to_single_sampled.MultisampledRenderToSingleSampledInfoEXT',
--     'Vulkan.Extensions.VK_EXT_subpass_merge_feedback.RenderPassCreationControlEXT',
--     'Vulkan.Extensions.VK_EXT_subpass_merge_feedback.RenderPassSubpassFeedbackCreateInfoEXT',
--     or
--     'Vulkan.Core12.Promoted_From_VK_KHR_depth_stencil_resolve.SubpassDescriptionDepthStencilResolve'
--
-- -   #VUID-VkSubpassDescription2-sType-unique# The @sType@ value of each
--     structure in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkSubpassDescription2-flags-parameter# @flags@ /must/ be a
--     valid combination of
--     'Vulkan.Core10.Enums.SubpassDescriptionFlagBits.SubpassDescriptionFlagBits'
--     values
--
-- -   #VUID-VkSubpassDescription2-pipelineBindPoint-parameter#
--     @pipelineBindPoint@ /must/ be a valid
--     'Vulkan.Core10.Enums.PipelineBindPoint.PipelineBindPoint' value
--
-- -   #VUID-VkSubpassDescription2-pInputAttachments-parameter# If
--     @inputAttachmentCount@ is not @0@, @pInputAttachments@ /must/ be a
--     valid pointer to an array of @inputAttachmentCount@ valid
--     'AttachmentReference2' structures
--
-- -   #VUID-VkSubpassDescription2-pColorAttachments-parameter# If
--     @colorAttachmentCount@ is not @0@, @pColorAttachments@ /must/ be a
--     valid pointer to an array of @colorAttachmentCount@ valid
--     'AttachmentReference2' structures
--
-- -   #VUID-VkSubpassDescription2-pResolveAttachments-parameter# If
--     @colorAttachmentCount@ is not @0@, and @pResolveAttachments@ is not
--     @NULL@, @pResolveAttachments@ /must/ be a valid pointer to an array
--     of @colorAttachmentCount@ valid 'AttachmentReference2' structures
--
-- -   #VUID-VkSubpassDescription2-pDepthStencilAttachment-parameter# If
--     @pDepthStencilAttachment@ is not @NULL@, @pDepthStencilAttachment@
--     /must/ be a valid pointer to a valid 'AttachmentReference2'
--     structure
--
-- -   #VUID-VkSubpassDescription2-pPreserveAttachments-parameter# If
--     @preserveAttachmentCount@ is not @0@, @pPreserveAttachments@ /must/
--     be a valid pointer to an array of @preserveAttachmentCount@
--     @uint32_t@ values
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_create_renderpass2 VK_KHR_create_renderpass2>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'AttachmentReference2',
-- 'Vulkan.Core10.Enums.PipelineBindPoint.PipelineBindPoint',
-- 'RenderPassCreateInfo2',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Core10.Enums.SubpassDescriptionFlagBits.SubpassDescriptionFlags'
data SubpassDescription2 (es :: [Type]) = SubpassDescription2
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). SubpassDescription2 es -> Chain es
next :: Chain es
  , -- | @flags@ is a bitmask of
    -- 'Vulkan.Core10.Enums.SubpassDescriptionFlagBits.SubpassDescriptionFlagBits'
    -- specifying usage of the subpass.
    forall (es :: [*]).
SubpassDescription2 es -> SubpassDescriptionFlags
flags :: SubpassDescriptionFlags
  , -- | @pipelineBindPoint@ is a
    -- 'Vulkan.Core10.Enums.PipelineBindPoint.PipelineBindPoint' value
    -- specifying the pipeline type supported for this subpass.
    forall (es :: [*]). SubpassDescription2 es -> PipelineBindPoint
pipelineBindPoint :: PipelineBindPoint
  , -- | @viewMask@ is a bitfield of view indices describing which views
    -- rendering is broadcast to in this subpass, when multiview is enabled.
    forall (es :: [*]). SubpassDescription2 es -> Word32
viewMask :: Word32
  , -- | @pInputAttachments@ is a pointer to an array of 'AttachmentReference2'
    -- structures defining the input attachments for this subpass and their
    -- layouts.
    forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
inputAttachments :: Vector (SomeStruct AttachmentReference2)
  , -- | @pColorAttachments@ is a pointer to an array of @colorAttachmentCount@
    -- 'AttachmentReference2' structures defining the color attachments for
    -- this subpass and their layouts.
    forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
colorAttachments :: Vector (SomeStruct AttachmentReference2)
  , -- | @pResolveAttachments@ is @NULL@ or a pointer to an array of
    -- @colorAttachmentCount@ 'AttachmentReference2' structures defining the
    -- resolve attachments for this subpass and their layouts.
    forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
resolveAttachments :: Vector (SomeStruct AttachmentReference2)
  , -- | @pDepthStencilAttachment@ is a pointer to a 'AttachmentReference2'
    -- structure specifying the depth\/stencil attachment for this subpass and
    -- its layout.
    forall (es :: [*]).
SubpassDescription2 es -> Maybe (SomeStruct AttachmentReference2)
depthStencilAttachment :: Maybe (SomeStruct AttachmentReference2)
  , -- | @pPreserveAttachments@ is a pointer to an array of
    -- @preserveAttachmentCount@ render pass attachment indices identifying
    -- attachments that are not used by this subpass, but whose contents /must/
    -- be preserved throughout the subpass.
    forall (es :: [*]). SubpassDescription2 es -> Vector Word32
preserveAttachments :: Vector Word32
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SubpassDescription2 (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (SubpassDescription2 es)

instance Extensible SubpassDescription2 where
  extensibleTypeName :: String
extensibleTypeName = String
"SubpassDescription2"
  setNext :: forall (ds :: [*]) (es :: [*]).
SubpassDescription2 ds -> Chain es -> SubpassDescription2 es
setNext SubpassDescription2{Maybe (SomeStruct AttachmentReference2)
Word32
Vector Word32
Vector (SomeStruct AttachmentReference2)
SubpassDescriptionFlags
PipelineBindPoint
Chain ds
next :: forall (es :: [*]). SubpassDescription2 es -> Chain es
flags :: forall (es :: [*]).
SubpassDescription2 es -> SubpassDescriptionFlags
pipelineBindPoint :: forall (es :: [*]). SubpassDescription2 es -> PipelineBindPoint
viewMask :: forall (es :: [*]). SubpassDescription2 es -> Word32
inputAttachments :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
colorAttachments :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
resolveAttachments :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
depthStencilAttachment :: forall (es :: [*]).
SubpassDescription2 es -> Maybe (SomeStruct AttachmentReference2)
preserveAttachments :: forall (es :: [*]). SubpassDescription2 es -> Vector Word32
next :: Chain ds
flags :: SubpassDescriptionFlags
pipelineBindPoint :: PipelineBindPoint
viewMask :: Word32
inputAttachments :: Vector (SomeStruct AttachmentReference2)
colorAttachments :: Vector (SomeStruct AttachmentReference2)
resolveAttachments :: Vector (SomeStruct AttachmentReference2)
depthStencilAttachment :: Maybe (SomeStruct AttachmentReference2)
preserveAttachments :: Vector Word32
..} Chain es
next' = SubpassDescription2{next :: Chain es
next = Chain es
next', Maybe (SomeStruct AttachmentReference2)
Word32
Vector Word32
Vector (SomeStruct AttachmentReference2)
SubpassDescriptionFlags
PipelineBindPoint
flags :: SubpassDescriptionFlags
pipelineBindPoint :: PipelineBindPoint
viewMask :: Word32
inputAttachments :: Vector (SomeStruct AttachmentReference2)
colorAttachments :: Vector (SomeStruct AttachmentReference2)
resolveAttachments :: Vector (SomeStruct AttachmentReference2)
depthStencilAttachment :: Maybe (SomeStruct AttachmentReference2)
preserveAttachments :: Vector Word32
flags :: SubpassDescriptionFlags
pipelineBindPoint :: PipelineBindPoint
viewMask :: Word32
inputAttachments :: Vector (SomeStruct AttachmentReference2)
colorAttachments :: Vector (SomeStruct AttachmentReference2)
resolveAttachments :: Vector (SomeStruct AttachmentReference2)
depthStencilAttachment :: Maybe (SomeStruct AttachmentReference2)
preserveAttachments :: Vector Word32
..}
  getNext :: forall (es :: [*]). SubpassDescription2 es -> Chain es
getNext SubpassDescription2{Maybe (SomeStruct AttachmentReference2)
Word32
Vector Word32
Vector (SomeStruct AttachmentReference2)
SubpassDescriptionFlags
PipelineBindPoint
Chain es
next :: forall (es :: [*]). SubpassDescription2 es -> Chain es
flags :: forall (es :: [*]).
SubpassDescription2 es -> SubpassDescriptionFlags
pipelineBindPoint :: forall (es :: [*]). SubpassDescription2 es -> PipelineBindPoint
viewMask :: forall (es :: [*]). SubpassDescription2 es -> Word32
inputAttachments :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
colorAttachments :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
resolveAttachments :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
depthStencilAttachment :: forall (es :: [*]).
SubpassDescription2 es -> Maybe (SomeStruct AttachmentReference2)
preserveAttachments :: forall (es :: [*]). SubpassDescription2 es -> Vector Word32
next :: Chain es
flags :: SubpassDescriptionFlags
pipelineBindPoint :: PipelineBindPoint
viewMask :: Word32
inputAttachments :: Vector (SomeStruct AttachmentReference2)
colorAttachments :: Vector (SomeStruct AttachmentReference2)
resolveAttachments :: Vector (SomeStruct AttachmentReference2)
depthStencilAttachment :: Maybe (SomeStruct AttachmentReference2)
preserveAttachments :: Vector Word32
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends SubpassDescription2 e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends SubpassDescription2 e => b) -> Maybe b
extends proxy e
_ Extends SubpassDescription2 e => b
f
    | Just e :~: RenderPassSubpassFeedbackCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @RenderPassSubpassFeedbackCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends SubpassDescription2 e => b
f
    | Just e :~: RenderPassCreationControlEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @RenderPassCreationControlEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends SubpassDescription2 e => b
f
    | Just e :~: MultisampledRenderToSingleSampledInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @MultisampledRenderToSingleSampledInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends SubpassDescription2 e => b
f
    | Just e :~: FragmentShadingRateAttachmentInfoKHR
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @FragmentShadingRateAttachmentInfoKHR = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends SubpassDescription2 e => b
f
    | Just e :~: SubpassDescriptionDepthStencilResolve
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @SubpassDescriptionDepthStencilResolve = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends SubpassDescription2 e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss SubpassDescription2 es
         , PokeChain es ) => ToCStruct (SubpassDescription2 es) where
  withCStruct :: forall b.
SubpassDescription2 es
-> (Ptr (SubpassDescription2 es) -> IO b) -> IO b
withCStruct SubpassDescription2 es
x Ptr (SubpassDescription2 es) -> IO b
f = Int -> (Ptr (SubpassDescription2 es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
88 ((Ptr (SubpassDescription2 es) -> IO b) -> IO b)
-> (Ptr (SubpassDescription2 es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (SubpassDescription2 es)
p -> Ptr (SubpassDescription2 es)
-> SubpassDescription2 es -> IO b -> IO b
forall b.
Ptr (SubpassDescription2 es)
-> SubpassDescription2 es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (SubpassDescription2 es)
p SubpassDescription2 es
x (Ptr (SubpassDescription2 es) -> IO b
f Ptr (SubpassDescription2 es)
p)
  pokeCStruct :: forall b.
Ptr (SubpassDescription2 es)
-> SubpassDescription2 es -> IO b -> IO b
pokeCStruct Ptr (SubpassDescription2 es)
p SubpassDescription2{Maybe (SomeStruct AttachmentReference2)
Word32
Vector Word32
Vector (SomeStruct AttachmentReference2)
SubpassDescriptionFlags
PipelineBindPoint
Chain es
next :: forall (es :: [*]). SubpassDescription2 es -> Chain es
flags :: forall (es :: [*]).
SubpassDescription2 es -> SubpassDescriptionFlags
pipelineBindPoint :: forall (es :: [*]). SubpassDescription2 es -> PipelineBindPoint
viewMask :: forall (es :: [*]). SubpassDescription2 es -> Word32
inputAttachments :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
colorAttachments :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
resolveAttachments :: forall (es :: [*]).
SubpassDescription2 es -> Vector (SomeStruct AttachmentReference2)
depthStencilAttachment :: forall (es :: [*]).
SubpassDescription2 es -> Maybe (SomeStruct AttachmentReference2)
preserveAttachments :: forall (es :: [*]). SubpassDescription2 es -> Vector Word32
next :: Chain es
flags :: SubpassDescriptionFlags
pipelineBindPoint :: PipelineBindPoint
viewMask :: Word32
inputAttachments :: Vector (SomeStruct AttachmentReference2)
colorAttachments :: Vector (SomeStruct AttachmentReference2)
resolveAttachments :: Vector (SomeStruct AttachmentReference2)
depthStencilAttachment :: Maybe (SomeStruct AttachmentReference2)
preserveAttachments :: Vector Word32
..} 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
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 (SubpassDescription2 es)
p Ptr (SubpassDescription2 es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2)
    pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext''
    lift $ poke ((p `plusPtr` 16 :: Ptr SubpassDescriptionFlags)) (flags)
    lift $ poke ((p `plusPtr` 20 :: Ptr PipelineBindPoint)) (pipelineBindPoint)
    lift $ poke ((p `plusPtr` 24 :: Ptr Word32)) (viewMask)
    lift $ poke ((p `plusPtr` 28 :: Ptr Word32)) ((fromIntegral (Data.Vector.length $ (inputAttachments)) :: Word32))
    pPInputAttachments' <- ContT $ allocaBytes @(AttachmentReference2 _) ((Data.Vector.length (inputAttachments)) * 32)
    Data.Vector.imapM_ (\Int
i SomeStruct AttachmentReference2
e -> ((() -> 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
$ Ptr (SomeStruct AttachmentReference2)
-> SomeStruct AttachmentReference2 -> IO b -> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (AttachmentReference2 (ZonkAny 3))
-> Ptr (SomeStruct AttachmentReference2)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (AttachmentReference2 (ZonkAny 0))
pPInputAttachments' Ptr (AttachmentReference2 (ZonkAny 0))
-> Int -> Ptr (AttachmentReference2 w)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
32 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AttachmentReference2 _))) (SomeStruct AttachmentReference2
e) (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
$ ())) (inputAttachments)
    lift $ poke ((p `plusPtr` 32 :: Ptr (Ptr (AttachmentReference2 _)))) (pPInputAttachments')
    let pColorAttachmentsLength = Vector (SomeStruct AttachmentReference2) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct AttachmentReference2) -> Int)
-> Vector (SomeStruct AttachmentReference2) -> Int
forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct AttachmentReference2)
colorAttachments)
    let pResolveAttachmentsLength = Vector (SomeStruct AttachmentReference2) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (SomeStruct AttachmentReference2) -> Int)
-> Vector (SomeStruct AttachmentReference2) -> Int
forall a b. (a -> b) -> a -> b
$ (Vector (SomeStruct AttachmentReference2)
resolveAttachments)
    lift $ unless (fromIntegral pResolveAttachmentsLength == pColorAttachmentsLength || pResolveAttachmentsLength == 0) $
      throwIO $ IOError Nothing InvalidArgument "" "pResolveAttachments and pColorAttachments must have the same length" Nothing Nothing
    lift $ poke ((p `plusPtr` 40 :: Ptr Word32)) ((fromIntegral pColorAttachmentsLength :: Word32))
    pPColorAttachments' <- ContT $ allocaBytes @(AttachmentReference2 _) ((Data.Vector.length (colorAttachments)) * 32)
    Data.Vector.imapM_ (\Int
i SomeStruct AttachmentReference2
e -> ((() -> 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
$ Ptr (SomeStruct AttachmentReference2)
-> SomeStruct AttachmentReference2 -> IO b -> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (AttachmentReference2 (ZonkAny 4))
-> Ptr (SomeStruct AttachmentReference2)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (AttachmentReference2 (ZonkAny 1))
pPColorAttachments' Ptr (AttachmentReference2 (ZonkAny 1))
-> Int -> Ptr (AttachmentReference2 w)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
32 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AttachmentReference2 _))) (SomeStruct AttachmentReference2
e) (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
$ ())) (colorAttachments)
    lift $ poke ((p `plusPtr` 48 :: Ptr (Ptr (AttachmentReference2 _)))) (pPColorAttachments')
    pResolveAttachments'' <- if Data.Vector.null (resolveAttachments)
      then pure nullPtr
      else do
        pPResolveAttachments <- ContT $ allocaBytes @(AttachmentReference2 _) (((Data.Vector.length (resolveAttachments))) * 32)
        Data.Vector.imapM_ (\Int
i SomeStruct AttachmentReference2
e -> ((() -> 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
$ Ptr (SomeStruct AttachmentReference2)
-> SomeStruct AttachmentReference2 -> IO b -> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (AttachmentReference2 (ZonkAny 5))
-> Ptr (SomeStruct AttachmentReference2)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (AttachmentReference2 (ZonkAny 2))
pPResolveAttachments Ptr (AttachmentReference2 (ZonkAny 2))
-> Int -> Ptr (AttachmentReference2 w)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
32 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AttachmentReference2 _))) (SomeStruct AttachmentReference2
e) (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
$ ())) ((resolveAttachments))
        pure $ pPResolveAttachments
    lift $ poke ((p `plusPtr` 56 :: Ptr (Ptr (AttachmentReference2 _)))) pResolveAttachments''
    pDepthStencilAttachment'' <- case (depthStencilAttachment) of
      Maybe (SomeStruct AttachmentReference2)
Nothing -> Ptr (AttachmentReference2 '[])
-> ContT b IO (Ptr (AttachmentReference2 '[]))
forall a. a -> ContT b IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr (AttachmentReference2 '[])
forall a. Ptr a
nullPtr
      Just SomeStruct AttachmentReference2
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
forall r (m :: * -> *) 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
$ \Ptr (AttachmentReference2 '[]) -> IO b
cont -> 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
j) (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)
    lift $ poke ((p `plusPtr` 64 :: Ptr (Ptr (AttachmentReference2 _)))) pDepthStencilAttachment''
    lift $ poke ((p `plusPtr` 72 :: Ptr Word32)) ((fromIntegral (Data.Vector.length $ (preserveAttachments)) :: Word32))
    pPPreserveAttachments' <- ContT $ allocaBytes @Word32 ((Data.Vector.length (preserveAttachments)) * 4)
    lift $ Data.Vector.imapM_ (\Int
i Word32
e -> Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word32
pPPreserveAttachments' Ptr Word32 -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) (Word32
e)) (preserveAttachments)
    lift $ poke ((p `plusPtr` 80 :: Ptr (Ptr Word32))) (pPPreserveAttachments')
    lift $ f
  cStructSize :: Int
cStructSize = Int
88
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (SubpassDescription2 es) -> IO b -> IO b
pokeZeroCStruct Ptr (SubpassDescription2 es)
p 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
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 (SubpassDescription2 es)
p Ptr (SubpassDescription2 es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_DESCRIPTION_2)
    pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext'
    lift $ poke ((p `plusPtr` 20 :: Ptr PipelineBindPoint)) (zero)
    lift $ poke ((p `plusPtr` 24 :: Ptr Word32)) (zero)
    lift $ f

instance ( Extendss SubpassDescription2 es
         , PeekChain es ) => FromCStruct (SubpassDescription2 es) where
  peekCStruct :: Ptr (SubpassDescription2 es) -> IO (SubpassDescription2 es)
peekCStruct Ptr (SubpassDescription2 es)
p = do
    pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (SubpassDescription2 es)
p Ptr (SubpassDescription2 es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    next <- peekChain (castPtr pNext)
    flags <- peek @SubpassDescriptionFlags ((p `plusPtr` 16 :: Ptr SubpassDescriptionFlags))
    pipelineBindPoint <- peek @PipelineBindPoint ((p `plusPtr` 20 :: Ptr PipelineBindPoint))
    viewMask <- peek @Word32 ((p `plusPtr` 24 :: Ptr Word32))
    inputAttachmentCount <- peek @Word32 ((p `plusPtr` 28 :: Ptr Word32))
    pInputAttachments <- peek @(Ptr (AttachmentReference2 _)) ((p `plusPtr` 32 :: Ptr (Ptr (AttachmentReference2 _))))
    pInputAttachments' <- generateM (fromIntegral inputAttachmentCount) (\Int
i -> 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 (AttachmentReference2 (ZonkAny 6))
-> Ptr (SomeStruct AttachmentReference2)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (AttachmentReference2 (ZonkAny 6))
pInputAttachments Ptr (AttachmentReference2 (ZonkAny 6))
-> Int -> Ptr (AttachmentReference2 (ZonkAny 6))
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
32 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AttachmentReference2 _)))))
    colorAttachmentCount <- peek @Word32 ((p `plusPtr` 40 :: Ptr Word32))
    pColorAttachments <- peek @(Ptr (AttachmentReference2 _)) ((p `plusPtr` 48 :: Ptr (Ptr (AttachmentReference2 _))))
    pColorAttachments' <- generateM (fromIntegral colorAttachmentCount) (\Int
i -> 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 (AttachmentReference2 (ZonkAny 7))
-> Ptr (SomeStruct AttachmentReference2)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (AttachmentReference2 (ZonkAny 7))
pColorAttachments Ptr (AttachmentReference2 (ZonkAny 7))
-> Int -> Ptr (AttachmentReference2 (ZonkAny 7))
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
32 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AttachmentReference2 _)))))
    pResolveAttachments <- peek @(Ptr (AttachmentReference2 _)) ((p `plusPtr` 56 :: Ptr (Ptr (AttachmentReference2 _))))
    let pResolveAttachmentsLength = if Ptr (AttachmentReference2 (ZonkAny 8))
pResolveAttachments Ptr (AttachmentReference2 (ZonkAny 8))
-> Ptr (AttachmentReference2 (ZonkAny 8)) -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr (AttachmentReference2 (ZonkAny 8))
forall a. Ptr a
nullPtr then Int
0 else (Word32 -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
colorAttachmentCount)
    pResolveAttachments' <- generateM pResolveAttachmentsLength (\Int
i -> 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 (AttachmentReference2 (ZonkAny 8))
-> Ptr (SomeStruct AttachmentReference2)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (AttachmentReference2 (ZonkAny 8))
pResolveAttachments Ptr (AttachmentReference2 (ZonkAny 8))
-> Int -> Ptr (AttachmentReference2 (ZonkAny 8))
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
32 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AttachmentReference2 _)))))
    pDepthStencilAttachment <- peek @(Ptr (AttachmentReference2 _)) ((p `plusPtr` 64 :: Ptr (Ptr (AttachmentReference2 _))))
    pDepthStencilAttachment' <- maybePeek (\Ptr (AttachmentReference2 (ZonkAny 9))
j -> 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 (AttachmentReference2 (ZonkAny 9))
-> Ptr (SomeStruct AttachmentReference2)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (AttachmentReference2 (ZonkAny 9))
j))) pDepthStencilAttachment
    preserveAttachmentCount <- peek @Word32 ((p `plusPtr` 72 :: Ptr Word32))
    pPreserveAttachments <- peek @(Ptr Word32) ((p `plusPtr` 80 :: Ptr (Ptr Word32)))
    pPreserveAttachments' <- generateM (fromIntegral preserveAttachmentCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr Word32
pPreserveAttachments Ptr Word32 -> Int -> Ptr Word32
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
    pure $ SubpassDescription2
             next
             flags
             pipelineBindPoint
             viewMask
             pInputAttachments'
             pColorAttachments'
             pResolveAttachments'
             pDepthStencilAttachment'
             pPreserveAttachments'

instance es ~ '[] => Zero (SubpassDescription2 es) where
  zero :: SubpassDescription2 es
zero = Chain es
-> SubpassDescriptionFlags
-> PipelineBindPoint
-> Word32
-> Vector (SomeStruct AttachmentReference2)
-> Vector (SomeStruct AttachmentReference2)
-> Vector (SomeStruct AttachmentReference2)
-> Maybe (SomeStruct AttachmentReference2)
-> Vector Word32
-> SubpassDescription2 es
forall (es :: [*]).
Chain es
-> SubpassDescriptionFlags
-> PipelineBindPoint
-> Word32
-> Vector (SomeStruct AttachmentReference2)
-> Vector (SomeStruct AttachmentReference2)
-> Vector (SomeStruct AttachmentReference2)
-> Maybe (SomeStruct AttachmentReference2)
-> Vector Word32
-> SubpassDescription2 es
SubpassDescription2
           ()
           SubpassDescriptionFlags
forall a. Zero a => a
zero
           PipelineBindPoint
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Vector (SomeStruct AttachmentReference2)
forall a. Monoid a => a
mempty
           Vector (SomeStruct AttachmentReference2)
forall a. Monoid a => a
mempty
           Vector (SomeStruct AttachmentReference2)
forall a. Monoid a => a
mempty
           Maybe (SomeStruct AttachmentReference2)
forall a. Maybe a
Nothing
           Vector Word32
forall a. Monoid a => a
mempty


-- | VkSubpassDependency2 - Structure specifying a subpass dependency
--
-- = Description
--
-- Parameters defined by this structure with the same name as those in
-- 'Vulkan.Core10.Pass.SubpassDependency' have the identical effect to
-- those parameters.
--
-- @viewOffset@ has the same effect for the described subpass dependency as
-- 'Vulkan.Core11.Promoted_From_VK_KHR_multiview.RenderPassMultiviewCreateInfo'::@pViewOffsets@
-- has on each corresponding subpass dependency.
--
-- If a
-- 'Vulkan.Core13.Promoted_From_VK_KHR_synchronization2.MemoryBarrier2' is
-- included in the @pNext@ chain, @srcStageMask@, @dstStageMask@,
-- @srcAccessMask@, and @dstAccessMask@ parameters are ignored. The
-- synchronization and access scopes instead are defined by the parameters
-- of 'Vulkan.Core13.Promoted_From_VK_KHR_synchronization2.MemoryBarrier2'.
-- If either @srcStageMask@ or @dstStageMask@ are set to
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ALL_COMMANDS_BIT',
-- it is equivalent to setting
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ALL_GRAPHICS_BIT'.
--
-- == Valid Usage
--
-- -   #VUID-VkSubpassDependency2-srcStageMask-04090# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-geometryShader geometryShader>
--     feature is not enabled, @srcStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_GEOMETRY_SHADER_BIT'
--
-- -   #VUID-VkSubpassDependency2-srcStageMask-04091# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-tessellationShader tessellationShader>
--     feature is not enabled, @srcStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT'
--     or
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT'
--
-- -   #VUID-VkSubpassDependency2-srcStageMask-04092# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-conditionalRendering conditionalRendering>
--     feature is not enabled, @srcStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT'
--
-- -   #VUID-VkSubpassDependency2-srcStageMask-04093# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-fragmentDensityMap fragmentDensityMap>
--     feature is not enabled, @srcStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT'
--
-- -   #VUID-VkSubpassDependency2-srcStageMask-04094# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-transformFeedback transformFeedback>
--     feature is not enabled, @srcStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT'
--
-- -   #VUID-VkSubpassDependency2-srcStageMask-04095# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-meshShader meshShader>
--     feature is not enabled, @srcStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_MESH_SHADER_BIT_EXT'
--
-- -   #VUID-VkSubpassDependency2-srcStageMask-04096# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-taskShader taskShader>
--     feature is not enabled, @srcStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_TASK_SHADER_BIT_EXT'
--
-- -   #VUID-VkSubpassDependency2-srcStageMask-07318# If neither of the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-shadingRateImage shadingRateImage>
--     or the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-attachmentFragmentShadingRate attachmentFragmentShadingRate>
--     features are enabled, @srcStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR'
--
-- -   #VUID-VkSubpassDependency2-srcStageMask-03937# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-synchronization2 synchronization2>
--     feature is not enabled, @srcStageMask@ /must/ not be @0@
--
-- -   #VUID-VkSubpassDependency2-srcStageMask-07949# If neither the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>
--     extension or the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-rayTracingPipeline rayTracingPipeline>
--     feature are enabled, @srcStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR'
--
-- -   #VUID-VkSubpassDependency2-srcStageMask-10754# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-accelerationStructure accelerationStructure>
--     feature is not enabled, @srcStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR'
--
-- -   #VUID-VkSubpassDependency2-dstStageMask-04090# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-geometryShader geometryShader>
--     feature is not enabled, @dstStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_GEOMETRY_SHADER_BIT'
--
-- -   #VUID-VkSubpassDependency2-dstStageMask-04091# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-tessellationShader tessellationShader>
--     feature is not enabled, @dstStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT'
--     or
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT'
--
-- -   #VUID-VkSubpassDependency2-dstStageMask-04092# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-conditionalRendering conditionalRendering>
--     feature is not enabled, @dstStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT'
--
-- -   #VUID-VkSubpassDependency2-dstStageMask-04093# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-fragmentDensityMap fragmentDensityMap>
--     feature is not enabled, @dstStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT'
--
-- -   #VUID-VkSubpassDependency2-dstStageMask-04094# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-transformFeedback transformFeedback>
--     feature is not enabled, @dstStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT'
--
-- -   #VUID-VkSubpassDependency2-dstStageMask-04095# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-meshShader meshShader>
--     feature is not enabled, @dstStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_MESH_SHADER_BIT_EXT'
--
-- -   #VUID-VkSubpassDependency2-dstStageMask-04096# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-taskShader taskShader>
--     feature is not enabled, @dstStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_TASK_SHADER_BIT_EXT'
--
-- -   #VUID-VkSubpassDependency2-dstStageMask-07318# If neither of the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-shadingRateImage shadingRateImage>
--     or the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-attachmentFragmentShadingRate attachmentFragmentShadingRate>
--     features are enabled, @dstStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR'
--
-- -   #VUID-VkSubpassDependency2-dstStageMask-03937# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-synchronization2 synchronization2>
--     feature is not enabled, @dstStageMask@ /must/ not be @0@
--
-- -   #VUID-VkSubpassDependency2-dstStageMask-07949# If neither the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_ray_tracing VK_NV_ray_tracing>
--     extension or the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-rayTracingPipeline rayTracingPipeline>
--     feature are enabled, @dstStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR'
--
-- -   #VUID-VkSubpassDependency2-dstStageMask-10754# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-accelerationStructure accelerationStructure>
--     feature is not enabled, @dstStageMask@ /must/ not contain
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR'
--
-- -   #VUID-VkSubpassDependency2-srcSubpass-03084# @srcSubpass@ /must/ be
--     less than or equal to @dstSubpass@, unless one of them is
--     'Vulkan.Core10.APIConstants.SUBPASS_EXTERNAL', to avoid cyclic
--     dependencies and ensure a valid execution order
--
-- -   #VUID-VkSubpassDependency2-srcSubpass-03085# @srcSubpass@ and
--     @dstSubpass@ /must/ not both be equal to
--     'Vulkan.Core10.APIConstants.SUBPASS_EXTERNAL'
--
-- -   #VUID-VkSubpassDependency2-srcSubpass-06810# If @srcSubpass@ is
--     equal to @dstSubpass@ and @srcStageMask@ includes a
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-framebuffer-regions framebuffer-space stage>,
--     @dstStageMask@ /must/ only contain
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-framebuffer-regions framebuffer-space stages>
--
-- -   #VUID-VkSubpassDependency2-srcAccessMask-03088# Any access flag
--     included in @srcAccessMask@ /must/ be supported by one of the
--     pipeline stages in @srcStageMask@, as specified in the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-access-types-supported table of supported access types>
--
-- -   #VUID-VkSubpassDependency2-dstAccessMask-03089# Any access flag
--     included in @dstAccessMask@ /must/ be supported by one of the
--     pipeline stages in @dstStageMask@, as specified in the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-access-types-supported table of supported access types>
--
-- -   #VUID-VkSubpassDependency2-dependencyFlags-03090# If
--     @dependencyFlags@ includes
--     'Vulkan.Core10.Enums.DependencyFlagBits.DEPENDENCY_VIEW_LOCAL_BIT',
--     @srcSubpass@ /must/ not be equal to
--     'Vulkan.Core10.APIConstants.SUBPASS_EXTERNAL'
--
-- -   #VUID-VkSubpassDependency2-dependencyFlags-03091# If
--     @dependencyFlags@ includes
--     'Vulkan.Core10.Enums.DependencyFlagBits.DEPENDENCY_VIEW_LOCAL_BIT',
--     @dstSubpass@ /must/ not be equal to
--     'Vulkan.Core10.APIConstants.SUBPASS_EXTERNAL'
--
-- -   #VUID-VkSubpassDependency2-srcSubpass-02245# If @srcSubpass@ equals
--     @dstSubpass@, and @srcStageMask@ and @dstStageMask@ both include a
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-framebuffer-regions framebuffer-space stage>,
--     then @dependencyFlags@ /must/ include
--     'Vulkan.Core10.Enums.DependencyFlagBits.DEPENDENCY_BY_REGION_BIT'
--
-- -   #VUID-VkSubpassDependency2-viewOffset-02530# If @viewOffset@ is not
--     equal to @0@, @srcSubpass@ /must/ not be equal to @dstSubpass@
--
-- -   #VUID-VkSubpassDependency2-dependencyFlags-03092# If
--     @dependencyFlags@ does not include
--     'Vulkan.Core10.Enums.DependencyFlagBits.DEPENDENCY_VIEW_LOCAL_BIT',
--     @viewOffset@ /must/ be @0@
--
-- -   #VUID-VkSubpassDependency2-dependencyFlags-10204# @dependencyFlags@
--     /must/ not include
--     'Vulkan.Core10.Enums.DependencyFlagBits.DEPENDENCY_QUEUE_FAMILY_OWNERSHIP_TRANSFER_USE_ALL_STAGES_BIT_KHR'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkSubpassDependency2-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2'
--
-- -   #VUID-VkSubpassDependency2-pNext-pNext# Each @pNext@ member of any
--     structure (including this one) in the @pNext@ chain /must/ be either
--     @NULL@ or a pointer to a valid instance of
--     'Vulkan.Core13.Promoted_From_VK_KHR_synchronization2.MemoryBarrier2'
--     or
--     'Vulkan.Extensions.VK_KHR_maintenance8.MemoryBarrierAccessFlags3KHR'
--
-- -   #VUID-VkSubpassDependency2-sType-unique# The @sType@ value of each
--     structure in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkSubpassDependency2-srcStageMask-parameter# @srcStageMask@
--     /must/ be a valid combination of
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PipelineStageFlagBits'
--     values
--
-- -   #VUID-VkSubpassDependency2-dstStageMask-parameter# @dstStageMask@
--     /must/ be a valid combination of
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PipelineStageFlagBits'
--     values
--
-- -   #VUID-VkSubpassDependency2-srcAccessMask-parameter# @srcAccessMask@
--     /must/ be a valid combination of
--     'Vulkan.Core10.Enums.AccessFlagBits.AccessFlagBits' values
--
-- -   #VUID-VkSubpassDependency2-dstAccessMask-parameter# @dstAccessMask@
--     /must/ be a valid combination of
--     'Vulkan.Core10.Enums.AccessFlagBits.AccessFlagBits' values
--
-- -   #VUID-VkSubpassDependency2-dependencyFlags-parameter#
--     @dependencyFlags@ /must/ be a valid combination of
--     'Vulkan.Core10.Enums.DependencyFlagBits.DependencyFlagBits' values
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_create_renderpass2 VK_KHR_create_renderpass2>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'Vulkan.Core10.Enums.AccessFlagBits.AccessFlags',
-- 'Vulkan.Core10.Enums.DependencyFlagBits.DependencyFlags',
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PipelineStageFlags',
-- 'RenderPassCreateInfo2',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data SubpassDependency2 (es :: [Type]) = SubpassDependency2
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). SubpassDependency2 es -> Chain es
next :: Chain es
  , -- | @srcSubpass@ is the subpass index of the first subpass in the
    -- dependency, or 'Vulkan.Core10.APIConstants.SUBPASS_EXTERNAL'.
    forall (es :: [*]). SubpassDependency2 es -> Word32
srcSubpass :: Word32
  , -- | @dstSubpass@ is the subpass index of the second subpass in the
    -- dependency, or 'Vulkan.Core10.APIConstants.SUBPASS_EXTERNAL'.
    forall (es :: [*]). SubpassDependency2 es -> Word32
dstSubpass :: Word32
  , -- | @srcStageMask@ is a bitmask of
    -- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PipelineStageFlagBits'
    -- specifying the
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-pipeline-stages-masks source stage mask>.
    -- If set to
    -- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ALL_COMMANDS_BIT',
    -- it is equivalent to setting it to
    -- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ALL_GRAPHICS_BIT'.
    forall (es :: [*]). SubpassDependency2 es -> PipelineStageFlags
srcStageMask :: PipelineStageFlags
  , -- | @dstStageMask@ is a bitmask of
    -- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PipelineStageFlagBits'
    -- specifying the
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-pipeline-stages-masks destination stage mask>
    -- If set to
    -- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ALL_COMMANDS_BIT',
    -- it is equivalent to setting it to
    -- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ALL_GRAPHICS_BIT'.
    forall (es :: [*]). SubpassDependency2 es -> PipelineStageFlags
dstStageMask :: PipelineStageFlags
  , -- | @srcAccessMask@ is a bitmask of
    -- 'Vulkan.Core10.Enums.AccessFlagBits.AccessFlagBits' specifying a
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-access-masks source access mask>.
    forall (es :: [*]). SubpassDependency2 es -> AccessFlags
srcAccessMask :: AccessFlags
  , -- | @dstAccessMask@ is a bitmask of
    -- 'Vulkan.Core10.Enums.AccessFlagBits.AccessFlagBits' specifying a
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-access-masks destination access mask>.
    forall (es :: [*]). SubpassDependency2 es -> AccessFlags
dstAccessMask :: AccessFlags
  , -- | @dependencyFlags@ is a bitmask of
    -- 'Vulkan.Core10.Enums.DependencyFlagBits.DependencyFlagBits'.
    forall (es :: [*]). SubpassDependency2 es -> DependencyFlags
dependencyFlags :: DependencyFlags
  , -- | @viewOffset@ controls which views in the source subpass the views in the
    -- destination subpass depend on.
    forall (es :: [*]). SubpassDependency2 es -> Int32
viewOffset :: Int32
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SubpassDependency2 (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (SubpassDependency2 es)

instance Extensible SubpassDependency2 where
  extensibleTypeName :: String
extensibleTypeName = String
"SubpassDependency2"
  setNext :: forall (ds :: [*]) (es :: [*]).
SubpassDependency2 ds -> Chain es -> SubpassDependency2 es
setNext SubpassDependency2{Int32
Word32
PipelineStageFlags
DependencyFlags
AccessFlags
Chain ds
next :: forall (es :: [*]). SubpassDependency2 es -> Chain es
srcSubpass :: forall (es :: [*]). SubpassDependency2 es -> Word32
dstSubpass :: forall (es :: [*]). SubpassDependency2 es -> Word32
srcStageMask :: forall (es :: [*]). SubpassDependency2 es -> PipelineStageFlags
dstStageMask :: forall (es :: [*]). SubpassDependency2 es -> PipelineStageFlags
srcAccessMask :: forall (es :: [*]). SubpassDependency2 es -> AccessFlags
dstAccessMask :: forall (es :: [*]). SubpassDependency2 es -> AccessFlags
dependencyFlags :: forall (es :: [*]). SubpassDependency2 es -> DependencyFlags
viewOffset :: forall (es :: [*]). SubpassDependency2 es -> Int32
next :: Chain ds
srcSubpass :: Word32
dstSubpass :: Word32
srcStageMask :: PipelineStageFlags
dstStageMask :: PipelineStageFlags
srcAccessMask :: AccessFlags
dstAccessMask :: AccessFlags
dependencyFlags :: DependencyFlags
viewOffset :: Int32
..} Chain es
next' = SubpassDependency2{next :: Chain es
next = Chain es
next', Int32
Word32
PipelineStageFlags
DependencyFlags
AccessFlags
srcSubpass :: Word32
dstSubpass :: Word32
srcStageMask :: PipelineStageFlags
dstStageMask :: PipelineStageFlags
srcAccessMask :: AccessFlags
dstAccessMask :: AccessFlags
dependencyFlags :: DependencyFlags
viewOffset :: Int32
srcSubpass :: Word32
dstSubpass :: Word32
srcStageMask :: PipelineStageFlags
dstStageMask :: PipelineStageFlags
srcAccessMask :: AccessFlags
dstAccessMask :: AccessFlags
dependencyFlags :: DependencyFlags
viewOffset :: Int32
..}
  getNext :: forall (es :: [*]). SubpassDependency2 es -> Chain es
getNext SubpassDependency2{Int32
Word32
PipelineStageFlags
DependencyFlags
AccessFlags
Chain es
next :: forall (es :: [*]). SubpassDependency2 es -> Chain es
srcSubpass :: forall (es :: [*]). SubpassDependency2 es -> Word32
dstSubpass :: forall (es :: [*]). SubpassDependency2 es -> Word32
srcStageMask :: forall (es :: [*]). SubpassDependency2 es -> PipelineStageFlags
dstStageMask :: forall (es :: [*]). SubpassDependency2 es -> PipelineStageFlags
srcAccessMask :: forall (es :: [*]). SubpassDependency2 es -> AccessFlags
dstAccessMask :: forall (es :: [*]). SubpassDependency2 es -> AccessFlags
dependencyFlags :: forall (es :: [*]). SubpassDependency2 es -> DependencyFlags
viewOffset :: forall (es :: [*]). SubpassDependency2 es -> Int32
next :: Chain es
srcSubpass :: Word32
dstSubpass :: Word32
srcStageMask :: PipelineStageFlags
dstStageMask :: PipelineStageFlags
srcAccessMask :: AccessFlags
dstAccessMask :: AccessFlags
dependencyFlags :: DependencyFlags
viewOffset :: Int32
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends SubpassDependency2 e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends SubpassDependency2 e => b) -> Maybe b
extends proxy e
_ Extends SubpassDependency2 e => b
f
    | Just e :~: MemoryBarrierAccessFlags3KHR
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @MemoryBarrierAccessFlags3KHR = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends SubpassDependency2 e => b
f
    | Just e :~: MemoryBarrier2
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @MemoryBarrier2 = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends SubpassDependency2 e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss SubpassDependency2 es
         , PokeChain es ) => ToCStruct (SubpassDependency2 es) where
  withCStruct :: forall b.
SubpassDependency2 es
-> (Ptr (SubpassDependency2 es) -> IO b) -> IO b
withCStruct SubpassDependency2 es
x Ptr (SubpassDependency2 es) -> IO b
f = Int -> (Ptr (SubpassDependency2 es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
48 ((Ptr (SubpassDependency2 es) -> IO b) -> IO b)
-> (Ptr (SubpassDependency2 es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (SubpassDependency2 es)
p -> Ptr (SubpassDependency2 es)
-> SubpassDependency2 es -> IO b -> IO b
forall b.
Ptr (SubpassDependency2 es)
-> SubpassDependency2 es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (SubpassDependency2 es)
p SubpassDependency2 es
x (Ptr (SubpassDependency2 es) -> IO b
f Ptr (SubpassDependency2 es)
p)
  pokeCStruct :: forall b.
Ptr (SubpassDependency2 es)
-> SubpassDependency2 es -> IO b -> IO b
pokeCStruct Ptr (SubpassDependency2 es)
p SubpassDependency2{Int32
Word32
PipelineStageFlags
DependencyFlags
AccessFlags
Chain es
next :: forall (es :: [*]). SubpassDependency2 es -> Chain es
srcSubpass :: forall (es :: [*]). SubpassDependency2 es -> Word32
dstSubpass :: forall (es :: [*]). SubpassDependency2 es -> Word32
srcStageMask :: forall (es :: [*]). SubpassDependency2 es -> PipelineStageFlags
dstStageMask :: forall (es :: [*]). SubpassDependency2 es -> PipelineStageFlags
srcAccessMask :: forall (es :: [*]). SubpassDependency2 es -> AccessFlags
dstAccessMask :: forall (es :: [*]). SubpassDependency2 es -> AccessFlags
dependencyFlags :: forall (es :: [*]). SubpassDependency2 es -> DependencyFlags
viewOffset :: forall (es :: [*]). SubpassDependency2 es -> Int32
next :: Chain es
srcSubpass :: Word32
dstSubpass :: Word32
srcStageMask :: PipelineStageFlags
dstStageMask :: PipelineStageFlags
srcAccessMask :: AccessFlags
dstAccessMask :: AccessFlags
dependencyFlags :: DependencyFlags
viewOffset :: Int32
..} 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
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 (SubpassDependency2 es)
p Ptr (SubpassDependency2 es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2)
    pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext''
    lift $ poke ((p `plusPtr` 16 :: Ptr Word32)) (srcSubpass)
    lift $ poke ((p `plusPtr` 20 :: Ptr Word32)) (dstSubpass)
    lift $ poke ((p `plusPtr` 24 :: Ptr PipelineStageFlags)) (srcStageMask)
    lift $ poke ((p `plusPtr` 28 :: Ptr PipelineStageFlags)) (dstStageMask)
    lift $ poke ((p `plusPtr` 32 :: Ptr AccessFlags)) (srcAccessMask)
    lift $ poke ((p `plusPtr` 36 :: Ptr AccessFlags)) (dstAccessMask)
    lift $ poke ((p `plusPtr` 40 :: Ptr DependencyFlags)) (dependencyFlags)
    lift $ poke ((p `plusPtr` 44 :: Ptr Int32)) (viewOffset)
    lift $ f
  cStructSize :: Int
cStructSize = Int
48
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (SubpassDependency2 es) -> IO b -> IO b
pokeZeroCStruct Ptr (SubpassDependency2 es)
p 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
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 (SubpassDependency2 es)
p Ptr (SubpassDependency2 es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_DEPENDENCY_2)
    pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext'
    lift $ poke ((p `plusPtr` 16 :: Ptr Word32)) (zero)
    lift $ poke ((p `plusPtr` 20 :: Ptr Word32)) (zero)
    lift $ poke ((p `plusPtr` 44 :: Ptr Int32)) (zero)
    lift $ f

instance ( Extendss SubpassDependency2 es
         , PeekChain es ) => FromCStruct (SubpassDependency2 es) where
  peekCStruct :: Ptr (SubpassDependency2 es) -> IO (SubpassDependency2 es)
peekCStruct Ptr (SubpassDependency2 es)
p = do
    pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (SubpassDependency2 es)
p Ptr (SubpassDependency2 es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    next <- peekChain (castPtr pNext)
    srcSubpass <- peek @Word32 ((p `plusPtr` 16 :: Ptr Word32))
    dstSubpass <- peek @Word32 ((p `plusPtr` 20 :: Ptr Word32))
    srcStageMask <- peek @PipelineStageFlags ((p `plusPtr` 24 :: Ptr PipelineStageFlags))
    dstStageMask <- peek @PipelineStageFlags ((p `plusPtr` 28 :: Ptr PipelineStageFlags))
    srcAccessMask <- peek @AccessFlags ((p `plusPtr` 32 :: Ptr AccessFlags))
    dstAccessMask <- peek @AccessFlags ((p `plusPtr` 36 :: Ptr AccessFlags))
    dependencyFlags <- peek @DependencyFlags ((p `plusPtr` 40 :: Ptr DependencyFlags))
    viewOffset <- peek @Int32 ((p `plusPtr` 44 :: Ptr Int32))
    pure $ SubpassDependency2
             next
             srcSubpass
             dstSubpass
             srcStageMask
             dstStageMask
             srcAccessMask
             dstAccessMask
             dependencyFlags
             viewOffset

instance es ~ '[] => Zero (SubpassDependency2 es) where
  zero :: SubpassDependency2 es
zero = Chain es
-> Word32
-> Word32
-> PipelineStageFlags
-> PipelineStageFlags
-> AccessFlags
-> AccessFlags
-> DependencyFlags
-> Int32
-> SubpassDependency2 es
forall (es :: [*]).
Chain es
-> Word32
-> Word32
-> PipelineStageFlags
-> PipelineStageFlags
-> AccessFlags
-> AccessFlags
-> DependencyFlags
-> Int32
-> SubpassDependency2 es
SubpassDependency2
           ()
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           PipelineStageFlags
forall a. Zero a => a
zero
           PipelineStageFlags
forall a. Zero a => a
zero
           AccessFlags
forall a. Zero a => a
zero
           AccessFlags
forall a. Zero a => a
zero
           DependencyFlags
forall a. Zero a => a
zero
           Int32
forall a. Zero a => a
zero


-- | VkRenderPassCreateInfo2 - Structure specifying parameters of a newly
-- created render pass
--
-- = Description
--
-- Parameters defined by this structure with the same name as those in
-- 'Vulkan.Core10.Pass.RenderPassCreateInfo' have the identical effect to
-- those parameters; the child structures are variants of those used in
-- 'Vulkan.Core10.Pass.RenderPassCreateInfo' which add @sType@ and @pNext@
-- parameters, allowing them to be extended.
--
-- If the 'SubpassDescription2'::@viewMask@ member of any element of
-- @pSubpasses@ is not zero, /multiview/ functionality is considered to be
-- enabled for this render pass.
--
-- @correlatedViewMaskCount@ and @pCorrelatedViewMasks@ have the same
-- effect as
-- 'Vulkan.Core11.Promoted_From_VK_KHR_multiview.RenderPassMultiviewCreateInfo'::@correlationMaskCount@
-- and
-- 'Vulkan.Core11.Promoted_From_VK_KHR_multiview.RenderPassMultiviewCreateInfo'::@pCorrelationMasks@,
-- respectively.
--
-- == Valid Usage
--
-- -   #VUID-VkRenderPassCreateInfo2-None-03049# If any two subpasses
--     operate on attachments with overlapping ranges of the same
--     'Vulkan.Core10.Handles.DeviceMemory' object, and at least one
--     subpass writes to that area of 'Vulkan.Core10.Handles.DeviceMemory',
--     a subpass dependency /must/ be included (either directly or via some
--     intermediate subpasses) between them
--
-- -   #VUID-VkRenderPassCreateInfo2-attachment-03050# If the @attachment@
--     member of any element of @pInputAttachments@, @pColorAttachments@,
--     @pResolveAttachments@ or @pDepthStencilAttachment@, or the
--     attachment indexed by any element of @pPreserveAttachments@ in any
--     element of @pSubpasses@ is bound to a range of a
--     'Vulkan.Core10.Handles.DeviceMemory' object that overlaps with any
--     other attachment in any subpass (including the same subpass), the
--     'AttachmentDescription2' structures describing them /must/ include
--     'Vulkan.Core10.Enums.AttachmentDescriptionFlagBits.ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT'
--     in @flags@
--
-- -   #VUID-VkRenderPassCreateInfo2-attachment-03051# If the @attachment@
--     member of any element of @pInputAttachments@, @pColorAttachments@,
--     @pResolveAttachments@ or @pDepthStencilAttachment@, or any element
--     of @pPreserveAttachments@ in any element of @pSubpasses@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', then it /must/ be
--     less than @attachmentCount@
--
-- -   #VUID-VkRenderPassCreateInfo2-fragmentDensityMapAttachment-06472# If
--     the pNext chain includes a
--     'Vulkan.Extensions.VK_EXT_fragment_density_map.RenderPassFragmentDensityMapCreateInfoEXT'
--     structure and the @fragmentDensityMapAttachment@ member is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', then @attachment@
--     /must/ be less than @attachmentCount@
--
-- -   #VUID-VkRenderPassCreateInfo2-fragmentDensityMapLayered-10829# If
--     the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-fragmentDensityMapLayered fragmentDensityMapLayered>
--     feature is not enabled, @flags@ /must/ not contain
--     'Vulkan.Core10.Enums.RenderPassCreateFlagBits.RENDER_PASS_CREATE_PER_LAYER_FRAGMENT_DENSITY_BIT_VALVE'
--
-- -   #VUID-VkRenderPassCreateInfo2-pSubpasses-06473# If the @pSubpasses@
--     pNext chain includes a
--     'Vulkan.Core12.Promoted_From_VK_KHR_depth_stencil_resolve.SubpassDescriptionDepthStencilResolve'
--     structure and the @pDepthStencilResolveAttachment@ member is not
--     @NULL@ and does not have the value
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', then @attachment@
--     /must/ be less than @attachmentCount@
--
-- -   #VUID-VkRenderPassCreateInfo2-pAttachments-02522# For any member of
--     @pAttachments@ with a @loadOp@ equal to
--     'Vulkan.Core10.Enums.AttachmentLoadOp.ATTACHMENT_LOAD_OP_CLEAR', the
--     first use of that attachment /must/ not specify a @layout@ equal to
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL',
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL'
--
-- -   #VUID-VkRenderPassCreateInfo2-pAttachments-02523# For any member of
--     @pAttachments@ with a @stencilLoadOp@ equal to
--     'Vulkan.Core10.Enums.AttachmentLoadOp.ATTACHMENT_LOAD_OP_CLEAR', the
--     first use of that attachment /must/ not specify a @layout@ equal to
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL',
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL'
--
-- -   #VUID-VkRenderPassCreateInfo2-pDependencies-03054# For each element
--     of @pDependencies@, if the @srcSubpass@ is not
--     'Vulkan.Core10.APIConstants.SUBPASS_EXTERNAL', all stage flags
--     included in the @srcStageMask@ member of that dependency /must/ be
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ALL_COMMANDS_BIT'
--     or a pipeline stage supported by the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-pipeline-stages-types pipeline>
--     identified by the @pipelineBindPoint@ member of the source subpass
--
-- -   #VUID-VkRenderPassCreateInfo2-pDependencies-03055# For each element
--     of @pDependencies@, if the @dstSubpass@ is not
--     'Vulkan.Core10.APIConstants.SUBPASS_EXTERNAL', all stage flags
--     included in the @dstStageMask@ member of that dependency /must/ be
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_ALL_COMMANDS_BIT'
--     or a pipeline stage supported by the
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#synchronization-pipeline-stages-types pipeline>
--     identified by the @pipelineBindPoint@ member of the destination
--     subpass
--
-- -   #VUID-VkRenderPassCreateInfo2-pCorrelatedViewMasks-03056# The set of
--     bits included in any element of @pCorrelatedViewMasks@ /must/ not
--     overlap with the set of bits included in any other element of
--     @pCorrelatedViewMasks@
--
-- -   #VUID-VkRenderPassCreateInfo2-viewMask-03057# If the
--     'SubpassDescription2'::@viewMask@ member of all elements of
--     @pSubpasses@ is @0@, @correlatedViewMaskCount@ /must/ be @0@
--
-- -   #VUID-VkRenderPassCreateInfo2-viewMask-03058# The
--     'SubpassDescription2'::@viewMask@ member of all elements of
--     @pSubpasses@ /must/ either all be @0@, or all not be @0@
--
-- -   #VUID-VkRenderPassCreateInfo2-viewMask-03059# If the
--     'SubpassDescription2'::@viewMask@ member of all elements of
--     @pSubpasses@ is @0@, the @dependencyFlags@ member of any element of
--     @pDependencies@ /must/ not include
--     'Vulkan.Core10.Enums.DependencyFlagBits.DEPENDENCY_VIEW_LOCAL_BIT'
--
-- -   #VUID-VkRenderPassCreateInfo2-pDependencies-03060# For each element
--     of @pDependencies@ where its @srcSubpass@ member equals its
--     @dstSubpass@ member, if the @viewMask@ member of the corresponding
--     element of @pSubpasses@ includes more than one bit, its
--     @dependencyFlags@ member /must/ include
--     'Vulkan.Core10.Enums.DependencyFlagBits.DEPENDENCY_VIEW_LOCAL_BIT'
--
-- -   #VUID-VkRenderPassCreateInfo2-attachment-02525# If the @attachment@
--     member of any element of the @pInputAttachments@ member of any
--     element of @pSubpasses@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', the @aspectMask@
--     member of that element of @pInputAttachments@ /must/ only include
--     aspects that are present in images of the format specified by the
--     element of @pAttachments@ specified by @attachment@
--
-- -   #VUID-VkRenderPassCreateInfo2-srcSubpass-02526# The @srcSubpass@
--     member of each element of @pDependencies@ /must/ be less than
--     @subpassCount@
--
-- -   #VUID-VkRenderPassCreateInfo2-dstSubpass-02527# The @dstSubpass@
--     member of each element of @pDependencies@ /must/ be less than
--     @subpassCount@
--
-- -   #VUID-VkRenderPassCreateInfo2-pAttachments-04585# If any element of
--     @pAttachments@ is used as a fragment shading rate attachment in any
--     subpass, it /must/ not be used as any other attachment in the render
--     pass
--
-- -   #VUID-VkRenderPassCreateInfo2-pAttachments-09387# If any element of
--     @pAttachments@ is used as a fragment shading rate attachment, the
--     @loadOp@ for that attachment /must/ not be
--     'Vulkan.Core10.Enums.AttachmentLoadOp.ATTACHMENT_LOAD_OP_CLEAR'
--
-- -   #VUID-VkRenderPassCreateInfo2-flags-04521# If @flags@ includes
--     'Vulkan.Core10.Enums.RenderPassCreateFlagBits.RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM',
--     an element of @pSubpasses@ includes an instance of
--     'Vulkan.Extensions.VK_KHR_fragment_shading_rate.FragmentShadingRateAttachmentInfoKHR'
--     in its @pNext@ chain, and the @pFragmentShadingRateAttachment@
--     member of that structure is not equal to @NULL@, the @attachment@
--     member of @pFragmentShadingRateAttachment@ /must/ be
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED'
--
-- -   #VUID-VkRenderPassCreateInfo2-pAttachments-04586# If any element of
--     @pAttachments@ is used as a fragment shading rate attachment in any
--     subpass, it /must/ have an image format whose
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#potential-format-features potential format features>
--     contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR'
--
-- -   #VUID-VkRenderPassCreateInfo2-attachment-06244# If the @attachment@
--     member of the @pDepthStencilAttachment@ member of an element of
--     @pSubpasses@ is not 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED',
--     the @layout@ member of that same structure is either
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL',
--     and the @pNext@ chain of that structure does not include a
--     'Vulkan.Core12.Promoted_From_VK_KHR_separate_depth_stencil_layouts.AttachmentReferenceStencilLayout'
--     structure, then the element of @pAttachments@ with an index equal to
--     @attachment@ /must/ not have a @format@ that includes both depth and
--     stencil components
--
-- -   #VUID-VkRenderPassCreateInfo2-attachment-06245# If the @attachment@
--     member of the @pDepthStencilAttachment@ member of an element of
--     @pSubpasses@ is not 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED'
--     and the @layout@ member of that same structure is either
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL',
--     then the element of @pAttachments@ with an index equal to
--     @attachment@ /must/ have a @format@ that includes only a stencil
--     component
--
-- -   #VUID-VkRenderPassCreateInfo2-attachment-06246# If the @attachment@
--     member of the @pDepthStencilAttachment@ member of an element of
--     @pSubpasses@ is not 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED'
--     and the @layout@ member of that same structure is either
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL'
--     or
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL',
--     then the element of @pAttachments@ with an index equal to
--     @attachment@ /must/ not have a @format@ that includes only a stencil
--     component
--
-- -   #VUID-VkRenderPassCreateInfo2-pResolveAttachments-09331# If any
--     element of @pResolveAttachments@ of any element of @pSubpasses@
--     references an attachment description with a format of
--     'Vulkan.Core10.Enums.Format.FORMAT_UNDEFINED',
--     'Vulkan.Extensions.VK_EXT_fragment_density_map.RenderPassFragmentDensityMapCreateInfoEXT'::@fragmentDensityMapAttachment->attachment@
--     /must/ be 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED'
--
-- -   #VUID-VkRenderPassCreateInfo2-pResolveAttachments-10650# If any
--     element of @pResolveAttachments@ of any element of @pSubpasses@
--     references an attachment description with a format of
--     'Vulkan.Core10.Enums.Format.FORMAT_UNDEFINED',
--     'Vulkan.Extensions.VK_QCOM_tile_shading.TILE_SHADING_RENDER_PASS_ENABLE_BIT_QCOM'
--     /must/ not be included in
--     'Vulkan.Extensions.VK_QCOM_tile_shading.RenderPassTileShadingCreateInfoQCOM'::@flags@
--
-- -   #VUID-VkRenderPassCreateInfo2-fragmentDensityMapAttachment-10651# If
--     'Vulkan.Extensions.VK_EXT_fragment_density_map.RenderPassFragmentDensityMapCreateInfoEXT'::@fragmentDensityMapAttachment@
--     is not 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED',
--     'Vulkan.Extensions.VK_QCOM_tile_shading.TILE_SHADING_RENDER_PASS_ENABLE_BIT_QCOM'
--     /must/ not be included in
--     'Vulkan.Extensions.VK_QCOM_tile_shading.RenderPassTileShadingCreateInfoQCOM'::@flags@
--
-- -   #VUID-VkRenderPassCreateInfo2-None-10916# If any subpass preserves
--     an attachment, there /must/ be a subpass dependency from a prior
--     subpass which uses or preserves that attachment
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkRenderPassCreateInfo2-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2'
--
-- -   #VUID-VkRenderPassCreateInfo2-pNext-pNext# Each @pNext@ member of
--     any structure (including this one) in the @pNext@ chain /must/ be
--     either @NULL@ or a pointer to a valid instance of
--     'Vulkan.Extensions.VK_EXT_subpass_merge_feedback.RenderPassCreationControlEXT',
--     'Vulkan.Extensions.VK_EXT_subpass_merge_feedback.RenderPassCreationFeedbackCreateInfoEXT',
--     'Vulkan.Extensions.VK_EXT_fragment_density_map.RenderPassFragmentDensityMapCreateInfoEXT',
--     'Vulkan.Extensions.VK_QCOM_tile_shading.RenderPassTileShadingCreateInfoQCOM',
--     or
--     'Vulkan.Extensions.VK_QCOM_tile_memory_heap.TileMemorySizeInfoQCOM'
--
-- -   #VUID-VkRenderPassCreateInfo2-sType-unique# The @sType@ value of
--     each structure in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkRenderPassCreateInfo2-flags-parameter# @flags@ /must/ be a
--     valid combination of
--     'Vulkan.Core10.Enums.RenderPassCreateFlagBits.RenderPassCreateFlagBits'
--     values
--
-- -   #VUID-VkRenderPassCreateInfo2-pAttachments-parameter# If
--     @attachmentCount@ is not @0@, @pAttachments@ /must/ be a valid
--     pointer to an array of @attachmentCount@ valid
--     'AttachmentDescription2' structures
--
-- -   #VUID-VkRenderPassCreateInfo2-pSubpasses-parameter# @pSubpasses@
--     /must/ be a valid pointer to an array of @subpassCount@ valid
--     'SubpassDescription2' structures
--
-- -   #VUID-VkRenderPassCreateInfo2-pDependencies-parameter# If
--     @dependencyCount@ is not @0@, @pDependencies@ /must/ be a valid
--     pointer to an array of @dependencyCount@ valid 'SubpassDependency2'
--     structures
--
-- -   #VUID-VkRenderPassCreateInfo2-pCorrelatedViewMasks-parameter# If
--     @correlatedViewMaskCount@ is not @0@, @pCorrelatedViewMasks@ /must/
--     be a valid pointer to an array of @correlatedViewMaskCount@
--     @uint32_t@ values
--
-- -   #VUID-VkRenderPassCreateInfo2-subpassCount-arraylength#
--     @subpassCount@ /must/ be greater than @0@
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_create_renderpass2 VK_KHR_create_renderpass2>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'AttachmentDescription2',
-- 'Vulkan.Core10.Enums.RenderPassCreateFlagBits.RenderPassCreateFlags',
-- 'Vulkan.Core10.Enums.StructureType.StructureType', 'SubpassDependency2',
-- 'SubpassDescription2', 'createRenderPass2', 'createRenderPass2'
data RenderPassCreateInfo2 (es :: [Type]) = RenderPassCreateInfo2
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). RenderPassCreateInfo2 es -> Chain es
next :: Chain es
  , -- | @flags@ is a bitmask of
    -- 'Vulkan.Core10.Enums.RenderPassCreateFlagBits.RenderPassCreateFlagBits'
    forall (es :: [*]).
RenderPassCreateInfo2 es -> RenderPassCreateFlags
flags :: RenderPassCreateFlags
  , -- | @pAttachments@ is a pointer to an array of @attachmentCount@
    -- 'AttachmentDescription2' structures describing the attachments used by
    -- the render pass.
    forall (es :: [*]).
RenderPassCreateInfo2 es
-> Vector (SomeStruct AttachmentDescription2)
attachments :: Vector (SomeStruct AttachmentDescription2)
  , -- | @pSubpasses@ is a pointer to an array of @subpassCount@
    -- 'SubpassDescription2' structures describing each subpass.
    forall (es :: [*]).
RenderPassCreateInfo2 es -> Vector (SomeStruct SubpassDescription2)
subpasses :: Vector (SomeStruct SubpassDescription2)
  , -- | @pDependencies@ is a pointer to an array of @dependencyCount@
    -- 'SubpassDependency2' structures describing dependencies between pairs of
    -- subpasses.
    forall (es :: [*]).
RenderPassCreateInfo2 es -> Vector (SomeStruct SubpassDependency2)
dependencies :: Vector (SomeStruct SubpassDependency2)
  , -- | @pCorrelatedViewMasks@ is a pointer to an array of view masks indicating
    -- sets of views that /may/ be more efficient to render concurrently.
    forall (es :: [*]). RenderPassCreateInfo2 es -> Vector Word32
correlatedViewMasks :: Vector Word32
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (RenderPassCreateInfo2 (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (RenderPassCreateInfo2 es)

instance Extensible RenderPassCreateInfo2 where
  extensibleTypeName :: String
extensibleTypeName = String
"RenderPassCreateInfo2"
  setNext :: forall (ds :: [*]) (es :: [*]).
RenderPassCreateInfo2 ds -> Chain es -> RenderPassCreateInfo2 es
setNext RenderPassCreateInfo2{Vector Word32
Vector (SomeStruct SubpassDescription2)
Vector (SomeStruct SubpassDependency2)
Vector (SomeStruct AttachmentDescription2)
RenderPassCreateFlags
Chain ds
next :: forall (es :: [*]). RenderPassCreateInfo2 es -> Chain es
flags :: forall (es :: [*]).
RenderPassCreateInfo2 es -> RenderPassCreateFlags
attachments :: forall (es :: [*]).
RenderPassCreateInfo2 es
-> Vector (SomeStruct AttachmentDescription2)
subpasses :: forall (es :: [*]).
RenderPassCreateInfo2 es -> Vector (SomeStruct SubpassDescription2)
dependencies :: forall (es :: [*]).
RenderPassCreateInfo2 es -> Vector (SomeStruct SubpassDependency2)
correlatedViewMasks :: forall (es :: [*]). RenderPassCreateInfo2 es -> Vector Word32
next :: Chain ds
flags :: RenderPassCreateFlags
attachments :: Vector (SomeStruct AttachmentDescription2)
subpasses :: Vector (SomeStruct SubpassDescription2)
dependencies :: Vector (SomeStruct SubpassDependency2)
correlatedViewMasks :: Vector Word32
..} Chain es
next' = RenderPassCreateInfo2{next :: Chain es
next = Chain es
next', Vector Word32
Vector (SomeStruct SubpassDescription2)
Vector (SomeStruct SubpassDependency2)
Vector (SomeStruct AttachmentDescription2)
RenderPassCreateFlags
flags :: RenderPassCreateFlags
attachments :: Vector (SomeStruct AttachmentDescription2)
subpasses :: Vector (SomeStruct SubpassDescription2)
dependencies :: Vector (SomeStruct SubpassDependency2)
correlatedViewMasks :: Vector Word32
flags :: RenderPassCreateFlags
attachments :: Vector (SomeStruct AttachmentDescription2)
subpasses :: Vector (SomeStruct SubpassDescription2)
dependencies :: Vector (SomeStruct SubpassDependency2)
correlatedViewMasks :: Vector Word32
..}
  getNext :: forall (es :: [*]). RenderPassCreateInfo2 es -> Chain es
getNext RenderPassCreateInfo2{Vector Word32
Vector (SomeStruct SubpassDescription2)
Vector (SomeStruct SubpassDependency2)
Vector (SomeStruct AttachmentDescription2)
RenderPassCreateFlags
Chain es
next :: forall (es :: [*]). RenderPassCreateInfo2 es -> Chain es
flags :: forall (es :: [*]).
RenderPassCreateInfo2 es -> RenderPassCreateFlags
attachments :: forall (es :: [*]).
RenderPassCreateInfo2 es
-> Vector (SomeStruct AttachmentDescription2)
subpasses :: forall (es :: [*]).
RenderPassCreateInfo2 es -> Vector (SomeStruct SubpassDescription2)
dependencies :: forall (es :: [*]).
RenderPassCreateInfo2 es -> Vector (SomeStruct SubpassDependency2)
correlatedViewMasks :: forall (es :: [*]). RenderPassCreateInfo2 es -> Vector Word32
next :: Chain es
flags :: RenderPassCreateFlags
attachments :: Vector (SomeStruct AttachmentDescription2)
subpasses :: Vector (SomeStruct SubpassDescription2)
dependencies :: Vector (SomeStruct SubpassDependency2)
correlatedViewMasks :: Vector Word32
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends RenderPassCreateInfo2 e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends RenderPassCreateInfo2 e => b) -> Maybe b
extends proxy e
_ Extends RenderPassCreateInfo2 e => b
f
    | Just e :~: RenderPassTileShadingCreateInfoQCOM
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @RenderPassTileShadingCreateInfoQCOM = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends RenderPassCreateInfo2 e => b
f
    | Just e :~: TileMemorySizeInfoQCOM
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @TileMemorySizeInfoQCOM = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends RenderPassCreateInfo2 e => b
f
    | Just e :~: RenderPassCreationFeedbackCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @RenderPassCreationFeedbackCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends RenderPassCreateInfo2 e => b
f
    | Just e :~: RenderPassCreationControlEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @RenderPassCreationControlEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends RenderPassCreateInfo2 e => b
f
    | Just e :~: RenderPassFragmentDensityMapCreateInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @RenderPassFragmentDensityMapCreateInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends RenderPassCreateInfo2 e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss RenderPassCreateInfo2 es
         , PokeChain es ) => ToCStruct (RenderPassCreateInfo2 es) where
  withCStruct :: forall b.
RenderPassCreateInfo2 es
-> (Ptr (RenderPassCreateInfo2 es) -> IO b) -> IO b
withCStruct RenderPassCreateInfo2 es
x Ptr (RenderPassCreateInfo2 es) -> IO b
f = Int -> (Ptr (RenderPassCreateInfo2 es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
80 ((Ptr (RenderPassCreateInfo2 es) -> IO b) -> IO b)
-> (Ptr (RenderPassCreateInfo2 es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (RenderPassCreateInfo2 es)
p -> Ptr (RenderPassCreateInfo2 es)
-> RenderPassCreateInfo2 es -> IO b -> IO b
forall b.
Ptr (RenderPassCreateInfo2 es)
-> RenderPassCreateInfo2 es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (RenderPassCreateInfo2 es)
p RenderPassCreateInfo2 es
x (Ptr (RenderPassCreateInfo2 es) -> IO b
f Ptr (RenderPassCreateInfo2 es)
p)
  pokeCStruct :: forall b.
Ptr (RenderPassCreateInfo2 es)
-> RenderPassCreateInfo2 es -> IO b -> IO b
pokeCStruct Ptr (RenderPassCreateInfo2 es)
p RenderPassCreateInfo2{Vector Word32
Vector (SomeStruct SubpassDescription2)
Vector (SomeStruct SubpassDependency2)
Vector (SomeStruct AttachmentDescription2)
RenderPassCreateFlags
Chain es
next :: forall (es :: [*]). RenderPassCreateInfo2 es -> Chain es
flags :: forall (es :: [*]).
RenderPassCreateInfo2 es -> RenderPassCreateFlags
attachments :: forall (es :: [*]).
RenderPassCreateInfo2 es
-> Vector (SomeStruct AttachmentDescription2)
subpasses :: forall (es :: [*]).
RenderPassCreateInfo2 es -> Vector (SomeStruct SubpassDescription2)
dependencies :: forall (es :: [*]).
RenderPassCreateInfo2 es -> Vector (SomeStruct SubpassDependency2)
correlatedViewMasks :: forall (es :: [*]). RenderPassCreateInfo2 es -> Vector Word32
next :: Chain es
flags :: RenderPassCreateFlags
attachments :: Vector (SomeStruct AttachmentDescription2)
subpasses :: Vector (SomeStruct SubpassDescription2)
dependencies :: Vector (SomeStruct SubpassDependency2)
correlatedViewMasks :: Vector Word32
..} 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
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 (RenderPassCreateInfo2 es)
p Ptr (RenderPassCreateInfo2 es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2)
    pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext''
    lift $ poke ((p `plusPtr` 16 :: Ptr RenderPassCreateFlags)) (flags)
    lift $ poke ((p `plusPtr` 20 :: Ptr Word32)) ((fromIntegral (Data.Vector.length $ (attachments)) :: Word32))
    pPAttachments' <- ContT $ allocaBytes @(AttachmentDescription2 _) ((Data.Vector.length (attachments)) * 56)
    Data.Vector.imapM_ (\Int
i SomeStruct AttachmentDescription2
e -> ((() -> 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
$ Ptr (SomeStruct AttachmentDescription2)
-> SomeStruct AttachmentDescription2 -> IO b -> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (AttachmentDescription2 (ZonkAny 13))
-> Ptr (SomeStruct AttachmentDescription2)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (AttachmentDescription2 (ZonkAny 10))
pPAttachments' Ptr (AttachmentDescription2 (ZonkAny 10))
-> Int -> Ptr (AttachmentDescription2 w)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
56 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AttachmentDescription2 _))) (SomeStruct AttachmentDescription2
e) (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
$ ())) (attachments)
    lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr (AttachmentDescription2 _)))) (pPAttachments')
    lift $ poke ((p `plusPtr` 32 :: Ptr Word32)) ((fromIntegral (Data.Vector.length $ (subpasses)) :: Word32))
    pPSubpasses' <- ContT $ allocaBytes @(SubpassDescription2 _) ((Data.Vector.length (subpasses)) * 88)
    Data.Vector.imapM_ (\Int
i SomeStruct SubpassDescription2
e -> ((() -> 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
$ Ptr (SomeStruct SubpassDescription2)
-> SomeStruct SubpassDescription2 -> IO b -> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (SubpassDescription2 (ZonkAny 14))
-> Ptr (SomeStruct SubpassDescription2)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (SubpassDescription2 (ZonkAny 11))
pPSubpasses' Ptr (SubpassDescription2 (ZonkAny 11))
-> Int -> Ptr (SubpassDescription2 w)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
88 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (SubpassDescription2 _))) (SomeStruct SubpassDescription2
e) (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
$ ())) (subpasses)
    lift $ poke ((p `plusPtr` 40 :: Ptr (Ptr (SubpassDescription2 _)))) (pPSubpasses')
    lift $ poke ((p `plusPtr` 48 :: Ptr Word32)) ((fromIntegral (Data.Vector.length $ (dependencies)) :: Word32))
    pPDependencies' <- ContT $ allocaBytes @(SubpassDependency2 _) ((Data.Vector.length (dependencies)) * 48)
    Data.Vector.imapM_ (\Int
i SomeStruct SubpassDependency2
e -> ((() -> 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
$ Ptr (SomeStruct SubpassDependency2)
-> SomeStruct SubpassDependency2 -> IO b -> IO b
forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (Ptr (SubpassDependency2 (ZonkAny 15))
-> Ptr (SomeStruct SubpassDependency2)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (SubpassDependency2 (ZonkAny 12))
pPDependencies' Ptr (SubpassDependency2 (ZonkAny 12))
-> Int -> Ptr (SubpassDependency2 w)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (SubpassDependency2 _))) (SomeStruct SubpassDependency2
e) (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
$ ())) (dependencies)
    lift $ poke ((p `plusPtr` 56 :: Ptr (Ptr (SubpassDependency2 _)))) (pPDependencies')
    lift $ poke ((p `plusPtr` 64 :: Ptr Word32)) ((fromIntegral (Data.Vector.length $ (correlatedViewMasks)) :: Word32))
    pPCorrelatedViewMasks' <- ContT $ allocaBytes @Word32 ((Data.Vector.length (correlatedViewMasks)) * 4)
    lift $ Data.Vector.imapM_ (\Int
i Word32
e -> Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Word32
pPCorrelatedViewMasks' Ptr Word32 -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32) (Word32
e)) (correlatedViewMasks)
    lift $ poke ((p `plusPtr` 72 :: Ptr (Ptr Word32))) (pPCorrelatedViewMasks')
    lift $ f
  cStructSize :: Int
cStructSize = Int
80
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (RenderPassCreateInfo2 es) -> IO b -> IO b
pokeZeroCStruct Ptr (RenderPassCreateInfo2 es)
p 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
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 (RenderPassCreateInfo2 es)
p Ptr (RenderPassCreateInfo2 es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO_2)
    pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext'
    lift $ f

instance ( Extendss RenderPassCreateInfo2 es
         , PeekChain es ) => FromCStruct (RenderPassCreateInfo2 es) where
  peekCStruct :: Ptr (RenderPassCreateInfo2 es) -> IO (RenderPassCreateInfo2 es)
peekCStruct Ptr (RenderPassCreateInfo2 es)
p = do
    pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (RenderPassCreateInfo2 es)
p Ptr (RenderPassCreateInfo2 es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    next <- peekChain (castPtr pNext)
    flags <- peek @RenderPassCreateFlags ((p `plusPtr` 16 :: Ptr RenderPassCreateFlags))
    attachmentCount <- peek @Word32 ((p `plusPtr` 20 :: Ptr Word32))
    pAttachments <- peek @(Ptr (AttachmentDescription2 _)) ((p `plusPtr` 24 :: Ptr (Ptr (AttachmentDescription2 _))))
    pAttachments' <- generateM (fromIntegral attachmentCount) (\Int
i -> Ptr (SomeStruct AttachmentDescription2)
-> IO (SomeStruct AttachmentDescription2)
forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (AttachmentDescription2 (ZonkAny 16))
-> Ptr (SomeStruct AttachmentDescription2)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (AttachmentDescription2 (ZonkAny 16))
pAttachments Ptr (AttachmentDescription2 (ZonkAny 16))
-> Int -> Ptr (AttachmentDescription2 (ZonkAny 16))
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
56 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (AttachmentDescription2 _)))))
    subpassCount <- peek @Word32 ((p `plusPtr` 32 :: Ptr Word32))
    pSubpasses <- peek @(Ptr (SubpassDescription2 _)) ((p `plusPtr` 40 :: Ptr (Ptr (SubpassDescription2 _))))
    pSubpasses' <- generateM (fromIntegral subpassCount) (\Int
i -> Ptr (SomeStruct SubpassDescription2)
-> IO (SomeStruct SubpassDescription2)
forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (SubpassDescription2 (ZonkAny 17))
-> Ptr (SomeStruct SubpassDescription2)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (SubpassDescription2 (ZonkAny 17))
pSubpasses Ptr (SubpassDescription2 (ZonkAny 17))
-> Int -> Ptr (SubpassDescription2 (ZonkAny 17))
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
88 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (SubpassDescription2 _)))))
    dependencyCount <- peek @Word32 ((p `plusPtr` 48 :: Ptr Word32))
    pDependencies <- peek @(Ptr (SubpassDependency2 _)) ((p `plusPtr` 56 :: Ptr (Ptr (SubpassDependency2 _))))
    pDependencies' <- generateM (fromIntegral dependencyCount) (\Int
i -> Ptr (SomeStruct SubpassDependency2)
-> IO (SomeStruct SubpassDependency2)
forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (SubpassDependency2 (ZonkAny 18))
-> Ptr (SomeStruct SubpassDependency2)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr (SubpassDependency2 (ZonkAny 18))
pDependencies Ptr (SubpassDependency2 (ZonkAny 18))
-> Int -> Ptr (SubpassDependency2 (ZonkAny 18))
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
48 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (SubpassDependency2 _)))))
    correlatedViewMaskCount <- peek @Word32 ((p `plusPtr` 64 :: Ptr Word32))
    pCorrelatedViewMasks <- peek @(Ptr Word32) ((p `plusPtr` 72 :: Ptr (Ptr Word32)))
    pCorrelatedViewMasks' <- generateM (fromIntegral correlatedViewMaskCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr Word32
pCorrelatedViewMasks Ptr Word32 -> Int -> Ptr Word32
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Word32)))
    pure $ RenderPassCreateInfo2
             next
             flags
             pAttachments'
             pSubpasses'
             pDependencies'
             pCorrelatedViewMasks'

instance es ~ '[] => Zero (RenderPassCreateInfo2 es) where
  zero :: RenderPassCreateInfo2 es
zero = Chain es
-> RenderPassCreateFlags
-> Vector (SomeStruct AttachmentDescription2)
-> Vector (SomeStruct SubpassDescription2)
-> Vector (SomeStruct SubpassDependency2)
-> Vector Word32
-> RenderPassCreateInfo2 es
forall (es :: [*]).
Chain es
-> RenderPassCreateFlags
-> Vector (SomeStruct AttachmentDescription2)
-> Vector (SomeStruct SubpassDescription2)
-> Vector (SomeStruct SubpassDependency2)
-> Vector Word32
-> RenderPassCreateInfo2 es
RenderPassCreateInfo2
           ()
           RenderPassCreateFlags
forall a. Zero a => a
zero
           Vector (SomeStruct AttachmentDescription2)
forall a. Monoid a => a
mempty
           Vector (SomeStruct SubpassDescription2)
forall a. Monoid a => a
mempty
           Vector (SomeStruct SubpassDependency2)
forall a. Monoid a => a
mempty
           Vector Word32
forall a. Monoid a => a
mempty


-- | VkSubpassBeginInfo - Structure specifying subpass begin information
--
-- == Valid Usage
--
-- -   #VUID-VkSubpassBeginInfo-contents-09382# If @contents@ is
--     'Vulkan.Core10.Enums.SubpassContents.SUBPASS_CONTENTS_INLINE_AND_SECONDARY_COMMAND_BUFFERS_KHR',
--     then at least one of the following features /must/ be enabled:
--
--     -   <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-maintenance7 maintenance7>
--
--     -   <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-nestedCommandBuffer nestedCommandBuffer>
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkSubpassBeginInfo-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SUBPASS_BEGIN_INFO'
--
-- -   #VUID-VkSubpassBeginInfo-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkSubpassBeginInfo-contents-parameter# @contents@ /must/ be a
--     valid 'Vulkan.Core10.Enums.SubpassContents.SubpassContents' value
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_create_renderpass2 VK_KHR_create_renderpass2>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Core10.Enums.SubpassContents.SubpassContents',
-- 'cmdBeginRenderPass2', 'cmdBeginRenderPass2', 'cmdNextSubpass2',
-- 'cmdNextSubpass2'
data SubpassBeginInfo = SubpassBeginInfo
  { -- | @contents@ is a 'Vulkan.Core10.Enums.SubpassContents.SubpassContents'
    -- value specifying how the commands in the next subpass will be provided.
    SubpassBeginInfo -> SubpassContents
contents :: SubpassContents }
  deriving (Typeable, SubpassBeginInfo -> SubpassBeginInfo -> Bool
(SubpassBeginInfo -> SubpassBeginInfo -> Bool)
-> (SubpassBeginInfo -> SubpassBeginInfo -> Bool)
-> Eq SubpassBeginInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SubpassBeginInfo -> SubpassBeginInfo -> Bool
== :: SubpassBeginInfo -> SubpassBeginInfo -> Bool
$c/= :: SubpassBeginInfo -> SubpassBeginInfo -> Bool
/= :: SubpassBeginInfo -> SubpassBeginInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SubpassBeginInfo)
#endif
deriving instance Show SubpassBeginInfo

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

instance FromCStruct SubpassBeginInfo where
  peekCStruct :: Ptr SubpassBeginInfo -> IO SubpassBeginInfo
peekCStruct Ptr SubpassBeginInfo
p = do
    contents <- forall a. Storable a => Ptr a -> IO a
peek @SubpassContents ((Ptr SubpassBeginInfo
p Ptr SubpassBeginInfo -> Int -> Ptr SubpassContents
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr SubpassContents))
    pure $ SubpassBeginInfo
             contents

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

instance Zero SubpassBeginInfo where
  zero :: SubpassBeginInfo
zero = SubpassContents -> SubpassBeginInfo
SubpassBeginInfo
           SubpassContents
forall a. Zero a => a
zero


-- | VkSubpassEndInfo - Structure specifying subpass end information
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkSubpassEndInfo-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SUBPASS_END_INFO'
--
-- -   #VUID-VkSubpassEndInfo-pNext-pNext# @pNext@ /must/ be @NULL@ or a
--     pointer to a valid instance of
--     'Vulkan.Extensions.VK_EXT_fragment_density_map_offset.RenderPassFragmentDensityMapOffsetEndInfoEXT'
--
-- -   #VUID-VkSubpassEndInfo-sType-unique# The @sType@ value of each
--     structure in the @pNext@ chain /must/ be unique
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_create_renderpass2 VK_KHR_create_renderpass2>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_2 VK_VERSION_1_2>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType', 'cmdEndRenderPass2',
-- 'cmdEndRenderPass2', 'cmdNextSubpass2', 'cmdNextSubpass2'
data SubpassEndInfo (es :: [Type]) = SubpassEndInfo
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). SubpassEndInfo es -> Chain es
next :: Chain es }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SubpassEndInfo (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (SubpassEndInfo es)

instance Extensible SubpassEndInfo where
  extensibleTypeName :: String
extensibleTypeName = String
"SubpassEndInfo"
  setNext :: forall (ds :: [*]) (es :: [*]).
SubpassEndInfo ds -> Chain es -> SubpassEndInfo es
setNext SubpassEndInfo ds
_ Chain es
next' = SubpassEndInfo{next :: Chain es
next = Chain es
next'}
  getNext :: forall (es :: [*]). SubpassEndInfo es -> Chain es
getNext SubpassEndInfo{Chain es
next :: forall (es :: [*]). SubpassEndInfo es -> Chain es
next :: Chain es
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends SubpassEndInfo e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends SubpassEndInfo e => b) -> Maybe b
extends proxy e
_ Extends SubpassEndInfo e => b
f
    | Just e :~: RenderPassFragmentDensityMapOffsetEndInfoEXT
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @RenderPassFragmentDensityMapOffsetEndInfoEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends SubpassEndInfo e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss SubpassEndInfo es
         , PokeChain es ) => ToCStruct (SubpassEndInfo es) where
  withCStruct :: forall b.
SubpassEndInfo es -> (Ptr (SubpassEndInfo es) -> IO b) -> IO b
withCStruct SubpassEndInfo es
x Ptr (SubpassEndInfo es) -> IO b
f = Int -> (Ptr (SubpassEndInfo es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
16 ((Ptr (SubpassEndInfo es) -> IO b) -> IO b)
-> (Ptr (SubpassEndInfo es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (SubpassEndInfo es)
p -> Ptr (SubpassEndInfo es) -> SubpassEndInfo es -> IO b -> IO b
forall b.
Ptr (SubpassEndInfo es) -> SubpassEndInfo es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (SubpassEndInfo es)
p SubpassEndInfo es
x (Ptr (SubpassEndInfo es) -> IO b
f Ptr (SubpassEndInfo es)
p)
  pokeCStruct :: forall b.
Ptr (SubpassEndInfo es) -> SubpassEndInfo es -> IO b -> IO b
pokeCStruct Ptr (SubpassEndInfo es)
p SubpassEndInfo{Chain es
next :: forall (es :: [*]). SubpassEndInfo es -> Chain es
next :: Chain es
..} 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
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 (SubpassEndInfo es)
p Ptr (SubpassEndInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_END_INFO)
    pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext''
    lift $ f
  cStructSize :: Int
cStructSize = Int
16
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (SubpassEndInfo es) -> IO b -> IO b
pokeZeroCStruct Ptr (SubpassEndInfo es)
p 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 (m :: * -> *) a. Monad m => m a -> ContT b m a
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 (SubpassEndInfo es)
p Ptr (SubpassEndInfo es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_END_INFO)
    pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext'
    lift $ f

instance ( Extendss SubpassEndInfo es
         , PeekChain es ) => FromCStruct (SubpassEndInfo es) where
  peekCStruct :: Ptr (SubpassEndInfo es) -> IO (SubpassEndInfo es)
peekCStruct Ptr (SubpassEndInfo es)
p = do
    pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (SubpassEndInfo es)
p Ptr (SubpassEndInfo es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    next <- peekChain (castPtr pNext)
    pure $ SubpassEndInfo
             next

instance es ~ '[] => Zero (SubpassEndInfo es) where
  zero :: SubpassEndInfo es
zero = Chain es -> SubpassEndInfo es
forall (es :: [*]). Chain es -> SubpassEndInfo es
SubpassEndInfo
           ()