{-# language CPP #-}
-- | = Name
--
-- VK_EXT_fragment_density_map2 - device extension
--
-- == VK_EXT_fragment_density_map2
--
-- [__Name String__]
--     @VK_EXT_fragment_density_map2@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     333
--
-- [__Revision__]
--     1
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires Vulkan 1.0
--
--     -   Requires @VK_EXT_fragment_density_map@
--
-- [__Contact__]
--
--     -   Matthew Netsch
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?title=VK_EXT_fragment_density_map2:%20&body=@mnetsch%20 >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2020-06-16
--
-- [__Interactions and External Dependencies__]
--
--     -   Interacts with Vulkan 1.1
--
-- [__Contributors__]
--
--     -   Matthew Netsch, Qualcomm Technologies, Inc.
--
--     -   Jonathan Tinkham, Qualcomm Technologies, Inc.
--
--     -   Jonathan Wicks, Qualcomm Technologies, Inc.
--
--     -   Jan-Harald Fredriksen, ARM
--
-- == Description
--
-- This extension adds additional features and properties to
-- @VK_EXT_fragment_density_map@ in order to reduce fragment density map
-- host latency as well as improved queries for subsampled sampler
-- implementation-dependent behavior.
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'Vulkan.Extensions.VK_EXT_fragment_density_map.PhysicalDeviceFragmentDensityMapFeaturesEXT'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceProperties2':
--
--     -   'Vulkan.Extensions.VK_EXT_fragment_density_map.PhysicalDeviceFragmentDensityMapPropertiesEXT'
--
-- -   Extending 'Vulkan.Core10.Pass.RenderPassCreateInfo',
--     'Vulkan.Core12.Promoted_From_VK_KHR_create_renderpass2.RenderPassCreateInfo2':
--
--     -   'Vulkan.Extensions.VK_EXT_fragment_density_map.RenderPassFragmentDensityMapCreateInfoEXT'
--
-- == New Enum Constants
--
-- -   'Vulkan.Extensions.VK_EXT_fragment_density_map.EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME'
--
-- -   'Vulkan.Extensions.VK_EXT_fragment_density_map.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'
--
-- == Version History
--
-- -   Revision 1, 2020-06-16 (Matthew Netsch)
--
--     -   Initial version
--
-- = See Also
--
-- 'PhysicalDeviceFragmentDensityMap2FeaturesEXT',
-- 'PhysicalDeviceFragmentDensityMap2PropertiesEXT'
--
-- = Document Notes
--
-- For more information, see the
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_fragment_density_map2 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_map2  ( PhysicalDeviceFragmentDensityMap2FeaturesEXT(..)
                                                       , PhysicalDeviceFragmentDensityMap2PropertiesEXT(..)
                                                       , EXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION
                                                       , pattern EXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION
                                                       , EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME
                                                       , pattern EXT_FRAGMENT_DENSITY_MAP_2_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.Word (Word32)
import Data.Kind (Type)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core10.FundamentalTypes (Bool32)
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_2_FEATURES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT))
-- | VkPhysicalDeviceFragmentDensityMap2FeaturesEXT - Structure describing
-- additional fragment density map features that can be supported by an
-- implementation
--
-- = Members
--
-- The members of the 'PhysicalDeviceFragmentDensityMap2FeaturesEXT'
-- structure describe the following features:
--
-- = Description
--
-- If the 'PhysicalDeviceFragmentDensityMap2FeaturesEXT' 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.
-- 'PhysicalDeviceFragmentDensityMap2FeaturesEXT' /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 PhysicalDeviceFragmentDensityMap2FeaturesEXT = PhysicalDeviceFragmentDensityMap2FeaturesEXT
  { -- | #features-fragmentDensityMapDeferred# @fragmentDensityMapDeferred@
    -- specifies whether the implementation supports deferred reads of fragment
    -- density map image views. If this feature is not enabled,
    -- 'Vulkan.Core10.Enums.ImageViewCreateFlagBits.IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT'
    -- /must/ not be included in
    -- 'Vulkan.Core10.ImageView.ImageViewCreateInfo'::@flags@.
    PhysicalDeviceFragmentDensityMap2FeaturesEXT -> Bool
fragmentDensityMapDeferred :: Bool }
  deriving (Typeable, PhysicalDeviceFragmentDensityMap2FeaturesEXT
-> PhysicalDeviceFragmentDensityMap2FeaturesEXT -> Bool
(PhysicalDeviceFragmentDensityMap2FeaturesEXT
 -> PhysicalDeviceFragmentDensityMap2FeaturesEXT -> Bool)
-> (PhysicalDeviceFragmentDensityMap2FeaturesEXT
    -> PhysicalDeviceFragmentDensityMap2FeaturesEXT -> Bool)
-> Eq PhysicalDeviceFragmentDensityMap2FeaturesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceFragmentDensityMap2FeaturesEXT
-> PhysicalDeviceFragmentDensityMap2FeaturesEXT -> Bool
$c/= :: PhysicalDeviceFragmentDensityMap2FeaturesEXT
-> PhysicalDeviceFragmentDensityMap2FeaturesEXT -> Bool
== :: PhysicalDeviceFragmentDensityMap2FeaturesEXT
-> PhysicalDeviceFragmentDensityMap2FeaturesEXT -> Bool
$c== :: PhysicalDeviceFragmentDensityMap2FeaturesEXT
-> PhysicalDeviceFragmentDensityMap2FeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceFragmentDensityMap2FeaturesEXT)
#endif
deriving instance Show PhysicalDeviceFragmentDensityMap2FeaturesEXT

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

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

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

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


-- | VkPhysicalDeviceFragmentDensityMap2PropertiesEXT - Structure describing
-- additional fragment density map properties that can be supported by an
-- implementation
--
-- = Members
--
-- The members of the 'PhysicalDeviceFragmentDensityMap2PropertiesEXT'
-- structure describe the following implementation-dependent limits:
--
-- == Valid Usage (Implicit)
--
-- If the 'PhysicalDeviceFragmentDensityMap2PropertiesEXT' 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.Enums.StructureType.StructureType'
data PhysicalDeviceFragmentDensityMap2PropertiesEXT = PhysicalDeviceFragmentDensityMap2PropertiesEXT
  { -- | #limits-subsampledLoads# @subsampledLoads@ specifies if performing image
    -- data read with load operations on subsampled attachments will be
    -- resampled to the fragment density of the render pass
    PhysicalDeviceFragmentDensityMap2PropertiesEXT -> Bool
subsampledLoads :: Bool
  , -- | #limits-subsampledCoarseReconstructionEarlyAccess#
    -- @subsampledCoarseReconstructionEarlyAccess@ specifies if performing
    -- image data read with samplers created with @flags@ containing
    -- 'Vulkan.Core10.Enums.SamplerCreateFlagBits.SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT'
    -- in fragment shader will trigger additional reads during
    -- 'Vulkan.Core10.Enums.PipelineStageFlagBits.PIPELINE_STAGE_VERTEX_SHADER_BIT'
    PhysicalDeviceFragmentDensityMap2PropertiesEXT -> Bool
subsampledCoarseReconstructionEarlyAccess :: Bool
  , -- | #limits-maxSubsampledArrayLayers# @maxSubsampledArrayLayers@ is the
    -- maximum number of 'Vulkan.Core10.Handles.ImageView' array layers for
    -- usages supporting subsampled samplers
    PhysicalDeviceFragmentDensityMap2PropertiesEXT -> Word32
maxSubsampledArrayLayers :: Word32
  , -- | #limits-maxDescriptorSetSubsampledSamplers#
    -- @maxDescriptorSetSubsampledSamplers@ is the maximum number of subsampled
    -- samplers that /can/ be included in a
    -- 'Vulkan.Core10.Handles.PipelineLayout'
    PhysicalDeviceFragmentDensityMap2PropertiesEXT -> Word32
maxDescriptorSetSubsampledSamplers :: Word32
  }
  deriving (Typeable, PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> PhysicalDeviceFragmentDensityMap2PropertiesEXT -> Bool
(PhysicalDeviceFragmentDensityMap2PropertiesEXT
 -> PhysicalDeviceFragmentDensityMap2PropertiesEXT -> Bool)
-> (PhysicalDeviceFragmentDensityMap2PropertiesEXT
    -> PhysicalDeviceFragmentDensityMap2PropertiesEXT -> Bool)
-> Eq PhysicalDeviceFragmentDensityMap2PropertiesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> PhysicalDeviceFragmentDensityMap2PropertiesEXT -> Bool
$c/= :: PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> PhysicalDeviceFragmentDensityMap2PropertiesEXT -> Bool
== :: PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> PhysicalDeviceFragmentDensityMap2PropertiesEXT -> Bool
$c== :: PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> PhysicalDeviceFragmentDensityMap2PropertiesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceFragmentDensityMap2PropertiesEXT)
#endif
deriving instance Show PhysicalDeviceFragmentDensityMap2PropertiesEXT

instance ToCStruct PhysicalDeviceFragmentDensityMap2PropertiesEXT where
  withCStruct :: PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> (Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT -> IO b)
-> IO b
withCStruct x :: PhysicalDeviceFragmentDensityMap2PropertiesEXT
x f :: Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT -> IO b)
 -> IO b)
-> (Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p -> Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> PhysicalDeviceFragmentDensityMap2PropertiesEXT -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p PhysicalDeviceFragmentDensityMap2PropertiesEXT
x (Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT -> IO b
f Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p)
  pokeCStruct :: Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> PhysicalDeviceFragmentDensityMap2PropertiesEXT -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p PhysicalDeviceFragmentDensityMap2PropertiesEXT{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> 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 PhysicalDeviceFragmentDensityMap2PropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
subsampledLoads))
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
subsampledCoarseReconstructionEarlyAccess))
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) (Word32
maxSubsampledArrayLayers)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32)) (Word32
maxDescriptorSetSubsampledSamplers)
    IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> 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 PhysicalDeviceFragmentDensityMap2PropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> 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 PhysicalDeviceFragmentDensityMap2PropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> 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 Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct PhysicalDeviceFragmentDensityMap2PropertiesEXT where
  peekCStruct :: Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> IO PhysicalDeviceFragmentDensityMap2PropertiesEXT
peekCStruct p :: Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p = do
    Bool32
subsampledLoads <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32))
    Bool32
subsampledCoarseReconstructionEarlyAccess <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 20 :: Ptr Bool32))
    Word32
maxSubsampledArrayLayers <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Word32))
    Word32
maxDescriptorSetSubsampledSamplers <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
p Ptr PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 28 :: Ptr Word32))
    PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> IO PhysicalDeviceFragmentDensityMap2PropertiesEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceFragmentDensityMap2PropertiesEXT
 -> IO PhysicalDeviceFragmentDensityMap2PropertiesEXT)
-> PhysicalDeviceFragmentDensityMap2PropertiesEXT
-> IO PhysicalDeviceFragmentDensityMap2PropertiesEXT
forall a b. (a -> b) -> a -> b
$ Bool
-> Bool
-> Word32
-> Word32
-> PhysicalDeviceFragmentDensityMap2PropertiesEXT
PhysicalDeviceFragmentDensityMap2PropertiesEXT
             (Bool32 -> Bool
bool32ToBool Bool32
subsampledLoads) (Bool32 -> Bool
bool32ToBool Bool32
subsampledCoarseReconstructionEarlyAccess) Word32
maxSubsampledArrayLayers Word32
maxDescriptorSetSubsampledSamplers

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

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


type EXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_EXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION"
pattern EXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION :: a
$mEXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
EXT_FRAGMENT_DENSITY_MAP_2_SPEC_VERSION = 1


type EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME = "VK_EXT_fragment_density_map2"

-- No documentation found for TopLevel "VK_EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME"
pattern EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME :: a
$mEXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME = "VK_EXT_fragment_density_map2"