{-# language CPP #-}
-- | = Name
--
-- VK_EXT_attachment_feedback_loop_layout - device extension
--
-- == VK_EXT_attachment_feedback_loop_layout
--
-- [__Name String__]
--     @VK_EXT_attachment_feedback_loop_layout@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     340
--
-- [__Revision__]
--     2
--
-- [__Extension and Version Dependencies__]
--
--     -   Requires support for Vulkan 1.0
--
--     -   Requires @VK_KHR_get_physical_device_properties2@ to be enabled
--         for any device-level functionality
--
-- [__Contact__]
--
--     -   Joshua Ashton
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_EXT_attachment_feedback_loop_layout] @Joshua-Ashton%0A*Here describe the issue or question you have about the VK_EXT_attachment_feedback_loop_layout extension* >
--
-- [__Extension Proposal__]
--     <https://github.com/KhronosGroup/Vulkan-Docs/tree/main/proposals/VK_EXT_attachment_feedback_loop_layout.adoc VK_EXT_attachment_feedback_loop_layout>
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2022-04-04
--
-- [__IP Status__]
--     No known IP claims.
--
-- [__Contributors__]
--
--     -   Joshua Ashton, Valve
--
--     -   Jason Ekstrand, Collabora
--
--     -   Bas Nieuwenhuizen, Google
--
--     -   Samuel Iglesias Gonsálvez, Igalia
--
--     -   Ralph Potter, Samsung
--
--     -   Jan-Harald Fredriksen, Arm
--
--     -   Ricardo Garcia, Igalia
--
-- == Description
--
-- This extension adds a new image layout,
-- 'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT',
-- which allows applications to have an image layout in which they are able
-- to both render to and sample\/fetch from the same subresource of an
-- image in a given render pass.
--
-- == New Structures
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT'
--
-- == New Enum Constants
--
-- -   'EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME'
--
-- -   'EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_SPEC_VERSION'
--
-- -   Extending
--     'Vulkan.Core10.Enums.DependencyFlagBits.DependencyFlagBits':
--
--     -   'Vulkan.Core10.Enums.DependencyFlagBits.DEPENDENCY_FEEDBACK_LOOP_BIT_EXT'
--
-- -   Extending 'Vulkan.Core10.Enums.ImageLayout.ImageLayout':
--
--     -   'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT'
--
-- -   Extending
--     'Vulkan.Core10.Enums.ImageUsageFlagBits.ImageUsageFlagBits':
--
--     -   'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT'
--
-- -   Extending
--     'Vulkan.Core10.Enums.PipelineCreateFlagBits.PipelineCreateFlagBits':
--
--     -   'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT'
--
--     -   'Vulkan.Core10.Enums.PipelineCreateFlagBits.PIPELINE_CREATE_DEPTH_STENCIL_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT'
--
-- == Version History
--
-- -   Revision 2, 2022-04-04 (Joshua Ashton)
--
--     -   Renamed from VALVE to EXT.
--
-- -   Revision 1, 2021-03-09 (Joshua Ashton)
--
--     -   Initial draft.
--
-- == See Also
--
-- 'PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_EXT_attachment_feedback_loop_layout 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_attachment_feedback_loop_layout  ( PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT(..)
                                                                 , EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_SPEC_VERSION
                                                                 , pattern EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_SPEC_VERSION
                                                                 , EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME
                                                                 , pattern EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_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.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_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT))
-- | VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT - Structure
-- indicating support for a render feedback loop image layout
--
-- = Members
--
-- This structure describes the following feature:
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_attachment_feedback_loop_layout VK_EXT_attachment_feedback_loop_layout>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT = PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT
  { -- | #features-attachmentFeedbackLoopLayout# @attachmentFeedbackLoopLayout@
    -- indicates whether the implementation supports using
    -- 'Vulkan.Core10.Enums.ImageLayout.IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT'
    -- image layout for images created with
    -- 'Vulkan.Core10.Enums.ImageUsageFlagBits.IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT'.
    PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT -> Bool
attachmentFeedbackLoopLayout :: Bool }
  deriving (Typeable, PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT
-> PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT -> Bool
(PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT
 -> PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT -> Bool)
-> (PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT
    -> PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT -> Bool)
-> Eq PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT
-> PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT -> Bool
$c/= :: PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT
-> PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT -> Bool
== :: PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT
-> PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT -> Bool
$c== :: PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT
-> PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT)
#endif
deriving instance Show PhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT

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

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

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


type EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_SPEC_VERSION = 2

-- No documentation found for TopLevel "VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_SPEC_VERSION"
pattern EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_SPEC_VERSION :: forall a. Integral a => a
$mEXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_SPEC_VERSION = 2


type EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME = "VK_EXT_attachment_feedback_loop_layout"

-- No documentation found for TopLevel "VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME"
pattern EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mEXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME = "VK_EXT_attachment_feedback_loop_layout"