{-# language CPP #-}
-- | = Name
--
-- VK_FUCHSIA_buffer_collection - device extension
--
-- == VK_FUCHSIA_buffer_collection
--
-- [__Name String__]
--     @VK_FUCHSIA_buffer_collection@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     367
--
-- [__Revision__]
--     2
--
-- [__Ratification Status__]
--     Not ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_external_memory VK_FUCHSIA_external_memory>
--     and
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_sampler_ycbcr_conversion VK_KHR_sampler_ycbcr_conversion>
--
-- [__Contact__]
--
--     -   John Rosasco
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_FUCHSIA_buffer_collection] @rosasco%0A*Here describe the issue or question you have about the VK_FUCHSIA_buffer_collection extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2021-09-23
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Craig Stout, Google
--
--     -   John Bauman, Google
--
--     -   John Rosasco, Google
--
-- == Description
--
-- A buffer collection is a collection of one or more buffers which were
-- allocated together as a group and which all have the same properties.
-- These properties describe the buffers\' internal representation such as
-- its dimensions and memory layout. This ensures that all of the buffers
-- can be used interchangeably by tasks that require swapping among
-- multiple buffers, such as double-buffered graphics rendering.
--
-- By sharing such a collection of buffers between components,
-- communication about buffer lifecycle can be made much simpler and more
-- efficient. For example, when a content producer finishes writing to a
-- buffer, it can message the consumer of the buffer with the buffer index,
-- rather than passing a handle to the shared memory.
--
-- On Fuchsia, the Sysmem service uses buffer collections as a core
-- construct in its design. VK_FUCHSIA_buffer_collection is the Vulkan
-- extension that allows Vulkan applications to interoperate with the
-- Sysmem service on Fuchsia.
--
-- == New Object Types
--
-- -   'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA'
--
-- == New Commands
--
-- -   'createBufferCollectionFUCHSIA'
--
-- -   'destroyBufferCollectionFUCHSIA'
--
-- -   'getBufferCollectionPropertiesFUCHSIA'
--
-- -   'setBufferCollectionBufferConstraintsFUCHSIA'
--
-- -   'setBufferCollectionImageConstraintsFUCHSIA'
--
-- == New Structures
--
-- -   'BufferCollectionConstraintsInfoFUCHSIA'
--
-- -   'BufferCollectionCreateInfoFUCHSIA'
--
-- -   'BufferCollectionPropertiesFUCHSIA'
--
-- -   'BufferConstraintsInfoFUCHSIA'
--
-- -   'ImageConstraintsInfoFUCHSIA'
--
-- -   'ImageFormatConstraintsInfoFUCHSIA'
--
-- -   'SysmemColorSpaceFUCHSIA'
--
-- -   Extending 'Vulkan.Core10.Buffer.BufferCreateInfo':
--
--     -   'BufferCollectionBufferCreateInfoFUCHSIA'
--
-- -   Extending 'Vulkan.Core10.Image.ImageCreateInfo':
--
--     -   'BufferCollectionImageCreateInfoFUCHSIA'
--
-- -   Extending 'Vulkan.Core10.Memory.MemoryAllocateInfo':
--
--     -   'ImportMemoryBufferCollectionFUCHSIA'
--
-- == New Enums
--
-- -   'ImageConstraintsInfoFlagBitsFUCHSIA'
--
-- == New Bitmasks
--
-- -   'ImageConstraintsInfoFlagsFUCHSIA'
--
-- -   'ImageFormatConstraintsFlagsFUCHSIA'
--
-- == New Enum Constants
--
-- -   'FUCHSIA_BUFFER_COLLECTION_EXTENSION_NAME'
--
-- -   'FUCHSIA_BUFFER_COLLECTION_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.ObjectType.ObjectType':
--
--     -   'Vulkan.Core10.Enums.ObjectType.OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SYSMEM_COLOR_SPACE_FUCHSIA'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_debug_report VK_EXT_debug_report>
-- is supported:
--
-- -   Extending
--     'Vulkan.Extensions.VK_EXT_debug_report.DebugReportObjectTypeEXT':
--
--     -   'Vulkan.Extensions.VK_EXT_debug_report.DEBUG_REPORT_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA_EXT'
--
-- == Issues
--
-- 1) When configuring a 'ImageConstraintsInfoFUCHSIA' structure for
-- constraint setting, should a NULL @pFormatConstraints@ parameter be
-- allowed ?
--
-- __RESOLVED__: No. Specifying a NULL @pFormatConstraints@ results in
-- logical complexity of interpreting the relationship between the
-- 'Vulkan.Core10.Image.ImageCreateInfo'::@usage@ settings of the elements
-- of the @pImageCreateInfos@ array and the implied or desired
-- 'Vulkan.Core10.Enums.FormatFeatureFlagBits.FormatFeatureFlags'.
--
-- The explicit requirement for @pFormatConstraints@ to be non-NULL
-- simplifies the implied logic of the implementation and expectations for
-- the Vulkan application.
--
-- == Version History
--
-- -   Revision 2, 2021-09-23 (John Rosasco)
--
--     -   Review passes
--
-- -   Revision 1, 2021-03-09 (John Rosasco)
--
--     -   Initial revision
--
-- == See Also
--
-- 'BufferCollectionBufferCreateInfoFUCHSIA',
-- 'BufferCollectionConstraintsInfoFUCHSIA',
-- 'BufferCollectionCreateInfoFUCHSIA',
-- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA',
-- 'BufferCollectionImageCreateInfoFUCHSIA',
-- 'BufferCollectionPropertiesFUCHSIA', 'BufferConstraintsInfoFUCHSIA',
-- 'ImageConstraintsInfoFUCHSIA', 'ImageConstraintsInfoFlagBitsFUCHSIA',
-- 'ImageConstraintsInfoFlagsFUCHSIA',
-- 'ImageFormatConstraintsFlagsFUCHSIA',
-- 'ImageFormatConstraintsInfoFUCHSIA',
-- 'ImportMemoryBufferCollectionFUCHSIA', 'SysmemColorSpaceFUCHSIA',
-- 'createBufferCollectionFUCHSIA', 'destroyBufferCollectionFUCHSIA',
-- 'getBufferCollectionPropertiesFUCHSIA',
-- 'setBufferCollectionBufferConstraintsFUCHSIA',
-- 'setBufferCollectionImageConstraintsFUCHSIA'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_FUCHSIA_buffer_collection  ( createBufferCollectionFUCHSIA
                                                       , withBufferCollectionFUCHSIA
                                                       , setBufferCollectionBufferConstraintsFUCHSIA
                                                       , setBufferCollectionImageConstraintsFUCHSIA
                                                       , destroyBufferCollectionFUCHSIA
                                                       , getBufferCollectionPropertiesFUCHSIA
                                                       , ImportMemoryBufferCollectionFUCHSIA(..)
                                                       , BufferCollectionImageCreateInfoFUCHSIA(..)
                                                       , BufferCollectionBufferCreateInfoFUCHSIA(..)
                                                       , BufferCollectionCreateInfoFUCHSIA(..)
                                                       , BufferCollectionPropertiesFUCHSIA(..)
                                                       , BufferConstraintsInfoFUCHSIA(..)
                                                       , SysmemColorSpaceFUCHSIA(..)
                                                       , ImageFormatConstraintsInfoFUCHSIA(..)
                                                       , ImageConstraintsInfoFUCHSIA(..)
                                                       , BufferCollectionConstraintsInfoFUCHSIA(..)
                                                       , ImageFormatConstraintsFlagsFUCHSIA(..)
                                                       , ImageConstraintsInfoFlagsFUCHSIA
                                                       , ImageConstraintsInfoFlagBitsFUCHSIA( IMAGE_CONSTRAINTS_INFO_CPU_READ_RARELY_FUCHSIA
                                                                                            , IMAGE_CONSTRAINTS_INFO_CPU_READ_OFTEN_FUCHSIA
                                                                                            , IMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA
                                                                                            , IMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA
                                                                                            , IMAGE_CONSTRAINTS_INFO_PROTECTED_OPTIONAL_FUCHSIA
                                                                                            , ..
                                                                                            )
                                                       , FUCHSIA_BUFFER_COLLECTION_SPEC_VERSION
                                                       , pattern FUCHSIA_BUFFER_COLLECTION_SPEC_VERSION
                                                       , FUCHSIA_BUFFER_COLLECTION_EXTENSION_NAME
                                                       , pattern FUCHSIA_BUFFER_COLLECTION_EXTENSION_NAME
                                                       , BufferCollectionFUCHSIA(..)
                                                       , DebugReportObjectTypeEXT(..)
                                                       , Zx_handle_t
                                                       ) 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.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.Base (when)
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.Word (Word64)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.CStruct.Extends (peekSomeCStruct)
import Vulkan.CStruct.Extends (pokeSomeCStruct)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Extensions.Handles (BufferCollectionFUCHSIA)
import Vulkan.Extensions.Handles (BufferCollectionFUCHSIA(..))
import Vulkan.Core10.Buffer (BufferCreateInfo)
import Vulkan.Core11.Enums.ChromaLocation (ChromaLocation)
import Vulkan.Core10.ImageView (ComponentMapping)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkCreateBufferCollectionFUCHSIA))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyBufferCollectionFUCHSIA))
import Vulkan.Dynamic (DeviceCmds(pVkGetBufferCollectionPropertiesFUCHSIA))
import Vulkan.Dynamic (DeviceCmds(pVkSetBufferCollectionBufferConstraintsFUCHSIA))
import Vulkan.Dynamic (DeviceCmds(pVkSetBufferCollectionImageConstraintsFUCHSIA))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.Core10.FundamentalTypes (Flags)
import Vulkan.Core10.Enums.FormatFeatureFlagBits (FormatFeatureFlags)
import Vulkan.Core10.Image (ImageCreateInfo)
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core11.Enums.SamplerYcbcrModelConversion (SamplerYcbcrModelConversion)
import Vulkan.Core11.Enums.SamplerYcbcrRange (SamplerYcbcrRange)
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.CStruct.Extends (SomeStruct(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Extensions.VK_FUCHSIA_imagepipe_surface (Zx_handle_t)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SYSMEM_COLOR_SPACE_FUCHSIA))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.Handles (BufferCollectionFUCHSIA(..))
import Vulkan.Extensions.VK_EXT_debug_report (DebugReportObjectTypeEXT(..))
import Vulkan.Extensions.VK_FUCHSIA_imagepipe_surface (Zx_handle_t)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCreateBufferCollectionFUCHSIA
  :: FunPtr (Ptr Device_T -> Ptr BufferCollectionCreateInfoFUCHSIA -> Ptr AllocationCallbacks -> Ptr BufferCollectionFUCHSIA -> IO Result) -> Ptr Device_T -> Ptr BufferCollectionCreateInfoFUCHSIA -> Ptr AllocationCallbacks -> Ptr BufferCollectionFUCHSIA -> IO Result

-- | vkCreateBufferCollectionFUCHSIA - Create a new buffer collection
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreateBufferCollectionFUCHSIA-device-parameter# @device@
--     /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCreateBufferCollectionFUCHSIA-pCreateInfo-parameter#
--     @pCreateInfo@ /must/ be a valid pointer to a valid
--     'BufferCollectionCreateInfoFUCHSIA' structure
--
-- -   #VUID-vkCreateBufferCollectionFUCHSIA-pAllocator-parameter# If
--     @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid pointer
--     to a valid 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
--     structure
--
-- -   #VUID-vkCreateBufferCollectionFUCHSIA-pCollection-parameter#
--     @pCollection@ /must/ be a valid pointer to a
--     'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA' handle
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_INVALID_EXTERNAL_HANDLE'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED'
--
-- == Host Access
--
-- All functions referencing a
-- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA' /must/ be externally
-- synchronized with the exception of 'createBufferCollectionFUCHSIA'.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'BufferCollectionCreateInfoFUCHSIA',
-- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA',
-- 'Vulkan.Core10.Handles.Device'
createBufferCollectionFUCHSIA :: forall io
                               . (MonadIO io)
                              => -- | @device@ is the logical device that creates the
                                 -- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA'
                                 Device
                              -> -- | @pCreateInfo@ is a pointer to a 'BufferCollectionCreateInfoFUCHSIA'
                                 -- structure containing parameters affecting creation of the buffer
                                 -- collection
                                 BufferCollectionCreateInfoFUCHSIA
                              -> -- | @pAllocator@ is a pointer to a
                                 -- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
                                 -- controlling host memory allocation as described in the
                                 -- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#memory-allocation Memory Allocation>
                                 -- chapter
                                 ("allocator" ::: Maybe AllocationCallbacks)
                              -> io (BufferCollectionFUCHSIA)
createBufferCollectionFUCHSIA :: forall (io :: * -> *).
MonadIO io =>
Device
-> BufferCollectionCreateInfoFUCHSIA
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io BufferCollectionFUCHSIA
createBufferCollectionFUCHSIA Device
device
                                BufferCollectionCreateInfoFUCHSIA
createInfo
                                "allocator" ::: Maybe AllocationCallbacks
allocator = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkCreateBufferCollectionFUCHSIAPtr :: FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pCollection" ::: Ptr BufferCollectionFUCHSIA)
   -> IO Result)
vkCreateBufferCollectionFUCHSIAPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> ("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA)
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> ("pCollection" ::: Ptr BufferCollectionFUCHSIA)
      -> IO Result)
pVkCreateBufferCollectionFUCHSIA (case Device
device of Device{DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pCollection" ::: Ptr BufferCollectionFUCHSIA)
   -> IO Result)
vkCreateBufferCollectionFUCHSIAPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCreateBufferCollectionFUCHSIA is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkCreateBufferCollectionFUCHSIA' :: Ptr Device_T
-> ("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pCollection" ::: Ptr BufferCollectionFUCHSIA)
-> IO Result
vkCreateBufferCollectionFUCHSIA' = FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pCollection" ::: Ptr BufferCollectionFUCHSIA)
   -> IO Result)
-> Ptr Device_T
-> ("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pCollection" ::: Ptr BufferCollectionFUCHSIA)
-> IO Result
mkVkCreateBufferCollectionFUCHSIA FunPtr
  (Ptr Device_T
   -> ("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA)
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> ("pCollection" ::: Ptr BufferCollectionFUCHSIA)
   -> IO Result)
vkCreateBufferCollectionFUCHSIAPtr
  "pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA
pCreateInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (BufferCollectionCreateInfoFUCHSIA
createInfo)
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  "pCollection" ::: Ptr BufferCollectionFUCHSIA
pPCollection <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (forall a. Int -> IO (Ptr a)
callocBytes @BufferCollectionFUCHSIA Int
8) forall a. Ptr a -> IO ()
free
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCreateBufferCollectionFUCHSIA" (Ptr Device_T
-> ("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA)
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> ("pCollection" ::: Ptr BufferCollectionFUCHSIA)
-> IO Result
vkCreateBufferCollectionFUCHSIA'
                                                                    (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                    "pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA
pCreateInfo
                                                                    "pAllocator" ::: Ptr AllocationCallbacks
pAllocator
                                                                    ("pCollection" ::: Ptr BufferCollectionFUCHSIA
pPCollection))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  BufferCollectionFUCHSIA
pCollection <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> IO a
peek @BufferCollectionFUCHSIA "pCollection" ::: Ptr BufferCollectionFUCHSIA
pPCollection
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (BufferCollectionFUCHSIA
pCollection)

-- | A convenience wrapper to make a compatible pair of calls to
-- 'createBufferCollectionFUCHSIA' and 'destroyBufferCollectionFUCHSIA'
--
-- To ensure that 'destroyBufferCollectionFUCHSIA' is always called: pass
-- 'Control.Exception.bracket' (or the allocate function from your
-- favourite resource management library) as the last argument.
-- To just extract the pair pass '(,)' as the last argument.
--
withBufferCollectionFUCHSIA :: forall io r . MonadIO io => Device -> BufferCollectionCreateInfoFUCHSIA -> Maybe AllocationCallbacks -> (io BufferCollectionFUCHSIA -> (BufferCollectionFUCHSIA -> io ()) -> r) -> r
withBufferCollectionFUCHSIA :: forall (io :: * -> *) r.
MonadIO io =>
Device
-> BufferCollectionCreateInfoFUCHSIA
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io BufferCollectionFUCHSIA
    -> (BufferCollectionFUCHSIA -> io ()) -> r)
-> r
withBufferCollectionFUCHSIA Device
device BufferCollectionCreateInfoFUCHSIA
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator io BufferCollectionFUCHSIA
-> (BufferCollectionFUCHSIA -> io ()) -> r
b =
  io BufferCollectionFUCHSIA
-> (BufferCollectionFUCHSIA -> io ()) -> r
b (forall (io :: * -> *).
MonadIO io =>
Device
-> BufferCollectionCreateInfoFUCHSIA
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io BufferCollectionFUCHSIA
createBufferCollectionFUCHSIA Device
device BufferCollectionCreateInfoFUCHSIA
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
    (\(BufferCollectionFUCHSIA
o0) -> forall (io :: * -> *).
MonadIO io =>
Device
-> BufferCollectionFUCHSIA
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyBufferCollectionFUCHSIA Device
device BufferCollectionFUCHSIA
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkSetBufferCollectionBufferConstraintsFUCHSIA
  :: FunPtr (Ptr Device_T -> BufferCollectionFUCHSIA -> Ptr BufferConstraintsInfoFUCHSIA -> IO Result) -> Ptr Device_T -> BufferCollectionFUCHSIA -> Ptr BufferConstraintsInfoFUCHSIA -> IO Result

-- | vkSetBufferCollectionBufferConstraintsFUCHSIA - Set buffer-based
-- constraints for a buffer collection
--
-- = Description
--
-- 'setBufferCollectionBufferConstraintsFUCHSIA' /may/ fail if the
-- implementation does not support the constraints specified in the
-- @bufferCollectionConstraints@ structure. If that occurs,
-- 'setBufferCollectionBufferConstraintsFUCHSIA' will return
-- 'Vulkan.Core10.Enums.Result.ERROR_FORMAT_NOT_SUPPORTED'.
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_FORMAT_NOT_SUPPORTED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA',
-- 'BufferConstraintsInfoFUCHSIA', 'Vulkan.Core10.Handles.Device'
setBufferCollectionBufferConstraintsFUCHSIA :: forall io
                                             . (MonadIO io)
                                            => -- | @device@ is the logical device
                                               --
                                               -- #VUID-vkSetBufferCollectionBufferConstraintsFUCHSIA-device-parameter#
                                               -- @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
                                               Device
                                            -> -- | @collection@ is the 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA'
                                               -- handle
                                               --
                                               -- #VUID-vkSetBufferCollectionBufferConstraintsFUCHSIA-collection-parameter#
                                               -- @collection@ /must/ be a valid
                                               -- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA' handle
                                               --
                                               -- #VUID-vkSetBufferCollectionBufferConstraintsFUCHSIA-collection-parent#
                                               -- @collection@ /must/ have been created, allocated, or retrieved from
                                               -- @device@
                                               BufferCollectionFUCHSIA
                                            -> -- | @pBufferConstraintsInfo@ is a pointer to a
                                               -- 'BufferConstraintsInfoFUCHSIA' structure
                                               --
                                               -- #VUID-vkSetBufferCollectionBufferConstraintsFUCHSIA-pBufferConstraintsInfo-parameter#
                                               -- @pBufferConstraintsInfo@ /must/ be a valid pointer to a valid
                                               -- 'BufferConstraintsInfoFUCHSIA' structure
                                               BufferConstraintsInfoFUCHSIA
                                            -> io ()
setBufferCollectionBufferConstraintsFUCHSIA :: forall (io :: * -> *).
MonadIO io =>
Device
-> BufferCollectionFUCHSIA -> BufferConstraintsInfoFUCHSIA -> io ()
setBufferCollectionBufferConstraintsFUCHSIA Device
device
                                              BufferCollectionFUCHSIA
collection
                                              BufferConstraintsInfoFUCHSIA
bufferConstraintsInfo = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkSetBufferCollectionBufferConstraintsFUCHSIAPtr :: FunPtr
  (Ptr Device_T
   -> BufferCollectionFUCHSIA
   -> ("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA)
   -> IO Result)
vkSetBufferCollectionBufferConstraintsFUCHSIAPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> BufferCollectionFUCHSIA
      -> ("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA)
      -> IO Result)
pVkSetBufferCollectionBufferConstraintsFUCHSIA (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> BufferCollectionFUCHSIA
   -> ("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA)
   -> IO Result)
vkSetBufferCollectionBufferConstraintsFUCHSIAPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkSetBufferCollectionBufferConstraintsFUCHSIA is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkSetBufferCollectionBufferConstraintsFUCHSIA' :: Ptr Device_T
-> BufferCollectionFUCHSIA
-> ("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA)
-> IO Result
vkSetBufferCollectionBufferConstraintsFUCHSIA' = FunPtr
  (Ptr Device_T
   -> BufferCollectionFUCHSIA
   -> ("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA)
   -> IO Result)
-> Ptr Device_T
-> BufferCollectionFUCHSIA
-> ("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA)
-> IO Result
mkVkSetBufferCollectionBufferConstraintsFUCHSIA FunPtr
  (Ptr Device_T
   -> BufferCollectionFUCHSIA
   -> ("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA)
   -> IO Result)
vkSetBufferCollectionBufferConstraintsFUCHSIAPtr
  "pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
pBufferConstraintsInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (BufferConstraintsInfoFUCHSIA
bufferConstraintsInfo)
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkSetBufferCollectionBufferConstraintsFUCHSIA" (Ptr Device_T
-> BufferCollectionFUCHSIA
-> ("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA)
-> IO Result
vkSetBufferCollectionBufferConstraintsFUCHSIA'
                                                                                  (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                                  (BufferCollectionFUCHSIA
collection)
                                                                                  "pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
pBufferConstraintsInfo)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkSetBufferCollectionImageConstraintsFUCHSIA
  :: FunPtr (Ptr Device_T -> BufferCollectionFUCHSIA -> Ptr ImageConstraintsInfoFUCHSIA -> IO Result) -> Ptr Device_T -> BufferCollectionFUCHSIA -> Ptr ImageConstraintsInfoFUCHSIA -> IO Result

-- | vkSetBufferCollectionImageConstraintsFUCHSIA - Set image-based
-- constraints for a buffer collection
--
-- = Description
--
-- 'setBufferCollectionImageConstraintsFUCHSIA' /may/ fail if
-- @pImageConstraintsInfo@::@formatConstraintsCount@ is larger than the
-- implementation-defined limit. If that occurs,
-- 'setBufferCollectionImageConstraintsFUCHSIA' will return
-- 'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED'.
--
-- 'setBufferCollectionImageConstraintsFUCHSIA' /may/ fail if the
-- implementation does not support any of the formats described by the
-- @pImageConstraintsInfo@ structure. If that occurs,
-- 'setBufferCollectionImageConstraintsFUCHSIA' will return
-- 'Vulkan.Core10.Enums.Result.ERROR_FORMAT_NOT_SUPPORTED'.
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_FORMAT_NOT_SUPPORTED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA',
-- 'Vulkan.Core10.Handles.Device', 'ImageConstraintsInfoFUCHSIA'
setBufferCollectionImageConstraintsFUCHSIA :: forall io
                                            . (MonadIO io)
                                           => -- | @device@ is the logical device
                                              --
                                              -- #VUID-vkSetBufferCollectionImageConstraintsFUCHSIA-device-parameter#
                                              -- @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
                                              Device
                                           -> -- | @collection@ is the 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA'
                                              -- handle
                                              --
                                              -- #VUID-vkSetBufferCollectionImageConstraintsFUCHSIA-collection-parameter#
                                              -- @collection@ /must/ be a valid
                                              -- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA' handle
                                              --
                                              -- #VUID-vkSetBufferCollectionImageConstraintsFUCHSIA-collection-parent#
                                              -- @collection@ /must/ have been created, allocated, or retrieved from
                                              -- @device@
                                              BufferCollectionFUCHSIA
                                           -> -- | @pImageConstraintsInfo@ is a pointer to a 'ImageConstraintsInfoFUCHSIA'
                                              -- structure
                                              --
                                              -- #VUID-vkSetBufferCollectionImageConstraintsFUCHSIA-pImageConstraintsInfo-parameter#
                                              -- @pImageConstraintsInfo@ /must/ be a valid pointer to a valid
                                              -- 'ImageConstraintsInfoFUCHSIA' structure
                                              ImageConstraintsInfoFUCHSIA
                                           -> io ()
setBufferCollectionImageConstraintsFUCHSIA :: forall (io :: * -> *).
MonadIO io =>
Device
-> BufferCollectionFUCHSIA -> ImageConstraintsInfoFUCHSIA -> io ()
setBufferCollectionImageConstraintsFUCHSIA Device
device
                                             BufferCollectionFUCHSIA
collection
                                             ImageConstraintsInfoFUCHSIA
imageConstraintsInfo = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkSetBufferCollectionImageConstraintsFUCHSIAPtr :: FunPtr
  (Ptr Device_T
   -> BufferCollectionFUCHSIA
   -> ("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA)
   -> IO Result)
vkSetBufferCollectionImageConstraintsFUCHSIAPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> BufferCollectionFUCHSIA
      -> ("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA)
      -> IO Result)
pVkSetBufferCollectionImageConstraintsFUCHSIA (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> BufferCollectionFUCHSIA
   -> ("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA)
   -> IO Result)
vkSetBufferCollectionImageConstraintsFUCHSIAPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkSetBufferCollectionImageConstraintsFUCHSIA is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkSetBufferCollectionImageConstraintsFUCHSIA' :: Ptr Device_T
-> BufferCollectionFUCHSIA
-> ("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA)
-> IO Result
vkSetBufferCollectionImageConstraintsFUCHSIA' = FunPtr
  (Ptr Device_T
   -> BufferCollectionFUCHSIA
   -> ("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA)
   -> IO Result)
-> Ptr Device_T
-> BufferCollectionFUCHSIA
-> ("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA)
-> IO Result
mkVkSetBufferCollectionImageConstraintsFUCHSIA FunPtr
  (Ptr Device_T
   -> BufferCollectionFUCHSIA
   -> ("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA)
   -> IO Result)
vkSetBufferCollectionImageConstraintsFUCHSIAPtr
  "pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
pImageConstraintsInfo <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (ImageConstraintsInfoFUCHSIA
imageConstraintsInfo)
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkSetBufferCollectionImageConstraintsFUCHSIA" (Ptr Device_T
-> BufferCollectionFUCHSIA
-> ("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA)
-> IO Result
vkSetBufferCollectionImageConstraintsFUCHSIA'
                                                                                 (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                                 (BufferCollectionFUCHSIA
collection)
                                                                                 "pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
pImageConstraintsInfo)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkDestroyBufferCollectionFUCHSIA
  :: FunPtr (Ptr Device_T -> BufferCollectionFUCHSIA -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> BufferCollectionFUCHSIA -> Ptr AllocationCallbacks -> IO ()

-- | vkDestroyBufferCollectionFUCHSIA - Destroy a buffer collection
--
-- == Valid Usage
--
-- -   #VUID-vkDestroyBufferCollectionFUCHSIA-collection-06407#
--     'Vulkan.Core10.Handles.Image' and 'Vulkan.Core10.Handles.Buffer'
--     objects that referenced @collection@ upon creation by inclusion of a
--     'BufferCollectionImageCreateInfoFUCHSIA' or
--     'BufferCollectionBufferCreateInfoFUCHSIA' chained to their
--     'Vulkan.Core10.Image.ImageCreateInfo' or
--     'Vulkan.Core10.Buffer.BufferCreateInfo' structures respectively,
--     /may/ outlive @collection@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkDestroyBufferCollectionFUCHSIA-device-parameter# @device@
--     /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkDestroyBufferCollectionFUCHSIA-collection-parameter#
--     @collection@ /must/ be a valid
--     'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA' handle
--
-- -   #VUID-vkDestroyBufferCollectionFUCHSIA-pAllocator-parameter# If
--     @pAllocator@ is not @NULL@, @pAllocator@ /must/ be a valid pointer
--     to a valid 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks'
--     structure
--
-- -   #VUID-vkDestroyBufferCollectionFUCHSIA-collection-parent#
--     @collection@ /must/ have been created, allocated, or retrieved from
--     @device@
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA',
-- 'Vulkan.Core10.Handles.Device'
destroyBufferCollectionFUCHSIA :: forall io
                                . (MonadIO io)
                               => -- | @device@ is the logical device that creates the
                                  -- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA'
                                  Device
                               -> -- | @collection@ is the 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA'
                                  -- handle
                                  BufferCollectionFUCHSIA
                               -> -- | @pAllocator@ is a pointer to a
                                  -- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
                                  -- controlling host memory allocation as described in the
                                  -- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#memory-allocation Memory Allocation>
                                  -- chapter
                                  ("allocator" ::: Maybe AllocationCallbacks)
                               -> io ()
destroyBufferCollectionFUCHSIA :: forall (io :: * -> *).
MonadIO io =>
Device
-> BufferCollectionFUCHSIA
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyBufferCollectionFUCHSIA Device
device
                                 BufferCollectionFUCHSIA
collection
                                 "allocator" ::: Maybe AllocationCallbacks
allocator = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkDestroyBufferCollectionFUCHSIAPtr :: FunPtr
  (Ptr Device_T
   -> BufferCollectionFUCHSIA
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyBufferCollectionFUCHSIAPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> BufferCollectionFUCHSIA
      -> ("pAllocator" ::: Ptr AllocationCallbacks)
      -> IO ())
pVkDestroyBufferCollectionFUCHSIA (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> BufferCollectionFUCHSIA
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyBufferCollectionFUCHSIAPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkDestroyBufferCollectionFUCHSIA is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkDestroyBufferCollectionFUCHSIA' :: Ptr Device_T
-> BufferCollectionFUCHSIA
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroyBufferCollectionFUCHSIA' = FunPtr
  (Ptr Device_T
   -> BufferCollectionFUCHSIA
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
-> Ptr Device_T
-> BufferCollectionFUCHSIA
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
mkVkDestroyBufferCollectionFUCHSIA FunPtr
  (Ptr Device_T
   -> BufferCollectionFUCHSIA
   -> ("pAllocator" ::: Ptr AllocationCallbacks)
   -> IO ())
vkDestroyBufferCollectionFUCHSIAPtr
  "pAllocator" ::: Ptr AllocationCallbacks
pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkDestroyBufferCollectionFUCHSIA" (Ptr Device_T
-> BufferCollectionFUCHSIA
-> ("pAllocator" ::: Ptr AllocationCallbacks)
-> IO ()
vkDestroyBufferCollectionFUCHSIA'
                                                                (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                (BufferCollectionFUCHSIA
collection)
                                                                "pAllocator" ::: Ptr AllocationCallbacks
pAllocator)
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkGetBufferCollectionPropertiesFUCHSIA
  :: FunPtr (Ptr Device_T -> BufferCollectionFUCHSIA -> Ptr BufferCollectionPropertiesFUCHSIA -> IO Result) -> Ptr Device_T -> BufferCollectionFUCHSIA -> Ptr BufferCollectionPropertiesFUCHSIA -> IO Result

-- | vkGetBufferCollectionPropertiesFUCHSIA - Retrieve properties from a
-- buffer collection
--
-- = Description
--
-- For image-based buffer collections, upon calling
-- 'getBufferCollectionPropertiesFUCHSIA', Sysmem will choose an element of
-- the 'ImageConstraintsInfoFUCHSIA'::@pImageCreateInfos@ established by
-- the preceding call to 'setBufferCollectionImageConstraintsFUCHSIA'. The
-- index of the element chosen is stored in and can be retrieved from
-- 'BufferCollectionPropertiesFUCHSIA'::@createInfoIndex@.
--
-- For buffer-based buffer collections, a single
-- 'Vulkan.Core10.Buffer.BufferCreateInfo' is specified as
-- 'BufferConstraintsInfoFUCHSIA'::@createInfo@.
-- 'BufferCollectionPropertiesFUCHSIA'::@createInfoIndex@ will therefore
-- always be zero.
--
-- 'getBufferCollectionPropertiesFUCHSIA' /may/ fail if Sysmem is unable to
-- resolve the constraints of all of the participants in the buffer
-- collection. If that occurs, 'getBufferCollectionPropertiesFUCHSIA' will
-- return 'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED'.
--
-- == Valid Usage
--
-- -   #VUID-vkGetBufferCollectionPropertiesFUCHSIA-None-06405# Prior to
--     calling 'getBufferCollectionPropertiesFUCHSIA', the constraints on
--     the buffer collection /must/ have been set by either
--     'setBufferCollectionImageConstraintsFUCHSIA' or
--     'setBufferCollectionBufferConstraintsFUCHSIA'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkGetBufferCollectionPropertiesFUCHSIA-device-parameter#
--     @device@ /must/ be a valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkGetBufferCollectionPropertiesFUCHSIA-collection-parameter#
--     @collection@ /must/ be a valid
--     'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA' handle
--
-- -   #VUID-vkGetBufferCollectionPropertiesFUCHSIA-pProperties-parameter#
--     @pProperties@ /must/ be a valid pointer to a
--     'BufferCollectionPropertiesFUCHSIA' structure
--
-- -   #VUID-vkGetBufferCollectionPropertiesFUCHSIA-collection-parent#
--     @collection@ /must/ have been created, allocated, or retrieved from
--     @device@
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA',
-- 'BufferCollectionPropertiesFUCHSIA', 'Vulkan.Core10.Handles.Device'
getBufferCollectionPropertiesFUCHSIA :: forall io
                                      . (MonadIO io)
                                     => -- | @device@ is the logical device handle
                                        Device
                                     -> -- | @collection@ is the 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA'
                                        -- handle
                                        BufferCollectionFUCHSIA
                                     -> io (BufferCollectionPropertiesFUCHSIA)
getBufferCollectionPropertiesFUCHSIA :: forall (io :: * -> *).
MonadIO io =>
Device
-> BufferCollectionFUCHSIA -> io BufferCollectionPropertiesFUCHSIA
getBufferCollectionPropertiesFUCHSIA Device
device BufferCollectionFUCHSIA
collection = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
  let vkGetBufferCollectionPropertiesFUCHSIAPtr :: FunPtr
  (Ptr Device_T
   -> BufferCollectionFUCHSIA
   -> ("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA)
   -> IO Result)
vkGetBufferCollectionPropertiesFUCHSIAPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> BufferCollectionFUCHSIA
      -> ("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA)
      -> IO Result)
pVkGetBufferCollectionPropertiesFUCHSIA (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:Device :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> BufferCollectionFUCHSIA
   -> ("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA)
   -> IO Result)
vkGetBufferCollectionPropertiesFUCHSIAPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
    forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkGetBufferCollectionPropertiesFUCHSIA is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
  let vkGetBufferCollectionPropertiesFUCHSIA' :: Ptr Device_T
-> BufferCollectionFUCHSIA
-> ("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA)
-> IO Result
vkGetBufferCollectionPropertiesFUCHSIA' = FunPtr
  (Ptr Device_T
   -> BufferCollectionFUCHSIA
   -> ("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA)
   -> IO Result)
-> Ptr Device_T
-> BufferCollectionFUCHSIA
-> ("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA)
-> IO Result
mkVkGetBufferCollectionPropertiesFUCHSIA FunPtr
  (Ptr Device_T
   -> BufferCollectionFUCHSIA
   -> ("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA)
   -> IO Result)
vkGetBufferCollectionPropertiesFUCHSIAPtr
  "pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
pPProperties <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @BufferCollectionPropertiesFUCHSIA)
  Result
r <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetBufferCollectionPropertiesFUCHSIA" (Ptr Device_T
-> BufferCollectionFUCHSIA
-> ("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA)
-> IO Result
vkGetBufferCollectionPropertiesFUCHSIA'
                                                                           (Device -> Ptr Device_T
deviceHandle (Device
device))
                                                                           (BufferCollectionFUCHSIA
collection)
                                                                           ("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
pPProperties))
  forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (forall e a. Exception e => e -> IO a
throwIO (Result -> VulkanException
VulkanException Result
r))
  BufferCollectionPropertiesFUCHSIA
pProperties <- forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @BufferCollectionPropertiesFUCHSIA "pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
pPProperties
  forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ (BufferCollectionPropertiesFUCHSIA
pProperties)


-- | VkImportMemoryBufferCollectionFUCHSIA - Structure to specify the Sysmem
-- buffer to import
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data ImportMemoryBufferCollectionFUCHSIA = ImportMemoryBufferCollectionFUCHSIA
  { -- | @collection@ is the 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA'
    -- handle
    --
    -- #VUID-VkImportMemoryBufferCollectionFUCHSIA-collection-parameter#
    -- @collection@ /must/ be a valid
    -- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA' handle
    ImportMemoryBufferCollectionFUCHSIA -> BufferCollectionFUCHSIA
collection :: BufferCollectionFUCHSIA
  , -- | @index@ the index of the buffer to import from @collection@
    --
    -- #VUID-VkImportMemoryBufferCollectionFUCHSIA-index-06406# @index@ /must/
    -- be less than the value retrieved as
    -- 'BufferCollectionPropertiesFUCHSIA':bufferCount
    ImportMemoryBufferCollectionFUCHSIA -> Flags
index :: Word32
  }
  deriving (Typeable, ImportMemoryBufferCollectionFUCHSIA
-> ImportMemoryBufferCollectionFUCHSIA -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportMemoryBufferCollectionFUCHSIA
-> ImportMemoryBufferCollectionFUCHSIA -> Bool
$c/= :: ImportMemoryBufferCollectionFUCHSIA
-> ImportMemoryBufferCollectionFUCHSIA -> Bool
== :: ImportMemoryBufferCollectionFUCHSIA
-> ImportMemoryBufferCollectionFUCHSIA -> Bool
$c== :: ImportMemoryBufferCollectionFUCHSIA
-> ImportMemoryBufferCollectionFUCHSIA -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImportMemoryBufferCollectionFUCHSIA)
#endif
deriving instance Show ImportMemoryBufferCollectionFUCHSIA

instance ToCStruct ImportMemoryBufferCollectionFUCHSIA where
  withCStruct :: forall b.
ImportMemoryBufferCollectionFUCHSIA
-> (Ptr ImportMemoryBufferCollectionFUCHSIA -> IO b) -> IO b
withCStruct ImportMemoryBufferCollectionFUCHSIA
x Ptr ImportMemoryBufferCollectionFUCHSIA -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr ImportMemoryBufferCollectionFUCHSIA
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImportMemoryBufferCollectionFUCHSIA
p ImportMemoryBufferCollectionFUCHSIA
x (Ptr ImportMemoryBufferCollectionFUCHSIA -> IO b
f Ptr ImportMemoryBufferCollectionFUCHSIA
p)
  pokeCStruct :: forall b.
Ptr ImportMemoryBufferCollectionFUCHSIA
-> ImportMemoryBufferCollectionFUCHSIA -> IO b -> IO b
pokeCStruct Ptr ImportMemoryBufferCollectionFUCHSIA
p ImportMemoryBufferCollectionFUCHSIA{Flags
BufferCollectionFUCHSIA
index :: Flags
collection :: BufferCollectionFUCHSIA
$sel:index:ImportMemoryBufferCollectionFUCHSIA :: ImportMemoryBufferCollectionFUCHSIA -> Flags
$sel:collection:ImportMemoryBufferCollectionFUCHSIA :: ImportMemoryBufferCollectionFUCHSIA -> BufferCollectionFUCHSIA
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryBufferCollectionFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryBufferCollectionFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryBufferCollectionFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr BufferCollectionFUCHSIA)) (BufferCollectionFUCHSIA
collection)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryBufferCollectionFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Flags
index)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr ImportMemoryBufferCollectionFUCHSIA -> IO b -> IO b
pokeZeroCStruct Ptr ImportMemoryBufferCollectionFUCHSIA
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryBufferCollectionFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryBufferCollectionFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryBufferCollectionFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr BufferCollectionFUCHSIA)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImportMemoryBufferCollectionFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct ImportMemoryBufferCollectionFUCHSIA where
  peekCStruct :: Ptr ImportMemoryBufferCollectionFUCHSIA
-> IO ImportMemoryBufferCollectionFUCHSIA
peekCStruct Ptr ImportMemoryBufferCollectionFUCHSIA
p = do
    BufferCollectionFUCHSIA
collection <- forall a. Storable a => Ptr a -> IO a
peek @BufferCollectionFUCHSIA ((Ptr ImportMemoryBufferCollectionFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr BufferCollectionFUCHSIA))
    Flags
index <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ImportMemoryBufferCollectionFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ BufferCollectionFUCHSIA
-> Flags -> ImportMemoryBufferCollectionFUCHSIA
ImportMemoryBufferCollectionFUCHSIA
             BufferCollectionFUCHSIA
collection Flags
index

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

instance Zero ImportMemoryBufferCollectionFUCHSIA where
  zero :: ImportMemoryBufferCollectionFUCHSIA
zero = BufferCollectionFUCHSIA
-> Flags -> ImportMemoryBufferCollectionFUCHSIA
ImportMemoryBufferCollectionFUCHSIA
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkBufferCollectionImageCreateInfoFUCHSIA - Create a
-- VkBufferCollectionFUCHSIA-compatible VkImage
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data BufferCollectionImageCreateInfoFUCHSIA = BufferCollectionImageCreateInfoFUCHSIA
  { -- | @collection@ is the 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA'
    -- handle
    --
    -- #VUID-VkBufferCollectionImageCreateInfoFUCHSIA-collection-parameter#
    -- @collection@ /must/ be a valid
    -- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA' handle
    BufferCollectionImageCreateInfoFUCHSIA -> BufferCollectionFUCHSIA
collection :: BufferCollectionFUCHSIA
  , -- | @index@ is the index of the buffer in the buffer collection from which
    -- the memory will be imported
    --
    -- #VUID-VkBufferCollectionImageCreateInfoFUCHSIA-index-06391# @index@
    -- /must/ be less than 'BufferCollectionPropertiesFUCHSIA'::@bufferCount@
    BufferCollectionImageCreateInfoFUCHSIA -> Flags
index :: Word32
  }
  deriving (Typeable, BufferCollectionImageCreateInfoFUCHSIA
-> BufferCollectionImageCreateInfoFUCHSIA -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BufferCollectionImageCreateInfoFUCHSIA
-> BufferCollectionImageCreateInfoFUCHSIA -> Bool
$c/= :: BufferCollectionImageCreateInfoFUCHSIA
-> BufferCollectionImageCreateInfoFUCHSIA -> Bool
== :: BufferCollectionImageCreateInfoFUCHSIA
-> BufferCollectionImageCreateInfoFUCHSIA -> Bool
$c== :: BufferCollectionImageCreateInfoFUCHSIA
-> BufferCollectionImageCreateInfoFUCHSIA -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BufferCollectionImageCreateInfoFUCHSIA)
#endif
deriving instance Show BufferCollectionImageCreateInfoFUCHSIA

instance ToCStruct BufferCollectionImageCreateInfoFUCHSIA where
  withCStruct :: forall b.
BufferCollectionImageCreateInfoFUCHSIA
-> (Ptr BufferCollectionImageCreateInfoFUCHSIA -> IO b) -> IO b
withCStruct BufferCollectionImageCreateInfoFUCHSIA
x Ptr BufferCollectionImageCreateInfoFUCHSIA -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr BufferCollectionImageCreateInfoFUCHSIA
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BufferCollectionImageCreateInfoFUCHSIA
p BufferCollectionImageCreateInfoFUCHSIA
x (Ptr BufferCollectionImageCreateInfoFUCHSIA -> IO b
f Ptr BufferCollectionImageCreateInfoFUCHSIA
p)
  pokeCStruct :: forall b.
Ptr BufferCollectionImageCreateInfoFUCHSIA
-> BufferCollectionImageCreateInfoFUCHSIA -> IO b -> IO b
pokeCStruct Ptr BufferCollectionImageCreateInfoFUCHSIA
p BufferCollectionImageCreateInfoFUCHSIA{Flags
BufferCollectionFUCHSIA
index :: Flags
collection :: BufferCollectionFUCHSIA
$sel:index:BufferCollectionImageCreateInfoFUCHSIA :: BufferCollectionImageCreateInfoFUCHSIA -> Flags
$sel:collection:BufferCollectionImageCreateInfoFUCHSIA :: BufferCollectionImageCreateInfoFUCHSIA -> BufferCollectionFUCHSIA
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionImageCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionImageCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionImageCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr BufferCollectionFUCHSIA)) (BufferCollectionFUCHSIA
collection)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionImageCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Flags
index)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr BufferCollectionImageCreateInfoFUCHSIA -> IO b -> IO b
pokeZeroCStruct Ptr BufferCollectionImageCreateInfoFUCHSIA
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionImageCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionImageCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionImageCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr BufferCollectionFUCHSIA)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionImageCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct BufferCollectionImageCreateInfoFUCHSIA where
  peekCStruct :: Ptr BufferCollectionImageCreateInfoFUCHSIA
-> IO BufferCollectionImageCreateInfoFUCHSIA
peekCStruct Ptr BufferCollectionImageCreateInfoFUCHSIA
p = do
    BufferCollectionFUCHSIA
collection <- forall a. Storable a => Ptr a -> IO a
peek @BufferCollectionFUCHSIA ((Ptr BufferCollectionImageCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr BufferCollectionFUCHSIA))
    Flags
index <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr BufferCollectionImageCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ BufferCollectionFUCHSIA
-> Flags -> BufferCollectionImageCreateInfoFUCHSIA
BufferCollectionImageCreateInfoFUCHSIA
             BufferCollectionFUCHSIA
collection Flags
index

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

instance Zero BufferCollectionImageCreateInfoFUCHSIA where
  zero :: BufferCollectionImageCreateInfoFUCHSIA
zero = BufferCollectionFUCHSIA
-> Flags -> BufferCollectionImageCreateInfoFUCHSIA
BufferCollectionImageCreateInfoFUCHSIA
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkBufferCollectionBufferCreateInfoFUCHSIA - Create a
-- VkBufferCollectionFUCHSIA-compatible VkBuffer
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data BufferCollectionBufferCreateInfoFUCHSIA = BufferCollectionBufferCreateInfoFUCHSIA
  { -- | @collection@ is the 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA'
    -- handle
    --
    -- #VUID-VkBufferCollectionBufferCreateInfoFUCHSIA-collection-parameter#
    -- @collection@ /must/ be a valid
    -- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA' handle
    BufferCollectionBufferCreateInfoFUCHSIA -> BufferCollectionFUCHSIA
collection :: BufferCollectionFUCHSIA
  , -- | @index@ is the index of the buffer in the buffer collection from which
    -- the memory will be imported
    --
    -- #VUID-VkBufferCollectionBufferCreateInfoFUCHSIA-index-06388# @index@
    -- /must/ be less than 'BufferCollectionPropertiesFUCHSIA'::@bufferCount@
    BufferCollectionBufferCreateInfoFUCHSIA -> Flags
index :: Word32
  }
  deriving (Typeable, BufferCollectionBufferCreateInfoFUCHSIA
-> BufferCollectionBufferCreateInfoFUCHSIA -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BufferCollectionBufferCreateInfoFUCHSIA
-> BufferCollectionBufferCreateInfoFUCHSIA -> Bool
$c/= :: BufferCollectionBufferCreateInfoFUCHSIA
-> BufferCollectionBufferCreateInfoFUCHSIA -> Bool
== :: BufferCollectionBufferCreateInfoFUCHSIA
-> BufferCollectionBufferCreateInfoFUCHSIA -> Bool
$c== :: BufferCollectionBufferCreateInfoFUCHSIA
-> BufferCollectionBufferCreateInfoFUCHSIA -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BufferCollectionBufferCreateInfoFUCHSIA)
#endif
deriving instance Show BufferCollectionBufferCreateInfoFUCHSIA

instance ToCStruct BufferCollectionBufferCreateInfoFUCHSIA where
  withCStruct :: forall b.
BufferCollectionBufferCreateInfoFUCHSIA
-> (Ptr BufferCollectionBufferCreateInfoFUCHSIA -> IO b) -> IO b
withCStruct BufferCollectionBufferCreateInfoFUCHSIA
x Ptr BufferCollectionBufferCreateInfoFUCHSIA -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr BufferCollectionBufferCreateInfoFUCHSIA
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BufferCollectionBufferCreateInfoFUCHSIA
p BufferCollectionBufferCreateInfoFUCHSIA
x (Ptr BufferCollectionBufferCreateInfoFUCHSIA -> IO b
f Ptr BufferCollectionBufferCreateInfoFUCHSIA
p)
  pokeCStruct :: forall b.
Ptr BufferCollectionBufferCreateInfoFUCHSIA
-> BufferCollectionBufferCreateInfoFUCHSIA -> IO b -> IO b
pokeCStruct Ptr BufferCollectionBufferCreateInfoFUCHSIA
p BufferCollectionBufferCreateInfoFUCHSIA{Flags
BufferCollectionFUCHSIA
index :: Flags
collection :: BufferCollectionFUCHSIA
$sel:index:BufferCollectionBufferCreateInfoFUCHSIA :: BufferCollectionBufferCreateInfoFUCHSIA -> Flags
$sel:collection:BufferCollectionBufferCreateInfoFUCHSIA :: BufferCollectionBufferCreateInfoFUCHSIA -> BufferCollectionFUCHSIA
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionBufferCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionBufferCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionBufferCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr BufferCollectionFUCHSIA)) (BufferCollectionFUCHSIA
collection)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionBufferCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Flags
index)
    IO b
f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr BufferCollectionBufferCreateInfoFUCHSIA -> IO b -> IO b
pokeZeroCStruct Ptr BufferCollectionBufferCreateInfoFUCHSIA
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionBufferCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionBufferCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionBufferCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr BufferCollectionFUCHSIA)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionBufferCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct BufferCollectionBufferCreateInfoFUCHSIA where
  peekCStruct :: Ptr BufferCollectionBufferCreateInfoFUCHSIA
-> IO BufferCollectionBufferCreateInfoFUCHSIA
peekCStruct Ptr BufferCollectionBufferCreateInfoFUCHSIA
p = do
    BufferCollectionFUCHSIA
collection <- forall a. Storable a => Ptr a -> IO a
peek @BufferCollectionFUCHSIA ((Ptr BufferCollectionBufferCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr BufferCollectionFUCHSIA))
    Flags
index <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr BufferCollectionBufferCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ BufferCollectionFUCHSIA
-> Flags -> BufferCollectionBufferCreateInfoFUCHSIA
BufferCollectionBufferCreateInfoFUCHSIA
             BufferCollectionFUCHSIA
collection Flags
index

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

instance Zero BufferCollectionBufferCreateInfoFUCHSIA where
  zero :: BufferCollectionBufferCreateInfoFUCHSIA
zero = BufferCollectionFUCHSIA
-> Flags -> BufferCollectionBufferCreateInfoFUCHSIA
BufferCollectionBufferCreateInfoFUCHSIA
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkBufferCollectionCreateInfoFUCHSIA - Structure specifying desired
-- parameters to create the buffer collection
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'createBufferCollectionFUCHSIA'
data BufferCollectionCreateInfoFUCHSIA = BufferCollectionCreateInfoFUCHSIA
  { -- | @collectionToken@ is a @zx_handle_t@ containing the Sysmem client’s
    -- buffer collection token
    --
    -- #VUID-VkBufferCollectionCreateInfoFUCHSIA-collectionToken-06393#
    -- @collectionToken@ /must/ be a valid @zx_handle_t@ to a Zircon channel
    -- allocated from Sysmem
    -- (@fuchsia.sysmem.Allocator@\/AllocateSharedCollection) with
    -- @ZX_DEFAULT_CHANNEL_RIGHTS@ rights
    BufferCollectionCreateInfoFUCHSIA -> Flags
collectionToken :: Zx_handle_t }
  deriving (Typeable, BufferCollectionCreateInfoFUCHSIA
-> BufferCollectionCreateInfoFUCHSIA -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BufferCollectionCreateInfoFUCHSIA
-> BufferCollectionCreateInfoFUCHSIA -> Bool
$c/= :: BufferCollectionCreateInfoFUCHSIA
-> BufferCollectionCreateInfoFUCHSIA -> Bool
== :: BufferCollectionCreateInfoFUCHSIA
-> BufferCollectionCreateInfoFUCHSIA -> Bool
$c== :: BufferCollectionCreateInfoFUCHSIA
-> BufferCollectionCreateInfoFUCHSIA -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BufferCollectionCreateInfoFUCHSIA)
#endif
deriving instance Show BufferCollectionCreateInfoFUCHSIA

instance ToCStruct BufferCollectionCreateInfoFUCHSIA where
  withCStruct :: forall b.
BufferCollectionCreateInfoFUCHSIA
-> (("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA)
    -> IO b)
-> IO b
withCStruct BufferCollectionCreateInfoFUCHSIA
x ("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \"pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA
p BufferCollectionCreateInfoFUCHSIA
x (("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA) -> IO b
f "pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA
p)
  pokeCStruct :: forall b.
("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA)
-> BufferCollectionCreateInfoFUCHSIA -> IO b -> IO b
pokeCStruct "pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA
p BufferCollectionCreateInfoFUCHSIA{Flags
collectionToken :: Flags
$sel:collectionToken:BufferCollectionCreateInfoFUCHSIA :: BufferCollectionCreateInfoFUCHSIA -> Flags
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Zx_handle_t)) (Flags
collectionToken)
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA)
-> IO b -> IO b
pokeZeroCStruct "pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Zx_handle_t)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct BufferCollectionCreateInfoFUCHSIA where
  peekCStruct :: ("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA)
-> IO BufferCollectionCreateInfoFUCHSIA
peekCStruct "pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA
p = do
    Flags
collectionToken <- forall a. Storable a => Ptr a -> IO a
peek @Zx_handle_t (("pCreateInfo" ::: Ptr BufferCollectionCreateInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Zx_handle_t))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Flags -> BufferCollectionCreateInfoFUCHSIA
BufferCollectionCreateInfoFUCHSIA
             Flags
collectionToken

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

instance Zero BufferCollectionCreateInfoFUCHSIA where
  zero :: BufferCollectionCreateInfoFUCHSIA
zero = Flags -> BufferCollectionCreateInfoFUCHSIA
BufferCollectionCreateInfoFUCHSIA
           forall a. Zero a => a
zero


-- | VkBufferCollectionPropertiesFUCHSIA - Structure specifying the
-- negotiated format chosen by Sysmem
--
-- = Description
--
-- @sysmemColorSpace@ is only set for image-based buffer collections where
-- the constraints were specified using 'ImageConstraintsInfoFUCHSIA' in a
-- call to 'setBufferCollectionImageConstraintsFUCHSIA'.
--
-- For image-based buffer collections, @createInfoIndex@ will identify both
-- the 'ImageConstraintsInfoFUCHSIA'::@pImageCreateInfos@ element and the
-- 'ImageConstraintsInfoFUCHSIA'::@pFormatConstraints@ element chosen by
-- Sysmem when 'setBufferCollectionImageConstraintsFUCHSIA' was called. The
-- value of @sysmemColorSpaceIndex@ will be an index to one of the color
-- spaces provided in the
-- 'ImageFormatConstraintsInfoFUCHSIA'::@pColorSpaces@ array.
--
-- The implementation must have @formatFeatures@ with all bits set that
-- were set in
-- 'ImageFormatConstraintsInfoFUCHSIA'::@requiredFormatFeatures@, by the
-- call to 'setBufferCollectionImageConstraintsFUCHSIA', at
-- @createInfoIndex@ (other bits could be set as well).
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'Vulkan.Core11.Enums.ChromaLocation.ChromaLocation',
-- 'Vulkan.Core10.ImageView.ComponentMapping',
-- 'Vulkan.Core10.Enums.FormatFeatureFlagBits.FormatFeatureFlags',
-- 'Vulkan.Core11.Enums.SamplerYcbcrModelConversion.SamplerYcbcrModelConversion',
-- 'Vulkan.Core11.Enums.SamplerYcbcrRange.SamplerYcbcrRange',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'SysmemColorSpaceFUCHSIA', 'getBufferCollectionPropertiesFUCHSIA'
data BufferCollectionPropertiesFUCHSIA = BufferCollectionPropertiesFUCHSIA
  { -- | @memoryTypeBits@ is a bitmask containing one bit set for every memory
    -- type which the buffer collection can be imported as buffer collection
    BufferCollectionPropertiesFUCHSIA -> Flags
memoryTypeBits :: Word32
  , -- | @bufferCount@ is the number of buffers in the collection
    BufferCollectionPropertiesFUCHSIA -> Flags
bufferCount :: Word32
  , -- | @createInfoIndex@ as described in
    -- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#sysmem-chosen-create-infos Sysmem chosen create infos>
    BufferCollectionPropertiesFUCHSIA -> Flags
createInfoIndex :: Word32
  , -- | @sysmemPixelFormat@ is the Sysmem @PixelFormatType@ as defined in
    -- @fuchsia.sysmem\/image_formats.fidl@
    BufferCollectionPropertiesFUCHSIA -> Word64
sysmemPixelFormat :: Word64
  , -- | @formatFeatures@ is a bitmask of
    -- 'Vulkan.Core10.Enums.FormatFeatureFlagBits.FormatFeatureFlagBits' shared
    -- by the buffer collection
    --
    -- #VUID-VkBufferCollectionPropertiesFUCHSIA-formatFeatures-parameter#
    -- @formatFeatures@ /must/ be a valid combination of
    -- 'Vulkan.Core10.Enums.FormatFeatureFlagBits.FormatFeatureFlagBits' values
    --
    -- #VUID-VkBufferCollectionPropertiesFUCHSIA-formatFeatures-requiredbitmask#
    -- @formatFeatures@ /must/ not be @0@
    BufferCollectionPropertiesFUCHSIA -> FormatFeatureFlags
formatFeatures :: FormatFeatureFlags
  , -- | @sysmemColorSpaceIndex@ is a 'SysmemColorSpaceFUCHSIA' struct specifying
    -- the color space
    --
    -- #VUID-VkBufferCollectionPropertiesFUCHSIA-sysmemColorSpaceIndex-parameter#
    -- @sysmemColorSpaceIndex@ /must/ be a valid 'SysmemColorSpaceFUCHSIA'
    -- structure
    BufferCollectionPropertiesFUCHSIA -> SysmemColorSpaceFUCHSIA
sysmemColorSpaceIndex :: SysmemColorSpaceFUCHSIA
  , -- | @samplerYcbcrConversionComponents@ is a
    -- 'Vulkan.Core10.ImageView.ComponentMapping' struct specifying the
    -- component mapping
    --
    -- #VUID-VkBufferCollectionPropertiesFUCHSIA-samplerYcbcrConversionComponents-parameter#
    -- @samplerYcbcrConversionComponents@ /must/ be a valid
    -- 'Vulkan.Core10.ImageView.ComponentMapping' structure
    BufferCollectionPropertiesFUCHSIA -> ComponentMapping
samplerYcbcrConversionComponents :: ComponentMapping
  , -- | @suggestedYcbcrModel@ is a
    -- 'Vulkan.Core11.Enums.SamplerYcbcrModelConversion.SamplerYcbcrModelConversion'
    -- value specifying the suggested Y′CBCR model
    --
    -- #VUID-VkBufferCollectionPropertiesFUCHSIA-suggestedYcbcrModel-parameter#
    -- @suggestedYcbcrModel@ /must/ be a valid
    -- 'Vulkan.Core11.Enums.SamplerYcbcrModelConversion.SamplerYcbcrModelConversion'
    -- value
    BufferCollectionPropertiesFUCHSIA -> SamplerYcbcrModelConversion
suggestedYcbcrModel :: SamplerYcbcrModelConversion
  , -- | @suggestedYcbcrRange@ is a
    -- 'Vulkan.Core11.Enums.SamplerYcbcrRange.SamplerYcbcrRange' value
    -- specifying the suggested Y′CBCR range
    --
    -- #VUID-VkBufferCollectionPropertiesFUCHSIA-suggestedYcbcrRange-parameter#
    -- @suggestedYcbcrRange@ /must/ be a valid
    -- 'Vulkan.Core11.Enums.SamplerYcbcrRange.SamplerYcbcrRange' value
    BufferCollectionPropertiesFUCHSIA -> SamplerYcbcrRange
suggestedYcbcrRange :: SamplerYcbcrRange
  , -- | @suggestedXChromaOffset@ is a
    -- 'Vulkan.Core11.Enums.ChromaLocation.ChromaLocation' value specifying the
    -- suggested X chroma offset
    --
    -- #VUID-VkBufferCollectionPropertiesFUCHSIA-suggestedXChromaOffset-parameter#
    -- @suggestedXChromaOffset@ /must/ be a valid
    -- 'Vulkan.Core11.Enums.ChromaLocation.ChromaLocation' value
    BufferCollectionPropertiesFUCHSIA -> ChromaLocation
suggestedXChromaOffset :: ChromaLocation
  , -- | @suggestedYChromaOffset@ is a
    -- 'Vulkan.Core11.Enums.ChromaLocation.ChromaLocation' value specifying the
    -- suggested Y chroma offset
    --
    -- #VUID-VkBufferCollectionPropertiesFUCHSIA-suggestedYChromaOffset-parameter#
    -- @suggestedYChromaOffset@ /must/ be a valid
    -- 'Vulkan.Core11.Enums.ChromaLocation.ChromaLocation' value
    BufferCollectionPropertiesFUCHSIA -> ChromaLocation
suggestedYChromaOffset :: ChromaLocation
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BufferCollectionPropertiesFUCHSIA)
#endif
deriving instance Show BufferCollectionPropertiesFUCHSIA

instance ToCStruct BufferCollectionPropertiesFUCHSIA where
  withCStruct :: forall b.
BufferCollectionPropertiesFUCHSIA
-> (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA)
    -> IO b)
-> IO b
withCStruct BufferCollectionPropertiesFUCHSIA
x ("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA) -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
104 forall a b. (a -> b) -> a -> b
$ \"pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p BufferCollectionPropertiesFUCHSIA
x (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA) -> IO b
f "pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p)
  pokeCStruct :: forall b.
("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA)
-> BufferCollectionPropertiesFUCHSIA -> IO b -> IO b
pokeCStruct "pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p BufferCollectionPropertiesFUCHSIA{Flags
Word64
ComponentMapping
SysmemColorSpaceFUCHSIA
SamplerYcbcrRange
SamplerYcbcrModelConversion
ChromaLocation
FormatFeatureFlags
suggestedYChromaOffset :: ChromaLocation
suggestedXChromaOffset :: ChromaLocation
suggestedYcbcrRange :: SamplerYcbcrRange
suggestedYcbcrModel :: SamplerYcbcrModelConversion
samplerYcbcrConversionComponents :: ComponentMapping
sysmemColorSpaceIndex :: SysmemColorSpaceFUCHSIA
formatFeatures :: FormatFeatureFlags
sysmemPixelFormat :: Word64
createInfoIndex :: Flags
bufferCount :: Flags
memoryTypeBits :: Flags
$sel:suggestedYChromaOffset:BufferCollectionPropertiesFUCHSIA :: BufferCollectionPropertiesFUCHSIA -> ChromaLocation
$sel:suggestedXChromaOffset:BufferCollectionPropertiesFUCHSIA :: BufferCollectionPropertiesFUCHSIA -> ChromaLocation
$sel:suggestedYcbcrRange:BufferCollectionPropertiesFUCHSIA :: BufferCollectionPropertiesFUCHSIA -> SamplerYcbcrRange
$sel:suggestedYcbcrModel:BufferCollectionPropertiesFUCHSIA :: BufferCollectionPropertiesFUCHSIA -> SamplerYcbcrModelConversion
$sel:samplerYcbcrConversionComponents:BufferCollectionPropertiesFUCHSIA :: BufferCollectionPropertiesFUCHSIA -> ComponentMapping
$sel:sysmemColorSpaceIndex:BufferCollectionPropertiesFUCHSIA :: BufferCollectionPropertiesFUCHSIA -> SysmemColorSpaceFUCHSIA
$sel:formatFeatures:BufferCollectionPropertiesFUCHSIA :: BufferCollectionPropertiesFUCHSIA -> FormatFeatureFlags
$sel:sysmemPixelFormat:BufferCollectionPropertiesFUCHSIA :: BufferCollectionPropertiesFUCHSIA -> Word64
$sel:createInfoIndex:BufferCollectionPropertiesFUCHSIA :: BufferCollectionPropertiesFUCHSIA -> Flags
$sel:bufferCount:BufferCollectionPropertiesFUCHSIA :: BufferCollectionPropertiesFUCHSIA -> Flags
$sel:memoryTypeBits:BufferCollectionPropertiesFUCHSIA :: BufferCollectionPropertiesFUCHSIA -> Flags
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Flags
memoryTypeBits)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (Flags
bufferCount)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Flags
createInfoIndex)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64)) (Word64
sysmemPixelFormat)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr FormatFeatureFlags)) (FormatFeatureFlags
formatFeatures)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr SysmemColorSpaceFUCHSIA)) (SysmemColorSpaceFUCHSIA
sysmemColorSpaceIndex)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr ComponentMapping)) (ComponentMapping
samplerYcbcrConversionComponents)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr SamplerYcbcrModelConversion)) (SamplerYcbcrModelConversion
suggestedYcbcrModel)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
92 :: Ptr SamplerYcbcrRange)) (SamplerYcbcrRange
suggestedYcbcrRange)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr ChromaLocation)) (ChromaLocation
suggestedXChromaOffset)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
100 :: Ptr ChromaLocation)) (ChromaLocation
suggestedYChromaOffset)
    IO b
f
  cStructSize :: Int
cStructSize = Int
104
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA)
-> IO b -> IO b
pokeZeroCStruct "pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr FormatFeatureFlags)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr SysmemColorSpaceFUCHSIA)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr ComponentMapping)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr SamplerYcbcrModelConversion)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
92 :: Ptr SamplerYcbcrRange)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr ChromaLocation)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
100 :: Ptr ChromaLocation)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct BufferCollectionPropertiesFUCHSIA where
  peekCStruct :: ("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA)
-> IO BufferCollectionPropertiesFUCHSIA
peekCStruct "pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p = do
    Flags
memoryTypeBits <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
    Flags
bufferCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
    Flags
createInfoIndex <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
    Word64
sysmemPixelFormat <- forall a. Storable a => Ptr a -> IO a
peek @Word64 (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word64))
    FormatFeatureFlags
formatFeatures <- forall a. Storable a => Ptr a -> IO a
peek @FormatFeatureFlags (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr FormatFeatureFlags))
    SysmemColorSpaceFUCHSIA
sysmemColorSpaceIndex <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @SysmemColorSpaceFUCHSIA (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr SysmemColorSpaceFUCHSIA))
    ComponentMapping
samplerYcbcrConversionComponents <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ComponentMapping (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr ComponentMapping))
    SamplerYcbcrModelConversion
suggestedYcbcrModel <- forall a. Storable a => Ptr a -> IO a
peek @SamplerYcbcrModelConversion (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
88 :: Ptr SamplerYcbcrModelConversion))
    SamplerYcbcrRange
suggestedYcbcrRange <- forall a. Storable a => Ptr a -> IO a
peek @SamplerYcbcrRange (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
92 :: Ptr SamplerYcbcrRange))
    ChromaLocation
suggestedXChromaOffset <- forall a. Storable a => Ptr a -> IO a
peek @ChromaLocation (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
96 :: Ptr ChromaLocation))
    ChromaLocation
suggestedYChromaOffset <- forall a. Storable a => Ptr a -> IO a
peek @ChromaLocation (("pProperties" ::: Ptr BufferCollectionPropertiesFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
100 :: Ptr ChromaLocation))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Flags
-> Flags
-> Flags
-> Word64
-> FormatFeatureFlags
-> SysmemColorSpaceFUCHSIA
-> ComponentMapping
-> SamplerYcbcrModelConversion
-> SamplerYcbcrRange
-> ChromaLocation
-> ChromaLocation
-> BufferCollectionPropertiesFUCHSIA
BufferCollectionPropertiesFUCHSIA
             Flags
memoryTypeBits
             Flags
bufferCount
             Flags
createInfoIndex
             Word64
sysmemPixelFormat
             FormatFeatureFlags
formatFeatures
             SysmemColorSpaceFUCHSIA
sysmemColorSpaceIndex
             ComponentMapping
samplerYcbcrConversionComponents
             SamplerYcbcrModelConversion
suggestedYcbcrModel
             SamplerYcbcrRange
suggestedYcbcrRange
             ChromaLocation
suggestedXChromaOffset
             ChromaLocation
suggestedYChromaOffset

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

instance Zero BufferCollectionPropertiesFUCHSIA where
  zero :: BufferCollectionPropertiesFUCHSIA
zero = Flags
-> Flags
-> Flags
-> Word64
-> FormatFeatureFlags
-> SysmemColorSpaceFUCHSIA
-> ComponentMapping
-> SamplerYcbcrModelConversion
-> SamplerYcbcrRange
-> ChromaLocation
-> ChromaLocation
-> BufferCollectionPropertiesFUCHSIA
BufferCollectionPropertiesFUCHSIA
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkBufferConstraintsInfoFUCHSIA - Structure buffer-based buffer
-- collection constraints
--
-- == Valid Usage
--
-- -   #VUID-VkBufferConstraintsInfoFUCHSIA-requiredFormatFeatures-06404#
--     The @requiredFormatFeatures@ bitmask of
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FormatFeatureFlagBits'
--     /must/ be chosen from among the buffer compatible format features
--     listed in
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#buffer-compatible-format-features buffer compatible format features>
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkBufferConstraintsInfoFUCHSIA-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA'
--
-- -   #VUID-VkBufferConstraintsInfoFUCHSIA-pNext-pNext# @pNext@ /must/ be
--     @NULL@
--
-- -   #VUID-VkBufferConstraintsInfoFUCHSIA-createInfo-parameter#
--     @createInfo@ /must/ be a valid
--     'Vulkan.Core10.Buffer.BufferCreateInfo' structure
--
-- -   #VUID-VkBufferConstraintsInfoFUCHSIA-requiredFormatFeatures-parameter#
--     @requiredFormatFeatures@ /must/ be a valid combination of
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FormatFeatureFlagBits'
--     values
--
-- -   #VUID-VkBufferConstraintsInfoFUCHSIA-bufferCollectionConstraints-parameter#
--     @bufferCollectionConstraints@ /must/ be a valid
--     'BufferCollectionConstraintsInfoFUCHSIA' structure
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'BufferCollectionConstraintsInfoFUCHSIA',
-- 'Vulkan.Core10.Buffer.BufferCreateInfo',
-- 'Vulkan.Core10.Enums.FormatFeatureFlagBits.FormatFeatureFlags',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'setBufferCollectionBufferConstraintsFUCHSIA'
data BufferConstraintsInfoFUCHSIA = BufferConstraintsInfoFUCHSIA
  { -- No documentation found for Nested "VkBufferConstraintsInfoFUCHSIA" "createInfo"
    BufferConstraintsInfoFUCHSIA -> SomeStruct BufferCreateInfo
createInfo :: SomeStruct BufferCreateInfo
  , -- | @requiredFormatFeatures@ bitmask of
    -- 'Vulkan.Core10.Enums.FormatFeatureFlagBits.FormatFeatureFlagBits'
    -- required features of the buffers in the buffer collection
    BufferConstraintsInfoFUCHSIA -> FormatFeatureFlags
requiredFormatFeatures :: FormatFeatureFlags
  , -- | @bufferCollectionConstraints@ is used to supply parameters for the
    -- negotiation and allocation of the buffer collection
    BufferConstraintsInfoFUCHSIA
-> BufferCollectionConstraintsInfoFUCHSIA
bufferCollectionConstraints :: BufferCollectionConstraintsInfoFUCHSIA
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BufferConstraintsInfoFUCHSIA)
#endif
deriving instance Show BufferConstraintsInfoFUCHSIA

instance ToCStruct BufferConstraintsInfoFUCHSIA where
  withCStruct :: forall b.
BufferConstraintsInfoFUCHSIA
-> (("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA)
    -> IO b)
-> IO b
withCStruct BufferConstraintsInfoFUCHSIA
x ("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA)
-> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
120 forall a b. (a -> b) -> a -> b
$ \"pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p BufferConstraintsInfoFUCHSIA
x (("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA)
-> IO b
f "pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p)
  pokeCStruct :: forall b.
("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA)
-> BufferConstraintsInfoFUCHSIA -> IO b -> IO b
pokeCStruct "pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p BufferConstraintsInfoFUCHSIA{BufferCollectionConstraintsInfoFUCHSIA
FormatFeatureFlags
SomeStruct BufferCreateInfo
bufferCollectionConstraints :: BufferCollectionConstraintsInfoFUCHSIA
requiredFormatFeatures :: FormatFeatureFlags
createInfo :: SomeStruct BufferCreateInfo
$sel:bufferCollectionConstraints:BufferConstraintsInfoFUCHSIA :: BufferConstraintsInfoFUCHSIA
-> BufferCollectionConstraintsInfoFUCHSIA
$sel:requiredFormatFeatures:BufferConstraintsInfoFUCHSIA :: BufferConstraintsInfoFUCHSIA -> FormatFeatureFlags
$sel:createInfo:BufferConstraintsInfoFUCHSIA :: BufferConstraintsInfoFUCHSIA -> SomeStruct BufferCreateInfo
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (BufferCreateInfo _)))) (SomeStruct BufferCreateInfo
createInfo) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr FormatFeatureFlags)) (FormatFeatureFlags
requiredFormatFeatures)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr BufferCollectionConstraintsInfoFUCHSIA)) (BufferCollectionConstraintsInfoFUCHSIA
bufferCollectionConstraints)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
120
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA)
-> IO b -> IO b
pokeZeroCStruct "pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (BufferCreateInfo _)))) ((forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct forall a. Zero a => a
zero)) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr BufferCollectionConstraintsInfoFUCHSIA)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct BufferConstraintsInfoFUCHSIA where
  peekCStruct :: ("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA)
-> IO BufferConstraintsInfoFUCHSIA
peekCStruct "pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p = do
    SomeStruct BufferCreateInfo
createInfo <- forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions (("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (BufferCreateInfo _))))
    FormatFeatureFlags
requiredFormatFeatures <- forall a. Storable a => Ptr a -> IO a
peek @FormatFeatureFlags (("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr FormatFeatureFlags))
    BufferCollectionConstraintsInfoFUCHSIA
bufferCollectionConstraints <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @BufferCollectionConstraintsInfoFUCHSIA (("pBufferConstraintsInfo" ::: Ptr BufferConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80 :: Ptr BufferCollectionConstraintsInfoFUCHSIA))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ SomeStruct BufferCreateInfo
-> FormatFeatureFlags
-> BufferCollectionConstraintsInfoFUCHSIA
-> BufferConstraintsInfoFUCHSIA
BufferConstraintsInfoFUCHSIA
             SomeStruct BufferCreateInfo
createInfo FormatFeatureFlags
requiredFormatFeatures BufferCollectionConstraintsInfoFUCHSIA
bufferCollectionConstraints

instance Zero BufferConstraintsInfoFUCHSIA where
  zero :: BufferConstraintsInfoFUCHSIA
zero = SomeStruct BufferCreateInfo
-> FormatFeatureFlags
-> BufferCollectionConstraintsInfoFUCHSIA
-> BufferConstraintsInfoFUCHSIA
BufferConstraintsInfoFUCHSIA
           (forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct forall a. Zero a => a
zero)
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkSysmemColorSpaceFUCHSIA - Structure describing the buffer collections
-- color space
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'BufferCollectionPropertiesFUCHSIA',
-- 'ImageFormatConstraintsInfoFUCHSIA',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data SysmemColorSpaceFUCHSIA = SysmemColorSpaceFUCHSIA
  { -- | @colorSpace@ value of the Sysmem @ColorSpaceType@
    --
    -- #VUID-VkSysmemColorSpaceFUCHSIA-colorSpace-06402# @colorSpace@ /must/ be
    -- a @ColorSpaceType@ as defined in @fuchsia.sysmem\/image_formats.fidl@
    SysmemColorSpaceFUCHSIA -> Flags
colorSpace :: Word32 }
  deriving (Typeable, SysmemColorSpaceFUCHSIA -> SysmemColorSpaceFUCHSIA -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SysmemColorSpaceFUCHSIA -> SysmemColorSpaceFUCHSIA -> Bool
$c/= :: SysmemColorSpaceFUCHSIA -> SysmemColorSpaceFUCHSIA -> Bool
== :: SysmemColorSpaceFUCHSIA -> SysmemColorSpaceFUCHSIA -> Bool
$c== :: SysmemColorSpaceFUCHSIA -> SysmemColorSpaceFUCHSIA -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SysmemColorSpaceFUCHSIA)
#endif
deriving instance Show SysmemColorSpaceFUCHSIA

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

instance FromCStruct SysmemColorSpaceFUCHSIA where
  peekCStruct :: Ptr SysmemColorSpaceFUCHSIA -> IO SysmemColorSpaceFUCHSIA
peekCStruct Ptr SysmemColorSpaceFUCHSIA
p = do
    Flags
colorSpace <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SysmemColorSpaceFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Flags -> SysmemColorSpaceFUCHSIA
SysmemColorSpaceFUCHSIA
             Flags
colorSpace

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

instance Zero SysmemColorSpaceFUCHSIA where
  zero :: SysmemColorSpaceFUCHSIA
zero = Flags -> SysmemColorSpaceFUCHSIA
SysmemColorSpaceFUCHSIA
           forall a. Zero a => a
zero


-- | VkImageFormatConstraintsInfoFUCHSIA - Structure image-based buffer
-- collection constraints
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'Vulkan.Core10.Enums.FormatFeatureFlagBits.FormatFeatureFlags',
-- 'ImageConstraintsInfoFUCHSIA', 'Vulkan.Core10.Image.ImageCreateInfo',
-- 'ImageFormatConstraintsFlagsFUCHSIA',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'SysmemColorSpaceFUCHSIA'
data ImageFormatConstraintsInfoFUCHSIA = ImageFormatConstraintsInfoFUCHSIA
  { -- | @imageCreateInfo@ is the 'Vulkan.Core10.Image.ImageCreateInfo' used to
    -- create a 'Vulkan.Core10.Handles.Image' that is to use memory from the
    -- 'Vulkan.Extensions.Handles.BufferCollectionFUCHSIA'
    --
    -- #VUID-VkImageFormatConstraintsInfoFUCHSIA-imageCreateInfo-parameter#
    -- @imageCreateInfo@ /must/ be a valid
    -- 'Vulkan.Core10.Image.ImageCreateInfo' structure
    ImageFormatConstraintsInfoFUCHSIA -> SomeStruct ImageCreateInfo
imageCreateInfo :: SomeStruct ImageCreateInfo
  , -- | @requiredFormatFeatures@ is a bitmask of
    -- 'Vulkan.Core10.Enums.FormatFeatureFlagBits.FormatFeatureFlagBits'
    -- specifying required features of the buffers in the buffer collection
    --
    -- #VUID-VkImageFormatConstraintsInfoFUCHSIA-requiredFormatFeatures-parameter#
    -- @requiredFormatFeatures@ /must/ be a valid combination of
    -- 'Vulkan.Core10.Enums.FormatFeatureFlagBits.FormatFeatureFlagBits' values
    --
    -- #VUID-VkImageFormatConstraintsInfoFUCHSIA-requiredFormatFeatures-requiredbitmask#
    -- @requiredFormatFeatures@ /must/ not be @0@
    ImageFormatConstraintsInfoFUCHSIA -> FormatFeatureFlags
requiredFormatFeatures :: FormatFeatureFlags
  , -- | @flags@ is reserved for future use
    --
    -- #VUID-VkImageFormatConstraintsInfoFUCHSIA-flags-zerobitmask# @flags@
    -- /must/ be @0@
    ImageFormatConstraintsInfoFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
flags :: ImageFormatConstraintsFlagsFUCHSIA
  , -- | @sysmemPixelFormat@ is a @PixelFormatType@ value from the
    -- @fuchsia.sysmem\/image_formats.fidl@ FIDL interface
    ImageFormatConstraintsInfoFUCHSIA -> Word64
sysmemPixelFormat :: Word64
  , -- | @pColorSpaces@ is a pointer to an array of 'SysmemColorSpaceFUCHSIA'
    -- structs of size @colorSpaceCount@
    --
    -- #VUID-VkImageFormatConstraintsInfoFUCHSIA-pColorSpaces-parameter#
    -- @pColorSpaces@ /must/ be a valid pointer to an array of
    -- @colorSpaceCount@ valid 'SysmemColorSpaceFUCHSIA' structures
    ImageFormatConstraintsInfoFUCHSIA -> Vector SysmemColorSpaceFUCHSIA
colorSpaces :: Vector SysmemColorSpaceFUCHSIA
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImageFormatConstraintsInfoFUCHSIA)
#endif
deriving instance Show ImageFormatConstraintsInfoFUCHSIA

instance ToCStruct ImageFormatConstraintsInfoFUCHSIA where
  withCStruct :: forall b.
ImageFormatConstraintsInfoFUCHSIA
-> (Ptr ImageFormatConstraintsInfoFUCHSIA -> IO b) -> IO b
withCStruct ImageFormatConstraintsInfoFUCHSIA
x Ptr ImageFormatConstraintsInfoFUCHSIA -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
136 forall a b. (a -> b) -> a -> b
$ \Ptr ImageFormatConstraintsInfoFUCHSIA
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageFormatConstraintsInfoFUCHSIA
p ImageFormatConstraintsInfoFUCHSIA
x (Ptr ImageFormatConstraintsInfoFUCHSIA -> IO b
f Ptr ImageFormatConstraintsInfoFUCHSIA
p)
  pokeCStruct :: forall b.
Ptr ImageFormatConstraintsInfoFUCHSIA
-> ImageFormatConstraintsInfoFUCHSIA -> IO b -> IO b
pokeCStruct Ptr ImageFormatConstraintsInfoFUCHSIA
p ImageFormatConstraintsInfoFUCHSIA{Word64
Vector SysmemColorSpaceFUCHSIA
FormatFeatureFlags
SomeStruct ImageCreateInfo
ImageFormatConstraintsFlagsFUCHSIA
colorSpaces :: Vector SysmemColorSpaceFUCHSIA
sysmemPixelFormat :: Word64
flags :: ImageFormatConstraintsFlagsFUCHSIA
requiredFormatFeatures :: FormatFeatureFlags
imageCreateInfo :: SomeStruct ImageCreateInfo
$sel:colorSpaces:ImageFormatConstraintsInfoFUCHSIA :: ImageFormatConstraintsInfoFUCHSIA -> Vector SysmemColorSpaceFUCHSIA
$sel:sysmemPixelFormat:ImageFormatConstraintsInfoFUCHSIA :: ImageFormatConstraintsInfoFUCHSIA -> Word64
$sel:flags:ImageFormatConstraintsInfoFUCHSIA :: ImageFormatConstraintsInfoFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
$sel:requiredFormatFeatures:ImageFormatConstraintsInfoFUCHSIA :: ImageFormatConstraintsInfoFUCHSIA -> FormatFeatureFlags
$sel:imageCreateInfo:ImageFormatConstraintsInfoFUCHSIA :: ImageFormatConstraintsInfoFUCHSIA -> SomeStruct ImageCreateInfo
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (ImageCreateInfo _)))) (SomeStruct ImageCreateInfo
imageCreateInfo) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
104 :: Ptr FormatFeatureFlags)) (FormatFeatureFlags
requiredFormatFeatures)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
108 :: Ptr ImageFormatConstraintsFlagsFUCHSIA)) (ImageFormatConstraintsFlagsFUCHSIA
flags)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
112 :: Ptr Word64)) (Word64
sysmemPixelFormat)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
120 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector SysmemColorSpaceFUCHSIA
colorSpaces)) :: Word32))
    Ptr SysmemColorSpaceFUCHSIA
pPColorSpaces' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @SysmemColorSpaceFUCHSIA ((forall a. Vector a -> Int
Data.Vector.length (Vector SysmemColorSpaceFUCHSIA
colorSpaces)) forall a. Num a => a -> a -> a
* Int
24)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i SysmemColorSpaceFUCHSIA
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr SysmemColorSpaceFUCHSIA
pPColorSpaces' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
24 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SysmemColorSpaceFUCHSIA) (SysmemColorSpaceFUCHSIA
e)) (Vector SysmemColorSpaceFUCHSIA
colorSpaces)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
128 :: Ptr (Ptr SysmemColorSpaceFUCHSIA))) (Ptr SysmemColorSpaceFUCHSIA
pPColorSpaces')
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
136
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr ImageFormatConstraintsInfoFUCHSIA -> IO b -> IO b
pokeZeroCStruct Ptr ImageFormatConstraintsInfoFUCHSIA
p IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall (a :: [*] -> *) b.
(forall (es :: [*]).
 (Extendss a es, PokeChain es) =>
 ToCStruct (a es)) =>
Ptr (SomeStruct a) -> SomeStruct a -> IO b -> IO b
pokeSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (ImageCreateInfo _)))) ((forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct forall a. Zero a => a
zero)) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
104 :: Ptr FormatFeatureFlags)) (forall a. Zero a => a
zero)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f

instance FromCStruct ImageFormatConstraintsInfoFUCHSIA where
  peekCStruct :: Ptr ImageFormatConstraintsInfoFUCHSIA
-> IO ImageFormatConstraintsInfoFUCHSIA
peekCStruct Ptr ImageFormatConstraintsInfoFUCHSIA
p = do
    SomeStruct ImageCreateInfo
imageCreateInfo <- forall (a :: [*] -> *).
(Extensible a,
 forall (es :: [*]).
 (Extendss a es, PeekChain es) =>
 FromCStruct (a es)) =>
Ptr (SomeStruct a) -> IO (SomeStruct a)
peekSomeCStruct (forall (a :: [*] -> *) (es :: [*]).
Ptr (a es) -> Ptr (SomeStruct a)
forgetExtensions ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr (ImageCreateInfo _))))
    FormatFeatureFlags
requiredFormatFeatures <- forall a. Storable a => Ptr a -> IO a
peek @FormatFeatureFlags ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
104 :: Ptr FormatFeatureFlags))
    ImageFormatConstraintsFlagsFUCHSIA
flags <- forall a. Storable a => Ptr a -> IO a
peek @ImageFormatConstraintsFlagsFUCHSIA ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
108 :: Ptr ImageFormatConstraintsFlagsFUCHSIA))
    Word64
sysmemPixelFormat <- forall a. Storable a => Ptr a -> IO a
peek @Word64 ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
112 :: Ptr Word64))
    Flags
colorSpaceCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
120 :: Ptr Word32))
    Ptr SysmemColorSpaceFUCHSIA
pColorSpaces <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr SysmemColorSpaceFUCHSIA) ((Ptr ImageFormatConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
128 :: Ptr (Ptr SysmemColorSpaceFUCHSIA)))
    Vector SysmemColorSpaceFUCHSIA
pColorSpaces' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Flags
colorSpaceCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @SysmemColorSpaceFUCHSIA ((Ptr SysmemColorSpaceFUCHSIA
pColorSpaces forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
24 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr SysmemColorSpaceFUCHSIA)))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ SomeStruct ImageCreateInfo
-> FormatFeatureFlags
-> ImageFormatConstraintsFlagsFUCHSIA
-> Word64
-> Vector SysmemColorSpaceFUCHSIA
-> ImageFormatConstraintsInfoFUCHSIA
ImageFormatConstraintsInfoFUCHSIA
             SomeStruct ImageCreateInfo
imageCreateInfo
             FormatFeatureFlags
requiredFormatFeatures
             ImageFormatConstraintsFlagsFUCHSIA
flags
             Word64
sysmemPixelFormat
             Vector SysmemColorSpaceFUCHSIA
pColorSpaces'

instance Zero ImageFormatConstraintsInfoFUCHSIA where
  zero :: ImageFormatConstraintsInfoFUCHSIA
zero = SomeStruct ImageCreateInfo
-> FormatFeatureFlags
-> ImageFormatConstraintsFlagsFUCHSIA
-> Word64
-> Vector SysmemColorSpaceFUCHSIA
-> ImageFormatConstraintsInfoFUCHSIA
ImageFormatConstraintsInfoFUCHSIA
           (forall (a :: [*] -> *) (es :: [*]).
(Extendss a es, PokeChain es, Show (Chain es)) =>
a es -> SomeStruct a
SomeStruct forall a. Zero a => a
zero)
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Monoid a => a
mempty


-- | VkImageConstraintsInfoFUCHSIA - Structure of image-based buffer
-- collection constraints
--
-- == Valid Usage
--
-- -   #VUID-VkImageConstraintsInfoFUCHSIA-pFormatConstraints-06395# All
--     elements of @pFormatConstraints@ /must/ have at least one bit set in
--     its 'ImageFormatConstraintsInfoFUCHSIA'::@requiredFormatFeatures@
--
-- -   #VUID-VkImageConstraintsInfoFUCHSIA-pFormatConstraints-06396# If
--     @pFormatConstraints@::@imageCreateInfo@::@usage@ contains
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_SAMPLED_BIT',
--     then @pFormatConstraints@::@requiredFormatFeatures@ /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_SAMPLED_IMAGE_BIT'
--
-- -   #VUID-VkImageConstraintsInfoFUCHSIA-pFormatConstraints-06397# If
--     @pFormatConstraints@::@imageCreateInfo@::@usage@ contains
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_STORAGE_BIT',
--     then @pFormatConstraints@::@requiredFormatFeatures@ /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_STORAGE_IMAGE_BIT'
--
-- -   #VUID-VkImageConstraintsInfoFUCHSIA-pFormatConstraints-06398# If
--     @pFormatConstraints@::@imageCreateInfo@::@usage@ contains
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_COLOR_ATTACHMENT_BIT',
--     then @pFormatConstraints@::@requiredFormatFeatures@ /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_COLOR_ATTACHMENT_BIT'
--
-- -   #VUID-VkImageConstraintsInfoFUCHSIA-pFormatConstraints-06399# If
--     @pFormatConstraints@::@imageCreateInfo@::@usage@ contains
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT',
--     then @pFormatConstraints@::@requiredFormatFeatures@ /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT'
--
-- -   #VUID-VkImageConstraintsInfoFUCHSIA-pFormatConstraints-06400# If
--     @pFormatConstraints@::@imageCreateInfo@::@usage@ contains
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_INPUT_ATTACHMENT_BIT',
--     then @pFormatConstraints@::@requiredFormatFeatures@ /must/ contain
--     at least one of
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_COLOR_ATTACHMENT_BIT'
--     or
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT'
--
-- -   #VUID-VkImageConstraintsInfoFUCHSIA-attachmentFragmentShadingRate-06401#
--     If the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-attachmentFragmentShadingRate attachmentFragmentShadingRate>
--     feature is enabled, and
--     @pFormatConstraints@::@imageCreateInfo@::@usage@ contains
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR',
--     then @pFormatConstraints@::@requiredFormatFeatures@ /must/ contain
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkImageConstraintsInfoFUCHSIA-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA'
--
-- -   #VUID-VkImageConstraintsInfoFUCHSIA-pNext-pNext# @pNext@ /must/ be
--     @NULL@
--
-- -   #VUID-VkImageConstraintsInfoFUCHSIA-pFormatConstraints-parameter#
--     @pFormatConstraints@ /must/ be a valid pointer to an array of
--     @formatConstraintsCount@ valid 'ImageFormatConstraintsInfoFUCHSIA'
--     structures
--
-- -   #VUID-VkImageConstraintsInfoFUCHSIA-bufferCollectionConstraints-parameter#
--     @bufferCollectionConstraints@ /must/ be a valid
--     'BufferCollectionConstraintsInfoFUCHSIA' structure
--
-- -   #VUID-VkImageConstraintsInfoFUCHSIA-flags-parameter# @flags@ /must/
--     be a valid combination of 'ImageConstraintsInfoFlagBitsFUCHSIA'
--     values
--
-- -   #VUID-VkImageConstraintsInfoFUCHSIA-formatConstraintsCount-arraylength#
--     @formatConstraintsCount@ /must/ be greater than @0@
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'BufferCollectionConstraintsInfoFUCHSIA',
-- 'ImageConstraintsInfoFlagsFUCHSIA', 'ImageFormatConstraintsInfoFUCHSIA',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'setBufferCollectionImageConstraintsFUCHSIA'
data ImageConstraintsInfoFUCHSIA = ImageConstraintsInfoFUCHSIA
  { -- | @pFormatConstraints@ is a pointer to an array of
    -- 'ImageFormatConstraintsInfoFUCHSIA' structures of size
    -- @formatConstraintsCount@ that is used to further constrain buffer
    -- collection format selection for image-based buffer collections.
    ImageConstraintsInfoFUCHSIA
-> Vector ImageFormatConstraintsInfoFUCHSIA
formatConstraints :: Vector ImageFormatConstraintsInfoFUCHSIA
  , -- | @bufferCollectionConstraints@ is a
    -- 'BufferCollectionConstraintsInfoFUCHSIA' structure used to supply
    -- parameters for the negotiation and allocation for buffer-based buffer
    -- collections.
    ImageConstraintsInfoFUCHSIA
-> BufferCollectionConstraintsInfoFUCHSIA
bufferCollectionConstraints :: BufferCollectionConstraintsInfoFUCHSIA
  , -- | @flags@ is a 'ImageConstraintsInfoFlagBitsFUCHSIA' value specifying
    -- hints about the type of memory Sysmem should allocate for the buffer
    -- collection.
    ImageConstraintsInfoFUCHSIA -> ImageConstraintsInfoFlagBitsFUCHSIA
flags :: ImageConstraintsInfoFlagsFUCHSIA
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImageConstraintsInfoFUCHSIA)
#endif
deriving instance Show ImageConstraintsInfoFUCHSIA

instance ToCStruct ImageConstraintsInfoFUCHSIA where
  withCStruct :: forall b.
ImageConstraintsInfoFUCHSIA
-> (("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA)
    -> IO b)
-> IO b
withCStruct ImageConstraintsInfoFUCHSIA
x ("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA)
-> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
80 forall a b. (a -> b) -> a -> b
$ \"pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct "pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p ImageConstraintsInfoFUCHSIA
x (("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA)
-> IO b
f "pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p)
  pokeCStruct :: forall b.
("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA)
-> ImageConstraintsInfoFUCHSIA -> IO b -> IO b
pokeCStruct "pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p ImageConstraintsInfoFUCHSIA{Vector ImageFormatConstraintsInfoFUCHSIA
BufferCollectionConstraintsInfoFUCHSIA
ImageConstraintsInfoFlagBitsFUCHSIA
flags :: ImageConstraintsInfoFlagBitsFUCHSIA
bufferCollectionConstraints :: BufferCollectionConstraintsInfoFUCHSIA
formatConstraints :: Vector ImageFormatConstraintsInfoFUCHSIA
$sel:flags:ImageConstraintsInfoFUCHSIA :: ImageConstraintsInfoFUCHSIA -> ImageConstraintsInfoFlagBitsFUCHSIA
$sel:bufferCollectionConstraints:ImageConstraintsInfoFUCHSIA :: ImageConstraintsInfoFUCHSIA
-> BufferCollectionConstraintsInfoFUCHSIA
$sel:formatConstraints:ImageConstraintsInfoFUCHSIA :: ImageConstraintsInfoFUCHSIA
-> Vector ImageFormatConstraintsInfoFUCHSIA
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector ImageFormatConstraintsInfoFUCHSIA
formatConstraints)) :: Word32))
    Ptr ImageFormatConstraintsInfoFUCHSIA
pPFormatConstraints' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @ImageFormatConstraintsInfoFUCHSIA ((forall a. Vector a -> Int
Data.Vector.length (Vector ImageFormatConstraintsInfoFUCHSIA
formatConstraints)) forall a. Num a => a -> a -> a
* Int
136)
    forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i ImageFormatConstraintsInfoFUCHSIA
e -> forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct (Ptr ImageFormatConstraintsInfoFUCHSIA
pPFormatConstraints' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
136 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ImageFormatConstraintsInfoFUCHSIA) (ImageFormatConstraintsInfoFUCHSIA
e) forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall a b. (a -> b) -> a -> b
$ ())) (Vector ImageFormatConstraintsInfoFUCHSIA
formatConstraints)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr ImageFormatConstraintsInfoFUCHSIA))) (Ptr ImageFormatConstraintsInfoFUCHSIA
pPFormatConstraints')
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr BufferCollectionConstraintsInfoFUCHSIA)) (BufferCollectionConstraintsInfoFUCHSIA
bufferCollectionConstraints)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr ImageConstraintsInfoFlagsFUCHSIA)) (ImageConstraintsInfoFlagBitsFUCHSIA
flags)
    forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
  cStructSize :: Int
cStructSize = Int
80
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA)
-> IO b -> IO b
pokeZeroCStruct "pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke (("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr BufferCollectionConstraintsInfoFUCHSIA)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct ImageConstraintsInfoFUCHSIA where
  peekCStruct :: ("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA)
-> IO ImageConstraintsInfoFUCHSIA
peekCStruct "pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p = do
    Flags
formatConstraintsCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 (("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
    Ptr ImageFormatConstraintsInfoFUCHSIA
pFormatConstraints <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ImageFormatConstraintsInfoFUCHSIA) (("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr ImageFormatConstraintsInfoFUCHSIA)))
    Vector ImageFormatConstraintsInfoFUCHSIA
pFormatConstraints' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Flags
formatConstraintsCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @ImageFormatConstraintsInfoFUCHSIA ((Ptr ImageFormatConstraintsInfoFUCHSIA
pFormatConstraints forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
136 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr ImageFormatConstraintsInfoFUCHSIA)))
    BufferCollectionConstraintsInfoFUCHSIA
bufferCollectionConstraints <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @BufferCollectionConstraintsInfoFUCHSIA (("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr BufferCollectionConstraintsInfoFUCHSIA))
    ImageConstraintsInfoFlagBitsFUCHSIA
flags <- forall a. Storable a => Ptr a -> IO a
peek @ImageConstraintsInfoFlagsFUCHSIA (("pImageConstraintsInfo" ::: Ptr ImageConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: Ptr ImageConstraintsInfoFlagsFUCHSIA))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Vector ImageFormatConstraintsInfoFUCHSIA
-> BufferCollectionConstraintsInfoFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFUCHSIA
ImageConstraintsInfoFUCHSIA
             Vector ImageFormatConstraintsInfoFUCHSIA
pFormatConstraints' BufferCollectionConstraintsInfoFUCHSIA
bufferCollectionConstraints ImageConstraintsInfoFlagBitsFUCHSIA
flags

instance Zero ImageConstraintsInfoFUCHSIA where
  zero :: ImageConstraintsInfoFUCHSIA
zero = Vector ImageFormatConstraintsInfoFUCHSIA
-> BufferCollectionConstraintsInfoFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFUCHSIA
ImageConstraintsInfoFUCHSIA
           forall a. Monoid a => a
mempty
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkBufferCollectionConstraintsInfoFUCHSIA - Structure of general buffer
-- collection constraints
--
-- = Description
--
-- Sysmem uses all buffer count parameters in combination to determine the
-- number of buffers it will allocate. Sysmem defines buffer count
-- constraints in @fuchsia.sysmem\/constraints.fidl@.
--
-- /Camping/ as referred to by @minBufferCountForCamping@, is the number of
-- buffers that should be available for the participant that are not for
-- transient use. This number of buffers is required for the participant to
-- logically operate.
--
-- /Slack/ as referred to by @minBufferCountForDedicatedSlack@ and
-- @minBufferCountForSharedSlack@, refers to the number of buffers desired
-- by participants for optimal performance.
-- @minBufferCountForDedicatedSlack@ refers to the current participant.
-- @minBufferCountForSharedSlack@ refers to buffer slack for all
-- participants in the collection.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'BufferConstraintsInfoFUCHSIA', 'ImageConstraintsInfoFUCHSIA',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data BufferCollectionConstraintsInfoFUCHSIA = BufferCollectionConstraintsInfoFUCHSIA
  { -- | @minBufferCount@ is the minimum number of buffers available in the
    -- collection
    BufferCollectionConstraintsInfoFUCHSIA -> Flags
minBufferCount :: Word32
  , -- | @maxBufferCount@ is the maximum number of buffers allowed in the
    -- collection
    BufferCollectionConstraintsInfoFUCHSIA -> Flags
maxBufferCount :: Word32
  , -- | @minBufferCountForCamping@ is the per-participant minimum buffers for
    -- camping
    BufferCollectionConstraintsInfoFUCHSIA -> Flags
minBufferCountForCamping :: Word32
  , -- | @minBufferCountForDedicatedSlack@ is the per-participant minimum buffers
    -- for dedicated slack
    BufferCollectionConstraintsInfoFUCHSIA -> Flags
minBufferCountForDedicatedSlack :: Word32
  , -- | @minBufferCountForSharedSlack@ is the per-participant minimum buffers
    -- for shared slack
    BufferCollectionConstraintsInfoFUCHSIA -> Flags
minBufferCountForSharedSlack :: Word32
  }
  deriving (Typeable, BufferCollectionConstraintsInfoFUCHSIA
-> BufferCollectionConstraintsInfoFUCHSIA -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BufferCollectionConstraintsInfoFUCHSIA
-> BufferCollectionConstraintsInfoFUCHSIA -> Bool
$c/= :: BufferCollectionConstraintsInfoFUCHSIA
-> BufferCollectionConstraintsInfoFUCHSIA -> Bool
== :: BufferCollectionConstraintsInfoFUCHSIA
-> BufferCollectionConstraintsInfoFUCHSIA -> Bool
$c== :: BufferCollectionConstraintsInfoFUCHSIA
-> BufferCollectionConstraintsInfoFUCHSIA -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (BufferCollectionConstraintsInfoFUCHSIA)
#endif
deriving instance Show BufferCollectionConstraintsInfoFUCHSIA

instance ToCStruct BufferCollectionConstraintsInfoFUCHSIA where
  withCStruct :: forall b.
BufferCollectionConstraintsInfoFUCHSIA
-> (Ptr BufferCollectionConstraintsInfoFUCHSIA -> IO b) -> IO b
withCStruct BufferCollectionConstraintsInfoFUCHSIA
x Ptr BufferCollectionConstraintsInfoFUCHSIA -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 forall a b. (a -> b) -> a -> b
$ \Ptr BufferCollectionConstraintsInfoFUCHSIA
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr BufferCollectionConstraintsInfoFUCHSIA
p BufferCollectionConstraintsInfoFUCHSIA
x (Ptr BufferCollectionConstraintsInfoFUCHSIA -> IO b
f Ptr BufferCollectionConstraintsInfoFUCHSIA
p)
  pokeCStruct :: forall b.
Ptr BufferCollectionConstraintsInfoFUCHSIA
-> BufferCollectionConstraintsInfoFUCHSIA -> IO b -> IO b
pokeCStruct Ptr BufferCollectionConstraintsInfoFUCHSIA
p BufferCollectionConstraintsInfoFUCHSIA{Flags
minBufferCountForSharedSlack :: Flags
minBufferCountForDedicatedSlack :: Flags
minBufferCountForCamping :: Flags
maxBufferCount :: Flags
minBufferCount :: Flags
$sel:minBufferCountForSharedSlack:BufferCollectionConstraintsInfoFUCHSIA :: BufferCollectionConstraintsInfoFUCHSIA -> Flags
$sel:minBufferCountForDedicatedSlack:BufferCollectionConstraintsInfoFUCHSIA :: BufferCollectionConstraintsInfoFUCHSIA -> Flags
$sel:minBufferCountForCamping:BufferCollectionConstraintsInfoFUCHSIA :: BufferCollectionConstraintsInfoFUCHSIA -> Flags
$sel:maxBufferCount:BufferCollectionConstraintsInfoFUCHSIA :: BufferCollectionConstraintsInfoFUCHSIA -> Flags
$sel:minBufferCount:BufferCollectionConstraintsInfoFUCHSIA :: BufferCollectionConstraintsInfoFUCHSIA -> Flags
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Flags
minBufferCount)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (Flags
maxBufferCount)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Flags
minBufferCountForCamping)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (Flags
minBufferCountForDedicatedSlack)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Flags
minBufferCountForSharedSlack)
    IO b
f
  cStructSize :: Int
cStructSize = Int
40
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr BufferCollectionConstraintsInfoFUCHSIA -> IO b -> IO b
pokeZeroCStruct Ptr BufferCollectionConstraintsInfoFUCHSIA
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct BufferCollectionConstraintsInfoFUCHSIA where
  peekCStruct :: Ptr BufferCollectionConstraintsInfoFUCHSIA
-> IO BufferCollectionConstraintsInfoFUCHSIA
peekCStruct Ptr BufferCollectionConstraintsInfoFUCHSIA
p = do
    Flags
minBufferCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
    Flags
maxBufferCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
    Flags
minBufferCountForCamping <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32))
    Flags
minBufferCountForDedicatedSlack <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32))
    Flags
minBufferCountForSharedSlack <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr BufferCollectionConstraintsInfoFUCHSIA
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Flags
-> Flags
-> Flags
-> Flags
-> Flags
-> BufferCollectionConstraintsInfoFUCHSIA
BufferCollectionConstraintsInfoFUCHSIA
             Flags
minBufferCount
             Flags
maxBufferCount
             Flags
minBufferCountForCamping
             Flags
minBufferCountForDedicatedSlack
             Flags
minBufferCountForSharedSlack

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

instance Zero BufferCollectionConstraintsInfoFUCHSIA where
  zero :: BufferCollectionConstraintsInfoFUCHSIA
zero = Flags
-> Flags
-> Flags
-> Flags
-> Flags
-> BufferCollectionConstraintsInfoFUCHSIA
BufferCollectionConstraintsInfoFUCHSIA
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero


-- | VkImageFormatConstraintsFlagsFUCHSIA - Reserved for future use
--
-- = Description
--
-- 'ImageFormatConstraintsFlagsFUCHSIA' is a bitmask type for setting a
-- mask, but is currently reserved for future use.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'ImageFormatConstraintsInfoFUCHSIA'
newtype ImageFormatConstraintsFlagsFUCHSIA = ImageFormatConstraintsFlagsFUCHSIA Flags
  deriving newtype (ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Bool
$c/= :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Bool
== :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Bool
$c== :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Bool
Eq, Eq ImageFormatConstraintsFlagsFUCHSIA
ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Bool
ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Ordering
ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
$cmin :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
max :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
$cmax :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
>= :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Bool
$c>= :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Bool
> :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Bool
$c> :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Bool
<= :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Bool
$c<= :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Bool
< :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Bool
$c< :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Bool
compare :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Ordering
$ccompare :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> Ordering
Ord, Ptr ImageFormatConstraintsFlagsFUCHSIA
-> IO ImageFormatConstraintsFlagsFUCHSIA
Ptr ImageFormatConstraintsFlagsFUCHSIA
-> Int -> IO ImageFormatConstraintsFlagsFUCHSIA
Ptr ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA -> IO ()
Ptr ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> IO ()
ImageFormatConstraintsFlagsFUCHSIA -> Int
forall b. Ptr b -> Int -> IO ImageFormatConstraintsFlagsFUCHSIA
forall b.
Ptr b -> Int -> ImageFormatConstraintsFlagsFUCHSIA -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> IO ()
$cpoke :: Ptr ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA -> IO ()
peek :: Ptr ImageFormatConstraintsFlagsFUCHSIA
-> IO ImageFormatConstraintsFlagsFUCHSIA
$cpeek :: Ptr ImageFormatConstraintsFlagsFUCHSIA
-> IO ImageFormatConstraintsFlagsFUCHSIA
pokeByteOff :: forall b.
Ptr b -> Int -> ImageFormatConstraintsFlagsFUCHSIA -> IO ()
$cpokeByteOff :: forall b.
Ptr b -> Int -> ImageFormatConstraintsFlagsFUCHSIA -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO ImageFormatConstraintsFlagsFUCHSIA
$cpeekByteOff :: forall b. Ptr b -> Int -> IO ImageFormatConstraintsFlagsFUCHSIA
pokeElemOff :: Ptr ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA -> IO ()
$cpokeElemOff :: Ptr ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA -> IO ()
peekElemOff :: Ptr ImageFormatConstraintsFlagsFUCHSIA
-> Int -> IO ImageFormatConstraintsFlagsFUCHSIA
$cpeekElemOff :: Ptr ImageFormatConstraintsFlagsFUCHSIA
-> Int -> IO ImageFormatConstraintsFlagsFUCHSIA
alignment :: ImageFormatConstraintsFlagsFUCHSIA -> Int
$calignment :: ImageFormatConstraintsFlagsFUCHSIA -> Int
sizeOf :: ImageFormatConstraintsFlagsFUCHSIA -> Int
$csizeOf :: ImageFormatConstraintsFlagsFUCHSIA -> Int
Storable, ImageFormatConstraintsFlagsFUCHSIA
forall a. a -> Zero a
zero :: ImageFormatConstraintsFlagsFUCHSIA
$czero :: ImageFormatConstraintsFlagsFUCHSIA
Zero, Eq ImageFormatConstraintsFlagsFUCHSIA
ImageFormatConstraintsFlagsFUCHSIA
Int -> ImageFormatConstraintsFlagsFUCHSIA
ImageFormatConstraintsFlagsFUCHSIA -> Bool
ImageFormatConstraintsFlagsFUCHSIA -> Int
ImageFormatConstraintsFlagsFUCHSIA -> Maybe Int
ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
ImageFormatConstraintsFlagsFUCHSIA -> Int -> Bool
ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
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
popCount :: ImageFormatConstraintsFlagsFUCHSIA -> Int
$cpopCount :: ImageFormatConstraintsFlagsFUCHSIA -> Int
rotateR :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
$crotateR :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
rotateL :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
$crotateL :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
unsafeShiftR :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
$cunsafeShiftR :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
shiftR :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
$cshiftR :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
unsafeShiftL :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
$cunsafeShiftL :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
shiftL :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
$cshiftL :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
isSigned :: ImageFormatConstraintsFlagsFUCHSIA -> Bool
$cisSigned :: ImageFormatConstraintsFlagsFUCHSIA -> Bool
bitSize :: ImageFormatConstraintsFlagsFUCHSIA -> Int
$cbitSize :: ImageFormatConstraintsFlagsFUCHSIA -> Int
bitSizeMaybe :: ImageFormatConstraintsFlagsFUCHSIA -> Maybe Int
$cbitSizeMaybe :: ImageFormatConstraintsFlagsFUCHSIA -> Maybe Int
testBit :: ImageFormatConstraintsFlagsFUCHSIA -> Int -> Bool
$ctestBit :: ImageFormatConstraintsFlagsFUCHSIA -> Int -> Bool
complementBit :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
$ccomplementBit :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
clearBit :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
$cclearBit :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
setBit :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
$csetBit :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
bit :: Int -> ImageFormatConstraintsFlagsFUCHSIA
$cbit :: Int -> ImageFormatConstraintsFlagsFUCHSIA
zeroBits :: ImageFormatConstraintsFlagsFUCHSIA
$czeroBits :: ImageFormatConstraintsFlagsFUCHSIA
rotate :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
$crotate :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
shift :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
$cshift :: ImageFormatConstraintsFlagsFUCHSIA
-> Int -> ImageFormatConstraintsFlagsFUCHSIA
complement :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
$ccomplement :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
xor :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
$cxor :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
.|. :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
$c.|. :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
.&. :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
$c.&. :: ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
-> ImageFormatConstraintsFlagsFUCHSIA
Bits, Bits ImageFormatConstraintsFlagsFUCHSIA
ImageFormatConstraintsFlagsFUCHSIA -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: ImageFormatConstraintsFlagsFUCHSIA -> Int
$ccountTrailingZeros :: ImageFormatConstraintsFlagsFUCHSIA -> Int
countLeadingZeros :: ImageFormatConstraintsFlagsFUCHSIA -> Int
$ccountLeadingZeros :: ImageFormatConstraintsFlagsFUCHSIA -> Int
finiteBitSize :: ImageFormatConstraintsFlagsFUCHSIA -> Int
$cfiniteBitSize :: ImageFormatConstraintsFlagsFUCHSIA -> Int
FiniteBits)

conNameImageFormatConstraintsFlagsFUCHSIA :: String
conNameImageFormatConstraintsFlagsFUCHSIA :: String
conNameImageFormatConstraintsFlagsFUCHSIA = String
"ImageFormatConstraintsFlagsFUCHSIA"

enumPrefixImageFormatConstraintsFlagsFUCHSIA :: String
enumPrefixImageFormatConstraintsFlagsFUCHSIA :: String
enumPrefixImageFormatConstraintsFlagsFUCHSIA = String
""

showTableImageFormatConstraintsFlagsFUCHSIA :: [(ImageFormatConstraintsFlagsFUCHSIA, String)]
showTableImageFormatConstraintsFlagsFUCHSIA :: [(ImageFormatConstraintsFlagsFUCHSIA, String)]
showTableImageFormatConstraintsFlagsFUCHSIA = []

instance Show ImageFormatConstraintsFlagsFUCHSIA where
  showsPrec :: Int -> ImageFormatConstraintsFlagsFUCHSIA -> ShowS
showsPrec =
    forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixImageFormatConstraintsFlagsFUCHSIA
      [(ImageFormatConstraintsFlagsFUCHSIA, String)]
showTableImageFormatConstraintsFlagsFUCHSIA
      String
conNameImageFormatConstraintsFlagsFUCHSIA
      (\(ImageFormatConstraintsFlagsFUCHSIA Flags
x) -> Flags
x)
      (\Flags
x -> String -> ShowS
showString String
"0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex Flags
x)

instance Read ImageFormatConstraintsFlagsFUCHSIA where
  readPrec :: ReadPrec ImageFormatConstraintsFlagsFUCHSIA
readPrec =
    forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixImageFormatConstraintsFlagsFUCHSIA
      [(ImageFormatConstraintsFlagsFUCHSIA, String)]
showTableImageFormatConstraintsFlagsFUCHSIA
      String
conNameImageFormatConstraintsFlagsFUCHSIA
      Flags -> ImageFormatConstraintsFlagsFUCHSIA
ImageFormatConstraintsFlagsFUCHSIA

type ImageConstraintsInfoFlagsFUCHSIA = ImageConstraintsInfoFlagBitsFUCHSIA

-- | VkImageConstraintsInfoFlagBitsFUCHSIA - Bitmask specifying image
-- constraints flags
--
-- = Description
--
-- General hints about the type of memory that should be allocated by
-- Sysmem based on the expected usage of the images in the buffer
-- collection include:
--
-- For protected memory:
--
-- Note that if all participants in the buffer collection (Vulkan or
-- otherwise) specify that protected memory is optional, Sysmem will not
-- allocate protected memory.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_FUCHSIA_buffer_collection VK_FUCHSIA_buffer_collection>,
-- 'ImageConstraintsInfoFlagsFUCHSIA'
newtype ImageConstraintsInfoFlagBitsFUCHSIA = ImageConstraintsInfoFlagBitsFUCHSIA Flags
  deriving newtype (ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
$c/= :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
== :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
$c== :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
Eq, Eq ImageConstraintsInfoFlagBitsFUCHSIA
ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Ordering
ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
$cmin :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
max :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
$cmax :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
>= :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
$c>= :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
> :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
$c> :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
<= :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
$c<= :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
< :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
$c< :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
compare :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Ordering
$ccompare :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> Ordering
Ord, Ptr ImageConstraintsInfoFlagBitsFUCHSIA
-> IO ImageConstraintsInfoFlagBitsFUCHSIA
Ptr ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> IO ImageConstraintsInfoFlagBitsFUCHSIA
Ptr ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA -> IO ()
Ptr ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> IO ()
ImageConstraintsInfoFlagBitsFUCHSIA -> Int
forall b. Ptr b -> Int -> IO ImageConstraintsInfoFlagBitsFUCHSIA
forall b.
Ptr b -> Int -> ImageConstraintsInfoFlagBitsFUCHSIA -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> IO ()
$cpoke :: Ptr ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA -> IO ()
peek :: Ptr ImageConstraintsInfoFlagBitsFUCHSIA
-> IO ImageConstraintsInfoFlagBitsFUCHSIA
$cpeek :: Ptr ImageConstraintsInfoFlagBitsFUCHSIA
-> IO ImageConstraintsInfoFlagBitsFUCHSIA
pokeByteOff :: forall b.
Ptr b -> Int -> ImageConstraintsInfoFlagBitsFUCHSIA -> IO ()
$cpokeByteOff :: forall b.
Ptr b -> Int -> ImageConstraintsInfoFlagBitsFUCHSIA -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO ImageConstraintsInfoFlagBitsFUCHSIA
$cpeekByteOff :: forall b. Ptr b -> Int -> IO ImageConstraintsInfoFlagBitsFUCHSIA
pokeElemOff :: Ptr ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA -> IO ()
$cpokeElemOff :: Ptr ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA -> IO ()
peekElemOff :: Ptr ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> IO ImageConstraintsInfoFlagBitsFUCHSIA
$cpeekElemOff :: Ptr ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> IO ImageConstraintsInfoFlagBitsFUCHSIA
alignment :: ImageConstraintsInfoFlagBitsFUCHSIA -> Int
$calignment :: ImageConstraintsInfoFlagBitsFUCHSIA -> Int
sizeOf :: ImageConstraintsInfoFlagBitsFUCHSIA -> Int
$csizeOf :: ImageConstraintsInfoFlagBitsFUCHSIA -> Int
Storable, ImageConstraintsInfoFlagBitsFUCHSIA
forall a. a -> Zero a
zero :: ImageConstraintsInfoFlagBitsFUCHSIA
$czero :: ImageConstraintsInfoFlagBitsFUCHSIA
Zero, Eq ImageConstraintsInfoFlagBitsFUCHSIA
ImageConstraintsInfoFlagBitsFUCHSIA
Int -> ImageConstraintsInfoFlagBitsFUCHSIA
ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
ImageConstraintsInfoFlagBitsFUCHSIA -> Int
ImageConstraintsInfoFlagBitsFUCHSIA -> Maybe Int
ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
ImageConstraintsInfoFlagBitsFUCHSIA -> Int -> Bool
ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
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
popCount :: ImageConstraintsInfoFlagBitsFUCHSIA -> Int
$cpopCount :: ImageConstraintsInfoFlagBitsFUCHSIA -> Int
rotateR :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
$crotateR :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
rotateL :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
$crotateL :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
unsafeShiftR :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
$cunsafeShiftR :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
shiftR :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
$cshiftR :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
unsafeShiftL :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
$cunsafeShiftL :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
shiftL :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
$cshiftL :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
isSigned :: ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
$cisSigned :: ImageConstraintsInfoFlagBitsFUCHSIA -> Bool
bitSize :: ImageConstraintsInfoFlagBitsFUCHSIA -> Int
$cbitSize :: ImageConstraintsInfoFlagBitsFUCHSIA -> Int
bitSizeMaybe :: ImageConstraintsInfoFlagBitsFUCHSIA -> Maybe Int
$cbitSizeMaybe :: ImageConstraintsInfoFlagBitsFUCHSIA -> Maybe Int
testBit :: ImageConstraintsInfoFlagBitsFUCHSIA -> Int -> Bool
$ctestBit :: ImageConstraintsInfoFlagBitsFUCHSIA -> Int -> Bool
complementBit :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
$ccomplementBit :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
clearBit :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
$cclearBit :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
setBit :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
$csetBit :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
bit :: Int -> ImageConstraintsInfoFlagBitsFUCHSIA
$cbit :: Int -> ImageConstraintsInfoFlagBitsFUCHSIA
zeroBits :: ImageConstraintsInfoFlagBitsFUCHSIA
$czeroBits :: ImageConstraintsInfoFlagBitsFUCHSIA
rotate :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
$crotate :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
shift :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
$cshift :: ImageConstraintsInfoFlagBitsFUCHSIA
-> Int -> ImageConstraintsInfoFlagBitsFUCHSIA
complement :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
$ccomplement :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
xor :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
$cxor :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
.|. :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
$c.|. :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
.&. :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
$c.&. :: ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
-> ImageConstraintsInfoFlagBitsFUCHSIA
Bits, Bits ImageConstraintsInfoFlagBitsFUCHSIA
ImageConstraintsInfoFlagBitsFUCHSIA -> Int
forall b.
Bits b -> (b -> Int) -> (b -> Int) -> (b -> Int) -> FiniteBits b
countTrailingZeros :: ImageConstraintsInfoFlagBitsFUCHSIA -> Int
$ccountTrailingZeros :: ImageConstraintsInfoFlagBitsFUCHSIA -> Int
countLeadingZeros :: ImageConstraintsInfoFlagBitsFUCHSIA -> Int
$ccountLeadingZeros :: ImageConstraintsInfoFlagBitsFUCHSIA -> Int
finiteBitSize :: ImageConstraintsInfoFlagBitsFUCHSIA -> Int
$cfiniteBitSize :: ImageConstraintsInfoFlagBitsFUCHSIA -> Int
FiniteBits)

-- | 'IMAGE_CONSTRAINTS_INFO_CPU_READ_RARELY_FUCHSIA'
pattern $bIMAGE_CONSTRAINTS_INFO_CPU_READ_RARELY_FUCHSIA :: ImageConstraintsInfoFlagBitsFUCHSIA
$mIMAGE_CONSTRAINTS_INFO_CPU_READ_RARELY_FUCHSIA :: forall {r}.
ImageConstraintsInfoFlagBitsFUCHSIA
-> ((# #) -> r) -> ((# #) -> r) -> r
IMAGE_CONSTRAINTS_INFO_CPU_READ_RARELY_FUCHSIA = ImageConstraintsInfoFlagBitsFUCHSIA 0x00000001

-- | 'IMAGE_CONSTRAINTS_INFO_CPU_READ_OFTEN_FUCHSIA'
pattern $bIMAGE_CONSTRAINTS_INFO_CPU_READ_OFTEN_FUCHSIA :: ImageConstraintsInfoFlagBitsFUCHSIA
$mIMAGE_CONSTRAINTS_INFO_CPU_READ_OFTEN_FUCHSIA :: forall {r}.
ImageConstraintsInfoFlagBitsFUCHSIA
-> ((# #) -> r) -> ((# #) -> r) -> r
IMAGE_CONSTRAINTS_INFO_CPU_READ_OFTEN_FUCHSIA = ImageConstraintsInfoFlagBitsFUCHSIA 0x00000002

-- | 'IMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA'
pattern $bIMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA :: ImageConstraintsInfoFlagBitsFUCHSIA
$mIMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA :: forall {r}.
ImageConstraintsInfoFlagBitsFUCHSIA
-> ((# #) -> r) -> ((# #) -> r) -> r
IMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA = ImageConstraintsInfoFlagBitsFUCHSIA 0x00000004

-- | 'IMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA'
pattern $bIMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA :: ImageConstraintsInfoFlagBitsFUCHSIA
$mIMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA :: forall {r}.
ImageConstraintsInfoFlagBitsFUCHSIA
-> ((# #) -> r) -> ((# #) -> r) -> r
IMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA = ImageConstraintsInfoFlagBitsFUCHSIA 0x00000008

-- | 'IMAGE_CONSTRAINTS_INFO_PROTECTED_OPTIONAL_FUCHSIA' specifies that
-- protected memory is optional for the buffer collection.
pattern $bIMAGE_CONSTRAINTS_INFO_PROTECTED_OPTIONAL_FUCHSIA :: ImageConstraintsInfoFlagBitsFUCHSIA
$mIMAGE_CONSTRAINTS_INFO_PROTECTED_OPTIONAL_FUCHSIA :: forall {r}.
ImageConstraintsInfoFlagBitsFUCHSIA
-> ((# #) -> r) -> ((# #) -> r) -> r
IMAGE_CONSTRAINTS_INFO_PROTECTED_OPTIONAL_FUCHSIA = ImageConstraintsInfoFlagBitsFUCHSIA 0x00000010

conNameImageConstraintsInfoFlagBitsFUCHSIA :: String
conNameImageConstraintsInfoFlagBitsFUCHSIA :: String
conNameImageConstraintsInfoFlagBitsFUCHSIA = String
"ImageConstraintsInfoFlagBitsFUCHSIA"

enumPrefixImageConstraintsInfoFlagBitsFUCHSIA :: String
enumPrefixImageConstraintsInfoFlagBitsFUCHSIA :: String
enumPrefixImageConstraintsInfoFlagBitsFUCHSIA = String
"IMAGE_CONSTRAINTS_INFO_"

showTableImageConstraintsInfoFlagBitsFUCHSIA :: [(ImageConstraintsInfoFlagBitsFUCHSIA, String)]
showTableImageConstraintsInfoFlagBitsFUCHSIA :: [(ImageConstraintsInfoFlagBitsFUCHSIA, String)]
showTableImageConstraintsInfoFlagBitsFUCHSIA =
  [
    ( ImageConstraintsInfoFlagBitsFUCHSIA
IMAGE_CONSTRAINTS_INFO_CPU_READ_RARELY_FUCHSIA
    , String
"CPU_READ_RARELY_FUCHSIA"
    )
  ,
    ( ImageConstraintsInfoFlagBitsFUCHSIA
IMAGE_CONSTRAINTS_INFO_CPU_READ_OFTEN_FUCHSIA
    , String
"CPU_READ_OFTEN_FUCHSIA"
    )
  ,
    ( ImageConstraintsInfoFlagBitsFUCHSIA
IMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA
    , String
"CPU_WRITE_RARELY_FUCHSIA"
    )
  ,
    ( ImageConstraintsInfoFlagBitsFUCHSIA
IMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA
    , String
"CPU_WRITE_OFTEN_FUCHSIA"
    )
  ,
    ( ImageConstraintsInfoFlagBitsFUCHSIA
IMAGE_CONSTRAINTS_INFO_PROTECTED_OPTIONAL_FUCHSIA
    , String
"PROTECTED_OPTIONAL_FUCHSIA"
    )
  ]

instance Show ImageConstraintsInfoFlagBitsFUCHSIA where
  showsPrec :: Int -> ImageConstraintsInfoFlagBitsFUCHSIA -> ShowS
showsPrec =
    forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
      String
enumPrefixImageConstraintsInfoFlagBitsFUCHSIA
      [(ImageConstraintsInfoFlagBitsFUCHSIA, String)]
showTableImageConstraintsInfoFlagBitsFUCHSIA
      String
conNameImageConstraintsInfoFlagBitsFUCHSIA
      (\(ImageConstraintsInfoFlagBitsFUCHSIA Flags
x) -> Flags
x)
      (\Flags
x -> String -> ShowS
showString String
"0x" forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. (Integral a, Show a) => a -> ShowS
showHex Flags
x)

instance Read ImageConstraintsInfoFlagBitsFUCHSIA where
  readPrec :: ReadPrec ImageConstraintsInfoFlagBitsFUCHSIA
readPrec =
    forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
      String
enumPrefixImageConstraintsInfoFlagBitsFUCHSIA
      [(ImageConstraintsInfoFlagBitsFUCHSIA, String)]
showTableImageConstraintsInfoFlagBitsFUCHSIA
      String
conNameImageConstraintsInfoFlagBitsFUCHSIA
      Flags -> ImageConstraintsInfoFlagBitsFUCHSIA
ImageConstraintsInfoFlagBitsFUCHSIA

type FUCHSIA_BUFFER_COLLECTION_SPEC_VERSION = 2

-- No documentation found for TopLevel "VK_FUCHSIA_BUFFER_COLLECTION_SPEC_VERSION"
pattern FUCHSIA_BUFFER_COLLECTION_SPEC_VERSION :: forall a . Integral a => a
pattern $bFUCHSIA_BUFFER_COLLECTION_SPEC_VERSION :: forall a. Integral a => a
$mFUCHSIA_BUFFER_COLLECTION_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
FUCHSIA_BUFFER_COLLECTION_SPEC_VERSION = 2


type FUCHSIA_BUFFER_COLLECTION_EXTENSION_NAME = "VK_FUCHSIA_buffer_collection"

-- No documentation found for TopLevel "VK_FUCHSIA_BUFFER_COLLECTION_EXTENSION_NAME"
pattern FUCHSIA_BUFFER_COLLECTION_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bFUCHSIA_BUFFER_COLLECTION_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mFUCHSIA_BUFFER_COLLECTION_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
FUCHSIA_BUFFER_COLLECTION_EXTENSION_NAME = "VK_FUCHSIA_buffer_collection"