{-# language CPP #-}
module Vulkan.Extensions.VK_NV_shader_image_footprint  ( PhysicalDeviceShaderImageFootprintFeaturesNV(..)
                                                       , NV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION
                                                       , pattern NV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION
                                                       , NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME
                                                       , pattern NV_SHADER_IMAGE_FOOTPRINT_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 Foreign.Ptr (Ptr)
import Data.Kind (Type)
import Vulkan.Core10.BaseType (bool32ToBool)
import Vulkan.Core10.BaseType (boolToBool32)
import Vulkan.Core10.BaseType (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_SHADER_IMAGE_FOOTPRINT_FEATURES_NV))
-- | VkPhysicalDeviceShaderImageFootprintFeaturesNV - Structure describing
-- shader image footprint features that can be supported by an
-- implementation
--
-- = Description
--
-- See
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#textures-footprint Texel Footprint Evaluation>
-- for more information.
--
-- If the 'PhysicalDeviceShaderImageFootprintFeaturesNV' 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.
-- 'PhysicalDeviceShaderImageFootprintFeaturesNV' /can/ also be included in
-- the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to enable
-- features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.BaseType.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceShaderImageFootprintFeaturesNV = PhysicalDeviceShaderImageFootprintFeaturesNV
  { -- | @imageFootprint@ specifies whether the implementation supports the
    -- @ImageFootprintNV@ SPIR-V capability.
    PhysicalDeviceShaderImageFootprintFeaturesNV -> Bool
imageFootprint :: Bool }
  deriving (Typeable)
deriving instance Show PhysicalDeviceShaderImageFootprintFeaturesNV

instance ToCStruct PhysicalDeviceShaderImageFootprintFeaturesNV where
  withCStruct :: PhysicalDeviceShaderImageFootprintFeaturesNV
-> (Ptr PhysicalDeviceShaderImageFootprintFeaturesNV -> IO b)
-> IO b
withCStruct x :: PhysicalDeviceShaderImageFootprintFeaturesNV
x f :: Ptr PhysicalDeviceShaderImageFootprintFeaturesNV -> IO b
f = Int
-> Int
-> (Ptr PhysicalDeviceShaderImageFootprintFeaturesNV -> IO b)
-> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr PhysicalDeviceShaderImageFootprintFeaturesNV -> IO b)
 -> IO b)
-> (Ptr PhysicalDeviceShaderImageFootprintFeaturesNV -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
p -> Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
-> PhysicalDeviceShaderImageFootprintFeaturesNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
p PhysicalDeviceShaderImageFootprintFeaturesNV
x (Ptr PhysicalDeviceShaderImageFootprintFeaturesNV -> IO b
f Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
p)
  pokeCStruct :: Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
-> PhysicalDeviceShaderImageFootprintFeaturesNV -> IO b -> IO b
pokeCStruct p :: Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
p PhysicalDeviceShaderImageFootprintFeaturesNV{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
p Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
p Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
-> 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 PhysicalDeviceShaderImageFootprintFeaturesNV
p Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
imageFootprint))
    IO b
f
  cStructSize :: Int
cStructSize = 24
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr PhysicalDeviceShaderImageFootprintFeaturesNV -> IO b -> IO b
pokeZeroCStruct p :: Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
p Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
p Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
-> 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 PhysicalDeviceShaderImageFootprintFeaturesNV
p Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
-> 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 PhysicalDeviceShaderImageFootprintFeaturesNV where
  peekCStruct :: Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
-> IO PhysicalDeviceShaderImageFootprintFeaturesNV
peekCStruct p :: Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
p = do
    Bool32
imageFootprint <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
p Ptr PhysicalDeviceShaderImageFootprintFeaturesNV
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Bool32))
    PhysicalDeviceShaderImageFootprintFeaturesNV
-> IO PhysicalDeviceShaderImageFootprintFeaturesNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceShaderImageFootprintFeaturesNV
 -> IO PhysicalDeviceShaderImageFootprintFeaturesNV)
-> PhysicalDeviceShaderImageFootprintFeaturesNV
-> IO PhysicalDeviceShaderImageFootprintFeaturesNV
forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceShaderImageFootprintFeaturesNV
PhysicalDeviceShaderImageFootprintFeaturesNV
             (Bool32 -> Bool
bool32ToBool Bool32
imageFootprint)

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

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


type NV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION = 2

-- No documentation found for TopLevel "VK_NV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION"
pattern NV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION :: forall a . Integral a => a
pattern $bNV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION :: a
$mNV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
NV_SHADER_IMAGE_FOOTPRINT_SPEC_VERSION = 2


type NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME = "VK_NV_shader_image_footprint"

-- No documentation found for TopLevel "VK_NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME"
pattern NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bNV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME :: a
$mNV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
NV_SHADER_IMAGE_FOOTPRINT_EXTENSION_NAME = "VK_NV_shader_image_footprint"