{-# language CPP #-}
-- | = Name
--
-- VK_EXT_fragment_density_map - device extension
--
-- == VK_EXT_fragment_density_map
--
-- [__Name String__]
--     @VK_EXT_fragment_density_map@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     219
--
-- [__Revision__]
--     1
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires Vulkan 1.0
--
--     -   Requires @VK_KHR_get_physical_device_properties2@
--
-- [__Contact__]
--
--     -   Matthew Netsch
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?title=VK_EXT_fragment_density_map:%20&body=@mnetsch%20 >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2018-09-25
--
-- [__Interactions and External Dependencies__]
--
--     -   This extension requires
--         <https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/EXT/SPV_EXT_fragment_invocation_density.html SPV_EXT_fragment_invocation_density>
--
-- [__Contributors__]
--
--     -   Matthew Netsch, Qualcomm Technologies, Inc.
--
--     -   Robert VanReenen, Qualcomm Technologies, Inc.
--
--     -   Jonathan Wicks, Qualcomm Technologies, Inc.
--
--     -   Tate Hornbeck, Qualcomm Technologies, Inc.
--
--     -   Sam Holmes, Qualcomm Technologies, Inc.
--
--     -   Jeff Leger, Qualcomm Technologies, Inc.
--
--     -   Jan-Harald Fredriksen, ARM
--
--     -   Jeff Bolz, NVIDIA
--
--     -   Pat Brown, NVIDIA
--
--     -   Daniel Rakos, AMD
--
--     -   Piers Daniell, NVIDIA
--
-- == Description
--
-- This extension allows an application to specify areas of the render
-- target where the fragment shader may be invoked fewer times. These
-- fragments are broadcasted out to multiple pixels to cover the render
-- target.
--
-- The primary use of this extension is to reduce workloads in areas where
-- lower quality may not be perceived such as the distorted edges of a lens
-- or the periphery of a user’s gaze.
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceFragmentDensityMapFeaturesEXT'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'PhysicalDeviceFragmentDensityMapPropertiesEXT'
--
-- -   Extending 'Vulkan.Core10.Pass.RenderPassCreateInfo',
--     'Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2.RenderPassCreateInfo2':
--
--     -   'RenderPassFragmentDensityMapCreateInfoEXT'
--
-- == New Enum Constants
--
-- -   'EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME'
--
-- -   'EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.AccessFlagBits.AccessFlagBits':
--
--     -   'Vulkan.Core10.Enums.AccessFlagBits.ACCESS_FRAGMENT_DENSITY_MAP_READ_BIT_EXT'
--
-- -   Extending
--     'Vulkan.Core10.Enums.FormatFeatureFlagBits.FormatFeatureFlagBits':
--
--     -   'Vulkan.Core10.Enums.FormatFeatureFlagBits.FORMAT_FEATURE_FRAGMENT_DENSITY_MAP_BIT_EXT'
--
-- -   Extending
--     'Vulkan.Core10.Enums.ImageCreateFlagBits.ImageCreateFlagBits':
--
--     -   'Vulkan.Core10.Enums.ImageCreateFlagBits.IMAGE_CREATE_SUBSAMPLED_BIT_EXT'
--
-- -   Extending 'Vulkan.Core10.Enums.ImageLayout.ImageLayout':
--
--     -   'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT'
--
-- -   Extending
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.ImageUsageFlagBits':
--
--     -   'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_FRAGMENT_DENSITY_MAP_BIT_EXT'
--
-- -   Extending
--     'Vulkan.Core10.Enums.ImageViewCreateFlagBits.ImageViewCreateFlagBits':
--
--     -   'Vulkan.Core10.Enums.ImageViewCreateFlagBits.IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT'
--
-- -   Extending
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PipelineStageFlagBits':
--
--     -   'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT'
--
-- -   Extending
--     'Vulkan.Core10.Enums.SamplerCreateFlagBits.SamplerCreateFlagBits':
--
--     -   'Vulkan.Core10.Enums.SamplerCreateFlagBits.SAMPLER_CREATE_SUBSAMPLED_BIT_EXT'
--
--     -   'Vulkan.Core10.Enums.SamplerCreateFlagBits.SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT'
--
-- == New or Modified Built-In Variables
--
-- -   <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#interfaces-builtin-variables-fraginvocationcount FragInvocationCountEXT>
--
-- -   <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#interfaces-builtin-variables-fragsize FragSizeEXT>
--
-- == New SPIR-V Capabilities
--
-- -   <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#spirvenv-capabilities-table-fragmentdensity FragmentDensityEXT>
--
-- == Version History
--
-- -   Revision 1, 2018-09-25 (Matthew Netsch)
--
--     -   Initial version
--
-- = See Also
--
-- 'PhysicalDeviceFragmentDensityMapFeaturesEXT',
-- 'PhysicalDeviceFragmentDensityMapPropertiesEXT',
-- 'RenderPassFragmentDensityMapCreateInfoEXT'
--
-- = Document Notes
--
-- For more information, see the
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_fragment_density_map Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_EXT_fragment_density_map  ( PhysicalDeviceFragmentDensityMapFeaturesEXT(..)
                                                      , PhysicalDeviceFragmentDensityMapPropertiesEXT(..)
                                                      , RenderPassFragmentDensityMapCreateInfoEXT(..)
                                                      , EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION
                                                      , pattern EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION
                                                      , EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME
                                                      , pattern EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME
                                                      ) where

import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
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.Kind (Type)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core10.Pass (AttachmentReference)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.FundamentalTypes (Extent2D)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT))
-- | VkPhysicalDeviceFragmentDensityMapFeaturesEXT - Structure describing
-- fragment density map features that can be supported by an implementation
--
-- = Members
--
-- The members of the 'PhysicalDeviceFragmentDensityMapFeaturesEXT'
-- structure describe the following features:
--
-- = Description
--
-- If the 'PhysicalDeviceFragmentDensityMapFeaturesEXT' structure is
-- included in the @pNext@ chain of
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
-- it is filled with values indicating whether each feature is supported.
-- 'PhysicalDeviceFragmentDensityMapFeaturesEXT' /can/ also be included in
-- @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to enable the
-- features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceFragmentDensityMapFeaturesEXT = PhysicalDeviceFragmentDensityMapFeaturesEXT
  { -- | #features-fragmentDensityMap# @fragmentDensityMap@ specifies whether the
    -- implementation supports render passes with a fragment density map
    -- attachment. If this feature is not enabled and the @pNext@ chain of
    -- 'Vulkan.Core10.Pass.RenderPassCreateInfo' includes a
    -- 'RenderPassFragmentDensityMapCreateInfoEXT' structure,
    -- @fragmentDensityMapAttachment@ /must/ be
    -- 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED'.
    PhysicalDeviceFragmentDensityMapFeaturesEXT -> Bool
fragmentDensityMap :: Bool
  , -- | #features-fragmentDensityMapDynamic# @fragmentDensityMapDynamic@
    -- specifies whether the implementation supports dynamic fragment density
    -- map image views. If this feature is not enabled,
    -- 'Vulkan.Core10.Enums.ImageViewCreateFlagBits.IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT'
    -- /must/ not be included in
    -- 'Vulkan.Core10.ImageView.ImageViewCreateInfo'::@flags@.
    PhysicalDeviceFragmentDensityMapFeaturesEXT -> Bool
fragmentDensityMapDynamic :: Bool
  , -- | #features-fragmentDensityMapNonSubsampledImages#
    -- @fragmentDensityMapNonSubsampledImages@ specifies whether the
    -- implementation supports regular non-subsampled image attachments with
    -- fragment density map render passes. If this feature is not enabled,
    -- render passes with a
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#renderpass-fragmentdensitymapattachment fragment density map attachment>
    -- /must/ only have
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#samplers-subsamplesampler subsampled attachments>
    -- bound.
    PhysicalDeviceFragmentDensityMapFeaturesEXT -> Bool
fragmentDensityMapNonSubsampledImages :: Bool
  }
  deriving (Typeable, PhysicalDeviceFragmentDensityMapFeaturesEXT
-> PhysicalDeviceFragmentDensityMapFeaturesEXT -> Bool
(PhysicalDeviceFragmentDensityMapFeaturesEXT
 -> PhysicalDeviceFragmentDensityMapFeaturesEXT -> Bool)
-> (PhysicalDeviceFragmentDensityMapFeaturesEXT
    -> PhysicalDeviceFragmentDensityMapFeaturesEXT -> Bool)
-> Eq PhysicalDeviceFragmentDensityMapFeaturesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceFragmentDensityMapFeaturesEXT
-> PhysicalDeviceFragmentDensityMapFeaturesEXT -> Bool
$c/= :: PhysicalDeviceFragmentDensityMapFeaturesEXT
-> PhysicalDeviceFragmentDensityMapFeaturesEXT -> Bool
== :: PhysicalDeviceFragmentDensityMapFeaturesEXT
-> PhysicalDeviceFragmentDensityMapFeaturesEXT -> Bool
$c== :: PhysicalDeviceFragmentDensityMapFeaturesEXT
-> PhysicalDeviceFragmentDensityMapFeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceFragmentDensityMapFeaturesEXT)
#endif
deriving instance Show PhysicalDeviceFragmentDensityMapFeaturesEXT

instance ToCStruct PhysicalDeviceFragmentDensityMapFeaturesEXT where
  withCStruct :: PhysicalDeviceFragmentDensityMapFeaturesEXT
-> (Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b)
-> IO b
withCStruct x :: PhysicalDeviceFragmentDensityMapFeaturesEXT
x f :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b) -> IO b)
-> (Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p -> Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p PhysicalDeviceFragmentDensityMapFeaturesEXT
x (Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b
f Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p)
  pokeCStruct :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p PhysicalDeviceFragmentDensityMapFeaturesEXT{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentDensityMap))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentDensityMapDynamic))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentDensityMapNonSubsampledImages))
    IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
p Ptr PhysicalDeviceFragmentDensityMapFeaturesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

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

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

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


-- | VkPhysicalDeviceFragmentDensityMapPropertiesEXT - Structure describing
-- fragment density map properties that can be supported by an
-- implementation
--
-- = Members
--
-- The members of the 'PhysicalDeviceFragmentDensityMapPropertiesEXT'
-- structure describe the following implementation-dependent limits:
--
-- == Valid Usage (Implicit)
--
-- If the 'PhysicalDeviceFragmentDensityMapPropertiesEXT' structure is
-- included in the @pNext@ chain of
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2',
-- it is filled with the implementation-dependent limits and properties.
--
-- = See Also
--
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.FundamentalTypes.Extent2D',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceFragmentDensityMapPropertiesEXT = PhysicalDeviceFragmentDensityMapPropertiesEXT
  { -- | #limits-minfragmentdensitytexelsize# @minFragmentDensityTexelSize@ is
    -- the minimum
    -- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#glossary-fragment-density-texel-size fragment density texel size>.
    PhysicalDeviceFragmentDensityMapPropertiesEXT -> Extent2D
minFragmentDensityTexelSize :: Extent2D
  , -- | #limits-maxfragmentdensitytexelsize# @maxFragmentDensityTexelSize@ is
    -- the maximum fragment density texel size.
    PhysicalDeviceFragmentDensityMapPropertiesEXT -> Extent2D
maxFragmentDensityTexelSize :: Extent2D
  , -- | #limits-fragmentdensityinvocations# @fragmentDensityInvocations@
    -- specifies whether the implementation /may/ invoke additional fragment
    -- shader invocations for each covered sample.
    PhysicalDeviceFragmentDensityMapPropertiesEXT -> Bool
fragmentDensityInvocations :: Bool
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceFragmentDensityMapPropertiesEXT)
#endif
deriving instance Show PhysicalDeviceFragmentDensityMapPropertiesEXT

instance ToCStruct PhysicalDeviceFragmentDensityMapPropertiesEXT where
  withCStruct :: PhysicalDeviceFragmentDensityMapPropertiesEXT
-> (Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b)
-> IO b
withCStruct x :: PhysicalDeviceFragmentDensityMapPropertiesEXT
x f :: Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 40 8 ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b)
 -> IO b)
-> (Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p -> Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p PhysicalDeviceFragmentDensityMapPropertiesEXT
x (Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b
f Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p)
  pokeCStruct :: Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p PhysicalDeviceFragmentDensityMapPropertiesEXT{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Extent2D -> Extent2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D)) (Extent2D
minFragmentDensityTexelSize)
    Ptr Extent2D -> Extent2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Extent2D)) (Extent2D
maxFragmentDensityTexelSize)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
fragmentDensityInvocations))
    IO b
f
  cStructSize :: Int
cStructSize = 40
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Extent2D -> Extent2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D)) (Extent2D
forall a. Zero a => a
zero)
    Ptr Extent2D -> Extent2D -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Extent2D)) (Extent2D
forall a. Zero a => a
zero)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct PhysicalDeviceFragmentDensityMapPropertiesEXT where
  peekCStruct :: Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> IO PhysicalDeviceFragmentDensityMapPropertiesEXT
peekCStruct p :: Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p = do
    Extent2D
minFragmentDensityTexelSize <- Ptr Extent2D -> IO Extent2D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Extent2D))
    Extent2D
maxFragmentDensityTexelSize <- Ptr Extent2D -> IO Extent2D
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Extent2D ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Extent2D
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Extent2D))
    Bool32
fragmentDensityInvocations <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMapPropertiesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr Bool32))
    PhysicalDeviceFragmentDensityMapPropertiesEXT
-> IO PhysicalDeviceFragmentDensityMapPropertiesEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceFragmentDensityMapPropertiesEXT
 -> IO PhysicalDeviceFragmentDensityMapPropertiesEXT)
-> PhysicalDeviceFragmentDensityMapPropertiesEXT
-> IO PhysicalDeviceFragmentDensityMapPropertiesEXT
forall a b. (a -> b) -> a -> b
$ Extent2D
-> Extent2D
-> Bool
-> PhysicalDeviceFragmentDensityMapPropertiesEXT
PhysicalDeviceFragmentDensityMapPropertiesEXT
             Extent2D
minFragmentDensityTexelSize Extent2D
maxFragmentDensityTexelSize (Bool32 -> Bool
bool32ToBool Bool32
fragmentDensityInvocations)

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

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


-- | VkRenderPassFragmentDensityMapCreateInfoEXT - Structure containing
-- fragment density map attachment for render pass
--
-- = Description
--
-- The fragment density map is read at an implementation-dependent time
-- with the following constraints determined by the attachment’s image view
-- @flags@:
--
-- -   'Vulkan.Core10.Enums.ImageViewCreateFlagBits.IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT'
--     specifies that the fragment density map will be read by the device
--     during
--     'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT'
--
-- -   'Vulkan.Core10.Enums.ImageViewCreateFlagBits.IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT'
--     specifies that the fragment density map will be read by the host
--     during 'Vulkan.Core10.CommandBuffer.endCommandBuffer' of the primary
--     command buffer that the render pass is recorded into
--
-- -   Otherwise the fragment density map will be read by the host during
--     'Vulkan.Core10.CommandBufferBuilding.cmdBeginRenderPass'
--
-- The fragment density map /may/ additionally be read by the device during
-- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT'
-- for any mode.
--
-- If this structure is not present, it is as if
-- @fragmentDensityMapAttachment@ was given as
-- 'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED'.
--
-- == Valid Usage
--
-- -   #VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-fragmentDensityMapAttachment-02547#
--     If @fragmentDensityMapAttachment@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED',
--     @fragmentDensityMapAttachment@ /must/ be less than
--     'Vulkan.Core10.Pass.RenderPassCreateInfo'::@attachmentCount@
--
-- -   #VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-fragmentDensityMapAttachment-02548#
--     If @fragmentDensityMapAttachment@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED',
--     @fragmentDensityMapAttachment@ /must/ not be an element of
--     'Vulkan.Core10.Pass.SubpassDescription'::@pInputAttachments@,
--     'Vulkan.Core10.Pass.SubpassDescription'::@pColorAttachments@,
--     'Vulkan.Core10.Pass.SubpassDescription'::@pResolveAttachments@,
--     'Vulkan.Core10.Pass.SubpassDescription'::@pDepthStencilAttachment@,
--     or 'Vulkan.Core10.Pass.SubpassDescription'::@pPreserveAttachments@
--     for any subpass
--
-- -   #VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-fragmentDensityMapAttachment-02549#
--     If @fragmentDensityMapAttachment@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED', @layout@ /must/ be
--     equal to
--     'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_FRAGMENT_DENSITY_MAP_OPTIMAL_EXT',
--     or 'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_GENERAL'
--
-- -   #VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-fragmentDensityMapAttachment-02550#
--     If @fragmentDensityMapAttachment@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED',
--     @fragmentDensityMapAttachment@ /must/ reference an attachment with a
--     @loadOp@ equal to
--     'Vulkan.Core10.Enums.AttachmentLoadOp.ATTACHMENT_LOAD_OP_LOAD' or
--     'Vulkan.Core10.Enums.AttachmentLoadOp.ATTACHMENT_LOAD_OP_DONT_CARE'
--
-- -   #VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-fragmentDensityMapAttachment-02551#
--     If @fragmentDensityMapAttachment@ is not
--     'Vulkan.Core10.APIConstants.ATTACHMENT_UNUSED',
--     @fragmentDensityMapAttachment@ /must/ reference an attachment with a
--     @storeOp@ equal to
--     'Vulkan.Core10.Enums.AttachmentStoreOp.ATTACHMENT_STORE_OP_DONT_CARE'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-sType-sType#
--     @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT'
--
-- -   #VUID-VkRenderPassFragmentDensityMapCreateInfoEXT-fragmentDensityMapAttachment-parameter#
--     @fragmentDensityMapAttachment@ /must/ be a valid
--     'Vulkan.Core10.Pass.AttachmentReference' structure
--
-- = See Also
--
-- 'Vulkan.Core10.Pass.AttachmentReference',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data RenderPassFragmentDensityMapCreateInfoEXT = RenderPassFragmentDensityMapCreateInfoEXT
  { -- | @fragmentDensityMapAttachment@ is the fragment density map to use for
    -- the render pass.
    RenderPassFragmentDensityMapCreateInfoEXT -> AttachmentReference
fragmentDensityMapAttachment :: AttachmentReference }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (RenderPassFragmentDensityMapCreateInfoEXT)
#endif
deriving instance Show RenderPassFragmentDensityMapCreateInfoEXT

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

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

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

instance Zero RenderPassFragmentDensityMapCreateInfoEXT where
  zero :: RenderPassFragmentDensityMapCreateInfoEXT
zero = AttachmentReference -> RenderPassFragmentDensityMapCreateInfoEXT
RenderPassFragmentDensityMapCreateInfoEXT
           AttachmentReference
forall a. Zero a => a
zero


type EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION"
pattern EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION :: a
$mEXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION = 1


type EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME = "VK_EXT_fragment_density_map"

-- No documentation found for TopLevel "VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME"
pattern EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME :: a
$mEXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME = "VK_EXT_fragment_density_map"