{-# language CPP #-}
-- | = Name
--
-- VK_VALVE_fragment_density_map_layered - device extension
--
-- = VK_VALVE_fragment_density_map_layered
--
-- [__Name String__]
--     @VK_VALVE_fragment_density_map_layered@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     612
--
-- [__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_maintenance5 VK_KHR_maintenance5>
--          or
--         
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#versions-1.4 Vulkan Version 1.4>
--     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__]
--
--     -   Connor Abbott
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_VALVE_fragment_density_map_layered] @cwabbott0%0A*Here describe the issue or question you have about the VK_VALVE_fragment_density_map_layered extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2025-06-06
--
-- [__Interactions and External Dependencies__]
--
--     -   Interacts with Vulkan 1.1.
--
--     -   Interacts with Vulkan 1.3.
--
--     -   Interacts with Vulkan 1.4.
--
--     -   Interacts with @VK_EXT_fragment_density_map@.
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Connor Abbott, VALVE
--
--     -   Mike Blumenkrantz, VALVE
--
-- == Description
--
-- This extension enables the use of layered fragment density maps.
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core10.GraphicsPipeline.GraphicsPipelineCreateInfo':
--
--     -   'PipelineFragmentDensityMapLayeredCreateInfoVALVE'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE'
--
-- == New Enum Constants
--
-- -   'VALVE_FRAGMENT_DENSITY_MAP_LAYERED_EXTENSION_NAME'
--
-- -   'VALVE_FRAGMENT_DENSITY_MAP_LAYERED_SPEC_VERSION'
--
-- -   Extending
--     'Vulkan.Core14.Enums.PipelineCreateFlags2.PipelineCreateFlagBits2':
--
--     -   'Vulkan.Core14.Enums.PipelineCreateFlags2.PIPELINE_CREATE_2_PER_LAYER_FRAGMENT_DENSITY_BIT_VALVE'
--
-- -   Extending 'Vulkan.Core13.Enums.RenderingFlagBits.RenderingFlagBits':
--
--     -   'Vulkan.Core13.Enums.RenderingFlagBits.RENDERING_PER_LAYER_FRAGMENT_DENSITY_BIT_VALVE'
--
-- -   Extending
--     'Vulkan.Core10.Enums.RenderPassCreateFlagBits.RenderPassCreateFlagBits':
--
--     -   'Vulkan.Core10.Enums.RenderPassCreateFlagBits.RENDER_PASS_CREATE_PER_LAYER_FRAGMENT_DENSITY_BIT_VALVE'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_LAYERED_FEATURES_VALVE'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_LAYERED_PROPERTIES_VALVE'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PIPELINE_FRAGMENT_DENSITY_MAP_LAYERED_CREATE_INFO_VALVE'
--
-- == Version History
--
-- -   Revision 1, 2025-06-06 (Mike Blumenkrantz)
--
--     -   Initial version
--
-- == See Also
--
-- No cross-references are available
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#VK_VALVE_fragment_density_map_layered Vulkan Specification>.
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_VALVE_fragment_density_map_layered  ( PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE(..)
                                                                , PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE(..)
                                                                , PipelineFragmentDensityMapLayeredCreateInfoVALVE(..)
                                                                , VALVE_FRAGMENT_DENSITY_MAP_LAYERED_SPEC_VERSION
                                                                , pattern VALVE_FRAGMENT_DENSITY_MAP_LAYERED_SPEC_VERSION
                                                                , VALVE_FRAGMENT_DENSITY_MAP_LAYERED_EXTENSION_NAME
                                                                , pattern VALVE_FRAGMENT_DENSITY_MAP_LAYERED_EXTENSION_NAME
                                                                ) where

import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
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 Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_LAYERED_FEATURES_VALVE))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_LAYERED_PROPERTIES_VALVE))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_FRAGMENT_DENSITY_MAP_LAYERED_CREATE_INFO_VALVE))
-- | VkPhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE - Structure
-- describing fragment density map layered properties that can be supported
-- by an implementation
--
-- = Description
--
-- If the 'PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE'
-- 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_VALVE_fragment_density_map_layered VK_VALVE_fragment_density_map_layered>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE = PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE
  { -- | #limits-maxFragmentDensityMapLayers# @maxFragmentDensityMapLayers@ is
    -- the maximum number of layers to use with a layered fragment density map.
    PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE -> Word32
maxFragmentDensityMapLayers :: Word32 }
  deriving (Typeable, PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE
-> PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE -> Bool
(PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE
 -> PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE -> Bool)
-> (PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE
    -> PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE -> Bool)
-> Eq PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE
-> PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE -> Bool
== :: PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE
-> PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE -> Bool
$c/= :: PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE
-> PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE -> Bool
/= :: PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE
-> PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE)
#endif
deriving instance Show PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE

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

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

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

instance Zero PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE where
  zero :: PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE
zero = Word32 -> PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE
PhysicalDeviceFragmentDensityMapLayeredPropertiesVALVE
           Word32
forall a. Zero a => a
zero


-- | VkPhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE - Structure
-- describing additional layered fragment density map features that can be
-- supported by an implementation
--
-- = Members
--
-- This structure describes the following feature:
--
-- = Description
--
-- If the 'PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE' structure
-- is included in the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2',
-- it is filled in to indicate whether each corresponding feature is
-- supported. If the application wishes to use a
-- 'Vulkan.Core10.Handles.Device' with any features described by
-- 'PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE', it /must/ add an
-- instance of the structure, with the desired feature members set to
-- 'Vulkan.Core10.FundamentalTypes.TRUE', to the @pNext@ chain of
-- 'Vulkan.Core10.Device.DeviceCreateInfo' when creating the
-- 'Vulkan.Core10.Handles.Device'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VALVE_fragment_density_map_layered VK_VALVE_fragment_density_map_layered>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE = PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE
  { -- | #features-fragmentDensityMapLayered# @fragmentDensityMapLayered@
    -- specifies whether the implementation supports layered fragment density
    -- maps.
    PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE -> Bool
fragmentDensityMapLayered :: Bool }
  deriving (Typeable, PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE
-> PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE -> Bool
(PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE
 -> PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE -> Bool)
-> (PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE
    -> PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE -> Bool)
-> Eq PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE
-> PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE -> Bool
== :: PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE
-> PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE -> Bool
$c/= :: PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE
-> PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE -> Bool
/= :: PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE
-> PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE)
#endif
deriving instance Show PhysicalDeviceFragmentDensityMapLayeredFeaturesVALVE

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

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

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

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


-- | VkPipelineFragmentDensityMapLayeredCreateInfoVALVE - Structure
-- specifying layered fragment density map info
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_VALVE_fragment_density_map_layered VK_VALVE_fragment_density_map_layered>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PipelineFragmentDensityMapLayeredCreateInfoVALVE = PipelineFragmentDensityMapLayeredCreateInfoVALVE
  { -- | @maxFragmentDensityMapLayers@ is the maximum number of layers which can
    -- be used with a fragment density map.
    --
    -- #VUID-VkPipelineFragmentDensityMapLayeredCreateInfoVALVE-maxFragmentDensityMapLayers-10825#
    -- @maxFragmentDensityMapLayers@ /must/ be less than or equal to
    -- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#limits-maxFragmentDensityMapLayers maxFragmentDensityMapLayers>
    PipelineFragmentDensityMapLayeredCreateInfoVALVE -> Word32
maxFragmentDensityMapLayers :: Word32 }
  deriving (Typeable, PipelineFragmentDensityMapLayeredCreateInfoVALVE
-> PipelineFragmentDensityMapLayeredCreateInfoVALVE -> Bool
(PipelineFragmentDensityMapLayeredCreateInfoVALVE
 -> PipelineFragmentDensityMapLayeredCreateInfoVALVE -> Bool)
-> (PipelineFragmentDensityMapLayeredCreateInfoVALVE
    -> PipelineFragmentDensityMapLayeredCreateInfoVALVE -> Bool)
-> Eq PipelineFragmentDensityMapLayeredCreateInfoVALVE
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PipelineFragmentDensityMapLayeredCreateInfoVALVE
-> PipelineFragmentDensityMapLayeredCreateInfoVALVE -> Bool
== :: PipelineFragmentDensityMapLayeredCreateInfoVALVE
-> PipelineFragmentDensityMapLayeredCreateInfoVALVE -> Bool
$c/= :: PipelineFragmentDensityMapLayeredCreateInfoVALVE
-> PipelineFragmentDensityMapLayeredCreateInfoVALVE -> Bool
/= :: PipelineFragmentDensityMapLayeredCreateInfoVALVE
-> PipelineFragmentDensityMapLayeredCreateInfoVALVE -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineFragmentDensityMapLayeredCreateInfoVALVE)
#endif
deriving instance Show PipelineFragmentDensityMapLayeredCreateInfoVALVE

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

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

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

instance Zero PipelineFragmentDensityMapLayeredCreateInfoVALVE where
  zero :: PipelineFragmentDensityMapLayeredCreateInfoVALVE
zero = Word32 -> PipelineFragmentDensityMapLayeredCreateInfoVALVE
PipelineFragmentDensityMapLayeredCreateInfoVALVE
           Word32
forall a. Zero a => a
zero


type VALVE_FRAGMENT_DENSITY_MAP_LAYERED_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_VALVE_FRAGMENT_DENSITY_MAP_LAYERED_SPEC_VERSION"
pattern VALVE_FRAGMENT_DENSITY_MAP_LAYERED_SPEC_VERSION :: forall a . Integral a => a
pattern $mVALVE_FRAGMENT_DENSITY_MAP_LAYERED_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bVALVE_FRAGMENT_DENSITY_MAP_LAYERED_SPEC_VERSION :: forall a. Integral a => a
VALVE_FRAGMENT_DENSITY_MAP_LAYERED_SPEC_VERSION = 1


type VALVE_FRAGMENT_DENSITY_MAP_LAYERED_EXTENSION_NAME = "VK_VALVE_fragment_density_map_layered"

-- No documentation found for TopLevel "VK_VALVE_FRAGMENT_DENSITY_MAP_LAYERED_EXTENSION_NAME"
pattern VALVE_FRAGMENT_DENSITY_MAP_LAYERED_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mVALVE_FRAGMENT_DENSITY_MAP_LAYERED_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bVALVE_FRAGMENT_DENSITY_MAP_LAYERED_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
VALVE_FRAGMENT_DENSITY_MAP_LAYERED_EXTENSION_NAME = "VK_VALVE_fragment_density_map_layered"