{-# language CPP #-}
-- | = Name
--
-- VK_KHR_copy_memory_indirect - device extension
--
-- = VK_KHR_copy_memory_indirect
--
-- [__Name String__]
--     @VK_KHR_copy_memory_indirect@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     550
--
-- [__Revision__]
--     1
--
-- [__Ratification Status__]
--     Ratified
--
-- [__Extension and Version Dependencies__]
--         
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_physical_device_properties2 VK_KHR_get_physical_device_properties2>
--          and
--         
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_buffer_device_address VK_KHR_buffer_device_address>
--     or
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.2 Vulkan Version 1.2>
--
-- [__Contact__]
--
--     -   Vikram Kushwaha
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_KHR_copy_memory_indirect] @vkushwaha-nv%0A*Here describe the issue or question you have about the VK_KHR_copy_memory_indirect extension* >
--
-- [__Extension Proposal__]
--     <https://github.com/KhronosGroup/Vulkan-Docs/tree/main/proposals/VK_KHR_copy_memory_indirect.adoc VK_KHR_copy_memory_indirect>
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2025-01-25
--
-- [__Contributors__]
--
--     -   Daniel Koch, NVIDIA
--
--     -   Vikram Kushwaha, NVIDIA
--
--     -   Jeff Bolz, NVIDIA
--
--     -   Christoph Kubisch, NVIDIA
--
--     -   Stuart Smith, AMD
--
--     -   Faith Ekstrand, Collabora
--
--     -   Caterina Shablia, Collabora
--
--     -   Spencer Fricke, LunarG
--
--     -   Matthew Netsch, Qualcomm Technologies, Inc
--
--     -   Mike Blumenkrantz, Valve
--
--     -   Alyssa Rosenzweig, Valve
--
-- == Description
--
-- This extension adds support for performing copies between memory and
-- image regions using indirect parameters that are read by the device from
-- a buffer during execution. This functionality may be useful for
-- performing copies where the copy parameters are not known during the
-- command buffer creation time.
--
-- == New Commands
--
-- -   'cmdCopyMemoryIndirectKHR'
--
-- -   'cmdCopyMemoryToImageIndirectKHR'
--
-- == New Structures
--
-- -   'CopyMemoryIndirectCommandKHR'
--
-- -   'CopyMemoryIndirectInfoKHR'
--
-- -   'CopyMemoryToImageIndirectCommandKHR'
--
-- -   'CopyMemoryToImageIndirectInfoKHR'
--
-- -   'StridedDeviceAddressRangeKHR'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceCopyMemoryIndirectFeaturesKHR'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'PhysicalDeviceCopyMemoryIndirectPropertiesKHR'
--
-- == New Enums
--
-- -   'AddressCopyFlagBitsKHR'
--
-- == New Bitmasks
--
-- -   'AddressCopyFlagsKHR'
--
-- == New Enum Constants
--
-- -   'KHR_COPY_MEMORY_INDIRECT_EXTENSION_NAME'
--
-- -   'KHR_COPY_MEMORY_INDIRECT_SPEC_VERSION'
--
-- -   Extending
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FormatFeatureFlagBits2':
--
--     -   'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_COPY_IMAGE_INDIRECT_DST_BIT_KHR'
--
-- -   Extending
--     'Vulkan.Core13.Enums.PipelineStageFlags2.PipelineStageFlagBits2':
--
--     -   'Vulkan.Core13.Enums.PipelineStageFlags2.PIPELINE_STAGE_2_COPY_INDIRECT_BIT_KHR'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_MEMORY_INDIRECT_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INDIRECT_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_KHR'
--
-- == Version History
--
-- -   Revision 1, 2025-01-25 (Daniel Koch, Vikram Kushwaha)
--
--     -   Initial external release
--
-- == See Also
--
-- No cross-references are available
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#VK_KHR_copy_memory_indirect Vulkan Specification>.
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_KHR_copy_memory_indirect  ( cmdCopyMemoryIndirectKHR
                                                      , cmdCopyMemoryToImageIndirectKHR
                                                      , StridedDeviceAddressRangeKHR(..)
                                                      , CopyMemoryIndirectCommandKHR(..)
                                                      , CopyMemoryIndirectInfoKHR(..)
                                                      , CopyMemoryToImageIndirectCommandKHR(..)
                                                      , CopyMemoryToImageIndirectInfoKHR(..)
                                                      , PhysicalDeviceCopyMemoryIndirectFeaturesKHR(..)
                                                      , PhysicalDeviceCopyMemoryIndirectPropertiesKHR(..)
                                                      , AddressCopyFlagsKHR
                                                      , AddressCopyFlagBitsKHR( ADDRESS_COPY_DEVICE_LOCAL_BIT_KHR
                                                                              , ADDRESS_COPY_SPARSE_BIT_KHR
                                                                              , ADDRESS_COPY_PROTECTED_BIT_KHR
                                                                              , ..
                                                                              )
                                                      , KHR_COPY_MEMORY_INDIRECT_SPEC_VERSION
                                                      , pattern KHR_COPY_MEMORY_INDIRECT_SPEC_VERSION
                                                      , KHR_COPY_MEMORY_INDIRECT_EXTENSION_NAME
                                                      , pattern KHR_COPY_MEMORY_INDIRECT_EXTENSION_NAME
                                                      ) where

import Data.Bits (Bits)
import Data.Bits (FiniteBits)
import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Show (showString)
import Numeric (showHex)
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 Vulkan.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
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.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer(CommandBuffer))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Core10.FundamentalTypes (DeviceAddress)
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyMemoryIndirectKHR))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCopyMemoryToImageIndirectKHR))
import Vulkan.Core10.FundamentalTypes (DeviceSize)
import Vulkan.Core10.FundamentalTypes (Extent3D)
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.Core10.Handles (Image)
import Vulkan.Core10.Enums.ImageLayout (ImageLayout)
import Vulkan.Core10.CommandBufferBuilding (ImageSubresourceLayers)
import Vulkan.Core10.FundamentalTypes (Offset3D)
import Vulkan.Core10.Enums.QueueFlagBits (QueueFlags)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_MEMORY_INDIRECT_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INDIRECT_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_KHR))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdCopyMemoryIndirectKHR
  :: FunPtr (Ptr CommandBuffer_T -> Ptr CopyMemoryIndirectInfoKHR -> IO ()) -> Ptr CommandBuffer_T -> Ptr CopyMemoryIndirectInfoKHR -> IO ()

-- | vkCmdCopyMemoryIndirectKHR - Copy data between memory regions
--
-- = Description
--
-- Each region specified in the memory referenced by
-- @pCopyMemoryIndirectInfo->copyAddressRange@ is copied from the source
-- region to the specified destination region. The results are undefined if
-- any of the source and destination regions overlap in memory.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdCopyMemoryIndirectKHR-indirectMemoryCopy-10935# The
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-indirectMemoryCopy indirectMemoryCopy>
--     feature /must/ be enabled
--
-- -   #VUID-vkCmdCopyMemoryIndirectKHR-commandBuffer-10936# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support at least one of the queue types
--     specified in
--     'PhysicalDeviceCopyMemoryIndirectPropertiesKHR'::@supportedQueues@
--
-- -   #VUID-vkCmdCopyMemoryIndirectKHR-commandBuffer-10937#
--     @commandBuffer@ must not be a protected command buffer
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdCopyMemoryIndirectKHR-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdCopyMemoryIndirectKHR-pCopyMemoryIndirectInfo-parameter#
--     @pCopyMemoryIndirectInfo@ /must/ be a valid pointer to a valid
--     'CopyMemoryIndirectInfoKHR' structure
--
-- -   #VUID-vkCmdCopyMemoryIndirectKHR-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-vkCmdCopyMemoryIndirectKHR-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_COMPUTE_BIT',
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT', or
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_TRANSFER_BIT' operations
--
-- -   #VUID-vkCmdCopyMemoryIndirectKHR-renderpass# This command /must/
--     only be called outside of a render pass instance
--
-- -   #VUID-vkCmdCopyMemoryIndirectKHR-suspended# This command /must/ not
--     be called between suspended render pass instances
--
-- -   #VUID-vkCmdCopyMemoryIndirectKHR-videocoding# This command /must/
--     only be called outside of a video coding scope
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Outside                                                                                                                     | VK_QUEUE_COMPUTE_BIT                                                                                                  | Action                                                                                                                                 |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             | VK_QUEUE_GRAPHICS_BIT                                                                                                 |                                                                                                                                        |
-- |                                                                                                                            |                                                                                                                        |                                                                                                                             | VK_QUEUE_TRANSFER_BIT                                                                                                 |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- == Conditional Rendering
--
-- vkCmdCopyMemoryIndirectKHR 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_copy_memory_indirect VK_KHR_copy_memory_indirect>,
-- 'Vulkan.Core10.Handles.CommandBuffer', 'CopyMemoryIndirectInfoKHR'
cmdCopyMemoryIndirectKHR :: forall io
                          . (MonadIO io)
                         => -- | @commandBuffer@ is the command buffer into which the command will be
                            -- recorded.
                            CommandBuffer
                         -> -- | @pCopyMemoryIndirectInfo@ is a pointer to a 'CopyMemoryIndirectInfoKHR'
                            -- structure containing the copy parameters, including the number of copies
                            -- to execute and a strided array of 'CopyMemoryIndirectCommandKHR'
                            -- structures.
                            CopyMemoryIndirectInfoKHR
                         -> io ()
cmdCopyMemoryIndirectKHR :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer -> CopyMemoryIndirectInfoKHR -> io ()
cmdCopyMemoryIndirectKHR CommandBuffer
commandBuffer
                           CopyMemoryIndirectInfoKHR
copyMemoryIndirectInfo = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdCopyMemoryIndirectKHRPtr :: FunPtr
  (Ptr CommandBuffer_T -> Ptr CopyMemoryIndirectInfoKHR -> IO ())
vkCmdCopyMemoryIndirectKHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T -> Ptr CopyMemoryIndirectInfoKHR -> IO ())
pVkCmdCopyMemoryIndirectKHR (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T -> Ptr CopyMemoryIndirectInfoKHR -> IO ())
vkCmdCopyMemoryIndirectKHRPtr FunPtr
  (Ptr CommandBuffer_T -> Ptr CopyMemoryIndirectInfoKHR -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T -> Ptr CopyMemoryIndirectInfoKHR -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T -> Ptr CopyMemoryIndirectInfoKHR -> 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 vkCmdCopyMemoryIndirectKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdCopyMemoryIndirectKHR' :: Ptr CommandBuffer_T -> Ptr CopyMemoryIndirectInfoKHR -> IO ()
vkCmdCopyMemoryIndirectKHR' = FunPtr
  (Ptr CommandBuffer_T -> Ptr CopyMemoryIndirectInfoKHR -> IO ())
-> Ptr CommandBuffer_T -> Ptr CopyMemoryIndirectInfoKHR -> IO ()
mkVkCmdCopyMemoryIndirectKHR FunPtr
  (Ptr CommandBuffer_T -> Ptr CopyMemoryIndirectInfoKHR -> IO ())
vkCmdCopyMemoryIndirectKHRPtr
  pCopyMemoryIndirectInfo <- ((Ptr CopyMemoryIndirectInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr CopyMemoryIndirectInfoKHR)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr CopyMemoryIndirectInfoKHR -> IO ()) -> IO ())
 -> ContT () IO (Ptr CopyMemoryIndirectInfoKHR))
-> ((Ptr CopyMemoryIndirectInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr CopyMemoryIndirectInfoKHR)
forall a b. (a -> b) -> a -> b
$ CopyMemoryIndirectInfoKHR
-> (Ptr CopyMemoryIndirectInfoKHR -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
CopyMemoryIndirectInfoKHR
-> (Ptr CopyMemoryIndirectInfoKHR -> IO b) -> IO b
withCStruct (CopyMemoryIndirectInfoKHR
copyMemoryIndirectInfo)
  lift $ traceAroundEvent "vkCmdCopyMemoryIndirectKHR" (vkCmdCopyMemoryIndirectKHR'
                                                          (commandBufferHandle (commandBuffer))
                                                          pCopyMemoryIndirectInfo)
  pure $ ()


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

-- | vkCmdCopyMemoryToImageIndirectKHR - Copy data from a memory region to an
-- image object
--
-- = Description
--
-- Each region specified in the memory referenced by
-- @pCopyMemoryToImageIndirectInfo->copyAddressRange@ is copied from the
-- source region to an image region in the destination image. If the
-- destination image is of type
-- 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_3D', the starting slice and
-- number of slices to copy are specified in
-- @pImageSubresources->baseArrayLayer@ and
-- @pImageSubresources->layerCount@ respectively as @imageOffset@ and
-- @imageExtent@ from 'CopyMemoryToImageIndirectCommandKHR' are only
-- available at device execution time. The results are undefined if any of
-- the source and destination regions overlap in memory.
--
-- == Valid Usage
--
-- -   #VUID-vkCmdCopyMemoryToImageIndirectKHR-indirectMemoryToImageCopy-10947#
--     The
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-indirectMemoryToImageCopy indirectMemoryToImageCopy>
--     feature /must/ be enabled
--
-- -   #VUID-vkCmdCopyMemoryToImageIndirectKHR-commandBuffer-10948# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support at least one of the queue types
--     specified in
--     'PhysicalDeviceCopyMemoryIndirectPropertiesKHR'::@supportedQueues@
--
-- -   #VUID-vkCmdCopyMemoryToImageIndirectKHR-commandBuffer-10949#
--     @commandBuffer@ must not be a protected command buffer
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdCopyMemoryToImageIndirectKHR-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdCopyMemoryToImageIndirectKHR-pCopyMemoryToImageIndirectInfo-parameter#
--     @pCopyMemoryToImageIndirectInfo@ /must/ be a valid pointer to a
--     valid 'CopyMemoryToImageIndirectInfoKHR' structure
--
-- -   #VUID-vkCmdCopyMemoryToImageIndirectKHR-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-vkCmdCopyMemoryToImageIndirectKHR-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_COMPUTE_BIT',
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT', or
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_TRANSFER_BIT' operations
--
-- -   #VUID-vkCmdCopyMemoryToImageIndirectKHR-renderpass# This command
--     /must/ only be called outside of a render pass instance
--
-- -   #VUID-vkCmdCopyMemoryToImageIndirectKHR-suspended# This command
--     /must/ not be called between suspended render pass instances
--
-- -   #VUID-vkCmdCopyMemoryToImageIndirectKHR-videocoding# This command
--     /must/ only be called outside of a video coding scope
--
-- == Host Synchronization
--
-- -   Host access to @commandBuffer@ /must/ be externally synchronized
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Outside                                                                                                                | Outside                                                                                                                     | VK_QUEUE_COMPUTE_BIT                                                                                                  | Action                                                                                                                                 |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             | VK_QUEUE_GRAPHICS_BIT                                                                                                 |                                                                                                                                        |
-- |                                                                                                                            |                                                                                                                        |                                                                                                                             | VK_QUEUE_TRANSFER_BIT                                                                                                 |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- == Conditional Rendering
--
-- vkCmdCopyMemoryToImageIndirectKHR 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_copy_memory_indirect VK_KHR_copy_memory_indirect>,
-- 'Vulkan.Core10.Handles.CommandBuffer',
-- 'CopyMemoryToImageIndirectInfoKHR'
cmdCopyMemoryToImageIndirectKHR :: forall io
                                 . (MonadIO io)
                                => -- | @commandBuffer@ is the command buffer into which the command will be
                                   -- recorded.
                                   CommandBuffer
                                -> -- | @pCopyMemoryToImageIndirectInfo@ is a pointer to a
                                   -- 'CopyMemoryToImageIndirectInfoKHR' structure which contains the copy
                                   -- parameters, including the number of copies to execute and a strided
                                   -- array of 'CopyMemoryToImageIndirectCommandKHR' structures.
                                   CopyMemoryToImageIndirectInfoKHR
                                -> io ()
cmdCopyMemoryToImageIndirectKHR :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer -> CopyMemoryToImageIndirectInfoKHR -> io ()
cmdCopyMemoryToImageIndirectKHR CommandBuffer
commandBuffer
                                  CopyMemoryToImageIndirectInfoKHR
copyMemoryToImageIndirectInfo = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdCopyMemoryToImageIndirectKHRPtr :: FunPtr
  (Ptr CommandBuffer_T
   -> Ptr CopyMemoryToImageIndirectInfoKHR -> IO ())
vkCmdCopyMemoryToImageIndirectKHRPtr = DeviceCmds
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr CopyMemoryToImageIndirectInfoKHR -> IO ())
pVkCmdCopyMemoryToImageIndirectKHR (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr CommandBuffer_T
   -> Ptr CopyMemoryToImageIndirectInfoKHR -> IO ())
vkCmdCopyMemoryToImageIndirectKHRPtr FunPtr
  (Ptr CommandBuffer_T
   -> Ptr CopyMemoryToImageIndirectInfoKHR -> IO ())
-> FunPtr
     (Ptr CommandBuffer_T
      -> Ptr CopyMemoryToImageIndirectInfoKHR -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr CommandBuffer_T
   -> Ptr CopyMemoryToImageIndirectInfoKHR -> 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 vkCmdCopyMemoryToImageIndirectKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdCopyMemoryToImageIndirectKHR' :: Ptr CommandBuffer_T
-> Ptr CopyMemoryToImageIndirectInfoKHR -> IO ()
vkCmdCopyMemoryToImageIndirectKHR' = FunPtr
  (Ptr CommandBuffer_T
   -> Ptr CopyMemoryToImageIndirectInfoKHR -> IO ())
-> Ptr CommandBuffer_T
-> Ptr CopyMemoryToImageIndirectInfoKHR
-> IO ()
mkVkCmdCopyMemoryToImageIndirectKHR FunPtr
  (Ptr CommandBuffer_T
   -> Ptr CopyMemoryToImageIndirectInfoKHR -> IO ())
vkCmdCopyMemoryToImageIndirectKHRPtr
  pCopyMemoryToImageIndirectInfo <- ((Ptr CopyMemoryToImageIndirectInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr CopyMemoryToImageIndirectInfoKHR)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr CopyMemoryToImageIndirectInfoKHR -> IO ()) -> IO ())
 -> ContT () IO (Ptr CopyMemoryToImageIndirectInfoKHR))
-> ((Ptr CopyMemoryToImageIndirectInfoKHR -> IO ()) -> IO ())
-> ContT () IO (Ptr CopyMemoryToImageIndirectInfoKHR)
forall a b. (a -> b) -> a -> b
$ CopyMemoryToImageIndirectInfoKHR
-> (Ptr CopyMemoryToImageIndirectInfoKHR -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
CopyMemoryToImageIndirectInfoKHR
-> (Ptr CopyMemoryToImageIndirectInfoKHR -> IO b) -> IO b
withCStruct (CopyMemoryToImageIndirectInfoKHR
copyMemoryToImageIndirectInfo)
  lift $ traceAroundEvent "vkCmdCopyMemoryToImageIndirectKHR" (vkCmdCopyMemoryToImageIndirectKHR'
                                                                 (commandBufferHandle (commandBuffer))
                                                                 pCopyMemoryToImageIndirectInfo)
  pure $ ()


-- | VkStridedDeviceAddressRangeKHR - Structure specifying a device address
-- range with a stride
--
-- == Valid Usage
--
-- -   #VUID-VkStridedDeviceAddressRangeKHR-size-11411# If @size@ is not 0,
--     @address@ /must/ not be 0
--
-- -   #VUID-VkStridedDeviceAddressRangeKHR-address-11365# The sum of
--     @address@ and @size@ /must/ be less than or equal to the sum of an
--     address retrieved from a 'Vulkan.Core10.Handles.Buffer' and the
--     value of 'Vulkan.Core10.Buffer.BufferCreateInfo'::@size@ used to
--     create that 'Vulkan.Core10.Handles.Buffer'
--
-- -   #VUID-VkStridedDeviceAddressRangeKHR-stride-10957# @stride@ /must/
--     be less than or equal to @size@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkStridedDeviceAddressRangeKHR-address-parameter# If @address@
--     is not @0@, @address@ /must/ be a valid
--     'Vulkan.Core10.FundamentalTypes.DeviceAddress' value
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_copy_memory_indirect VK_KHR_copy_memory_indirect>,
-- 'CopyMemoryIndirectInfoKHR', 'CopyMemoryToImageIndirectInfoKHR',
-- 'Vulkan.Core10.FundamentalTypes.DeviceAddress',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize'
data StridedDeviceAddressRangeKHR = StridedDeviceAddressRangeKHR
  { -- | @address@ is a 'Vulkan.Core10.FundamentalTypes.DeviceAddress' specifying
    -- the start of the range.
    StridedDeviceAddressRangeKHR -> DeviceAddress
address :: DeviceAddress
  , -- | @size@ is a 'Vulkan.Core10.FundamentalTypes.DeviceSize' specifying the
    -- size of the range.
    StridedDeviceAddressRangeKHR -> DeviceAddress
size :: DeviceSize
  , -- | @stride@ is a 'Vulkan.Core10.FundamentalTypes.DeviceSize' specifying the
    -- stride of elements over the range.
    StridedDeviceAddressRangeKHR -> DeviceAddress
stride :: DeviceSize
  }
  deriving (Typeable, StridedDeviceAddressRangeKHR
-> StridedDeviceAddressRangeKHR -> Bool
(StridedDeviceAddressRangeKHR
 -> StridedDeviceAddressRangeKHR -> Bool)
-> (StridedDeviceAddressRangeKHR
    -> StridedDeviceAddressRangeKHR -> Bool)
-> Eq StridedDeviceAddressRangeKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StridedDeviceAddressRangeKHR
-> StridedDeviceAddressRangeKHR -> Bool
== :: StridedDeviceAddressRangeKHR
-> StridedDeviceAddressRangeKHR -> Bool
$c/= :: StridedDeviceAddressRangeKHR
-> StridedDeviceAddressRangeKHR -> Bool
/= :: StridedDeviceAddressRangeKHR
-> StridedDeviceAddressRangeKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (StridedDeviceAddressRangeKHR)
#endif
deriving instance Show StridedDeviceAddressRangeKHR

instance ToCStruct StridedDeviceAddressRangeKHR where
  withCStruct :: forall b.
StridedDeviceAddressRangeKHR
-> (Ptr StridedDeviceAddressRangeKHR -> IO b) -> IO b
withCStruct StridedDeviceAddressRangeKHR
x Ptr StridedDeviceAddressRangeKHR -> IO b
f = Int -> (Ptr StridedDeviceAddressRangeKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr StridedDeviceAddressRangeKHR -> IO b) -> IO b)
-> (Ptr StridedDeviceAddressRangeKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr StridedDeviceAddressRangeKHR
p -> Ptr StridedDeviceAddressRangeKHR
-> StridedDeviceAddressRangeKHR -> IO b -> IO b
forall b.
Ptr StridedDeviceAddressRangeKHR
-> StridedDeviceAddressRangeKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr StridedDeviceAddressRangeKHR
p StridedDeviceAddressRangeKHR
x (Ptr StridedDeviceAddressRangeKHR -> IO b
f Ptr StridedDeviceAddressRangeKHR
p)
  pokeCStruct :: forall b.
Ptr StridedDeviceAddressRangeKHR
-> StridedDeviceAddressRangeKHR -> IO b -> IO b
pokeCStruct Ptr StridedDeviceAddressRangeKHR
p StridedDeviceAddressRangeKHR{DeviceAddress
address :: StridedDeviceAddressRangeKHR -> DeviceAddress
size :: StridedDeviceAddressRangeKHR -> DeviceAddress
stride :: StridedDeviceAddressRangeKHR -> DeviceAddress
address :: DeviceAddress
size :: DeviceAddress
stride :: DeviceAddress
..} IO b
f = do
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StridedDeviceAddressRangeKHR
p Ptr StridedDeviceAddressRangeKHR -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceAddress)) (DeviceAddress
address)
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StridedDeviceAddressRangeKHR
p Ptr StridedDeviceAddressRangeKHR -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize)) (DeviceAddress
size)
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StridedDeviceAddressRangeKHR
p Ptr StridedDeviceAddressRangeKHR -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (DeviceAddress
stride)
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr StridedDeviceAddressRangeKHR -> IO b -> IO b
pokeZeroCStruct Ptr StridedDeviceAddressRangeKHR
p IO b
f = do
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StridedDeviceAddressRangeKHR
p Ptr StridedDeviceAddressRangeKHR -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceSize)) (DeviceAddress
forall a. Zero a => a
zero)
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr StridedDeviceAddressRangeKHR
p Ptr StridedDeviceAddressRangeKHR -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (DeviceAddress
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct StridedDeviceAddressRangeKHR where
  peekCStruct :: Ptr StridedDeviceAddressRangeKHR -> IO StridedDeviceAddressRangeKHR
peekCStruct Ptr StridedDeviceAddressRangeKHR
p = do
    address <- forall a. Storable a => Ptr a -> IO a
peek @DeviceAddress ((Ptr StridedDeviceAddressRangeKHR
p Ptr StridedDeviceAddressRangeKHR -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceAddress))
    size <- peek @DeviceSize ((p `plusPtr` 8 :: Ptr DeviceSize))
    stride <- peek @DeviceSize ((p `plusPtr` 16 :: Ptr DeviceSize))
    pure $ StridedDeviceAddressRangeKHR
             address size stride

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

instance Zero StridedDeviceAddressRangeKHR where
  zero :: StridedDeviceAddressRangeKHR
zero = DeviceAddress
-> DeviceAddress -> DeviceAddress -> StridedDeviceAddressRangeKHR
StridedDeviceAddressRangeKHR
           DeviceAddress
forall a. Zero a => a
zero
           DeviceAddress
forall a. Zero a => a
zero
           DeviceAddress
forall a. Zero a => a
zero


-- | VkCopyMemoryIndirectCommandKHR - Structure specifying indirect memory
-- region copy operation
--
-- == Valid Usage
--
-- -   #VUID-VkCopyMemoryIndirectCommandKHR-srcAddress-10958# The
--     @srcAddress@ /must/ be 4 byte aligned
--
-- -   #VUID-VkCopyMemoryIndirectCommandKHR-dstAddress-10959# The
--     @dstAddress@ /must/ be 4 byte aligned
--
-- -   #VUID-VkCopyMemoryIndirectCommandKHR-size-10960# The @size@ /must/
--     be 4 byte aligned
--
-- -   #VUID-VkCopyMemoryIndirectCommandKHR-srcAddress-10961# The memory in
--     range [@srcAddress@, @srcAddress@ + @size@ - 1] /must/ be within the
--     bounds of the memory allocation backing @srcAddress@
--
-- -   #VUID-VkCopyMemoryIndirectCommandKHR-dstAddress-10962# The memory in
--     range [@dstAddress@, @dstAddress@ + @size@ - 1] /must/ be within the
--     bounds of the memory allocation backing @dstAddress@
--
-- -   #VUID-VkCopyMemoryIndirectCommandKHR-srcAddress-12211# The range of
--     memory defined by @srcAddress@ and @size@ /must/ be a device address
--     range allocated to the application from a buffer created with the
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_TRANSFER_SRC_BIT'
--     usage flag set
--
-- -   #VUID-VkCopyMemoryIndirectCommandKHR-dstAddress-12212# The range of
--     memory defined by @dstAddress@ and @size@ /must/ be a device address
--     range allocated to the application from a buffer created with the
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_TRANSFER_DST_BIT'
--     usage flag set
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkCopyMemoryIndirectCommandKHR-srcAddress-parameter#
--     @srcAddress@ /must/ be a valid
--     'Vulkan.Core10.FundamentalTypes.DeviceAddress' value
--
-- -   #VUID-VkCopyMemoryIndirectCommandKHR-dstAddress-parameter#
--     @dstAddress@ /must/ be a valid
--     'Vulkan.Core10.FundamentalTypes.DeviceAddress' value
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_copy_memory_indirect VK_KHR_copy_memory_indirect>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_copy_memory_indirect VK_NV_copy_memory_indirect>,
-- 'Vulkan.Core10.FundamentalTypes.DeviceAddress',
-- 'Vulkan.Core10.FundamentalTypes.DeviceSize'
data CopyMemoryIndirectCommandKHR = CopyMemoryIndirectCommandKHR
  { -- | @srcAddress@ is the starting address of the source device memory to copy
    -- from.
    CopyMemoryIndirectCommandKHR -> DeviceAddress
srcAddress :: DeviceAddress
  , -- | @dstAddress@ is the starting address of the destination device memory to
    -- copy to.
    CopyMemoryIndirectCommandKHR -> DeviceAddress
dstAddress :: DeviceAddress
  , -- | @size@ is the size of the copy in bytes.
    CopyMemoryIndirectCommandKHR -> DeviceAddress
size :: DeviceSize
  }
  deriving (Typeable, CopyMemoryIndirectCommandKHR
-> CopyMemoryIndirectCommandKHR -> Bool
(CopyMemoryIndirectCommandKHR
 -> CopyMemoryIndirectCommandKHR -> Bool)
-> (CopyMemoryIndirectCommandKHR
    -> CopyMemoryIndirectCommandKHR -> Bool)
-> Eq CopyMemoryIndirectCommandKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CopyMemoryIndirectCommandKHR
-> CopyMemoryIndirectCommandKHR -> Bool
== :: CopyMemoryIndirectCommandKHR
-> CopyMemoryIndirectCommandKHR -> Bool
$c/= :: CopyMemoryIndirectCommandKHR
-> CopyMemoryIndirectCommandKHR -> Bool
/= :: CopyMemoryIndirectCommandKHR
-> CopyMemoryIndirectCommandKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CopyMemoryIndirectCommandKHR)
#endif
deriving instance Show CopyMemoryIndirectCommandKHR

instance ToCStruct CopyMemoryIndirectCommandKHR where
  withCStruct :: forall b.
CopyMemoryIndirectCommandKHR
-> (Ptr CopyMemoryIndirectCommandKHR -> IO b) -> IO b
withCStruct CopyMemoryIndirectCommandKHR
x Ptr CopyMemoryIndirectCommandKHR -> IO b
f = Int -> (Ptr CopyMemoryIndirectCommandKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr CopyMemoryIndirectCommandKHR -> IO b) -> IO b)
-> (Ptr CopyMemoryIndirectCommandKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr CopyMemoryIndirectCommandKHR
p -> Ptr CopyMemoryIndirectCommandKHR
-> CopyMemoryIndirectCommandKHR -> IO b -> IO b
forall b.
Ptr CopyMemoryIndirectCommandKHR
-> CopyMemoryIndirectCommandKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CopyMemoryIndirectCommandKHR
p CopyMemoryIndirectCommandKHR
x (Ptr CopyMemoryIndirectCommandKHR -> IO b
f Ptr CopyMemoryIndirectCommandKHR
p)
  pokeCStruct :: forall b.
Ptr CopyMemoryIndirectCommandKHR
-> CopyMemoryIndirectCommandKHR -> IO b -> IO b
pokeCStruct Ptr CopyMemoryIndirectCommandKHR
p CopyMemoryIndirectCommandKHR{DeviceAddress
srcAddress :: CopyMemoryIndirectCommandKHR -> DeviceAddress
dstAddress :: CopyMemoryIndirectCommandKHR -> DeviceAddress
size :: CopyMemoryIndirectCommandKHR -> DeviceAddress
srcAddress :: DeviceAddress
dstAddress :: DeviceAddress
size :: DeviceAddress
..} IO b
f = do
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryIndirectCommandKHR
p Ptr CopyMemoryIndirectCommandKHR -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceAddress)) (DeviceAddress
srcAddress)
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryIndirectCommandKHR
p Ptr CopyMemoryIndirectCommandKHR -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceAddress)) (DeviceAddress
dstAddress)
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryIndirectCommandKHR
p Ptr CopyMemoryIndirectCommandKHR -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (DeviceAddress
size)
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr CopyMemoryIndirectCommandKHR -> IO b -> IO b
pokeZeroCStruct Ptr CopyMemoryIndirectCommandKHR
p IO b
f = do
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryIndirectCommandKHR
p Ptr CopyMemoryIndirectCommandKHR -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceAddress)) (DeviceAddress
forall a. Zero a => a
zero)
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryIndirectCommandKHR
p Ptr CopyMemoryIndirectCommandKHR -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceAddress)) (DeviceAddress
forall a. Zero a => a
zero)
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryIndirectCommandKHR
p Ptr CopyMemoryIndirectCommandKHR -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) (DeviceAddress
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct CopyMemoryIndirectCommandKHR where
  peekCStruct :: Ptr CopyMemoryIndirectCommandKHR -> IO CopyMemoryIndirectCommandKHR
peekCStruct Ptr CopyMemoryIndirectCommandKHR
p = do
    srcAddress <- forall a. Storable a => Ptr a -> IO a
peek @DeviceAddress ((Ptr CopyMemoryIndirectCommandKHR
p Ptr CopyMemoryIndirectCommandKHR -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceAddress))
    dstAddress <- peek @DeviceAddress ((p `plusPtr` 8 :: Ptr DeviceAddress))
    size <- peek @DeviceSize ((p `plusPtr` 16 :: Ptr DeviceSize))
    pure $ CopyMemoryIndirectCommandKHR
             srcAddress dstAddress size

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

instance Zero CopyMemoryIndirectCommandKHR where
  zero :: CopyMemoryIndirectCommandKHR
zero = DeviceAddress
-> DeviceAddress -> DeviceAddress -> CopyMemoryIndirectCommandKHR
CopyMemoryIndirectCommandKHR
           DeviceAddress
forall a. Zero a => a
zero
           DeviceAddress
forall a. Zero a => a
zero
           DeviceAddress
forall a. Zero a => a
zero


-- | VkCopyMemoryIndirectInfoKHR - Parameters describing indirect copy
-- parameters
--
-- == Valid Usage
--
-- -   #VUID-VkCopyMemoryIndirectInfoKHR-srcCopyFlags-10938# If
--     @srcCopyFlags@ contains 'ADDRESS_COPY_SPARSE_BIT_KHR', the source
--     memory regions accessed /must/ be
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#sparsememory bound to memory>
--
-- -   #VUID-VkCopyMemoryIndirectInfoKHR-dstCopyFlags-10939# If
--     @dstCopyFlags@ contains 'ADDRESS_COPY_SPARSE_BIT_KHR', the
--     destination memory regions accessed /must/ be
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#sparsememory bound to memory>
--
-- -   #VUID-VkCopyMemoryIndirectInfoKHR-srcCopyFlags-10940# @srcCopyFlags@
--     /must/ not contain 'ADDRESS_COPY_PROTECTED_BIT_KHR'
--
-- -   #VUID-VkCopyMemoryIndirectInfoKHR-dstCopyFlags-10941# @dstCopyFlags@
--     /must/ not contain 'ADDRESS_COPY_PROTECTED_BIT_KHR'
--
-- -   #VUID-VkCopyMemoryIndirectInfoKHR-copyAddressRange-10942#
--     @copyAddressRange.address@ /must/ be 4 byte aligned
--
-- -   #VUID-VkCopyMemoryIndirectInfoKHR-copyAddressRange-10943#
--     @copyAddressRange.stride@ /must/ be a multiple of @4@ and /must/ be
--     greater than or equal to sizeof('CopyMemoryIndirectCommandKHR')
--
-- -   #VUID-VkCopyMemoryIndirectInfoKHR-copyCount-10944# @copyCount@
--     /must/ be less than or equal to @copyAddressRange.size@ \/
--     @copyAddressRange.stride@
--
-- -   #VUID-VkCopyMemoryIndirectInfoKHR-copyAddressRange-10945# Any of the
--     source or destination memory regions specified in @copyAddressRange@
--     /must/ not overlap with any of the specified destination memory
--     regions
--
-- -   #VUID-VkCopyMemoryIndirectInfoKHR-copyAddressRange-12210#
--     @copyAddressRange@ /must/ be a device address range allocated to the
--     application from a buffer created with the
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_INDIRECT_BUFFER_BIT'
--     usage flag set
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkCopyMemoryIndirectInfoKHR-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_MEMORY_INDIRECT_INFO_KHR'
--
-- -   #VUID-VkCopyMemoryIndirectInfoKHR-pNext-pNext# @pNext@ /must/ be
--     @NULL@
--
-- -   #VUID-VkCopyMemoryIndirectInfoKHR-srcCopyFlags-parameter#
--     @srcCopyFlags@ /must/ be a valid combination of
--     'AddressCopyFlagBitsKHR' values
--
-- -   #VUID-VkCopyMemoryIndirectInfoKHR-dstCopyFlags-parameter#
--     @dstCopyFlags@ /must/ be a valid combination of
--     'AddressCopyFlagBitsKHR' values
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_copy_memory_indirect VK_KHR_copy_memory_indirect>,
-- 'AddressCopyFlagsKHR', 'StridedDeviceAddressRangeKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdCopyMemoryIndirectKHR'
data CopyMemoryIndirectInfoKHR = CopyMemoryIndirectInfoKHR
  { -- | @srcCopyFlags@ is a 'AddressCopyFlagsKHR' value defining the copy flags
    -- for the source address range.
    CopyMemoryIndirectInfoKHR -> AddressCopyFlagsKHR
srcCopyFlags :: AddressCopyFlagsKHR
  , -- | @dstCopyFlags@ is a 'AddressCopyFlagsKHR' value defining the copy flags
    -- for the destination address range.
    CopyMemoryIndirectInfoKHR -> AddressCopyFlagsKHR
dstCopyFlags :: AddressCopyFlagsKHR
  , -- | @copyCount@ is the number of copies to execute, and /can/ be zero.
    CopyMemoryIndirectInfoKHR -> Word32
copyCount :: Word32
  , -- | @copyAddressRange@ is a memory region specifying the copy parameters. It
    -- is laid out as an array of 'CopyMemoryIndirectCommandKHR' structures.
    CopyMemoryIndirectInfoKHR -> StridedDeviceAddressRangeKHR
copyAddressRange :: StridedDeviceAddressRangeKHR
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CopyMemoryIndirectInfoKHR)
#endif
deriving instance Show CopyMemoryIndirectInfoKHR

instance ToCStruct CopyMemoryIndirectInfoKHR where
  withCStruct :: forall b.
CopyMemoryIndirectInfoKHR
-> (Ptr CopyMemoryIndirectInfoKHR -> IO b) -> IO b
withCStruct CopyMemoryIndirectInfoKHR
x Ptr CopyMemoryIndirectInfoKHR -> IO b
f = Int -> (Ptr CopyMemoryIndirectInfoKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 ((Ptr CopyMemoryIndirectInfoKHR -> IO b) -> IO b)
-> (Ptr CopyMemoryIndirectInfoKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr CopyMemoryIndirectInfoKHR
p -> Ptr CopyMemoryIndirectInfoKHR
-> CopyMemoryIndirectInfoKHR -> IO b -> IO b
forall b.
Ptr CopyMemoryIndirectInfoKHR
-> CopyMemoryIndirectInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CopyMemoryIndirectInfoKHR
p CopyMemoryIndirectInfoKHR
x (Ptr CopyMemoryIndirectInfoKHR -> IO b
f Ptr CopyMemoryIndirectInfoKHR
p)
  pokeCStruct :: forall b.
Ptr CopyMemoryIndirectInfoKHR
-> CopyMemoryIndirectInfoKHR -> IO b -> IO b
pokeCStruct Ptr CopyMemoryIndirectInfoKHR
p CopyMemoryIndirectInfoKHR{Word32
StridedDeviceAddressRangeKHR
AddressCopyFlagsKHR
srcCopyFlags :: CopyMemoryIndirectInfoKHR -> AddressCopyFlagsKHR
dstCopyFlags :: CopyMemoryIndirectInfoKHR -> AddressCopyFlagsKHR
copyCount :: CopyMemoryIndirectInfoKHR -> Word32
copyAddressRange :: CopyMemoryIndirectInfoKHR -> StridedDeviceAddressRangeKHR
srcCopyFlags :: AddressCopyFlagsKHR
dstCopyFlags :: AddressCopyFlagsKHR
copyCount :: Word32
copyAddressRange :: StridedDeviceAddressRangeKHR
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryIndirectInfoKHR
p Ptr CopyMemoryIndirectInfoKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_MEMORY_INDIRECT_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryIndirectInfoKHR
p Ptr CopyMemoryIndirectInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryIndirectInfoKHR
p Ptr CopyMemoryIndirectInfoKHR -> Int -> Ptr AddressCopyFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr AddressCopyFlagsKHR)) (AddressCopyFlagsKHR
srcCopyFlags)
    Ptr AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryIndirectInfoKHR
p Ptr CopyMemoryIndirectInfoKHR -> Int -> Ptr AddressCopyFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr AddressCopyFlagsKHR)) (AddressCopyFlagsKHR
dstCopyFlags)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryIndirectInfoKHR
p Ptr CopyMemoryIndirectInfoKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Word32
copyCount)
    Ptr StridedDeviceAddressRangeKHR
-> StridedDeviceAddressRangeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryIndirectInfoKHR
p Ptr CopyMemoryIndirectInfoKHR
-> Int -> Ptr StridedDeviceAddressRangeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr StridedDeviceAddressRangeKHR)) (StridedDeviceAddressRangeKHR
copyAddressRange)
    IO b
f
  cStructSize :: Int
cStructSize = Int
56
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr CopyMemoryIndirectInfoKHR -> IO b -> IO b
pokeZeroCStruct Ptr CopyMemoryIndirectInfoKHR
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryIndirectInfoKHR
p Ptr CopyMemoryIndirectInfoKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_MEMORY_INDIRECT_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryIndirectInfoKHR
p Ptr CopyMemoryIndirectInfoKHR -> 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 CopyMemoryIndirectInfoKHR
p Ptr CopyMemoryIndirectInfoKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr StridedDeviceAddressRangeKHR
-> StridedDeviceAddressRangeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryIndirectInfoKHR
p Ptr CopyMemoryIndirectInfoKHR
-> Int -> Ptr StridedDeviceAddressRangeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr StridedDeviceAddressRangeKHR)) (StridedDeviceAddressRangeKHR
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct CopyMemoryIndirectInfoKHR where
  peekCStruct :: Ptr CopyMemoryIndirectInfoKHR -> IO CopyMemoryIndirectInfoKHR
peekCStruct Ptr CopyMemoryIndirectInfoKHR
p = do
    srcCopyFlags <- forall a. Storable a => Ptr a -> IO a
peek @AddressCopyFlagsKHR ((Ptr CopyMemoryIndirectInfoKHR
p Ptr CopyMemoryIndirectInfoKHR -> Int -> Ptr AddressCopyFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr AddressCopyFlagsKHR))
    dstCopyFlags <- peek @AddressCopyFlagsKHR ((p `plusPtr` 20 :: Ptr AddressCopyFlagsKHR))
    copyCount <- peek @Word32 ((p `plusPtr` 24 :: Ptr Word32))
    copyAddressRange <- peekCStruct @StridedDeviceAddressRangeKHR ((p `plusPtr` 32 :: Ptr StridedDeviceAddressRangeKHR))
    pure $ CopyMemoryIndirectInfoKHR
             srcCopyFlags dstCopyFlags copyCount copyAddressRange

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

instance Zero CopyMemoryIndirectInfoKHR where
  zero :: CopyMemoryIndirectInfoKHR
zero = AddressCopyFlagsKHR
-> AddressCopyFlagsKHR
-> Word32
-> StridedDeviceAddressRangeKHR
-> CopyMemoryIndirectInfoKHR
CopyMemoryIndirectInfoKHR
           AddressCopyFlagsKHR
forall a. Zero a => a
zero
           AddressCopyFlagsKHR
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           StridedDeviceAddressRangeKHR
forall a. Zero a => a
zero


-- | VkCopyMemoryToImageIndirectCommandKHR - Structure specifying indirect
-- memory region to image copy operation
--
-- == Valid Usage
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-srcAddress-10963# The
--     @srcAddress@ /must/ be 4 byte aligned
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-dstImage-12282# If
--     @dstImage@ does not have either a depth\/stencil format or a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>,
--     @srcAddress@ /must/ be a multiple of the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-compatibility-classes texel block size>
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-dstImage-12283# If
--     @dstImage@ has a
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-requiring-sampler-ycbcr-conversion multi-planar format>,
--     @srcAddress@ /must/ be a multiple of the element size of the
--     compatible format for the format and the @aspectMask@ of the
--     @imageSubresource@ as defined in
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-compatible-planes ???>
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-bufferRowLength-10964#
--     @bufferRowLength@ /must/ be @0@, or greater than or equal to the
--     @width@ member of @imageExtent@
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-bufferImageHeight-10965#
--     @bufferImageHeight@ /must/ be @0@, or greater than or equal to the
--     @height@ member of @imageExtent@
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-imageOffset-10966#
--     @imageOffset@ /must/ specify a valid offset in the destination image
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-imageExtent-10967#
--     @imageExtent@ /must/ specify a valid region in the destination image
--     and /can/ be @0@
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-srcAddress-10968# The
--     memory region starting at @srcAddress@ and described by
--     @bufferRowLength@ and @bufferImageHeight@ /must/ not exceed the
--     bounds of the memory allocation backing memory at @srcAddress@
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-imageOffset-10969# The
--     @imageOffset@ and @imageExtent@ members of each region /must/
--     respect the image transfer granularity requirements of
--     @commandBuffer@’s command pool’s queue family, as described in
--     'Vulkan.Core10.DeviceInitialization.QueueFamilyProperties'
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-imageOffset-10970# For
--     each destination region, @imageOffset.x@ and (@imageExtent.width@ +
--     @imageOffset.x@) /must/ both be greater than or equal to @0@ and
--     less than or equal to the width of the specified subresource
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-imageOffset-10971# For
--     each destination region, @imageOffset.y@ and (@imageExtent.height@ +
--     @imageOffset.y@) /must/ both be greater than or equal to @0@ and
--     less than or equal to the height of the specified subresource
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-imageSubresource-12284#
--     The members of @imageSubresource@ /must/ be identical to the members
--     of the 'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers'
--     structure specified in the corresponding index of the
--     @pCopyMemoryToImageIndirectInfo->pImageSubresources@ array of
--     'cmdCopyMemoryToImageIndirectKHR' during command recording
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-dstImage-12285# If
--     @dstImage@ is of type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D',
--     @imageOffset.y@ /must/ be @0@ and @imageExtent.height@ /must/ be @1@
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-dstImage-12286# If
--     @dstImage@ is of type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_1D'
--     or 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_2D', @imageOffset.z@
--     /must/ be @0@ and @imageExtent.depth@ /must/ be @1@
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-srcAddress-12214#
--     @srcAddress@ /must/ be a device address allocated to the application
--     from a buffer created with the
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_TRANSFER_SRC_BIT'
--     usage flag set
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-srcAddress-parameter#
--     @srcAddress@ /must/ be a valid
--     'Vulkan.Core10.FundamentalTypes.DeviceAddress' value
--
-- -   #VUID-VkCopyMemoryToImageIndirectCommandKHR-imageSubresource-parameter#
--     @imageSubresource@ /must/ be a valid
--     'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers'
--     structure
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_copy_memory_indirect VK_KHR_copy_memory_indirect>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_copy_memory_indirect VK_NV_copy_memory_indirect>,
-- 'Vulkan.Core10.FundamentalTypes.DeviceAddress',
-- 'Vulkan.Core10.FundamentalTypes.Extent3D',
-- 'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers',
-- 'Vulkan.Core10.FundamentalTypes.Offset3D'
data CopyMemoryToImageIndirectCommandKHR = CopyMemoryToImageIndirectCommandKHR
  { -- | @srcAddress@ is the starting address of the source device memory to copy
    -- from.
    CopyMemoryToImageIndirectCommandKHR -> DeviceAddress
srcAddress :: DeviceAddress
  , -- | @bufferRowLength@ and @bufferImageHeight@ specify in texels a subregion
    -- of a larger two- or three-dimensional image in buffer memory, and
    -- control the addressing calculations. If either of these values is zero,
    -- that aspect of the buffer memory is considered to be tightly packed
    -- according to the @imageExtent@.
    CopyMemoryToImageIndirectCommandKHR -> Word32
bufferRowLength :: Word32
  , -- No documentation found for Nested "VkCopyMemoryToImageIndirectCommandKHR" "bufferImageHeight"
    CopyMemoryToImageIndirectCommandKHR -> Word32
bufferImageHeight :: Word32
  , -- | @imageSubresource@ is a
    -- 'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers' structure
    -- used to specify the specific image subresources of the image used for
    -- the destination image data, which /must/ match the value specified in
    -- corresponding index of the
    -- @pCopyMemoryToImageIndirectInfo->pImageSubresources@ array of
    -- 'cmdCopyMemoryToImageIndirectKHR' during command recording.
    CopyMemoryToImageIndirectCommandKHR -> ImageSubresourceLayers
imageSubresource :: ImageSubresourceLayers
  , -- | @imageOffset@ selects the initial @x@, @y@, @z@ offsets in texels of the
    -- sub-region of the destination image data.
    CopyMemoryToImageIndirectCommandKHR -> Offset3D
imageOffset :: Offset3D
  , -- | @imageExtent@ is the size in texels of the destination image in @width@,
    -- @height@ and @depth@.
    CopyMemoryToImageIndirectCommandKHR -> Extent3D
imageExtent :: Extent3D
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CopyMemoryToImageIndirectCommandKHR)
#endif
deriving instance Show CopyMemoryToImageIndirectCommandKHR

instance ToCStruct CopyMemoryToImageIndirectCommandKHR where
  withCStruct :: forall b.
CopyMemoryToImageIndirectCommandKHR
-> (Ptr CopyMemoryToImageIndirectCommandKHR -> IO b) -> IO b
withCStruct CopyMemoryToImageIndirectCommandKHR
x Ptr CopyMemoryToImageIndirectCommandKHR -> IO b
f = Int -> (Ptr CopyMemoryToImageIndirectCommandKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 ((Ptr CopyMemoryToImageIndirectCommandKHR -> IO b) -> IO b)
-> (Ptr CopyMemoryToImageIndirectCommandKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr CopyMemoryToImageIndirectCommandKHR
p -> Ptr CopyMemoryToImageIndirectCommandKHR
-> CopyMemoryToImageIndirectCommandKHR -> IO b -> IO b
forall b.
Ptr CopyMemoryToImageIndirectCommandKHR
-> CopyMemoryToImageIndirectCommandKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CopyMemoryToImageIndirectCommandKHR
p CopyMemoryToImageIndirectCommandKHR
x (Ptr CopyMemoryToImageIndirectCommandKHR -> IO b
f Ptr CopyMemoryToImageIndirectCommandKHR
p)
  pokeCStruct :: forall b.
Ptr CopyMemoryToImageIndirectCommandKHR
-> CopyMemoryToImageIndirectCommandKHR -> IO b -> IO b
pokeCStruct Ptr CopyMemoryToImageIndirectCommandKHR
p CopyMemoryToImageIndirectCommandKHR{Word32
DeviceAddress
Offset3D
Extent3D
ImageSubresourceLayers
srcAddress :: CopyMemoryToImageIndirectCommandKHR -> DeviceAddress
bufferRowLength :: CopyMemoryToImageIndirectCommandKHR -> Word32
bufferImageHeight :: CopyMemoryToImageIndirectCommandKHR -> Word32
imageSubresource :: CopyMemoryToImageIndirectCommandKHR -> ImageSubresourceLayers
imageOffset :: CopyMemoryToImageIndirectCommandKHR -> Offset3D
imageExtent :: CopyMemoryToImageIndirectCommandKHR -> Extent3D
srcAddress :: DeviceAddress
bufferRowLength :: Word32
bufferImageHeight :: Word32
imageSubresource :: ImageSubresourceLayers
imageOffset :: Offset3D
imageExtent :: Extent3D
..} IO b
f = do
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectCommandKHR
p Ptr CopyMemoryToImageIndirectCommandKHR -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceAddress)) (DeviceAddress
srcAddress)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectCommandKHR
p Ptr CopyMemoryToImageIndirectCommandKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Word32)) (Word32
bufferRowLength)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectCommandKHR
p Ptr CopyMemoryToImageIndirectCommandKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr Word32)) (Word32
bufferImageHeight)
    Ptr ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectCommandKHR
p Ptr CopyMemoryToImageIndirectCommandKHR
-> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
imageSubresource)
    Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectCommandKHR
p Ptr CopyMemoryToImageIndirectCommandKHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Offset3D)) (Offset3D
imageOffset)
    Ptr Extent3D -> Extent3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectCommandKHR
p Ptr CopyMemoryToImageIndirectCommandKHR -> Int -> Ptr Extent3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Extent3D)) (Extent3D
imageExtent)
    IO b
f
  cStructSize :: Int
cStructSize = Int
56
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr CopyMemoryToImageIndirectCommandKHR -> IO b -> IO b
pokeZeroCStruct Ptr CopyMemoryToImageIndirectCommandKHR
p IO b
f = do
    Ptr DeviceAddress -> DeviceAddress -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectCommandKHR
p Ptr CopyMemoryToImageIndirectCommandKHR -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceAddress)) (DeviceAddress
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectCommandKHR
p Ptr CopyMemoryToImageIndirectCommandKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectCommandKHR
p Ptr CopyMemoryToImageIndirectCommandKHR -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectCommandKHR
p Ptr CopyMemoryToImageIndirectCommandKHR
-> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageSubresourceLayers)) (ImageSubresourceLayers
forall a. Zero a => a
zero)
    Ptr Offset3D -> Offset3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectCommandKHR
p Ptr CopyMemoryToImageIndirectCommandKHR -> Int -> Ptr Offset3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Offset3D)) (Offset3D
forall a. Zero a => a
zero)
    Ptr Extent3D -> Extent3D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectCommandKHR
p Ptr CopyMemoryToImageIndirectCommandKHR -> Int -> Ptr Extent3D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Extent3D)) (Extent3D
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct CopyMemoryToImageIndirectCommandKHR where
  peekCStruct :: Ptr CopyMemoryToImageIndirectCommandKHR
-> IO CopyMemoryToImageIndirectCommandKHR
peekCStruct Ptr CopyMemoryToImageIndirectCommandKHR
p = do
    srcAddress <- forall a. Storable a => Ptr a -> IO a
peek @DeviceAddress ((Ptr CopyMemoryToImageIndirectCommandKHR
p Ptr CopyMemoryToImageIndirectCommandKHR -> Int -> Ptr DeviceAddress
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceAddress))
    bufferRowLength <- peek @Word32 ((p `plusPtr` 8 :: Ptr Word32))
    bufferImageHeight <- peek @Word32 ((p `plusPtr` 12 :: Ptr Word32))
    imageSubresource <- peekCStruct @ImageSubresourceLayers ((p `plusPtr` 16 :: Ptr ImageSubresourceLayers))
    imageOffset <- peekCStruct @Offset3D ((p `plusPtr` 32 :: Ptr Offset3D))
    imageExtent <- peekCStruct @Extent3D ((p `plusPtr` 44 :: Ptr Extent3D))
    pure $ CopyMemoryToImageIndirectCommandKHR
             srcAddress
             bufferRowLength
             bufferImageHeight
             imageSubresource
             imageOffset
             imageExtent

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

instance Zero CopyMemoryToImageIndirectCommandKHR where
  zero :: CopyMemoryToImageIndirectCommandKHR
zero = DeviceAddress
-> Word32
-> Word32
-> ImageSubresourceLayers
-> Offset3D
-> Extent3D
-> CopyMemoryToImageIndirectCommandKHR
CopyMemoryToImageIndirectCommandKHR
           DeviceAddress
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           ImageSubresourceLayers
forall a. Zero a => a
zero
           Offset3D
forall a. Zero a => a
zero
           Extent3D
forall a. Zero a => a
zero


-- | VkCopyMemoryToImageIndirectInfoKHR - Parameters describing indirect
-- image copy parameters
--
-- == Valid Usage
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-srcCopyFlags-10950# If
--     @srcCopyFlags@ contains 'ADDRESS_COPY_SPARSE_BIT_KHR', the source
--     memory regions accessed /must/ be
--     <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#sparsememory bound to memory>
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-copyCount-10951#
--     @copyCount@ /must/ be less than or equal to @copyAddressRange.size@
--     \/ @copyAddressRange.stride@
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-copyAddressRange-10952#
--     @copyAddressRange.address@ /must/ be 4 byte aligned
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-copyAddressRange-10953#
--     @copyAddressRange.stride@ /must/ be a multiple of @4@ and /must/ be
--     greater than or equal to
--     sizeof('CopyMemoryToImageIndirectCommandKHR')
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImage-10955# The format
--     features of @dstImage@ /must/ contain
--     'Vulkan.Core13.Enums.FormatFeatureFlags2.FORMAT_FEATURE_2_COPY_IMAGE_INDIRECT_DST_BIT_KHR'
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-copyAddressRange-12213#
--     @copyAddressRange@ /must/ be a device address range allocated to the
--     application from a buffer created with the
--     'Vulkan.Core10.Enums.BufferUsageFlagBits.BUFFER_USAGE_INDIRECT_BUFFER_BIT'
--     usage flag set
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImage-07661# @dstImage@
--     /must/ not be a protected image
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-aspectMask-07662# The
--     @aspectMask@ member for every subresource in @pImageSubresources@
--     /must/ only have a single bit set
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-aspectMask-12287# The
--     @aspectMask@ member for every subresource in @pImageSubresources@
--     /must/ specify an aspect present in @dstImage@
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImage-07664# @dstImage@
--     /must/ have been created with the
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_TRANSFER_DST_BIT'
--     usage flag set
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImage-07665# If
--     @dstImage@ is non-sparse then the image or each specified /disjoint/
--     plane /must/ be bound completely and contiguously to a single
--     'Vulkan.Core10.Handles.DeviceMemory' object
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImage-07973# @dstImage@
--     /must/ have a sample count equal to
--     'Vulkan.Core10.Enums.SampleCountFlagBits.SAMPLE_COUNT_1_BIT'
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImageLayout-07667#
--     @dstImageLayout@ /must/ specify the layout of the image subresources
--     of @dstImage@ at the time this command is executed on a
--     'Vulkan.Core10.Handles.Device'
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImageLayout-07669#
--     @dstImageLayout@ /must/ be
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL',
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_SHARED_PRESENT_KHR',
--     or 'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_GENERAL'
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-mipLevel-07670# The
--     specified @mipLevel@ of each region in @pImageSubresources@ /must/
--     be less than the @mipLevels@ specified in
--     'Vulkan.Core10.Image.ImageCreateInfo' when @dstImage@ was created
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImage-12288# If
--     @dstImage@ is not of type
--     'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_3D', and the specified
--     @layerCount@ of each region in @pImageSubresources@ is not
--     'Vulkan.Core10.APIConstants.REMAINING_ARRAY_LAYERS', the specified
--     @baseArrayLayer@ + @layerCount@ of each region in
--     @pImageSubresources@ /must/ be less than or equal to the
--     @arrayLayers@ specified in 'Vulkan.Core10.Image.ImageCreateInfo'
--     when @dstImage@ was created
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImage-12289# If
--     @dstImage@ is of type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_3D',
--     and the specified @layerCount@ of each region in
--     @pImageSubresources@ is not
--     'Vulkan.Core10.APIConstants.REMAINING_ARRAY_LAYERS', for each
--     destination region, (@imageSubresource.baseArrayLayer@ +
--     @imageSubresource.layerCount@) /must/ be less than or equal to the
--     depth of the specified subresource
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImage-12290# If
--     @dstImage@ is of type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_3D',
--     and the specified @layerCount@ of each region in
--     @pImageSubresources@ is not
--     'Vulkan.Core10.APIConstants.REMAINING_ARRAY_LAYERS', for each
--     destination region, if (@imageSubresource.baseArrayLayer@ +
--     @imageSubresource.layerCount@) does not equal the depth of the
--     specified subresource, @imageSubresource.layerCount@ /must/ be a
--     multiple of the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-compatibility-classes texel block extent depth>
--     of the 'Vulkan.Core10.Enums.Format.Format' of @dstImage@
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImage-12291# If
--     @dstImage@ is of type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_3D',
--     for each destination region, @imageSubresource.baseArrayLayer@
--     /must/ be a multiple of the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#formats-compatibility-classes texel block extent depth>
--     of the 'Vulkan.Core10.Enums.Format.Format' of @dstImage@
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImage-12292# If
--     @dstImage@ is of type 'Vulkan.Core10.Enums.ImageType.IMAGE_TYPE_3D',
--     for each destination region, @imageSubresource.baseArrayLayer@
--     /must/ be less than or equal to the depth of the specified
--     subresource
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImage-07673# @dstImage@
--     /must/ not have been created with @flags@ containing
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_SUBSAMPLED_BIT_EXT'
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-commandBuffer-07674# If the
--     queue family used to create the 'Vulkan.Core10.Handles.CommandPool'
--     which @commandBuffer@ was allocated from does not support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT', for each
--     region, the @aspectMask@ member of @pImageSubresources@ /must/ not
--     be 'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_DEPTH_BIT'
--     or
--     'Vulkan.Core10.Enums.ImageAspectFlagBits.IMAGE_ASPECT_STENCIL_BIT'
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImage-10974# The format
--     features of @dstImage@ /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_TRANSFER_DST_BIT'
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-copyAddressRange-10975# Any
--     of the source or destination memory regions specified in
--     @copyAddressRange@ /must/ not overlap with any of the specified
--     destination memory regions at the time this command is executed on
--     device
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-sType-sType# @sType@ /must/
--     be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INDIRECT_INFO_KHR'
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-pNext-pNext# @pNext@ /must/
--     be @NULL@
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-srcCopyFlags-parameter#
--     @srcCopyFlags@ /must/ be a valid combination of
--     'AddressCopyFlagBitsKHR' values
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImage-parameter#
--     @dstImage@ /must/ be a valid 'Vulkan.Core10.Handles.Image' handle
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-dstImageLayout-parameter#
--     @dstImageLayout@ /must/ be a valid
--     'Vulkan.Core10.Enums.ImageLayout.ImageLayout' value
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-pImageSubresources-parameter#
--     @pImageSubresources@ /must/ be a valid pointer to an array of
--     @copyCount@ valid
--     'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers'
--     structures
--
-- -   #VUID-VkCopyMemoryToImageIndirectInfoKHR-copyCount-arraylength#
--     @copyCount@ /must/ be greater than @0@
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_copy_memory_indirect VK_KHR_copy_memory_indirect>,
-- 'AddressCopyFlagsKHR', 'Vulkan.Core10.Handles.Image',
-- 'Vulkan.Core10.Enums.ImageLayout.ImageLayout',
-- 'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers',
-- 'StridedDeviceAddressRangeKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdCopyMemoryToImageIndirectKHR'
data CopyMemoryToImageIndirectInfoKHR = CopyMemoryToImageIndirectInfoKHR
  { -- | @srcCopyFlags@ is a 'AddressCopyFlagsKHR' value defining the copy flags
    -- for the source address range.
    CopyMemoryToImageIndirectInfoKHR -> AddressCopyFlagsKHR
srcCopyFlags :: AddressCopyFlagsKHR
  , -- | @copyAddressRange@ is a memory region specifying the copy parameters. It
    -- is laid out as an array of 'CopyMemoryToImageIndirectCommandKHR'
    -- structures.
    CopyMemoryToImageIndirectInfoKHR -> StridedDeviceAddressRangeKHR
copyAddressRange :: StridedDeviceAddressRangeKHR
  , -- | @dstImage@ is the destination image.
    CopyMemoryToImageIndirectInfoKHR -> Image
dstImage :: Image
  , -- | @dstImageLayout@ is the layout of the destination image subresources for
    -- the copy.
    CopyMemoryToImageIndirectInfoKHR -> ImageLayout
dstImageLayout :: ImageLayout
  , -- | @pImageSubresources@ is a pointer to an array of @copyCount@
    -- 'Vulkan.Core10.CommandBufferBuilding.ImageSubresourceLayers' structures,
    -- specifying the image subresources of the destination image data for the
    -- copy operation.
    CopyMemoryToImageIndirectInfoKHR -> Vector ImageSubresourceLayers
imageSubresources :: Vector ImageSubresourceLayers
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CopyMemoryToImageIndirectInfoKHR)
#endif
deriving instance Show CopyMemoryToImageIndirectInfoKHR

instance ToCStruct CopyMemoryToImageIndirectInfoKHR where
  withCStruct :: forall b.
CopyMemoryToImageIndirectInfoKHR
-> (Ptr CopyMemoryToImageIndirectInfoKHR -> IO b) -> IO b
withCStruct CopyMemoryToImageIndirectInfoKHR
x Ptr CopyMemoryToImageIndirectInfoKHR -> IO b
f = Int -> (Ptr CopyMemoryToImageIndirectInfoKHR -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
72 ((Ptr CopyMemoryToImageIndirectInfoKHR -> IO b) -> IO b)
-> (Ptr CopyMemoryToImageIndirectInfoKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr CopyMemoryToImageIndirectInfoKHR
p -> Ptr CopyMemoryToImageIndirectInfoKHR
-> CopyMemoryToImageIndirectInfoKHR -> IO b -> IO b
forall b.
Ptr CopyMemoryToImageIndirectInfoKHR
-> CopyMemoryToImageIndirectInfoKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CopyMemoryToImageIndirectInfoKHR
p CopyMemoryToImageIndirectInfoKHR
x (Ptr CopyMemoryToImageIndirectInfoKHR -> IO b
f Ptr CopyMemoryToImageIndirectInfoKHR
p)
  pokeCStruct :: forall b.
Ptr CopyMemoryToImageIndirectInfoKHR
-> CopyMemoryToImageIndirectInfoKHR -> IO b -> IO b
pokeCStruct Ptr CopyMemoryToImageIndirectInfoKHR
p CopyMemoryToImageIndirectInfoKHR{Vector ImageSubresourceLayers
ImageLayout
StridedDeviceAddressRangeKHR
Image
AddressCopyFlagsKHR
srcCopyFlags :: CopyMemoryToImageIndirectInfoKHR -> AddressCopyFlagsKHR
copyAddressRange :: CopyMemoryToImageIndirectInfoKHR -> StridedDeviceAddressRangeKHR
dstImage :: CopyMemoryToImageIndirectInfoKHR -> Image
dstImageLayout :: CopyMemoryToImageIndirectInfoKHR -> ImageLayout
imageSubresources :: CopyMemoryToImageIndirectInfoKHR -> Vector ImageSubresourceLayers
srcCopyFlags :: AddressCopyFlagsKHR
copyAddressRange :: StridedDeviceAddressRangeKHR
dstImage :: Image
dstImageLayout :: ImageLayout
imageSubresources :: Vector ImageSubresourceLayers
..} 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 CopyMemoryToImageIndirectInfoKHR
p Ptr CopyMemoryToImageIndirectInfoKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INDIRECT_INFO_KHR)
    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 CopyMemoryToImageIndirectInfoKHR
p Ptr CopyMemoryToImageIndirectInfoKHR -> 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 AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectInfoKHR
p Ptr CopyMemoryToImageIndirectInfoKHR
-> Int -> Ptr AddressCopyFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr AddressCopyFlagsKHR)) (AddressCopyFlagsKHR
srcCopyFlags)
    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 CopyMemoryToImageIndirectInfoKHR
p Ptr CopyMemoryToImageIndirectInfoKHR -> 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 ImageSubresourceLayers -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ImageSubresourceLayers -> Int)
-> Vector ImageSubresourceLayers -> Int
forall a b. (a -> b) -> a -> b
$ (Vector ImageSubresourceLayers
imageSubresources)) :: Word32))
    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 StridedDeviceAddressRangeKHR
-> StridedDeviceAddressRangeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectInfoKHR
p Ptr CopyMemoryToImageIndirectInfoKHR
-> Int -> Ptr StridedDeviceAddressRangeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr StridedDeviceAddressRangeKHR)) (StridedDeviceAddressRangeKHR
copyAddressRange)
    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 Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectInfoKHR
p Ptr CopyMemoryToImageIndirectInfoKHR -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Image)) (Image
dstImage)
    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 ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectInfoKHR
p Ptr CopyMemoryToImageIndirectInfoKHR -> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr ImageLayout)) (ImageLayout
dstImageLayout)
    pPImageSubresources' <- ((Ptr ImageSubresourceLayers -> IO b) -> IO b)
-> ContT b IO (Ptr ImageSubresourceLayers)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ImageSubresourceLayers -> IO b) -> IO b)
 -> ContT b IO (Ptr ImageSubresourceLayers))
-> ((Ptr ImageSubresourceLayers -> IO b) -> IO b)
-> ContT b IO (Ptr ImageSubresourceLayers)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @ImageSubresourceLayers ((Vector ImageSubresourceLayers -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector ImageSubresourceLayers
imageSubresources)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
16)
    lift $ Data.Vector.imapM_ (\Int
i ImageSubresourceLayers
e -> Ptr ImageSubresourceLayers -> ImageSubresourceLayers -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr ImageSubresourceLayers
pPImageSubresources' Ptr ImageSubresourceLayers -> Int -> Ptr ImageSubresourceLayers
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ImageSubresourceLayers) (ImageSubresourceLayers
e)) (imageSubresources)
    lift $ poke ((p `plusPtr` 64 :: Ptr (Ptr ImageSubresourceLayers))) (pPImageSubresources')
    lift $ f
  cStructSize :: Int
cStructSize = Int
72
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr CopyMemoryToImageIndirectInfoKHR -> IO b -> IO b
pokeZeroCStruct Ptr CopyMemoryToImageIndirectInfoKHR
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectInfoKHR
p Ptr CopyMemoryToImageIndirectInfoKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INDIRECT_INFO_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectInfoKHR
p Ptr CopyMemoryToImageIndirectInfoKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr StridedDeviceAddressRangeKHR
-> StridedDeviceAddressRangeKHR -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectInfoKHR
p Ptr CopyMemoryToImageIndirectInfoKHR
-> Int -> Ptr StridedDeviceAddressRangeKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr StridedDeviceAddressRangeKHR)) (StridedDeviceAddressRangeKHR
forall a. Zero a => a
zero)
    Ptr Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectInfoKHR
p Ptr CopyMemoryToImageIndirectInfoKHR -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Image)) (Image
forall a. Zero a => a
zero)
    Ptr ImageLayout -> ImageLayout -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CopyMemoryToImageIndirectInfoKHR
p Ptr CopyMemoryToImageIndirectInfoKHR -> Int -> Ptr ImageLayout
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr ImageLayout)) (ImageLayout
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct CopyMemoryToImageIndirectInfoKHR where
  peekCStruct :: Ptr CopyMemoryToImageIndirectInfoKHR
-> IO CopyMemoryToImageIndirectInfoKHR
peekCStruct Ptr CopyMemoryToImageIndirectInfoKHR
p = do
    srcCopyFlags <- forall a. Storable a => Ptr a -> IO a
peek @AddressCopyFlagsKHR ((Ptr CopyMemoryToImageIndirectInfoKHR
p Ptr CopyMemoryToImageIndirectInfoKHR
-> Int -> Ptr AddressCopyFlagsKHR
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr AddressCopyFlagsKHR))
    copyAddressRange <- peekCStruct @StridedDeviceAddressRangeKHR ((p `plusPtr` 24 :: Ptr StridedDeviceAddressRangeKHR))
    dstImage <- peek @Image ((p `plusPtr` 48 :: Ptr Image))
    dstImageLayout <- peek @ImageLayout ((p `plusPtr` 56 :: Ptr ImageLayout))
    copyCount <- peek @Word32 ((p `plusPtr` 20 :: Ptr Word32))
    pImageSubresources <- peek @(Ptr ImageSubresourceLayers) ((p `plusPtr` 64 :: Ptr (Ptr ImageSubresourceLayers)))
    pImageSubresources' <- generateM (fromIntegral copyCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageSubresourceLayers ((Ptr ImageSubresourceLayers
pImageSubresources Ptr ImageSubresourceLayers -> Int -> Ptr ImageSubresourceLayers
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
16 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ImageSubresourceLayers)))
    pure $ CopyMemoryToImageIndirectInfoKHR
             srcCopyFlags
             copyAddressRange
             dstImage
             dstImageLayout
             pImageSubresources'

instance Zero CopyMemoryToImageIndirectInfoKHR where
  zero :: CopyMemoryToImageIndirectInfoKHR
zero = AddressCopyFlagsKHR
-> StridedDeviceAddressRangeKHR
-> Image
-> ImageLayout
-> Vector ImageSubresourceLayers
-> CopyMemoryToImageIndirectInfoKHR
CopyMemoryToImageIndirectInfoKHR
           AddressCopyFlagsKHR
forall a. Zero a => a
zero
           StridedDeviceAddressRangeKHR
forall a. Zero a => a
zero
           Image
forall a. Zero a => a
zero
           ImageLayout
forall a. Zero a => a
zero
           Vector ImageSubresourceLayers
forall a. Monoid a => a
mempty


-- | VkPhysicalDeviceCopyMemoryIndirectFeaturesKHR - Structure describing
-- indirect copy features supported by an implementation
--
-- = Members
--
-- This structure describes the following features:
--
-- = Description
--
-- If the 'PhysicalDeviceCopyMemoryIndirectFeaturesKHR' 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
-- 'PhysicalDeviceCopyMemoryIndirectFeaturesKHR', 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_copy_memory_indirect VK_KHR_copy_memory_indirect>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceCopyMemoryIndirectFeaturesKHR = PhysicalDeviceCopyMemoryIndirectFeaturesKHR
  { -- | #features-indirectMemoryCopy# @indirectMemoryCopy@ indicates whether
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#indirect-copies indirect memory to memory copies>
    -- are supported.
    PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> Bool
indirectMemoryCopy :: Bool
  , -- | #features-indirectMemoryToImageCopy# @indirectMemoryToImageCopy@
    -- indicates whether
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#indirect-copies indirect memory to image copies>
    -- are supported.
    PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> Bool
indirectMemoryToImageCopy :: Bool
  }
  deriving (Typeable, PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> Bool
(PhysicalDeviceCopyMemoryIndirectFeaturesKHR
 -> PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> Bool)
-> (PhysicalDeviceCopyMemoryIndirectFeaturesKHR
    -> PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> Bool)
-> Eq PhysicalDeviceCopyMemoryIndirectFeaturesKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> Bool
== :: PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> Bool
$c/= :: PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> Bool
/= :: PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceCopyMemoryIndirectFeaturesKHR)
#endif
deriving instance Show PhysicalDeviceCopyMemoryIndirectFeaturesKHR

instance ToCStruct PhysicalDeviceCopyMemoryIndirectFeaturesKHR where
  withCStruct :: forall b.
PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> (Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> IO b)
-> IO b
withCStruct PhysicalDeviceCopyMemoryIndirectFeaturesKHR
x Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> IO b
f = Int
-> (Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> IO b) -> IO b)
-> (Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
p -> Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> IO b -> IO b
forall b.
Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
p PhysicalDeviceCopyMemoryIndirectFeaturesKHR
x (Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> IO b
f Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
p)
  pokeCStruct :: forall b.
Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
p PhysicalDeviceCopyMemoryIndirectFeaturesKHR{Bool
indirectMemoryCopy :: PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> Bool
indirectMemoryToImageCopy :: PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> Bool
indirectMemoryCopy :: Bool
indirectMemoryToImageCopy :: Bool
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
p Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
p Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> 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 PhysicalDeviceCopyMemoryIndirectFeaturesKHR
p Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
indirectMemoryCopy))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
p Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
indirectMemoryToImageCopy))
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
p Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
p Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> 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 PhysicalDeviceCopyMemoryIndirectFeaturesKHR
p Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> 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 PhysicalDeviceCopyMemoryIndirectFeaturesKHR
p Ptr PhysicalDeviceCopyMemoryIndirectFeaturesKHR
-> 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))
    IO b
f

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

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

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


-- | VkPhysicalDeviceCopyMemoryIndirectPropertiesKHR - Structure describing
-- supported queues for indirect copy
--
-- = Description
--
-- If the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-indirectMemoryCopy indirectMemoryCopy>
-- or
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#features-indirectMemoryToImageCopy indirectMemoryToImageCopy>
-- feature is supported, @supportedQueues@ /must/ return at least one
-- supported queue type.
--
-- If the 'PhysicalDeviceCopyMemoryIndirectPropertiesKHR' 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_copy_memory_indirect VK_KHR_copy_memory_indirect>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NV_copy_memory_indirect VK_NV_copy_memory_indirect>,
-- 'Vulkan.Core10.Enums.QueueFlagBits.QueueFlags',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceCopyMemoryIndirectPropertiesKHR = PhysicalDeviceCopyMemoryIndirectPropertiesKHR
  { -- | @supportedQueues@ is a bitmask of
    -- 'Vulkan.Core10.Enums.QueueFlagBits.QueueFlagBits' indicating the types
    -- of queues on which
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#indirect-copies indirect copy commands>
    -- are supported. If a queue family supports any of the bits set in
    -- @supportedQueues@, then it /must/ support at least one
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#indirect-copies indirect copy command>.
    PhysicalDeviceCopyMemoryIndirectPropertiesKHR -> QueueFlags
supportedQueues :: QueueFlags }
  deriving (Typeable, PhysicalDeviceCopyMemoryIndirectPropertiesKHR
-> PhysicalDeviceCopyMemoryIndirectPropertiesKHR -> Bool
(PhysicalDeviceCopyMemoryIndirectPropertiesKHR
 -> PhysicalDeviceCopyMemoryIndirectPropertiesKHR -> Bool)
-> (PhysicalDeviceCopyMemoryIndirectPropertiesKHR
    -> PhysicalDeviceCopyMemoryIndirectPropertiesKHR -> Bool)
-> Eq PhysicalDeviceCopyMemoryIndirectPropertiesKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceCopyMemoryIndirectPropertiesKHR
-> PhysicalDeviceCopyMemoryIndirectPropertiesKHR -> Bool
== :: PhysicalDeviceCopyMemoryIndirectPropertiesKHR
-> PhysicalDeviceCopyMemoryIndirectPropertiesKHR -> Bool
$c/= :: PhysicalDeviceCopyMemoryIndirectPropertiesKHR
-> PhysicalDeviceCopyMemoryIndirectPropertiesKHR -> Bool
/= :: PhysicalDeviceCopyMemoryIndirectPropertiesKHR
-> PhysicalDeviceCopyMemoryIndirectPropertiesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceCopyMemoryIndirectPropertiesKHR)
#endif
deriving instance Show PhysicalDeviceCopyMemoryIndirectPropertiesKHR

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

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

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

instance Zero PhysicalDeviceCopyMemoryIndirectPropertiesKHR where
  zero :: PhysicalDeviceCopyMemoryIndirectPropertiesKHR
zero = QueueFlags -> PhysicalDeviceCopyMemoryIndirectPropertiesKHR
PhysicalDeviceCopyMemoryIndirectPropertiesKHR
           QueueFlags
forall a. Zero a => a
zero


type AddressCopyFlagsKHR = AddressCopyFlagBitsKHR

-- | VkAddressCopyFlagBitsKHR - Bitmask specifying address copy parameters
--
-- = Description
--
-- -   'ADDRESS_COPY_DEVICE_LOCAL_BIT_KHR' specifies that the address range
--     is expected to be resident in device local memory. Specifying this
--     value is optional, but /may/ lead to improved performance if set
--     accurately.
--
-- -   'ADDRESS_COPY_PROTECTED_BIT_KHR' specifies that the address range is
--     allocated from protected memory.
--
-- -   'ADDRESS_COPY_SPARSE_BIT_KHR' specifies that the address range may
--     not be fully bound to physical memory when accessed.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_copy_memory_indirect VK_KHR_copy_memory_indirect>,
-- 'AddressCopyFlagsKHR'
newtype AddressCopyFlagBitsKHR = AddressCopyFlagBitsKHR Flags
  deriving newtype (AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool
(AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool)
-> (AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool)
-> Eq AddressCopyFlagsKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool
== :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool
$c/= :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool
/= :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool
Eq, Eq AddressCopyFlagsKHR
Eq AddressCopyFlagsKHR =>
(AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Ordering)
-> (AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool)
-> (AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool)
-> (AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool)
-> (AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool)
-> (AddressCopyFlagsKHR
    -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR)
-> (AddressCopyFlagsKHR
    -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR)
-> Ord AddressCopyFlagsKHR
AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool
AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Ordering
AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Ordering
compare :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Ordering
$c< :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool
< :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool
$c<= :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool
<= :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool
$c> :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool
> :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool
$c>= :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool
>= :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> Bool
$cmax :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR
max :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR
$cmin :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR
min :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR
Ord, Ptr AddressCopyFlagsKHR -> IO AddressCopyFlagsKHR
Ptr AddressCopyFlagsKHR -> Int -> IO AddressCopyFlagsKHR
Ptr AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR -> IO ()
Ptr AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> IO ()
AddressCopyFlagsKHR -> Int
(AddressCopyFlagsKHR -> Int)
-> (AddressCopyFlagsKHR -> Int)
-> (Ptr AddressCopyFlagsKHR -> Int -> IO AddressCopyFlagsKHR)
-> (Ptr AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR -> IO ())
-> (forall b. Ptr b -> Int -> IO AddressCopyFlagsKHR)
-> (forall b. Ptr b -> Int -> AddressCopyFlagsKHR -> IO ())
-> (Ptr AddressCopyFlagsKHR -> IO AddressCopyFlagsKHR)
-> (Ptr AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> IO ())
-> Storable AddressCopyFlagsKHR
forall b. Ptr b -> Int -> IO AddressCopyFlagsKHR
forall b. Ptr b -> Int -> AddressCopyFlagsKHR -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
$csizeOf :: AddressCopyFlagsKHR -> Int
sizeOf :: AddressCopyFlagsKHR -> Int
$calignment :: AddressCopyFlagsKHR -> Int
alignment :: AddressCopyFlagsKHR -> Int
$cpeekElemOff :: Ptr AddressCopyFlagsKHR -> Int -> IO AddressCopyFlagsKHR
peekElemOff :: Ptr AddressCopyFlagsKHR -> Int -> IO AddressCopyFlagsKHR
$cpokeElemOff :: Ptr AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR -> IO ()
pokeElemOff :: Ptr AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR -> IO ()
$cpeekByteOff :: forall b. Ptr b -> Int -> IO AddressCopyFlagsKHR
peekByteOff :: forall b. Ptr b -> Int -> IO AddressCopyFlagsKHR
$cpokeByteOff :: forall b. Ptr b -> Int -> AddressCopyFlagsKHR -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> AddressCopyFlagsKHR -> IO ()
$cpeek :: Ptr AddressCopyFlagsKHR -> IO AddressCopyFlagsKHR
peek :: Ptr AddressCopyFlagsKHR -> IO AddressCopyFlagsKHR
$cpoke :: Ptr AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> IO ()
poke :: Ptr AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> IO ()
Storable, AddressCopyFlagsKHR
AddressCopyFlagsKHR -> Zero AddressCopyFlagsKHR
forall a. a -> Zero a
$czero :: AddressCopyFlagsKHR
zero :: AddressCopyFlagsKHR
Zero, Eq AddressCopyFlagsKHR
AddressCopyFlagsKHR
Eq AddressCopyFlagsKHR =>
(AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR)
-> (AddressCopyFlagsKHR
    -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR)
-> (AddressCopyFlagsKHR
    -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR)
-> (AddressCopyFlagsKHR -> AddressCopyFlagsKHR)
-> (AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR)
-> (AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR)
-> AddressCopyFlagsKHR
-> (Int -> AddressCopyFlagsKHR)
-> (AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR)
-> (AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR)
-> (AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR)
-> (AddressCopyFlagsKHR -> Int -> Bool)
-> (AddressCopyFlagsKHR -> Maybe Int)
-> (AddressCopyFlagsKHR -> Int)
-> (AddressCopyFlagsKHR -> Bool)
-> (AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR)
-> (AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR)
-> (AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR)
-> (AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR)
-> (AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR)
-> (AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR)
-> (AddressCopyFlagsKHR -> Int)
-> Bits AddressCopyFlagsKHR
Int -> AddressCopyFlagsKHR
AddressCopyFlagsKHR -> Bool
AddressCopyFlagsKHR -> Int
AddressCopyFlagsKHR -> Maybe Int
AddressCopyFlagsKHR -> AddressCopyFlagsKHR
AddressCopyFlagsKHR -> Int -> Bool
AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR
forall a.
Eq a =>
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
$c.&. :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR
.&. :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR
$c.|. :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR
.|. :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR
$cxor :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR
xor :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR -> AddressCopyFlagsKHR
$ccomplement :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR
complement :: AddressCopyFlagsKHR -> AddressCopyFlagsKHR
$cshift :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
shift :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
$crotate :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
rotate :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
$czeroBits :: AddressCopyFlagsKHR
zeroBits :: AddressCopyFlagsKHR
$cbit :: Int -> AddressCopyFlagsKHR
bit :: Int -> AddressCopyFlagsKHR
$csetBit :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
setBit :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
$cclearBit :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
clearBit :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
$ccomplementBit :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
complementBit :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
$ctestBit :: AddressCopyFlagsKHR -> Int -> Bool
testBit :: AddressCopyFlagsKHR -> Int -> Bool
$cbitSizeMaybe :: AddressCopyFlagsKHR -> Maybe Int
bitSizeMaybe :: AddressCopyFlagsKHR -> Maybe Int
$cbitSize :: AddressCopyFlagsKHR -> Int
bitSize :: AddressCopyFlagsKHR -> Int
$cisSigned :: AddressCopyFlagsKHR -> Bool
isSigned :: AddressCopyFlagsKHR -> Bool
$cshiftL :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
shiftL :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
$cunsafeShiftL :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
unsafeShiftL :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
$cshiftR :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
shiftR :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
$cunsafeShiftR :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
unsafeShiftR :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
$crotateL :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
rotateL :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
$crotateR :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
rotateR :: AddressCopyFlagsKHR -> Int -> AddressCopyFlagsKHR
$cpopCount :: AddressCopyFlagsKHR -> Int
popCount :: AddressCopyFlagsKHR -> Int
Bits, Bits AddressCopyFlagsKHR
Bits AddressCopyFlagsKHR =>
(AddressCopyFlagsKHR -> Int)
-> (AddressCopyFlagsKHR -> Int)
-> (AddressCopyFlagsKHR -> Int)
-> FiniteBits AddressCopyFlagsKHR
AddressCopyFlagsKHR -> Int
forall b.
Bits b =>
(b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
$cfiniteBitSize :: AddressCopyFlagsKHR -> Int
finiteBitSize :: AddressCopyFlagsKHR -> Int
$ccountLeadingZeros :: AddressCopyFlagsKHR -> Int
countLeadingZeros :: AddressCopyFlagsKHR -> Int
$ccountTrailingZeros :: AddressCopyFlagsKHR -> Int
countTrailingZeros :: AddressCopyFlagsKHR -> Int
FiniteBits)

-- No documentation found for Nested "VkAddressCopyFlagBitsKHR" "VK_ADDRESS_COPY_DEVICE_LOCAL_BIT_KHR"
pattern $mADDRESS_COPY_DEVICE_LOCAL_BIT_KHR :: forall {r}.
AddressCopyFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bADDRESS_COPY_DEVICE_LOCAL_BIT_KHR :: AddressCopyFlagsKHR
ADDRESS_COPY_DEVICE_LOCAL_BIT_KHR = AddressCopyFlagBitsKHR 0x00000001

-- No documentation found for Nested "VkAddressCopyFlagBitsKHR" "VK_ADDRESS_COPY_SPARSE_BIT_KHR"
pattern $mADDRESS_COPY_SPARSE_BIT_KHR :: forall {r}.
AddressCopyFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bADDRESS_COPY_SPARSE_BIT_KHR :: AddressCopyFlagsKHR
ADDRESS_COPY_SPARSE_BIT_KHR = AddressCopyFlagBitsKHR 0x00000002

-- No documentation found for Nested "VkAddressCopyFlagBitsKHR" "VK_ADDRESS_COPY_PROTECTED_BIT_KHR"
pattern $mADDRESS_COPY_PROTECTED_BIT_KHR :: forall {r}.
AddressCopyFlagsKHR -> ((# #) -> r) -> ((# #) -> r) -> r
$bADDRESS_COPY_PROTECTED_BIT_KHR :: AddressCopyFlagsKHR
ADDRESS_COPY_PROTECTED_BIT_KHR = AddressCopyFlagBitsKHR 0x00000004

conNameAddressCopyFlagBitsKHR :: String
conNameAddressCopyFlagBitsKHR :: String
conNameAddressCopyFlagBitsKHR = String
"AddressCopyFlagBitsKHR"

enumPrefixAddressCopyFlagBitsKHR :: String
enumPrefixAddressCopyFlagBitsKHR :: String
enumPrefixAddressCopyFlagBitsKHR = String
"ADDRESS_COPY_"

showTableAddressCopyFlagBitsKHR :: [(AddressCopyFlagBitsKHR, String)]
showTableAddressCopyFlagBitsKHR :: [(AddressCopyFlagsKHR, String)]
showTableAddressCopyFlagBitsKHR =
  [
    ( AddressCopyFlagsKHR
ADDRESS_COPY_DEVICE_LOCAL_BIT_KHR
    , String
"DEVICE_LOCAL_BIT_KHR"
    )
  ,
    ( AddressCopyFlagsKHR
ADDRESS_COPY_SPARSE_BIT_KHR
    , String
"SPARSE_BIT_KHR"
    )
  ,
    ( AddressCopyFlagsKHR
ADDRESS_COPY_PROTECTED_BIT_KHR
    , String
"PROTECTED_BIT_KHR"
    )
  ]

instance Show AddressCopyFlagBitsKHR where
  showsPrec :: Int -> AddressCopyFlagsKHR -> ShowS
showsPrec =
    String
-> [(AddressCopyFlagsKHR, String)]
-> String
-> (AddressCopyFlagsKHR -> Word32)
-> (Word32 -> ShowS)
-> Int
-> AddressCopyFlagsKHR
-> ShowS
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixAddressCopyFlagBitsKHR
      [(AddressCopyFlagsKHR, String)]
showTableAddressCopyFlagBitsKHR
      String
conNameAddressCopyFlagBitsKHR
      (\(AddressCopyFlagBitsKHR Word32
x) -> Word32
x)
      (\Word32
x -> String -> ShowS
showString String
"0x" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word32 -> ShowS
forall a. Integral a => a -> ShowS
showHex Word32
x)

instance Read AddressCopyFlagBitsKHR where
  readPrec :: ReadPrec AddressCopyFlagsKHR
readPrec =
    String
-> [(AddressCopyFlagsKHR, String)]
-> String
-> (Word32 -> AddressCopyFlagsKHR)
-> ReadPrec AddressCopyFlagsKHR
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixAddressCopyFlagBitsKHR
      [(AddressCopyFlagsKHR, String)]
showTableAddressCopyFlagBitsKHR
      String
conNameAddressCopyFlagBitsKHR
      Word32 -> AddressCopyFlagsKHR
AddressCopyFlagBitsKHR

type KHR_COPY_MEMORY_INDIRECT_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_KHR_COPY_MEMORY_INDIRECT_SPEC_VERSION"
pattern KHR_COPY_MEMORY_INDIRECT_SPEC_VERSION :: forall a . Integral a => a
pattern $mKHR_COPY_MEMORY_INDIRECT_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bKHR_COPY_MEMORY_INDIRECT_SPEC_VERSION :: forall a. Integral a => a
KHR_COPY_MEMORY_INDIRECT_SPEC_VERSION = 1


type KHR_COPY_MEMORY_INDIRECT_EXTENSION_NAME = "VK_KHR_copy_memory_indirect"

-- No documentation found for TopLevel "VK_KHR_COPY_MEMORY_INDIRECT_EXTENSION_NAME"
pattern KHR_COPY_MEMORY_INDIRECT_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mKHR_COPY_MEMORY_INDIRECT_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bKHR_COPY_MEMORY_INDIRECT_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
KHR_COPY_MEMORY_INDIRECT_EXTENSION_NAME = "VK_KHR_copy_memory_indirect"