{-# language CPP #-}
-- No documentation found for Chapter "Promoted_From_VK_KHR_maintenance5Roadmap"
module Vulkan.Core14.Promoted_From_VK_KHR_maintenance5Roadmap  ( getRenderingAreaGranularity
                                                               , cmdBindIndexBuffer2
                                                               , getImageSubresourceLayout2
                                                               , getDeviceImageSubresourceLayout
                                                               , BufferUsageFlags2CreateInfo(..)
                                                               , PipelineCreateFlags2CreateInfo(..)
                                                               , PhysicalDeviceMaintenance5Features(..)
                                                               , PhysicalDeviceMaintenance5Properties(..)
                                                               , RenderingAreaInfo(..)
                                                               , ImageSubresource2(..)
                                                               , SubresourceLayout2(..)
                                                               , DeviceImageSubresourceInfo(..)
                                                               , Format(..)
                                                               , StructureType(..)
                                                               , BufferUsageFlagBits2(..)
                                                               , BufferUsageFlags2
                                                               , PipelineCreateFlagBits2(..)
                                                               , PipelineCreateFlags2
                                                               ) where

import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
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 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 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.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.CStruct.Extends (peekSomeCStruct)
import Vulkan.CStruct.Extends (withSomeCStruct)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (Buffer)
import Vulkan.Core10.Handles (Buffer(..))
import Vulkan.Core14.Enums.BufferUsageFlags2 (BufferUsageFlags2)
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.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkCmdBindIndexBuffer2))
import Vulkan.Dynamic (DeviceCmds(pVkGetDeviceImageSubresourceLayout))
import Vulkan.Dynamic (DeviceCmds(pVkGetImageSubresourceLayout2))
import Vulkan.Dynamic (DeviceCmds(pVkGetRenderingAreaGranularity))
import Vulkan.Core10.FundamentalTypes (DeviceSize)
import Vulkan.Core10.Handles (Device_T)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import Vulkan.Core10.FundamentalTypes (Extent2D)
import Vulkan.Core10.Enums.Format (Format)
import Vulkan.Core10.Handles (Image)
import Vulkan.Core10.Handles (Image(..))
import {-# SOURCE #-} Vulkan.Extensions.VK_EXT_image_compression_control (ImageCompressionPropertiesEXT)
import Vulkan.Core10.Image (ImageCreateInfo)
import Vulkan.Core10.SparseResourceMemoryManagement (ImageSubresource)
import Vulkan.Core10.Enums.IndexType (IndexType)
import Vulkan.Core10.Enums.IndexType (IndexType(..))
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.Core14.Enums.PipelineCreateFlags2 (PipelineCreateFlags2)
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.CStruct.Extends (SomeStruct(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import {-# SOURCE #-} Vulkan.Core14.PromotedStreamingTransfers' (SubresourceHostMemcpySize)
import Vulkan.Core10.Image (SubresourceLayout)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BUFFER_USAGE_FLAGS_2_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_IMAGE_SUBRESOURCE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_FEATURES))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_CREATE_FLAGS_2_CREATE_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RENDERING_AREA_INFO))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2))
import Vulkan.Core14.Enums.BufferUsageFlags2 (BufferUsageFlagBits2(..))
import Vulkan.Core14.Enums.BufferUsageFlags2 (BufferUsageFlags2)
import Vulkan.Core10.Enums.Format (Format(..))
import Vulkan.Core14.Enums.PipelineCreateFlags2 (PipelineCreateFlagBits2(..))
import Vulkan.Core14.Enums.PipelineCreateFlags2 (PipelineCreateFlags2)
import Vulkan.Core10.Enums.StructureType (StructureType(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetRenderingAreaGranularity
  :: FunPtr (Ptr Device_T -> Ptr RenderingAreaInfo -> Ptr Extent2D -> IO ()) -> Ptr Device_T -> Ptr RenderingAreaInfo -> Ptr Extent2D -> IO ()

-- | vkGetRenderingAreaGranularity - Returns the granularity for dynamic
-- rendering optimal render area
--
-- = Description
--
-- The conditions leading to an optimal @renderArea@ are:
--
-- -   the @offset.x@ member in @renderArea@ is a multiple of the @width@
--     member of the returned 'Vulkan.Core10.FundamentalTypes.Extent2D'
--     (the horizontal granularity).
--
-- -   the @offset.y@ member in @renderArea@ is a multiple of the @height@
--     member of the returned 'Vulkan.Core10.FundamentalTypes.Extent2D'
--     (the vertical granularity).
--
-- -   either the @extent.width@ member in @renderArea@ is a multiple of
--     the horizontal granularity or @offset.x@+@extent.width@ is equal to
--     the @width@ of each attachment used in the render pass instance.
--
-- -   either the @extent.height@ member in @renderArea@ is a multiple of
--     the vertical granularity or @offset.y@+@extent.height@ is equal to
--     the @height@ of each attachment used in the render pass instance.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetRenderingAreaGranularity-device-parameter# @device@
--     /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetRenderingAreaGranularity-pRenderingAreaInfo-parameter#
--     @pRenderingAreaInfo@ /must/ be a valid pointer to a valid
--     'RenderingAreaInfo' structure
--
-- -   #VUID-vkGetRenderingAreaGranularity-pGranularity-parameter#
--     @pGranularity@ /must/ be a valid pointer to a
--     'Vulkan.Core10.FundamentalTypes.Extent2D' structure
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance5 VK_KHR_maintenance5>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.Handles.Device',
-- 'Vulkan.Core10.FundamentalTypes.Extent2D', 'RenderingAreaInfo'
getRenderingAreaGranularity :: forall io
                             . (MonadIO io)
                            => -- | @device@ is the logical device that owns the render pass instance.
                               Device
                            -> -- | @pRenderingAreaInfo@ is a pointer to a 'RenderingAreaInfo' structure
                               -- specifying details of the render pass instance to query the render area
                               -- granularity for.
                               RenderingAreaInfo
                            -> io (("granularity" ::: Extent2D))
getRenderingAreaGranularity :: forall (io :: * -> *).
MonadIO io =>
Device -> RenderingAreaInfo -> io ("granularity" ::: Extent2D)
getRenderingAreaGranularity Device
device RenderingAreaInfo
renderingAreaInfo = IO ("granularity" ::: Extent2D) -> io ("granularity" ::: Extent2D)
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ("granularity" ::: Extent2D)
 -> io ("granularity" ::: Extent2D))
-> (ContT
      ("granularity" ::: Extent2D) IO ("granularity" ::: Extent2D)
    -> IO ("granularity" ::: Extent2D))
-> ContT
     ("granularity" ::: Extent2D) IO ("granularity" ::: Extent2D)
-> io ("granularity" ::: Extent2D)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT ("granularity" ::: Extent2D) IO ("granularity" ::: Extent2D)
-> IO ("granularity" ::: Extent2D)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT ("granularity" ::: Extent2D) IO ("granularity" ::: Extent2D)
 -> io ("granularity" ::: Extent2D))
-> ContT
     ("granularity" ::: Extent2D) IO ("granularity" ::: Extent2D)
-> io ("granularity" ::: Extent2D)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetRenderingAreaGranularityPtr :: FunPtr
  (Ptr Device_T
   -> Ptr RenderingAreaInfo
   -> Ptr ("granularity" ::: Extent2D)
   -> IO ())
vkGetRenderingAreaGranularityPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> Ptr RenderingAreaInfo
      -> Ptr ("granularity" ::: Extent2D)
      -> IO ())
pVkGetRenderingAreaGranularity (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT ("granularity" ::: Extent2D) IO ()
forall (m :: * -> *) a.
Monad m =>
m a -> ContT ("granularity" ::: Extent2D) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("granularity" ::: Extent2D) IO ())
-> IO () -> ContT ("granularity" ::: Extent2D) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> Ptr RenderingAreaInfo
   -> Ptr ("granularity" ::: Extent2D)
   -> IO ())
vkGetRenderingAreaGranularityPtr FunPtr
  (Ptr Device_T
   -> Ptr RenderingAreaInfo
   -> Ptr ("granularity" ::: Extent2D)
   -> IO ())
-> FunPtr
     (Ptr Device_T
      -> Ptr RenderingAreaInfo
      -> Ptr ("granularity" ::: Extent2D)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> Ptr RenderingAreaInfo
   -> Ptr ("granularity" ::: Extent2D)
   -> 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 vkGetRenderingAreaGranularity is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetRenderingAreaGranularity' :: Ptr Device_T
-> Ptr RenderingAreaInfo
-> Ptr ("granularity" ::: Extent2D)
-> IO ()
vkGetRenderingAreaGranularity' = FunPtr
  (Ptr Device_T
   -> Ptr RenderingAreaInfo
   -> Ptr ("granularity" ::: Extent2D)
   -> IO ())
-> Ptr Device_T
-> Ptr RenderingAreaInfo
-> Ptr ("granularity" ::: Extent2D)
-> IO ()
mkVkGetRenderingAreaGranularity FunPtr
  (Ptr Device_T
   -> Ptr RenderingAreaInfo
   -> Ptr ("granularity" ::: Extent2D)
   -> IO ())
vkGetRenderingAreaGranularityPtr
  pRenderingAreaInfo <- ((Ptr RenderingAreaInfo -> IO ("granularity" ::: Extent2D))
 -> IO ("granularity" ::: Extent2D))
-> ContT ("granularity" ::: Extent2D) IO (Ptr RenderingAreaInfo)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr RenderingAreaInfo -> IO ("granularity" ::: Extent2D))
  -> IO ("granularity" ::: Extent2D))
 -> ContT ("granularity" ::: Extent2D) IO (Ptr RenderingAreaInfo))
-> ((Ptr RenderingAreaInfo -> IO ("granularity" ::: Extent2D))
    -> IO ("granularity" ::: Extent2D))
-> ContT ("granularity" ::: Extent2D) IO (Ptr RenderingAreaInfo)
forall a b. (a -> b) -> a -> b
$ RenderingAreaInfo
-> (Ptr RenderingAreaInfo -> IO ("granularity" ::: Extent2D))
-> IO ("granularity" ::: Extent2D)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
RenderingAreaInfo -> (Ptr RenderingAreaInfo -> IO b) -> IO b
withCStruct (RenderingAreaInfo
renderingAreaInfo)
  pPGranularity <- ContT (withZeroCStruct @Extent2D)
  lift $ traceAroundEvent "vkGetRenderingAreaGranularity" (vkGetRenderingAreaGranularity'
                                                             (deviceHandle (device))
                                                             pRenderingAreaInfo
                                                             (pPGranularity))
  pGranularity <- lift $ peekCStruct @Extent2D pPGranularity
  pure $ (pGranularity)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdBindIndexBuffer2
  :: FunPtr (Ptr CommandBuffer_T -> Buffer -> DeviceSize -> DeviceSize -> IndexType -> IO ()) -> Ptr CommandBuffer_T -> Buffer -> DeviceSize -> DeviceSize -> IndexType -> IO ()

-- | vkCmdBindIndexBuffer2 - Bind an index buffer to a command buffer
--
-- = Description
--
-- @size@ specifies the bound size of the index buffer starting from
-- @offset@. If @size@ is 'Vulkan.Core10.APIConstants.WHOLE_SIZE' then the
-- bound size is from @offset@ to the end of the @buffer@.
--
-- If the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-maintenance6 maintenance6>
-- feature is enabled, @buffer@ /can/ be
-- 'Vulkan.Core10.APIConstants.NULL_HANDLE'. If @buffer@ is
-- 'Vulkan.Core10.APIConstants.NULL_HANDLE' and the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-nullDescriptor nullDescriptor>
-- feature is enabled, every index fetched results in a value of zero.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdBindIndexBuffer2-offset-08782# @offset@ /must/ be less
--     than the size of @buffer@
--
-- -   #VUID-vkCmdBindIndexBuffer2-offset-08783# The sum of @offset@ and
--     the base address of the range of
--     'Vulkan.Core10.Handles.DeviceMemory' object that is backing
--     @buffer@, /must/ be a multiple of the size of the type indicated by
--     @indexType@
--
-- -   #VUID-vkCmdBindIndexBuffer2-buffer-08784# @buffer@ /must/ have been
--     created with the
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_INDEX_BUFFER_BIT'
--     usage flag set
--
-- -   #VUID-vkCmdBindIndexBuffer2-buffer-08785# If @buffer@ is non-sparse
--     then it /must/ be bound completely and contiguously to a single
--     'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-vkCmdBindIndexBuffer2-indexType-08786# @indexType@ /must/ not
--     be 'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_NONE_KHR'
--
-- -   #VUID-vkCmdBindIndexBuffer2-indexType-08787# If @indexType@ is
--     'Vulkan.Core10.Enums.IndexType.INDEX_TYPE_UINT8', the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-indexTypeUint8 indexTypeUint8>
--     feature /must/ be enabled
--
-- -   #VUID-vkCmdBindIndexBuffer2-None-09493# If the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#features-maintenance6 maintenance6>
--     feature is not enabled, @buffer@ /must/ not be
--     'Vulkan.Core10.APIConstants.NULL_HANDLE'
--
-- -   #VUID-vkCmdBindIndexBuffer2-buffer-09494# If @buffer@ is
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', offset /must/ be zero
--
-- -   #VUID-vkCmdBindIndexBuffer2-size-08767# If @size@ is not
--     'Vulkan.Core10.APIConstants.WHOLE_SIZE', @size@ /must/ be a multiple
--     of the size of the type indicated by @indexType@
--
-- -   #VUID-vkCmdBindIndexBuffer2-size-08768# If @size@ is not
--     'Vulkan.Core10.APIConstants.WHOLE_SIZE', the sum of @offset@ and
--     @size@ /must/ be less than or equal to the size of @buffer@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdBindIndexBuffer2-commandBuffer-parameter# @commandBuffer@
--     /must/ be a valid 'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdBindIndexBuffer2-buffer-parameter# If @buffer@ is not
--     'Vulkan.Core10.APIConstants.NULL_HANDLE', @buffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.Buffer' handle
--
-- -   #VUID-vkCmdBindIndexBuffer2-indexType-parameter# @indexType@ /must/
--     be a valid 'Vulkan.Core10.Enums.IndexType.IndexType' value
--
-- -   #VUID-vkCmdBindIndexBuffer2-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-vkCmdBindIndexBuffer2-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT' operations
--
-- -   #VUID-vkCmdBindIndexBuffer2-videocoding# This command /must/ only be
--     called outside of a video coding scope
--
-- -   #VUID-vkCmdBindIndexBuffer2-commonparent# Both of @buffer@, and
--     @commandBuffer@ that are valid handles of non-ignored parameters
--     /must/ have been created, allocated, or retrieved from the same
--     'Vulkan.Core10.Handles.Device'
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Both                                                                                                                   | Outside                                                                                                                     | VK_QUEUE_GRAPHICS_BIT                                                                                                 | State                                                                                                                                  |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             |                                                                                                                       |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- == Conditional Rendering
--
-- vkCmdBindIndexBuffer2 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_maintenance5 VK_KHR_maintenance5>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.Handles.Buffer', 'Vulkan.Core10.Handles.CommandBuffer',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize',
-- 'Vulkan.Core10.Enums.IndexType.IndexType'
cmdBindIndexBuffer2 :: forall io
                     . (MonadIO io)
                    => -- | @commandBuffer@ is the command buffer into which the command is
                       -- recorded.
                       CommandBuffer
                    -> -- | @buffer@ is the buffer being bound.
                       Buffer
                    -> -- | @offset@ is the starting offset in bytes within @buffer@ used in index
                       -- buffer address calculations.
                       ("offset" ::: DeviceSize)
                    -> -- | @size@ is the size in bytes of index data bound from @buffer@.
                       DeviceSize
                    -> -- | @indexType@ is a 'Vulkan.Core10.Enums.IndexType.IndexType' value
                       -- specifying the size of the indices.
                       IndexType
                    -> io ()
cmdBindIndexBuffer2 :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer
-> Buffer
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> IndexType
-> io ()
cmdBindIndexBuffer2 CommandBuffer
commandBuffer Buffer
buffer "offset" ::: DeviceSize
offset "offset" ::: DeviceSize
size IndexType
indexType = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ()) -> IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdBindIndexBuffer2Ptr :: FunPtr
  (Ptr CommandBuffer_T
   -> Buffer
   -> ("offset" ::: DeviceSize)
   -> ("offset" ::: DeviceSize)
   -> IndexType
   -> IO ())
vkCmdBindIndexBuffer2Ptr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> Buffer
      -> ("offset" ::: DeviceSize)
      -> ("offset" ::: DeviceSize)
      -> IndexType
      -> IO ())
pVkCmdBindIndexBuffer2 (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> Buffer
   -> ("offset" ::: DeviceSize)
   -> ("offset" ::: DeviceSize)
   -> IndexType
   -> IO ())
vkCmdBindIndexBuffer2Ptr FunPtr
  (Ptr CommandBuffer_T
   -> Buffer
   -> ("offset" ::: DeviceSize)
   -> ("offset" ::: DeviceSize)
   -> IndexType
   -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> Buffer
      -> ("offset" ::: DeviceSize)
      -> ("offset" ::: DeviceSize)
      -> IndexType
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> Buffer
   -> ("offset" ::: DeviceSize)
   -> ("offset" ::: DeviceSize)
   -> IndexType
   -> 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 vkCmdBindIndexBuffer2 is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdBindIndexBuffer2' :: Ptr CommandBuffer_T
-> Buffer
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> IndexType
-> IO ()
vkCmdBindIndexBuffer2' = FunPtr
  (Ptr CommandBuffer_T
   -> Buffer
   -> ("offset" ::: DeviceSize)
   -> ("offset" ::: DeviceSize)
   -> IndexType
   -> IO ())
-> Ptr CommandBuffer_T
-> Buffer
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> IndexType
-> IO ()
mkVkCmdBindIndexBuffer2 FunPtr
  (Ptr CommandBuffer_T
   -> Buffer
   -> ("offset" ::: DeviceSize)
   -> ("offset" ::: DeviceSize)
   -> IndexType
   -> IO ())
vkCmdBindIndexBuffer2Ptr
  String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdBindIndexBuffer2" (Ptr CommandBuffer_T
-> Buffer
-> ("offset" ::: DeviceSize)
-> ("offset" ::: DeviceSize)
-> IndexType
-> IO ()
vkCmdBindIndexBuffer2'
                                              (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
                                              (Buffer
buffer)
                                              ("offset" ::: DeviceSize
offset)
                                              ("offset" ::: DeviceSize
size)
                                              (IndexType
indexType))
  () -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetImageSubresourceLayout2
  :: FunPtr (Ptr Device_T -> Image -> Ptr ImageSubresource2 -> Ptr (SomeStruct SubresourceLayout2) -> IO ()) -> Ptr Device_T -> Image -> Ptr ImageSubresource2 -> Ptr (SomeStruct SubresourceLayout2) -> IO ()

-- | vkGetImageSubresourceLayout2 - Retrieve information about an image
-- subresource
--
-- = Description
--
-- 'getImageSubresourceLayout2' behaves similarly to
-- 'Vulkan.Core10.Image.getImageSubresourceLayout', with the ability to
-- specify extended inputs via chained input structures, and to return
-- extended information via chained output structures.
--
-- It is legal to call 'getImageSubresourceLayout2' with an @image@ created
-- with @tiling@ equal to
-- 'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_OPTIMAL', but the members
-- of 'SubresourceLayout2'::@subresourceLayout@ will have undefined values
-- in this case.
--
-- Structures chained from 'ImageSubresource2'::@pNext@ will also be
-- updated when @tiling@ is equal to
-- 'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_OPTIMAL'.
--
-- == Valid Usage
--
-- -   #VUID-vkGetImageSubresourceLayout2-aspectMask-00997# The
--     @aspectMask@ member of @pSubresource@ /must/ only have a single bit
--     set
--
-- -   #VUID-vkGetImageSubresourceLayout2-mipLevel-01716# The @mipLevel@
--     member of @pSubresource@ /must/ be less than the @mipLevels@
--     specified in @image@
--
-- -   #VUID-vkGetImageSubresourceLayout2-arrayLayer-01717# The
--     @arrayLayer@ member of @pSubresource@ /must/ be less than the
--     @arrayLayers@ specified in @image@
--
-- -   #VUID-vkGetImageSubresourceLayout2-format-08886# If @format@ of the
--     @image@ is a color format that is not a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-multiplanar multi-planar format>,
--     and @tiling@ of the @image@ is
--     'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_LINEAR' or
--     'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_OPTIMAL', the
--     @aspectMask@ member of @pSubresource@ /must/ be
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_COLOR_BIT'
--
-- -   #VUID-vkGetImageSubresourceLayout2-format-04462# If @format@ of the
--     @image@ has a depth component, the @aspectMask@ member of
--     @pSubresource@ /must/ contain
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_DEPTH_BIT'
--
-- -   #VUID-vkGetImageSubresourceLayout2-format-04463# If @format@ of the
--     @image@ has a stencil component, the @aspectMask@ member of
--     @pSubresource@ /must/ contain
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_STENCIL_BIT'
--
-- -   #VUID-vkGetImageSubresourceLayout2-format-04464# If @format@ of the
--     @image@ does not contain a stencil or depth component, the
--     @aspectMask@ member of @pSubresource@ /must/ not contain
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_DEPTH_BIT' or
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_STENCIL_BIT'
--
-- -   #VUID-vkGetImageSubresourceLayout2-tiling-08717# If the @tiling@ of
--     the @image@ is 'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_LINEAR'
--     and has a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-multiplanar multi-planar format>,
--     then the @aspectMask@ member of @pSubresource@ /must/ be a single
--     valid
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-multiplanar-image-aspect multi-planar aspect mask>
--     bit
--
-- -   #VUID-vkGetImageSubresourceLayout2-image-09434# If @image@ was
--     created with the
--     'Vulkan.Core11.Enums.ExternalMemoryHandleTypeFlagBits.EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID'
--     external memory handle type, then @image@ /must/ be bound to memory
--
-- -   #VUID-vkGetImageSubresourceLayout2-tiling-09435# If the @tiling@ of
--     the @image@ is
--     'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT',
--     then the @aspectMask@ member of @pSubresource@ /must/ be
--     @VK_IMAGE_ASPECT_MEMORY_PLANE_i_BIT_EXT@ and the index /i/ /must/ be
--     less than the
--     'Vulkan.Extensions.VK_EXT_image_drm_format_modifier.DrmFormatModifierPropertiesEXT'::@drmFormatModifierPlaneCount@
--     associated with the image’s @format@ and
--     'Vulkan.Extensions.VK_EXT_image_drm_format_modifier.ImageDrmFormatModifierPropertiesEXT'::@drmFormatModifier@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetImageSubresourceLayout2-device-parameter# @device@ /must/
--     be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetImageSubresourceLayout2-image-parameter# @image@ /must/
--     be a valid 'Vulkan.Core10.Handles.Image' handle
--
-- -   #VUID-vkGetImageSubresourceLayout2-pSubresource-parameter#
--     @pSubresource@ /must/ be a valid pointer to a valid
--     'ImageSubresource2' structure
--
-- -   #VUID-vkGetImageSubresourceLayout2-pLayout-parameter# @pLayout@
--     /must/ be a valid pointer to a 'SubresourceLayout2' structure
--
-- -   #VUID-vkGetImageSubresourceLayout2-image-parent# @image@ /must/ have
--     been created, allocated, or retrieved from @device@
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_host_image_copy VK_EXT_host_image_copy>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_image_compression_control VK_EXT_image_compression_control>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance5 VK_KHR_maintenance5>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.Handles.Device', 'Vulkan.Core10.Handles.Image',
-- 'ImageSubresource2', 'SubresourceLayout2'
getImageSubresourceLayout2 :: forall a io
                            . ( Extendss SubresourceLayout2 a
                              , PokeChain a
                              , PeekChain a
                              , MonadIO io )
                           => -- | @device@ is the logical device that owns the image.
                              Device
                           -> -- | @image@ is the image whose layout is being queried.
                              Image
                           -> -- | @pSubresource@ is a pointer to a 'ImageSubresource2' structure selecting
                              -- a specific image for the image subresource.
                              ImageSubresource2
                           -> io (SubresourceLayout2 a)
getImageSubresourceLayout2 :: forall (a :: [*]) (io :: * -> *).
(Extendss SubresourceLayout2 a, PokeChain a, PeekChain a,
 MonadIO io) =>
Device -> Image -> ImageSubresource2 -> io (SubresourceLayout2 a)
getImageSubresourceLayout2 Device
device Image
image ImageSubresource2
subresource = IO (SubresourceLayout2 a) -> io (SubresourceLayout2 a)
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (SubresourceLayout2 a) -> io (SubresourceLayout2 a))
-> (ContT (SubresourceLayout2 a) IO (SubresourceLayout2 a)
    -> IO (SubresourceLayout2 a))
-> ContT (SubresourceLayout2 a) IO (SubresourceLayout2 a)
-> io (SubresourceLayout2 a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT (SubresourceLayout2 a) IO (SubresourceLayout2 a)
-> IO (SubresourceLayout2 a)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT (SubresourceLayout2 a) IO (SubresourceLayout2 a)
 -> io (SubresourceLayout2 a))
-> ContT (SubresourceLayout2 a) IO (SubresourceLayout2 a)
-> io (SubresourceLayout2 a)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetImageSubresourceLayout2Ptr :: FunPtr
  (Ptr Device_T
   -> Image
   -> Ptr ImageSubresource2
   -> Ptr (SomeStruct SubresourceLayout2)
   -> IO ())
vkGetImageSubresourceLayout2Ptr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> Image
      -> Ptr ImageSubresource2
      -> Ptr (SomeStruct SubresourceLayout2)
      -> IO ())
pVkGetImageSubresourceLayout2 (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT (SubresourceLayout2 a) IO ()
forall (m :: * -> *) a.
Monad m =>
m a -> ContT (SubresourceLayout2 a) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (SubresourceLayout2 a) IO ())
-> IO () -> ContT (SubresourceLayout2 a) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> Image
   -> Ptr ImageSubresource2
   -> Ptr (SomeStruct SubresourceLayout2)
   -> IO ())
vkGetImageSubresourceLayout2Ptr FunPtr
  (Ptr Device_T
   -> Image
   -> Ptr ImageSubresource2
   -> Ptr (SomeStruct SubresourceLayout2)
   -> IO ())
-> FunPtr
     (Ptr Device_T
      -> Image
      -> Ptr ImageSubresource2
      -> Ptr (SomeStruct SubresourceLayout2)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> Image
   -> Ptr ImageSubresource2
   -> Ptr (SomeStruct SubresourceLayout2)
   -> 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 vkGetImageSubresourceLayout2 is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetImageSubresourceLayout2' :: Ptr Device_T
-> Image
-> Ptr ImageSubresource2
-> Ptr (SomeStruct SubresourceLayout2)
-> IO ()
vkGetImageSubresourceLayout2' = FunPtr
  (Ptr Device_T
   -> Image
   -> Ptr ImageSubresource2
   -> Ptr (SomeStruct SubresourceLayout2)
   -> IO ())
-> Ptr Device_T
-> Image
-> Ptr ImageSubresource2
-> Ptr (SomeStruct SubresourceLayout2)
-> IO ()
mkVkGetImageSubresourceLayout2 FunPtr
  (Ptr Device_T
   -> Image
   -> Ptr ImageSubresource2
   -> Ptr (SomeStruct SubresourceLayout2)
   -> IO ())
vkGetImageSubresourceLayout2Ptr
  pSubresource <- ((Ptr ImageSubresource2 -> IO (SubresourceLayout2 a))
 -> IO (SubresourceLayout2 a))
-> ContT (SubresourceLayout2 a) IO (Ptr ImageSubresource2)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ImageSubresource2 -> IO (SubresourceLayout2 a))
  -> IO (SubresourceLayout2 a))
 -> ContT (SubresourceLayout2 a) IO (Ptr ImageSubresource2))
-> ((Ptr ImageSubresource2 -> IO (SubresourceLayout2 a))
    -> IO (SubresourceLayout2 a))
-> ContT (SubresourceLayout2 a) IO (Ptr ImageSubresource2)
forall a b. (a -> b) -> a -> b
$ ImageSubresource2
-> (Ptr ImageSubresource2 -> IO (SubresourceLayout2 a))
-> IO (SubresourceLayout2 a)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
ImageSubresource2 -> (Ptr ImageSubresource2 -> IO b) -> IO b
withCStruct (ImageSubresource2
subresource)
  pPLayout <- ContT (withZeroCStruct @(SubresourceLayout2 _))
  lift $ traceAroundEvent "vkGetImageSubresourceLayout2" (vkGetImageSubresourceLayout2'
                                                            (deviceHandle (device))
                                                            (image)
                                                            pSubresource
                                                            (forgetExtensions (pPLayout)))
  pLayout <- lift $ peekCStruct @(SubresourceLayout2 _) pPLayout
  pure $ (pLayout)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetDeviceImageSubresourceLayout
  :: FunPtr (Ptr Device_T -> Ptr DeviceImageSubresourceInfo -> Ptr (SomeStruct SubresourceLayout2) -> IO ()) -> Ptr Device_T -> Ptr DeviceImageSubresourceInfo -> Ptr (SomeStruct SubresourceLayout2) -> IO ()

-- | vkGetDeviceImageSubresourceLayout - Retrieve information about an image
-- subresource without an image object
--
-- = Description
--
-- 'getDeviceImageSubresourceLayout' behaves similarly to
-- 'getImageSubresourceLayout2', but uses a
-- 'Vulkan.Core10.Image.ImageCreateInfo' structure to specify the image
-- rather than a 'Vulkan.Core10.Handles.Image' object.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance5 VK_KHR_maintenance5>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.Handles.Device', 'DeviceImageSubresourceInfo',
-- 'SubresourceLayout2'
getDeviceImageSubresourceLayout :: forall a io
                                 . ( Extendss SubresourceLayout2 a
                                   , PokeChain a
                                   , PeekChain a
                                   , MonadIO io )
                                => -- | @device@ is the logical device that owns the image.
                                   --
                                   -- #VUID-vkGetDeviceImageSubresourceLayout-device-parameter# @device@
                                   -- /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
                                   Device
                                -> -- | @pInfo@ is a pointer to a 'DeviceImageSubresourceInfo' structure
                                   -- containing parameters required for the subresource layout query.
                                   --
                                   -- #VUID-vkGetDeviceImageSubresourceLayout-pInfo-parameter# @pInfo@ /must/
                                   -- be a valid pointer to a valid 'DeviceImageSubresourceInfo' structure
                                   DeviceImageSubresourceInfo
                                -> io (SubresourceLayout2 a)
getDeviceImageSubresourceLayout :: forall (a :: [*]) (io :: * -> *).
(Extendss SubresourceLayout2 a, PokeChain a, PeekChain a,
 MonadIO io) =>
Device -> DeviceImageSubresourceInfo -> io (SubresourceLayout2 a)
getDeviceImageSubresourceLayout Device
device DeviceImageSubresourceInfo
info = IO (SubresourceLayout2 a) -> io (SubresourceLayout2 a)
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (SubresourceLayout2 a) -> io (SubresourceLayout2 a))
-> (ContT (SubresourceLayout2 a) IO (SubresourceLayout2 a)
    -> IO (SubresourceLayout2 a))
-> ContT (SubresourceLayout2 a) IO (SubresourceLayout2 a)
-> io (SubresourceLayout2 a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT (SubresourceLayout2 a) IO (SubresourceLayout2 a)
-> IO (SubresourceLayout2 a)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT (SubresourceLayout2 a) IO (SubresourceLayout2 a)
 -> io (SubresourceLayout2 a))
-> ContT (SubresourceLayout2 a) IO (SubresourceLayout2 a)
-> io (SubresourceLayout2 a)
forall a b. (a -> b) -> a -> b
$ do
  let vkGetDeviceImageSubresourceLayoutPtr :: FunPtr
  (Ptr Device_T
   -> Ptr DeviceImageSubresourceInfo
   -> Ptr (SomeStruct SubresourceLayout2)
   -> IO ())
vkGetDeviceImageSubresourceLayoutPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> Ptr DeviceImageSubresourceInfo
      -> Ptr (SomeStruct SubresourceLayout2)
      -> IO ())
pVkGetDeviceImageSubresourceLayout (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT (SubresourceLayout2 a) IO ()
forall (m :: * -> *) a.
Monad m =>
m a -> ContT (SubresourceLayout2 a) m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT (SubresourceLayout2 a) IO ())
-> IO () -> ContT (SubresourceLayout2 a) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> Ptr DeviceImageSubresourceInfo
   -> Ptr (SomeStruct SubresourceLayout2)
   -> IO ())
vkGetDeviceImageSubresourceLayoutPtr FunPtr
  (Ptr Device_T
   -> Ptr DeviceImageSubresourceInfo
   -> Ptr (SomeStruct SubresourceLayout2)
   -> IO ())
-> FunPtr
     (Ptr Device_T
      -> Ptr DeviceImageSubresourceInfo
      -> Ptr (SomeStruct SubresourceLayout2)
      -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> Ptr DeviceImageSubresourceInfo
   -> Ptr (SomeStruct SubresourceLayout2)
   -> 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 vkGetDeviceImageSubresourceLayout is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkGetDeviceImageSubresourceLayout' :: Ptr Device_T
-> Ptr DeviceImageSubresourceInfo
-> Ptr (SomeStruct SubresourceLayout2)
-> IO ()
vkGetDeviceImageSubresourceLayout' = FunPtr
  (Ptr Device_T
   -> Ptr DeviceImageSubresourceInfo
   -> Ptr (SomeStruct SubresourceLayout2)
   -> IO ())
-> Ptr Device_T
-> Ptr DeviceImageSubresourceInfo
-> Ptr (SomeStruct SubresourceLayout2)
-> IO ()
mkVkGetDeviceImageSubresourceLayout FunPtr
  (Ptr Device_T
   -> Ptr DeviceImageSubresourceInfo
   -> Ptr (SomeStruct SubresourceLayout2)
   -> IO ())
vkGetDeviceImageSubresourceLayoutPtr
  pInfo <- ((Ptr DeviceImageSubresourceInfo -> IO (SubresourceLayout2 a))
 -> IO (SubresourceLayout2 a))
-> ContT (SubresourceLayout2 a) IO (Ptr DeviceImageSubresourceInfo)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr DeviceImageSubresourceInfo -> IO (SubresourceLayout2 a))
  -> IO (SubresourceLayout2 a))
 -> ContT
      (SubresourceLayout2 a) IO (Ptr DeviceImageSubresourceInfo))
-> ((Ptr DeviceImageSubresourceInfo -> IO (SubresourceLayout2 a))
    -> IO (SubresourceLayout2 a))
-> ContT (SubresourceLayout2 a) IO (Ptr DeviceImageSubresourceInfo)
forall a b. (a -> b) -> a -> b
$ DeviceImageSubresourceInfo
-> (Ptr DeviceImageSubresourceInfo -> IO (SubresourceLayout2 a))
-> IO (SubresourceLayout2 a)
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
DeviceImageSubresourceInfo
-> (Ptr DeviceImageSubresourceInfo -> IO b) -> IO b
withCStruct (DeviceImageSubresourceInfo
info)
  pPLayout <- ContT (withZeroCStruct @(SubresourceLayout2 _))
  lift $ traceAroundEvent "vkGetDeviceImageSubresourceLayout" (vkGetDeviceImageSubresourceLayout'
                                                                 (deviceHandle (device))
                                                                 pInfo
                                                                 (forgetExtensions (pPLayout)))
  pLayout <- lift $ peekCStruct @(SubresourceLayout2 _) pPLayout
  pure $ (pLayout)


-- | VkBufferUsageFlags2CreateInfo - Extended buffer usage flags
--
-- = Description
--
-- If this structure is included in the @pNext@ chain of a buffer creation
-- structure, @usage@ is used instead of the corresponding @usage@ value
-- passed in that creation structure, allowing additional usage flags to be
-- specified. If this structure is included in the @pNext@ chain of a
-- buffer query structure, the usage flags of the buffer are returned in
-- @usage@ of this structure, and the usage flags representable in @usage@
-- of the buffer query structure are also returned in that field.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance5 VK_KHR_maintenance5>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core14.Enums.BufferUsageFlags2.BufferUsageFlags2',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data BufferUsageFlags2CreateInfo = BufferUsageFlags2CreateInfo
  { -- | @usage@ is a bitmask of
    -- 'Vulkan.Core14.Enums.BufferUsageFlags2.BufferUsageFlagBits2' specifying
    -- allowed usages of the buffer.
    --
    -- #VUID-VkBufferUsageFlags2CreateInfo-usage-parameter# @usage@ /must/ be a
    -- valid combination of
    -- 'Vulkan.Core14.Enums.BufferUsageFlags2.BufferUsageFlagBits2' values
    --
    -- #VUID-VkBufferUsageFlags2CreateInfo-usage-requiredbitmask# @usage@
    -- /must/ not be @0@
    BufferUsageFlags2CreateInfo -> BufferUsageFlags2
usage :: BufferUsageFlags2 }
  deriving (Typeable, BufferUsageFlags2CreateInfo -> BufferUsageFlags2CreateInfo -> Bool
(BufferUsageFlags2CreateInfo
 -> BufferUsageFlags2CreateInfo -> Bool)
-> (BufferUsageFlags2CreateInfo
    -> BufferUsageFlags2CreateInfo -> Bool)
-> Eq BufferUsageFlags2CreateInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BufferUsageFlags2CreateInfo -> BufferUsageFlags2CreateInfo -> Bool
== :: BufferUsageFlags2CreateInfo -> BufferUsageFlags2CreateInfo -> Bool
$c/= :: BufferUsageFlags2CreateInfo -> BufferUsageFlags2CreateInfo -> Bool
/= :: BufferUsageFlags2CreateInfo -> BufferUsageFlags2CreateInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BufferUsageFlags2CreateInfo)
#endif
deriving instance Show BufferUsageFlags2CreateInfo

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

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

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

instance Zero BufferUsageFlags2CreateInfo where
  zero :: BufferUsageFlags2CreateInfo
zero = BufferUsageFlags2 -> BufferUsageFlags2CreateInfo
BufferUsageFlags2CreateInfo
           BufferUsageFlags2
forall a. Zero a => a
zero


-- | VkPipelineCreateFlags2CreateInfo - Extended pipeline create flags
--
-- = Description
--
-- If this structure is included in the @pNext@ chain of a pipeline
-- creation structure, @flags@ is used instead of the corresponding @flags@
-- value passed in that creation structure, allowing additional creation
-- flags to be specified.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance5 VK_KHR_maintenance5>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core14.Enums.PipelineCreateFlags2.PipelineCreateFlags2',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PipelineCreateFlags2CreateInfo = PipelineCreateFlags2CreateInfo
  { -- | @flags@ is a bitmask of
    -- 'Vulkan.Core14.Enums.PipelineCreateFlags2.PipelineCreateFlagBits2'
    -- specifying how a pipeline will be generated.
    --
    -- #VUID-VkPipelineCreateFlags2CreateInfo-flags-parameter# @flags@ /must/
    -- be a valid combination of
    -- 'Vulkan.Core14.Enums.PipelineCreateFlags2.PipelineCreateFlagBits2'
    -- values
    PipelineCreateFlags2CreateInfo -> PipelineCreateFlags2
flags :: PipelineCreateFlags2 }
  deriving (Typeable, PipelineCreateFlags2CreateInfo
-> PipelineCreateFlags2CreateInfo -> Bool
(PipelineCreateFlags2CreateInfo
 -> PipelineCreateFlags2CreateInfo -> Bool)
-> (PipelineCreateFlags2CreateInfo
    -> PipelineCreateFlags2CreateInfo -> Bool)
-> Eq PipelineCreateFlags2CreateInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PipelineCreateFlags2CreateInfo
-> PipelineCreateFlags2CreateInfo -> Bool
== :: PipelineCreateFlags2CreateInfo
-> PipelineCreateFlags2CreateInfo -> Bool
$c/= :: PipelineCreateFlags2CreateInfo
-> PipelineCreateFlags2CreateInfo -> Bool
/= :: PipelineCreateFlags2CreateInfo
-> PipelineCreateFlags2CreateInfo -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineCreateFlags2CreateInfo)
#endif
deriving instance Show PipelineCreateFlags2CreateInfo

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

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

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

instance Zero PipelineCreateFlags2CreateInfo where
  zero :: PipelineCreateFlags2CreateInfo
zero = PipelineCreateFlags2 -> PipelineCreateFlags2CreateInfo
PipelineCreateFlags2CreateInfo
           PipelineCreateFlags2
forall a. Zero a => a
zero


-- | VkPhysicalDeviceMaintenance5Features - Structure describing whether the
-- implementation supports maintenance5 functionality
--
-- = Members
--
-- This structure describes the following feature:
--
-- = Description
--
-- If the 'PhysicalDeviceMaintenance5Features' structure is included in the
-- @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2',
-- it is filled in to indicate whether each corresponding feature is
-- supported. If the application wishes to use a
-- 'Vulkan.Core10.Handles.Device' with any features described by
-- 'PhysicalDeviceMaintenance5Features', it /must/ add an instance of the
-- structure, with the desired feature members set to
-- 'Vulkan.Core10.FundamentalTypes.TRUE', to the @pNext@ chain of
-- 'Vulkan.Core10.Device.DeviceCreateInfo' when creating the
-- 'Vulkan.Core10.Handles.Device'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance5 VK_KHR_maintenance5>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceMaintenance5Features = PhysicalDeviceMaintenance5Features
  { -- | #extension-features-maintenance5# @maintenance5@ indicates that the
    -- implementation supports the following:
    --
    -- -   The ability to expose support for the optional format
    --     'Vulkan.Core10.Enums.Format.FORMAT_A1B5G5R5_UNORM_PACK16'.
    --
    -- -   The ability to expose support for the optional format
    --     'Vulkan.Core10.Enums.Format.FORMAT_A8_UNORM'.
    --
    -- -   A property to indicate that multisample coverage operations are
    --     performed after sample counting in EarlyFragmentTests mode.
    --
    -- -   Creating a 'Vulkan.Core10.Handles.BufferView' with a subset of the
    --     associated 'Vulkan.Core10.Handles.Buffer' usage using
    --     'BufferUsageFlags2CreateInfo'.
    --
    -- -   A new function 'cmdBindIndexBuffer2', allowing a range of memory to
    --     be bound as an index buffer.
    --
    -- -   'Vulkan.Core10.DeviceInitialization.getDeviceProcAddr' will return
    --     @NULL@ for function pointers of core functions for versions higher
    --     than the version requested by the application.
    --
    -- -   'Vulkan.Core13.Promoted_From_VK_EXT_extended_dynamic_state.cmdBindVertexBuffers2'
    --     supports using 'Vulkan.Core10.APIConstants.WHOLE_SIZE' in the
    --     @pSizes@ parameter.
    --
    -- -   If @PointSize@ is not written, a default value of @1.0@ is used for
    --     the size of points.
    --
    -- -   'Vulkan.Core10.Shader.ShaderModuleCreateInfo' /can/ be added as a
    --     chained structure to pipeline creation via
    --     'Vulkan.Core10.ComputePipeline.PipelineShaderStageCreateInfo',
    --     rather than having to create a shader module.
    --
    -- -   A function 'getRenderingAreaGranularity' to query the optimal render
    --     area for a dynamic rendering instance.
    --
    -- -   A property to indicate that depth\/stencil texturing operations with
    --     'Vulkan.Core10.Enums.ComponentSwizzle.COMPONENT_SWIZZLE_ONE' have
    --     defined behavior.
    --
    -- -   'getDeviceImageSubresourceLayout' allows an application to perform a
    --     'Vulkan.Core10.Image.getImageSubresourceLayout' query without having
    --     to create an image.
    --
    -- -   'Vulkan.Core10.APIConstants.REMAINING_ARRAY_LAYERS' as the
    --     @layerCount@ member of
    --     'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers'.
    --
    -- -   A property to indicate whether @PointSize@ controls the final
    --     rasterization of polygons if
    --     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#primsrast-polygonmode polygon mode>
    --     is 'Vulkan.Core10.Enums.PolygonMode.POLYGON_MODE_POINT'.
    --
    -- -   Two properties to indicate the non-strict line rasterization
    --     algorithm used.
    --
    -- -   Two new flags words
    --     'Vulkan.Core14.Enums.PipelineCreateFlags2.PipelineCreateFlagBits2'
    --     and 'Vulkan.Core14.Enums.BufferUsageFlags2.BufferUsageFlagBits2'.
    --
    -- -   Physical-device-level functions /can/ now be called with any value
    --     in the valid range for a type beyond the defined enumerants, such
    --     that applications can avoid checking individual features,
    --     extensions, or versions before querying supported properties of a
    --     particular enumerant.
    --
    -- -   Copies between images of any type are allowed, with 1D images
    --     treated as 2D images with a height of @1@.
    PhysicalDeviceMaintenance5Features -> Bool
maintenance5 :: Bool }
  deriving (Typeable, PhysicalDeviceMaintenance5Features
-> PhysicalDeviceMaintenance5Features -> Bool
(PhysicalDeviceMaintenance5Features
 -> PhysicalDeviceMaintenance5Features -> Bool)
-> (PhysicalDeviceMaintenance5Features
    -> PhysicalDeviceMaintenance5Features -> Bool)
-> Eq PhysicalDeviceMaintenance5Features
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceMaintenance5Features
-> PhysicalDeviceMaintenance5Features -> Bool
== :: PhysicalDeviceMaintenance5Features
-> PhysicalDeviceMaintenance5Features -> Bool
$c/= :: PhysicalDeviceMaintenance5Features
-> PhysicalDeviceMaintenance5Features -> Bool
/= :: PhysicalDeviceMaintenance5Features
-> PhysicalDeviceMaintenance5Features -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceMaintenance5Features)
#endif
deriving instance Show PhysicalDeviceMaintenance5Features

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

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

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

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


-- | VkPhysicalDeviceMaintenance5Properties - Structure describing various
-- implementation-defined properties introduced with VK_KHR_maintenance5
--
-- = Description
--
-- If the 'PhysicalDeviceMaintenance5Properties' structure is included in
-- the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceProperties2',
-- it is filled in with each corresponding implementation-dependent
-- property.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance5 VK_KHR_maintenance5>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceMaintenance5Properties = PhysicalDeviceMaintenance5Properties
  { -- | @earlyFragmentMultisampleCoverageAfterSampleCounting@ is a boolean value
    -- indicating whether the
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#fragops-shader fragment shading>
    -- and
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#fragops-covg multisample coverage>
    -- operations are performed after
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#fragops-samplecount sample counting>
    -- for
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#fragops-shader fragment shaders>
    -- with @EarlyFragmentTests@ execution mode.
    PhysicalDeviceMaintenance5Properties -> Bool
earlyFragmentMultisampleCoverageAfterSampleCounting :: Bool
  , -- | @earlyFragmentSampleMaskTestBeforeSampleCounting@ is a boolean value
    -- indicating whether the
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#fragops-samplemask sample mask test>
    -- operation is performed before
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#fragops-samplecount sample counting>
    -- for
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#fragops-shader fragment shaders>
    -- using the @EarlyFragmentTests@ execution mode.
    PhysicalDeviceMaintenance5Properties -> Bool
earlyFragmentSampleMaskTestBeforeSampleCounting :: Bool
  , -- | @depthStencilSwizzleOneSupport@ is a boolean indicating that
    -- depth\/stencil texturing operations with
    -- 'Vulkan.Core10.Enums.ComponentSwizzle.COMPONENT_SWIZZLE_ONE' have
    -- defined behavior.
    PhysicalDeviceMaintenance5Properties -> Bool
depthStencilSwizzleOneSupport :: Bool
  , -- | @polygonModePointSize@ is a boolean value indicating whether the point
    -- size of the final rasterization of polygons with
    -- 'Vulkan.Core10.Enums.PolygonMode.POLYGON_MODE_POINT' is controlled by
    -- @PointSize@.
    PhysicalDeviceMaintenance5Properties -> Bool
polygonModePointSize :: Bool
  , -- | @nonStrictSinglePixelWideLinesUseParallelogram@ is a boolean value
    -- indicating whether non-strict lines with a width of 1.0 are rasterized
    -- as parallelograms or using Bresenham’s algorithm.
    PhysicalDeviceMaintenance5Properties -> Bool
nonStrictSinglePixelWideLinesUseParallelogram :: Bool
  , -- | @nonStrictWideLinesUseParallelogram@ is a boolean value indicating
    -- whether non-strict lines with a width greater than 1.0 are rasterized as
    -- parallelograms or using Bresenham’s algorithm.
    PhysicalDeviceMaintenance5Properties -> Bool
nonStrictWideLinesUseParallelogram :: Bool
  }
  deriving (Typeable, PhysicalDeviceMaintenance5Properties
-> PhysicalDeviceMaintenance5Properties -> Bool
(PhysicalDeviceMaintenance5Properties
 -> PhysicalDeviceMaintenance5Properties -> Bool)
-> (PhysicalDeviceMaintenance5Properties
    -> PhysicalDeviceMaintenance5Properties -> Bool)
-> Eq PhysicalDeviceMaintenance5Properties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceMaintenance5Properties
-> PhysicalDeviceMaintenance5Properties -> Bool
== :: PhysicalDeviceMaintenance5Properties
-> PhysicalDeviceMaintenance5Properties -> Bool
$c/= :: PhysicalDeviceMaintenance5Properties
-> PhysicalDeviceMaintenance5Properties -> Bool
/= :: PhysicalDeviceMaintenance5Properties
-> PhysicalDeviceMaintenance5Properties -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceMaintenance5Properties)
#endif
deriving instance Show PhysicalDeviceMaintenance5Properties

instance ToCStruct PhysicalDeviceMaintenance5Properties where
  withCStruct :: forall b.
PhysicalDeviceMaintenance5Properties
-> (Ptr PhysicalDeviceMaintenance5Properties -> IO b) -> IO b
withCStruct PhysicalDeviceMaintenance5Properties
x Ptr PhysicalDeviceMaintenance5Properties -> IO b
f = Int -> (Ptr PhysicalDeviceMaintenance5Properties -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr PhysicalDeviceMaintenance5Properties -> IO b) -> IO b)
-> (Ptr PhysicalDeviceMaintenance5Properties -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceMaintenance5Properties
p -> Ptr PhysicalDeviceMaintenance5Properties
-> PhysicalDeviceMaintenance5Properties -> IO b -> IO b
forall b.
Ptr PhysicalDeviceMaintenance5Properties
-> PhysicalDeviceMaintenance5Properties -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance5Properties
p PhysicalDeviceMaintenance5Properties
x (Ptr PhysicalDeviceMaintenance5Properties -> IO b
f Ptr PhysicalDeviceMaintenance5Properties
p)
  pokeCStruct :: forall b.
Ptr PhysicalDeviceMaintenance5Properties
-> PhysicalDeviceMaintenance5Properties -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceMaintenance5Properties
p PhysicalDeviceMaintenance5Properties{Bool
earlyFragmentMultisampleCoverageAfterSampleCounting :: PhysicalDeviceMaintenance5Properties -> Bool
earlyFragmentSampleMaskTestBeforeSampleCounting :: PhysicalDeviceMaintenance5Properties -> Bool
depthStencilSwizzleOneSupport :: PhysicalDeviceMaintenance5Properties -> Bool
polygonModePointSize :: PhysicalDeviceMaintenance5Properties -> Bool
nonStrictSinglePixelWideLinesUseParallelogram :: PhysicalDeviceMaintenance5Properties -> Bool
nonStrictWideLinesUseParallelogram :: PhysicalDeviceMaintenance5Properties -> Bool
earlyFragmentMultisampleCoverageAfterSampleCounting :: Bool
earlyFragmentSampleMaskTestBeforeSampleCounting :: Bool
depthStencilSwizzleOneSupport :: Bool
polygonModePointSize :: Bool
nonStrictSinglePixelWideLinesUseParallelogram :: Bool
nonStrictWideLinesUseParallelogram :: Bool
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
earlyFragmentMultisampleCoverageAfterSampleCounting))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
earlyFragmentSampleMaskTestBeforeSampleCounting))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
depthStencilSwizzleOneSupport))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
polygonModePointSize))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
nonStrictSinglePixelWideLinesUseParallelogram))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
nonStrictWideLinesUseParallelogram))
    IO b
f
  cStructSize :: Int
cStructSize = Int
40
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PhysicalDeviceMaintenance5Properties -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceMaintenance5Properties
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_5_PROPERTIES)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct PhysicalDeviceMaintenance5Properties where
  peekCStruct :: Ptr PhysicalDeviceMaintenance5Properties
-> IO PhysicalDeviceMaintenance5Properties
peekCStruct Ptr PhysicalDeviceMaintenance5Properties
p = do
    earlyFragmentMultisampleCoverageAfterSampleCounting <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceMaintenance5Properties
p Ptr PhysicalDeviceMaintenance5Properties -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    earlyFragmentSampleMaskTestBeforeSampleCounting <- peek @Bool32 ((p `plusPtr` 20 :: Ptr Bool32))
    depthStencilSwizzleOneSupport <- peek @Bool32 ((p `plusPtr` 24 :: Ptr Bool32))
    polygonModePointSize <- peek @Bool32 ((p `plusPtr` 28 :: Ptr Bool32))
    nonStrictSinglePixelWideLinesUseParallelogram <- peek @Bool32 ((p `plusPtr` 32 :: Ptr Bool32))
    nonStrictWideLinesUseParallelogram <- peek @Bool32 ((p `plusPtr` 36 :: Ptr Bool32))
    pure $ PhysicalDeviceMaintenance5Properties
             (bool32ToBool earlyFragmentMultisampleCoverageAfterSampleCounting)
             (bool32ToBool earlyFragmentSampleMaskTestBeforeSampleCounting)
             (bool32ToBool depthStencilSwizzleOneSupport)
             (bool32ToBool polygonModePointSize)
             (bool32ToBool nonStrictSinglePixelWideLinesUseParallelogram)
             (bool32ToBool nonStrictWideLinesUseParallelogram)

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

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


-- | VkRenderingAreaInfo - Structure describing rendering area granularity
-- query info
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance5 VK_KHR_maintenance5>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.Enums.Format.Format',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getRenderingAreaGranularity', 'getRenderingAreaGranularity'
data RenderingAreaInfo = RenderingAreaInfo
  { -- | @viewMask@ is the viewMask used for rendering.
    RenderingAreaInfo -> Word32
viewMask :: Word32
  , -- | @pColorAttachmentFormats@ is a pointer to an array of
    -- 'Vulkan.Core10.Enums.Format.Format' values defining the format of color
    -- attachments used in the render pass instance.
    RenderingAreaInfo -> Vector Format
colorAttachmentFormats :: Vector Format
  , -- | @depthAttachmentFormat@ is a 'Vulkan.Core10.Enums.Format.Format' value
    -- defining the format of the depth attachment used in the render pass
    -- instance.
    RenderingAreaInfo -> Format
depthAttachmentFormat :: Format
  , -- | @stencilAttachmentFormat@ is a 'Vulkan.Core10.Enums.Format.Format' value
    -- defining the format of the stencil attachment used in the render pass
    -- instance.
    RenderingAreaInfo -> Format
stencilAttachmentFormat :: Format
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (RenderingAreaInfo)
#endif
deriving instance Show RenderingAreaInfo

instance ToCStruct RenderingAreaInfo where
  withCStruct :: forall b.
RenderingAreaInfo -> (Ptr RenderingAreaInfo -> IO b) -> IO b
withCStruct RenderingAreaInfo
x Ptr RenderingAreaInfo -> IO b
f = Int -> (Ptr RenderingAreaInfo -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr RenderingAreaInfo -> IO b) -> IO b)
-> (Ptr RenderingAreaInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr RenderingAreaInfo
p -> Ptr RenderingAreaInfo -> RenderingAreaInfo -> IO b -> IO b
forall b.
Ptr RenderingAreaInfo -> RenderingAreaInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr RenderingAreaInfo
p RenderingAreaInfo
x (Ptr RenderingAreaInfo -> IO b
f Ptr RenderingAreaInfo
p)
  pokeCStruct :: forall b.
Ptr RenderingAreaInfo -> RenderingAreaInfo -> IO b -> IO b
pokeCStruct Ptr RenderingAreaInfo
p RenderingAreaInfo{Word32
Vector Format
Format
viewMask :: RenderingAreaInfo -> Word32
colorAttachmentFormats :: RenderingAreaInfo -> Vector Format
depthAttachmentFormat :: RenderingAreaInfo -> Format
stencilAttachmentFormat :: RenderingAreaInfo -> Format
viewMask :: Word32
colorAttachmentFormats :: Vector Format
depthAttachmentFormat :: Format
stencilAttachmentFormat :: Format
..} 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 RenderingAreaInfo
p Ptr RenderingAreaInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDERING_AREA_INFO)
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAreaInfo
p Ptr RenderingAreaInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAreaInfo
p Ptr RenderingAreaInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
viewMask)
    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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAreaInfo
p Ptr RenderingAreaInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) ((Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Vector Format -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Format -> Int) -> Vector Format -> Int
forall a b. (a -> b) -> a -> b
$ (Vector Format
colorAttachmentFormats)) :: Word32))
    pPColorAttachmentFormats' <- ((Ptr Format -> IO b) -> IO b) -> ContT b IO (Ptr Format)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Format -> IO b) -> IO b) -> ContT b IO (Ptr Format))
-> ((Ptr Format -> IO b) -> IO b) -> ContT b IO (Ptr Format)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Format ((Vector Format -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector Format
colorAttachmentFormats)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
4)
    lift $ Data.Vector.imapM_ (\Int
i Format
e -> Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Format
pPColorAttachmentFormats' Ptr Format -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Format) (Format
e)) (colorAttachmentFormats)
    lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr Format))) (pPColorAttachmentFormats')
    lift $ poke ((p `plusPtr` 32 :: Ptr Format)) (depthAttachmentFormat)
    lift $ poke ((p `plusPtr` 36 :: Ptr Format)) (stencilAttachmentFormat)
    lift $ f
  cStructSize :: Int
cStructSize = Int
40
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr RenderingAreaInfo -> IO b -> IO b
pokeZeroCStruct Ptr RenderingAreaInfo
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAreaInfo
p Ptr RenderingAreaInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_RENDERING_AREA_INFO)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAreaInfo
p Ptr RenderingAreaInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAreaInfo
p Ptr RenderingAreaInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAreaInfo
p Ptr RenderingAreaInfo -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Format)) (Format
forall a. Zero a => a
zero)
    Ptr Format -> Format -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr RenderingAreaInfo
p Ptr RenderingAreaInfo -> Int -> Ptr Format
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Format)) (Format
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct RenderingAreaInfo where
  peekCStruct :: Ptr RenderingAreaInfo -> IO RenderingAreaInfo
peekCStruct Ptr RenderingAreaInfo
p = do
    viewMask <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr RenderingAreaInfo
p Ptr RenderingAreaInfo -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
    colorAttachmentCount <- peek @Word32 ((p `plusPtr` 20 :: Ptr Word32))
    pColorAttachmentFormats <- peek @(Ptr Format) ((p `plusPtr` 24 :: Ptr (Ptr Format)))
    pColorAttachmentFormats' <- generateM (fromIntegral colorAttachmentCount) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @Format ((Ptr Format
pColorAttachmentFormats Ptr Format -> Int -> Ptr Format
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Format)))
    depthAttachmentFormat <- peek @Format ((p `plusPtr` 32 :: Ptr Format))
    stencilAttachmentFormat <- peek @Format ((p `plusPtr` 36 :: Ptr Format))
    pure $ RenderingAreaInfo
             viewMask
             pColorAttachmentFormats'
             depthAttachmentFormat
             stencilAttachmentFormat

instance Zero RenderingAreaInfo where
  zero :: RenderingAreaInfo
zero = Word32 -> Vector Format -> Format -> Format -> RenderingAreaInfo
RenderingAreaInfo
           Word32
forall a. Zero a => a
zero
           Vector Format
forall a. Monoid a => a
mempty
           Format
forall a. Zero a => a
zero
           Format
forall a. Zero a => a
zero


-- | VkImageSubresource2 - Structure specifying an image subresource
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_host_image_copy VK_EXT_host_image_copy>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_image_compression_control VK_EXT_image_compression_control>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance5 VK_KHR_maintenance5>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'DeviceImageSubresourceInfo',
-- 'Vulkan.Core10.SparseResourceMemoryManagement.ImageSubresource',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getImageSubresourceLayout2', 'getImageSubresourceLayout2',
-- 'getImageSubresourceLayout2'
data ImageSubresource2 = ImageSubresource2
  { -- | @imageSubresource@ is a
    -- 'Vulkan.Core10.SparseResourceMemoryManagement.ImageSubresource'
    -- structure.
    --
    -- #VUID-VkImageSubresource2-imageSubresource-parameter# @imageSubresource@
    -- /must/ be a valid
    -- 'Vulkan.Core10.SparseResourceMemoryManagement.ImageSubresource'
    -- structure
    ImageSubresource2 -> ImageSubresource
imageSubresource :: ImageSubresource }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImageSubresource2)
#endif
deriving instance Show ImageSubresource2

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

instance FromCStruct ImageSubresource2 where
  peekCStruct :: Ptr ImageSubresource2 -> IO ImageSubresource2
peekCStruct Ptr ImageSubresource2
p = do
    imageSubresource <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresource ((Ptr ImageSubresource2
p Ptr ImageSubresource2 -> Int -> Ptr ImageSubresource
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageSubresource))
    pure $ ImageSubresource2
             imageSubresource

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

instance Zero ImageSubresource2 where
  zero :: ImageSubresource2
zero = ImageSubresource -> ImageSubresource2
ImageSubresource2
           ImageSubresource
forall a. Zero a => a
zero


-- | VkSubresourceLayout2 - Structure specifying subresource layout
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkSubresourceLayout2-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2'
--
-- -   #VUID-VkSubresourceLayout2-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_image_compression_control.ImageCompressionPropertiesEXT'
--     or
--     'Vulkan.Core14.PromotedStreamingTransfers'.SubresourceHostMemcpySize'
--
-- -   #VUID-VkSubresourceLayout2-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_EXT_host_image_copy VK_EXT_host_image_copy>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_image_compression_control VK_EXT_image_compression_control>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance5 VK_KHR_maintenance5>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'Vulkan.Core10.Image.SubresourceLayout',
-- 'getDeviceImageSubresourceLayout', 'getDeviceImageSubresourceLayout',
-- 'getImageSubresourceLayout2', 'getImageSubresourceLayout2',
-- 'getImageSubresourceLayout2'
data SubresourceLayout2 (es :: [Type]) = SubresourceLayout2
  { -- | @pNext@ is @NULL@ or a pointer to a structure extending this structure.
    forall (es :: [*]). SubresourceLayout2 es -> Chain es
next :: Chain es
  , -- | @subresourceLayout@ is a 'Vulkan.Core10.Image.SubresourceLayout'
    -- structure.
    forall (es :: [*]). SubresourceLayout2 es -> SubresourceLayout
subresourceLayout :: SubresourceLayout
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SubresourceLayout2 (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (SubresourceLayout2 es)

instance Extensible SubresourceLayout2 where
  extensibleTypeName :: String
extensibleTypeName = String
"SubresourceLayout2"
  setNext :: forall (ds :: [*]) (es :: [*]).
SubresourceLayout2 ds -> Chain es -> SubresourceLayout2 es
setNext SubresourceLayout2{Chain ds
SubresourceLayout
next :: forall (es :: [*]). SubresourceLayout2 es -> Chain es
subresourceLayout :: forall (es :: [*]). SubresourceLayout2 es -> SubresourceLayout
next :: Chain ds
subresourceLayout :: SubresourceLayout
..} Chain es
next' = SubresourceLayout2{next :: Chain es
next = Chain es
next', SubresourceLayout
subresourceLayout :: SubresourceLayout
subresourceLayout :: SubresourceLayout
..}
  getNext :: forall (es :: [*]). SubresourceLayout2 es -> Chain es
getNext SubresourceLayout2{Chain es
SubresourceLayout
next :: forall (es :: [*]). SubresourceLayout2 es -> Chain es
subresourceLayout :: forall (es :: [*]). SubresourceLayout2 es -> SubresourceLayout
next :: Chain es
subresourceLayout :: SubresourceLayout
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends SubresourceLayout2 e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends SubresourceLayout2 e => b) -> Maybe b
extends proxy e
_ Extends SubresourceLayout2 e => b
f
    | Just e :~: ImageCompressionPropertiesEXT
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 @ImageCompressionPropertiesEXT = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends SubresourceLayout2 e => b
f
    | Just e :~: SubresourceHostMemcpySize
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 @SubresourceHostMemcpySize = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends SubresourceLayout2 e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss SubresourceLayout2 es
         , PokeChain es ) => ToCStruct (SubresourceLayout2 es) where
  withCStruct :: forall b.
SubresourceLayout2 es
-> (Ptr (SubresourceLayout2 es) -> IO b) -> IO b
withCStruct SubresourceLayout2 es
x Ptr (SubresourceLayout2 es) -> IO b
f = Int -> (Ptr (SubresourceLayout2 es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 ((Ptr (SubresourceLayout2 es) -> IO b) -> IO b)
-> (Ptr (SubresourceLayout2 es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (SubresourceLayout2 es)
p -> Ptr (SubresourceLayout2 es)
-> SubresourceLayout2 es -> IO b -> IO b
forall b.
Ptr (SubresourceLayout2 es)
-> SubresourceLayout2 es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (SubresourceLayout2 es)
p SubresourceLayout2 es
x (Ptr (SubresourceLayout2 es) -> IO b
f Ptr (SubresourceLayout2 es)
p)
  pokeCStruct :: forall b.
Ptr (SubresourceLayout2 es)
-> SubresourceLayout2 es -> IO b -> IO b
pokeCStruct Ptr (SubresourceLayout2 es)
p SubresourceLayout2{Chain es
SubresourceLayout
next :: forall (es :: [*]). SubresourceLayout2 es -> Chain es
subresourceLayout :: forall (es :: [*]). SubresourceLayout2 es -> SubresourceLayout
next :: Chain es
subresourceLayout :: SubresourceLayout
..} 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 (SubresourceLayout2 es)
p Ptr (SubresourceLayout2 es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_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 SubresourceLayout)) (subresourceLayout)
    lift $ f
  cStructSize :: Int
cStructSize = Int
56
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (SubresourceLayout2 es) -> IO b -> IO b
pokeZeroCStruct Ptr (SubresourceLayout2 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 (SubresourceLayout2 es)
p Ptr (SubresourceLayout2 es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_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 SubresourceLayout)) (zero)
    lift $ f

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

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


-- | VkDeviceImageSubresourceInfo - Image creation information for querying
-- subresource layout
--
-- == Valid Usage
--
-- -   #VUID-VkDeviceImageSubresourceInfo-aspectMask-00997# The
--     @aspectMask@ member of @pSubresource@ /must/ only have a single bit
--     set
--
-- -   #VUID-VkDeviceImageSubresourceInfo-mipLevel-01716# The @mipLevel@
--     member of @pSubresource@ /must/ be less than the @mipLevels@
--     specified in @pCreateInfo@
--
-- -   #VUID-VkDeviceImageSubresourceInfo-arrayLayer-01717# The
--     @arrayLayer@ member of @pSubresource@ /must/ be less than the
--     @arrayLayers@ specified in @pCreateInfo@
--
-- -   #VUID-VkDeviceImageSubresourceInfo-format-08886# If @format@ of the
--     @image@ is a color format that is not a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-multiplanar multi-planar format>,
--     and @tiling@ of the @pCreateInfo@ is
--     'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_LINEAR' or
--     'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_OPTIMAL', the
--     @aspectMask@ member of @pSubresource@ /must/ be
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_COLOR_BIT'
--
-- -   #VUID-VkDeviceImageSubresourceInfo-format-04462# If @format@ of the
--     @pCreateInfo@ has a depth component, the @aspectMask@ member of
--     @pSubresource@ /must/ contain
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_DEPTH_BIT'
--
-- -   #VUID-VkDeviceImageSubresourceInfo-format-04463# If @format@ of the
--     @pCreateInfo@ has a stencil component, the @aspectMask@ member of
--     @pSubresource@ /must/ contain
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_STENCIL_BIT'
--
-- -   #VUID-VkDeviceImageSubresourceInfo-format-04464# If @format@ of the
--     @pCreateInfo@ does not contain a stencil or depth component, the
--     @aspectMask@ member of @pSubresource@ /must/ not contain
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_DEPTH_BIT' or
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_STENCIL_BIT'
--
-- -   #VUID-VkDeviceImageSubresourceInfo-tiling-08717# If the @tiling@ of
--     the @pCreateInfo@ is
--     'Vulkan.Core10.Enums.ImageTiling.IMAGE_TILING_LINEAR' and has a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-multiplanar multi-planar format>,
--     then the @aspectMask@ member of @pSubresource@ /must/ be a single
--     valid
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-multiplanar-image-aspect multi-planar aspect mask>
--     bit
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkDeviceImageSubresourceInfo-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DEVICE_IMAGE_SUBRESOURCE_INFO'
--
-- -   #VUID-VkDeviceImageSubresourceInfo-pNext-pNext# @pNext@ /must/ be
--     @NULL@
--
-- -   #VUID-VkDeviceImageSubresourceInfo-pCreateInfo-parameter#
--     @pCreateInfo@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.Image.ImageCreateInfo' structure
--
-- -   #VUID-VkDeviceImageSubresourceInfo-pSubresource-parameter#
--     @pSubresource@ /must/ be a valid pointer to a valid
--     'ImageSubresource2' structure
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_maintenance5 VK_KHR_maintenance5>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VERSION_1_4 VK_VERSION_1_4>,
-- 'Vulkan.Core10.Image.ImageCreateInfo', 'ImageSubresource2',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'getDeviceImageSubresourceLayout', 'getDeviceImageSubresourceLayout'
data DeviceImageSubresourceInfo = DeviceImageSubresourceInfo
  { -- | @pCreateInfo@ is a pointer to a 'Vulkan.Core10.Image.ImageCreateInfo'
    -- structure containing parameters affecting creation of the image to
    -- query.
    DeviceImageSubresourceInfo -> SomeStruct ImageCreateInfo
createInfo :: SomeStruct ImageCreateInfo
  , -- | @pSubresource@ is a pointer to a 'ImageSubresource2' structure selecting
    -- a specific image subresource for the query.
    DeviceImageSubresourceInfo -> ImageSubresource2
subresource :: ImageSubresource2
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DeviceImageSubresourceInfo)
#endif
deriving instance Show DeviceImageSubresourceInfo

instance ToCStruct DeviceImageSubresourceInfo where
  withCStruct :: forall b.
DeviceImageSubresourceInfo
-> (Ptr DeviceImageSubresourceInfo -> IO b) -> IO b
withCStruct DeviceImageSubresourceInfo
x Ptr DeviceImageSubresourceInfo -> IO b
f = Int -> (Ptr DeviceImageSubresourceInfo -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr DeviceImageSubresourceInfo -> IO b) -> IO b)
-> (Ptr DeviceImageSubresourceInfo -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr DeviceImageSubresourceInfo
p -> Ptr DeviceImageSubresourceInfo
-> DeviceImageSubresourceInfo -> IO b -> IO b
forall b.
Ptr DeviceImageSubresourceInfo
-> DeviceImageSubresourceInfo -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceImageSubresourceInfo
p DeviceImageSubresourceInfo
x (Ptr DeviceImageSubresourceInfo -> IO b
f Ptr DeviceImageSubresourceInfo
p)
  pokeCStruct :: forall b.
Ptr DeviceImageSubresourceInfo
-> DeviceImageSubresourceInfo -> IO b -> IO b
pokeCStruct Ptr DeviceImageSubresourceInfo
p DeviceImageSubresourceInfo{ImageSubresource2
SomeStruct ImageCreateInfo
createInfo :: DeviceImageSubresourceInfo -> SomeStruct ImageCreateInfo
subresource :: DeviceImageSubresourceInfo -> ImageSubresource2
createInfo :: SomeStruct ImageCreateInfo
subresource :: ImageSubresource2
..} 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 DeviceImageSubresourceInfo
p Ptr DeviceImageSubresourceInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_IMAGE_SUBRESOURCE_INFO)
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceImageSubresourceInfo
p Ptr DeviceImageSubresourceInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    pCreateInfo'' <- 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 (ImageCreateInfo '[])) (((Ptr (ImageCreateInfo '[]) -> IO b) -> IO b)
 -> ContT b IO (Ptr (ImageCreateInfo '[])))
-> ((Ptr (ImageCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (ImageCreateInfo '[]))
forall a b. (a -> b) -> a -> b
$ \Ptr (ImageCreateInfo '[]) -> 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 @ImageCreateInfo (SomeStruct ImageCreateInfo
createInfo) (Ptr (ImageCreateInfo '[]) -> IO b
cont (Ptr (ImageCreateInfo '[]) -> IO b)
-> (Ptr (ImageCreateInfo es) -> Ptr (ImageCreateInfo '[]))
-> Ptr (ImageCreateInfo es)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (ImageCreateInfo es) -> Ptr (ImageCreateInfo '[])
forall a b. Ptr a -> Ptr b
castPtr)
    lift $ poke ((p `plusPtr` 16 :: Ptr (Ptr (ImageCreateInfo _)))) pCreateInfo''
    pSubresource'' <- ContT $ withCStruct (subresource)
    lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr ImageSubresource2))) pSubresource''
    lift $ f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr DeviceImageSubresourceInfo -> IO b -> IO b
pokeZeroCStruct Ptr DeviceImageSubresourceInfo
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 DeviceImageSubresourceInfo
p Ptr DeviceImageSubresourceInfo -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_IMAGE_SUBRESOURCE_INFO)
    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 (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceImageSubresourceInfo
p Ptr DeviceImageSubresourceInfo -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    pCreateInfo'' <- 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 (ImageCreateInfo '[])) (((Ptr (ImageCreateInfo '[]) -> IO b) -> IO b)
 -> ContT b IO (Ptr (ImageCreateInfo '[])))
-> ((Ptr (ImageCreateInfo '[]) -> IO b) -> IO b)
-> ContT b IO (Ptr (ImageCreateInfo '[]))
forall a b. (a -> b) -> a -> b
$ \Ptr (ImageCreateInfo '[]) -> 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 @ImageCreateInfo ((ImageCreateInfo '[] -> SomeStruct ImageCreateInfo
forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct ImageCreateInfo '[]
forall a. Zero a => a
zero)) (Ptr (ImageCreateInfo '[]) -> IO b
cont (Ptr (ImageCreateInfo '[]) -> IO b)
-> (Ptr (ImageCreateInfo es) -> Ptr (ImageCreateInfo '[]))
-> Ptr (ImageCreateInfo es)
-> IO b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (ImageCreateInfo es) -> Ptr (ImageCreateInfo '[])
forall a b. Ptr a -> Ptr b
castPtr)
    lift $ poke ((p `plusPtr` 16 :: Ptr (Ptr (ImageCreateInfo _)))) pCreateInfo''
    pSubresource'' <- ContT $ withCStruct (zero)
    lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr ImageSubresource2))) pSubresource''
    lift $ f

instance FromCStruct DeviceImageSubresourceInfo where
  peekCStruct :: Ptr DeviceImageSubresourceInfo -> IO DeviceImageSubresourceInfo
peekCStruct Ptr DeviceImageSubresourceInfo
p = do
    pCreateInfo <- Ptr (SomeStruct ImageCreateInfo) -> IO (SomeStruct ImageCreateInfo)
forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (Ptr (SomeStruct ImageCreateInfo)
 -> IO (SomeStruct ImageCreateInfo))
-> (Ptr (ImageCreateInfo (ZonkAny 0))
    -> Ptr (SomeStruct ImageCreateInfo))
-> Ptr (ImageCreateInfo (ZonkAny 0))
-> IO (SomeStruct ImageCreateInfo)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr (ImageCreateInfo (ZonkAny 0))
-> Ptr (SomeStruct ImageCreateInfo)
forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (Ptr (ImageCreateInfo (ZonkAny 0))
 -> IO (SomeStruct ImageCreateInfo))
-> IO (Ptr (ImageCreateInfo (ZonkAny 0)))
-> IO (SomeStruct ImageCreateInfo)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr (Ptr (ImageCreateInfo (ZonkAny 0)))
-> IO (Ptr (ImageCreateInfo (ZonkAny 0)))
forall a. Storable a => Ptr a -> IO a
peek ((Ptr DeviceImageSubresourceInfo
p Ptr DeviceImageSubresourceInfo
-> Int -> Ptr (Ptr (ImageCreateInfo w))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (Ptr (ImageCreateInfo _))))
    pSubresource <- peekCStruct @ImageSubresource2 =<< peek ((p `plusPtr` 24 :: Ptr (Ptr ImageSubresource2)))
    pure $ DeviceImageSubresourceInfo
             pCreateInfo pSubresource

instance Zero DeviceImageSubresourceInfo where
  zero :: DeviceImageSubresourceInfo
zero = SomeStruct ImageCreateInfo
-> ImageSubresource2 -> DeviceImageSubresourceInfo
DeviceImageSubresourceInfo
           (ImageCreateInfo '[] -> SomeStruct ImageCreateInfo
forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct ImageCreateInfo '[]
forall a. Zero a => a
zero)
           ImageSubresource2
forall a. Zero a => a
zero