{-# language CPP #-}
-- | = Name
--
-- VK_EXT_shader_image_atomic_int64 - device extension
--
-- == VK_EXT_shader_image_atomic_int64
--
-- [__Name String__]
--     @VK_EXT_shader_image_atomic_int64@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     235
--
-- [__Revision__]
--     1
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires Vulkan 1.0
--
--     -   Requires @VK_KHR_get_physical_device_properties2@
--
-- [__Contact__]
--
--     -   Tobias Hector
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?title=VK_EXT_shader_image_atomic_int64:%20&body=@tobski%20 >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2020-07-14
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Matthaeus Chajdas, AMD
--
--     -   Graham Wihlidal, Epic Games
--
--     -   Tobias Hector, AMD
--
--     -   Jeff Bolz, Nvidia
--
--     -   Jason Ekstrand, Intel
--
-- [__Interactions and External Dependencies__]
--
--     -   This extension requires the
--         <https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/master/extensions/KHR/SPV_EXT_shader_image_atomic_int64.html SPV_EXT_shader_image_int64>
--         SPIR-V extension.
--
--     -   This extension requires the
--         <https://github.com/KhronosGroup/GLSL/blob/master/extensions/ext/GLSL_EXT_shader_image_int64.txt GLSL_EXT_shader_image_int64>
--         extension for GLSL source languages.
--
-- == Description
--
-- This extension extends existing 64-bit integer atomic support to enable
-- these operations on images as well.
--
-- When working with large 2- or 3-dimensional data sets (e.g.
-- rasterization or screen-space effects), image accesses are generally
-- more efficient than equivalent buffer accesses. This extension allows
-- applications relying on 64-bit integer atomics in this manner to quickly
-- improve performance with only relatively minor code changes.
--
-- 64-bit integer atomic support is guaranteed for optimally tiled images
-- with the 'Vulkan.Core10.Enums.Format.FORMAT_R64_UINT' and
-- 'Vulkan.Core10.Enums.Format.FORMAT_R64_SINT' formats.
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceShaderImageAtomicInt64FeaturesEXT'
--
-- == New Enum Constants
--
-- -   'EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME'
--
-- -   'EXT_SHADER_IMAGE_ATOMIC_INT64_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT'
--
-- == Version History
--
-- -   Revision 1, 2020-07-14 (Tobias Hector)
--
--     -   Initial draft
--
-- = See Also
--
-- 'PhysicalDeviceShaderImageAtomicInt64FeaturesEXT'
--
-- = Document Notes
--
-- For more information, see the
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_shader_image_atomic_int64 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_shader_image_atomic_int64  ( PhysicalDeviceShaderImageAtomicInt64FeaturesEXT(..)
                                                           , EXT_SHADER_IMAGE_ATOMIC_INT64_SPEC_VERSION
                                                           , pattern EXT_SHADER_IMAGE_ATOMIC_INT64_SPEC_VERSION
                                                           , EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME
                                                           , pattern EXT_SHADER_IMAGE_ATOMIC_INT64_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.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_SHADER_IMAGE_ATOMIC_INT64_FEATURES_EXT))
-- | VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT - Structure describing
-- features supported by VK_EXT_shader_image_atomic_int64
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceShaderImageAtomicInt64FeaturesEXT = PhysicalDeviceShaderImageAtomicInt64FeaturesEXT
  { -- | #features-shaderImageInt64Atomics# @shaderImageInt64Atomics@ indicates
    -- whether shaders /can/ support 64-bit unsigned and signed integer atomic
    -- operations on images.
    PhysicalDeviceShaderImageAtomicInt64FeaturesEXT -> Bool
shaderImageInt64Atomics :: Bool
  , -- | #features-sparseImageInt64Atomics# @sparseImageInt64Atomics@ indicates
    -- whether 64-bit integer atomics /can/ be used on sparse images.
    PhysicalDeviceShaderImageAtomicInt64FeaturesEXT -> Bool
sparseImageInt64Atomics :: Bool
  }
  deriving (Typeable, PhysicalDeviceShaderImageAtomicInt64FeaturesEXT
-> PhysicalDeviceShaderImageAtomicInt64FeaturesEXT -> Bool
(PhysicalDeviceShaderImageAtomicInt64FeaturesEXT
 -> PhysicalDeviceShaderImageAtomicInt64FeaturesEXT -> Bool)
-> (PhysicalDeviceShaderImageAtomicInt64FeaturesEXT
    -> PhysicalDeviceShaderImageAtomicInt64FeaturesEXT -> Bool)
-> Eq PhysicalDeviceShaderImageAtomicInt64FeaturesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceShaderImageAtomicInt64FeaturesEXT
-> PhysicalDeviceShaderImageAtomicInt64FeaturesEXT -> Bool
$c/= :: PhysicalDeviceShaderImageAtomicInt64FeaturesEXT
-> PhysicalDeviceShaderImageAtomicInt64FeaturesEXT -> Bool
== :: PhysicalDeviceShaderImageAtomicInt64FeaturesEXT
-> PhysicalDeviceShaderImageAtomicInt64FeaturesEXT -> Bool
$c== :: PhysicalDeviceShaderImageAtomicInt64FeaturesEXT
-> PhysicalDeviceShaderImageAtomicInt64FeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceShaderImageAtomicInt64FeaturesEXT)
#endif
deriving instance Show PhysicalDeviceShaderImageAtomicInt64FeaturesEXT

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

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

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

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


type EXT_SHADER_IMAGE_ATOMIC_INT64_SPEC_VERSION = 1

-- No documentation found for TopLevel "VK_EXT_SHADER_IMAGE_ATOMIC_INT64_SPEC_VERSION"
pattern EXT_SHADER_IMAGE_ATOMIC_INT64_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_SHADER_IMAGE_ATOMIC_INT64_SPEC_VERSION :: a
$mEXT_SHADER_IMAGE_ATOMIC_INT64_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
EXT_SHADER_IMAGE_ATOMIC_INT64_SPEC_VERSION = 1


type EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME = "VK_EXT_shader_image_atomic_int64"

-- No documentation found for TopLevel "VK_EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME"
pattern EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME :: a
$mEXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_SHADER_IMAGE_ATOMIC_INT64_EXTENSION_NAME = "VK_EXT_shader_image_atomic_int64"