{-# language CPP #-}
-- | = Name
--
-- VK_QCOM_fragment_density_map_offset - device extension
--
-- == VK_QCOM_fragment_density_map_offset
--
-- [__Name String__]
--     @VK_QCOM_fragment_density_map_offset@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     426
--
-- [__Revision__]
--     1
--
-- [__Ratification Status__]
--     Not ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_physical_device_properties2 VK_KHR_get_physical_device_properties2>
--     and
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_fragment_density_map VK_EXT_fragment_density_map>
--
-- [__Contact__]
--
--     -   Matthew Netsch
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_QCOM_fragment_density_map_offset] @mnetsch%0A*Here describe the issue or question you have about the VK_QCOM_fragment_density_map_offset extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2021-09-03
--
-- [__Contributors__]
--
--     -   Matthew Netsch, Qualcomm Technologies, Inc.
--
--     -   Jonathan Wicks, Qualcomm Technologies, Inc.
--
--     -   Jonathan Tinkham, Qualcomm Technologies, Inc.
--
--     -   Jeff Leger, Qualcomm Technologies, Inc.
--
-- == Description
--
-- This extension allows an application to specify offsets to a fragment
-- density map attachment, changing the framebuffer location where density
-- values are applied to without having to regenerate the fragment density
-- map.
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM'
--
-- -   Extending
--     'Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2.SubpassEndInfo':
--
--     -   'SubpassFragmentDensityMapOffsetEndInfoQCOM'
--
-- == New Enum Constants
--
-- -   'QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME'
--
-- -   'QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION'
--
-- -   Extending
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.ImageCreateFlagBits':
--
--     -   'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM'
--
-- == Version History
--
-- -   Revision 1, 2021-09-03 (Matthew Netsch)
--
--     -   Initial version
--
-- == See Also
--
-- 'PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM',
-- 'PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM',
-- 'SubpassFragmentDensityMapOffsetEndInfoQCOM'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_QCOM_fragment_density_map_offset Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_QCOM_fragment_density_map_offset  ( PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM(..)
                                                              , PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM(..)
                                                              , SubpassFragmentDensityMapOffsetEndInfoQCOM(..)
                                                              , QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION
                                                              , pattern QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION
                                                              , QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME
                                                              , pattern QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME
                                                              ) where

import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import 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 Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.FundamentalTypes (Extent2D)
import Vulkan.Core10.FundamentalTypes (Offset2D)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM))
-- | VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM - Structure
-- describing fragment density map offset features that can be supported by
-- an implementation
--
-- = Members
--
-- This structure describes the following feature:
--
-- = Description
--
-- If the 'PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM' structure is
-- included in the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2',
-- it is filled in to indicate whether each corresponding feature is
-- supported. 'PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM' /can/
-- also be used in the @pNext@ chain of
-- 'Vulkan.Core10.Device.DeviceCreateInfo' to selectively enable these
-- features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QCOM_fragment_density_map_offset VK_QCOM_fragment_density_map_offset>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM = PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
  { -- No documentation found for Nested "VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM" "fragmentDensityMapOffset"
    PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> Bool
fragmentDensityMapOffset :: Bool }
  deriving (Typeable, PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> Bool
$c/= :: PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> Bool
== :: PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> Bool
$c== :: PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM
-> PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM)
#endif
deriving instance Show PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM

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

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

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

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


-- | VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM - Structure
-- describing fragment density map offset properties that can be supported
-- by an implementation
--
-- = Description
--
-- If the 'PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM' structure
-- is included in the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceProperties2',
-- it is filled in with each corresponding implementation-dependent
-- property.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QCOM_fragment_density_map_offset VK_QCOM_fragment_density_map_offset>,
-- 'Vulkan.Core10.FundamentalTypes.Extent2D',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM = PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
  { -- | #limits-fragmentdensityoffsetgranularity#
    -- @fragmentDensityOffsetGranularity@ is the granularity for
    -- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#renderpass-fragmentdensitymapoffsets fragment density offsets>.
    PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM -> Extent2D
fragmentDensityOffsetGranularity :: Extent2D }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM)
#endif
deriving instance Show PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM

instance ToCStruct PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM where
  withCStruct :: forall b.
PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
-> (Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
    -> IO b)
-> IO b
withCStruct PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
x Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
x (Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM -> IO b
f Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p)
  pokeCStruct :: forall b.
Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
-> PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
-> IO b
-> IO b
pokeCStruct Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM{Extent2D
fragmentDensityOffsetGranularity :: Extent2D
$sel:fragmentDensityOffsetGranularity:PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM :: PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM -> Extent2D
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
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 PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Extent2D)) (Extent2D
fragmentDensityOffsetGranularity)
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
-> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
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 PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Extent2D)) (forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM where
  peekCStruct :: Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
-> IO PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
peekCStruct Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p = do
    Extent2D
fragmentDensityOffsetGranularity <- forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D ((Ptr PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Extent2D))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Extent2D -> PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
             Extent2D
fragmentDensityOffsetGranularity

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

instance Zero PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM where
  zero :: PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
zero = Extent2D -> PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
PhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM
           forall a. Zero a => a
zero


-- | VkSubpassFragmentDensityMapOffsetEndInfoQCOM - Structure specifying
-- fragment density map offset subpass end information
--
-- = Description
--
-- The array elements are given per @layer@ as defined by
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#fragmentdensitymap-fetch-density-value Fetch Density Value>,
-- where index = layer. Each (x,y) offset is in framebuffer pixels and
-- shifts the fetch of the fragment density map by that amount. Offsets can
-- be positive or negative.
--
-- Offset values specified for any subpass that is not the last subpass in
-- the render pass are ignored. If the
-- 'Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2.SubpassEndInfo'::@pNext@
-- chain for the last subpass of a render pass does not include
-- 'SubpassFragmentDensityMapOffsetEndInfoQCOM', or if
-- @fragmentDensityOffsetCount@ is zero, then the offset (0,0) is used for
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#fragmentdensitymap-fetch-density-value Fetch Density Value>.
--
-- == Valid Usage
--
-- -   #VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-fragmentDensityMapOffsets-06503#
--     If the
--     <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#features-fragmentDensityMapOffsets fragmentDensityMapOffsets>
--     feature is not enabled or fragment density map is not enabled in the
--     render pass, @fragmentDensityOffsetCount@ /must/ equal @0@
--
-- -   #VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-fragmentDensityMapAttachment-06504#
--     If
--     'Vulkan.Core10.Pass.SubpassDescription'::@fragmentDensityMapAttachment@
--     is not is not 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' and was
--     not created with
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM',
--     @fragmentDensityOffsetCount@ /must/ equal @0@
--
-- -   #VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-pDepthStencilAttachment-06505#
--     If
--     'Vulkan.Core10.Pass.SubpassDescription'::@pDepthStencilAttachment@
--     is not is not 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' and was
--     not created with
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM',
--     @fragmentDensityOffsetCount@ /must/ equal @0@
--
-- -   #VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-pInputAttachments-06506#
--     If any element of
--     'Vulkan.Core10.Pass.SubpassDescription'::@pInputAttachments@ is not
--     is not 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' and was not
--     created with
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM',
--     @fragmentDensityOffsetCount@ /must/ equal @0@
--
-- -   #VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-pColorAttachments-06507#
--     If any element of
--     'Vulkan.Core10.Pass.SubpassDescription'::@pColorAttachments@ is not
--     is not 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' and was not
--     created with
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM',
--     @fragmentDensityOffsetCount@ /must/ equal @0@
--
-- -   #VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-pResolveAttachments-06508#
--     If any element of
--     'Vulkan.Core10.Pass.SubpassDescription'::@pResolveAttachments@ is
--     not is not 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' and was
--     not created with
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM',
--     @fragmentDensityOffsetCount@ /must/ equal @0@
--
-- -   #VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-pPreserveAttachments-06509#
--     If any element of
--     'Vulkan.Core10.Pass.SubpassDescription'::@pPreserveAttachments@ is
--     not is not 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED' and was
--     not created with
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM',
--     @fragmentDensityOffsetCount@ /must/ equal @0@
--
-- -   #VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-fragmentDensityOffsetCount-06510#
--     If @fragmentDensityOffsetCount@ is not @0@ and multiview is enabled
--     for the render pass, @fragmentDensityOffsetCount@ /must/ equal the
--     @layerCount@ that was specified in creating the fragment density map
--     attachment view
--
-- -   #VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-fragmentDensityOffsetCount-06511#
--     If @fragmentDensityOffsetCount@ is not @0@ and multiview is not
--     enabled for the render pass, @fragmentDensityOffsetCount@ /must/
--     equal @1@
--
-- -   #VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-x-06512# The @x@
--     component of each element of @pFragmentDensityOffsets@ /must/ be an
--     integer multiple of @fragmentDensityOffsetGranularity.width@
--
-- -   #VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-y-06513# The @y@
--     component of each element of @pFragmentDensityOffsets@ /must/ be an
--     integer multiple of @fragmentDensityOffsetGranularity.height@
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-sType-sType#
--     @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM'
--
-- -   #VUID-VkSubpassFragmentDensityMapOffsetEndInfoQCOM-pFragmentDensityOffsets-parameter#
--     If @fragmentDensityOffsetCount@ is not @0@,
--     @pFragmentDensityOffsets@ /must/ be a valid pointer to an array of
--     @fragmentDensityOffsetCount@
--     'Vulkan.Core10.FundamentalTypes.Offset2D' structures
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_QCOM_fragment_density_map_offset VK_QCOM_fragment_density_map_offset>,
-- 'Vulkan.Core10.FundamentalTypes.Offset2D',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data SubpassFragmentDensityMapOffsetEndInfoQCOM = SubpassFragmentDensityMapOffsetEndInfoQCOM
  { -- | @pFragmentDensityOffsets@ is a pointer to an array of
    -- 'Vulkan.Core10.FundamentalTypes.Offset2D' structs, each of which
    -- describes the offset per layer.
    SubpassFragmentDensityMapOffsetEndInfoQCOM -> Vector Offset2D
fragmentDensityOffsets :: Vector Offset2D }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SubpassFragmentDensityMapOffsetEndInfoQCOM)
#endif
deriving instance Show SubpassFragmentDensityMapOffsetEndInfoQCOM

instance ToCStruct SubpassFragmentDensityMapOffsetEndInfoQCOM where
  withCStruct :: forall b.
SubpassFragmentDensityMapOffsetEndInfoQCOM
-> (Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM -> IO b) -> IO b
withCStruct SubpassFragmentDensityMapOffsetEndInfoQCOM
x Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p SubpassFragmentDensityMapOffsetEndInfoQCOM
x (Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM -> IO b
f Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p)
  pokeCStruct :: forall b.
Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
-> SubpassFragmentDensityMapOffsetEndInfoQCOM -> IO b -> IO b
pokeCStruct Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p SubpassFragmentDensityMapOffsetEndInfoQCOM{Vector Offset2D
fragmentDensityOffsets :: Vector Offset2D
$sel:fragmentDensityOffsets:SubpassFragmentDensityMapOffsetEndInfoQCOM :: SubpassFragmentDensityMapOffsetEndInfoQCOM -> Vector Offset2D
..} 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 SubpassFragmentDensityMapOffsetEndInfoQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM)
    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 SubpassFragmentDensityMapOffsetEndInfoQCOM
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 ((Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
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 Offset2D
fragmentDensityOffsets)) :: Word32))
    Ptr Offset2D
pPFragmentDensityOffsets' <- 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 @Offset2D ((forall a. Vector a -> Int
Data.Vector.length (Vector Offset2D
fragmentDensityOffsets)) forall a. Num a => a -> a -> a
* Int
8)
    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 Offset2D
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Offset2D
pPFragmentDensityOffsets' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Offset2D) (Offset2D
e)) (Vector Offset2D
fragmentDensityOffsets)
    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 SubpassFragmentDensityMapOffsetEndInfoQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Offset2D))) (Ptr Offset2D
pPFragmentDensityOffsets')
    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
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b.
Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM -> IO b -> IO b
pokeZeroCStruct Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    IO b
f

instance FromCStruct SubpassFragmentDensityMapOffsetEndInfoQCOM where
  peekCStruct :: Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
-> IO SubpassFragmentDensityMapOffsetEndInfoQCOM
peekCStruct Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p = do
    Word32
fragmentDensityOffsetCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
    Ptr Offset2D
pFragmentDensityOffsets <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Offset2D) ((Ptr SubpassFragmentDensityMapOffsetEndInfoQCOM
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Offset2D)))
    Vector Offset2D
pFragmentDensityOffsets' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word32
fragmentDensityOffsetCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Offset2D ((Ptr Offset2D
pFragmentDensityOffsets forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Offset2D)))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Vector Offset2D -> SubpassFragmentDensityMapOffsetEndInfoQCOM
SubpassFragmentDensityMapOffsetEndInfoQCOM
             Vector Offset2D
pFragmentDensityOffsets'

instance Zero SubpassFragmentDensityMapOffsetEndInfoQCOM where
  zero :: SubpassFragmentDensityMapOffsetEndInfoQCOM
zero = Vector Offset2D -> SubpassFragmentDensityMapOffsetEndInfoQCOM
SubpassFragmentDensityMapOffsetEndInfoQCOM
           forall a. Monoid a => a
mempty


type QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION"
pattern QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION :: forall a . Integral a => a
pattern $bQCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION :: forall a. Integral a => a
$mQCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION = 1


type QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME = "VK_QCOM_fragment_density_map_offset"

-- No documentation found for TopLevel "VK_QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME"
pattern QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bQCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mQCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME = "VK_QCOM_fragment_density_map_offset"