{-# language CPP #-}
module Vulkan.Extensions.VK_EXT_attachment_feedback_loop_dynamic_state ( cmdSetAttachmentFeedbackLoopEnableEXT
, PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT(..)
, EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_SPEC_VERSION
, pattern EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_SPEC_VERSION
, EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_EXTENSION_NAME
, pattern EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_EXTENSION_NAME
) where
import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
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 Control.Monad.IO.Class (MonadIO)
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 GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Kind (Type)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer(CommandBuffer))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Dynamic (DeviceCmds(pVkCmdSetAttachmentFeedbackLoopEnableEXT))
import Vulkan.Core10.Enums.ImageAspectFlagBits (ImageAspectFlagBits(..))
import Vulkan.Core10.Enums.ImageAspectFlagBits (ImageAspectFlags)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdSetAttachmentFeedbackLoopEnableEXT
:: FunPtr (Ptr CommandBuffer_T -> ImageAspectFlags -> IO ()) -> Ptr CommandBuffer_T -> ImageAspectFlags -> IO ()
cmdSetAttachmentFeedbackLoopEnableEXT :: forall io
. (MonadIO io)
=>
CommandBuffer
->
("aspectMask" ::: ImageAspectFlags)
-> io ()
cmdSetAttachmentFeedbackLoopEnableEXT :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer -> ("aspectMask" ::: ImageAspectFlags) -> io ()
cmdSetAttachmentFeedbackLoopEnableEXT CommandBuffer
commandBuffer "aspectMask" ::: ImageAspectFlags
aspectMask = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
let vkCmdSetAttachmentFeedbackLoopEnableEXTPtr :: FunPtr
(Ptr CommandBuffer_T
-> ("aspectMask" ::: ImageAspectFlags) -> IO ())
vkCmdSetAttachmentFeedbackLoopEnableEXTPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("aspectMask" ::: ImageAspectFlags) -> IO ())
pVkCmdSetAttachmentFeedbackLoopEnableEXT (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("aspectMask" ::: ImageAspectFlags) -> IO ())
vkCmdSetAttachmentFeedbackLoopEnableEXTPtr forall a. Eq a => a -> a -> Bool
/= forall a. FunPtr a
nullFunPtr) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdSetAttachmentFeedbackLoopEnableEXT is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCmdSetAttachmentFeedbackLoopEnableEXT' :: Ptr CommandBuffer_T -> ("aspectMask" ::: ImageAspectFlags) -> IO ()
vkCmdSetAttachmentFeedbackLoopEnableEXT' = FunPtr
(Ptr CommandBuffer_T
-> ("aspectMask" ::: ImageAspectFlags) -> IO ())
-> Ptr CommandBuffer_T
-> ("aspectMask" ::: ImageAspectFlags)
-> IO ()
mkVkCmdSetAttachmentFeedbackLoopEnableEXT FunPtr
(Ptr CommandBuffer_T
-> ("aspectMask" ::: ImageAspectFlags) -> IO ())
vkCmdSetAttachmentFeedbackLoopEnableEXTPtr
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdSetAttachmentFeedbackLoopEnableEXT" (Ptr CommandBuffer_T -> ("aspectMask" ::: ImageAspectFlags) -> IO ()
vkCmdSetAttachmentFeedbackLoopEnableEXT'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
("aspectMask" ::: ImageAspectFlags
aspectMask))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
data PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT = PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
{
PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT -> Bool
attachmentFeedbackLoopDynamicState :: Bool }
deriving (Typeable, PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> Bool
$c/= :: PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> Bool
== :: PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> Bool
$c== :: PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT)
#endif
deriving instance Show PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
instance ToCStruct PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT where
withCStruct :: forall b.
PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> (Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> IO b)
-> IO b
withCStruct PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
x Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
p PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
x (Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> IO b
f Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> IO b
-> IO b
pokeCStruct Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
p PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT{Bool
attachmentFeedbackLoopDynamicState :: Bool
$sel:attachmentFeedbackLoopDynamicState:PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT :: PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT -> Bool
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
attachmentFeedbackLoopDynamicState))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_FEATURES_EXT)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT where
peekCStruct :: Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> IO PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
peekCStruct Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
p = do
Bool32
attachmentFeedbackLoopDynamicState <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
(Bool32 -> Bool
bool32ToBool Bool32
attachmentFeedbackLoopDynamicState)
instance Storable PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT where
sizeOf :: PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT -> Int
sizeOf ~PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
_ = Int
24
alignment :: PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT -> Int
alignment ~PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
_ = Int
8
peek :: Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> IO PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
-> IO ()
poke Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
ptr PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT where
zero :: PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
zero = Bool -> PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
PhysicalDeviceAttachmentFeedbackLoopDynamicStateFeaturesEXT
forall a. Zero a => a
zero
type EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_SPEC_VERSION = 1
pattern EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_SPEC_VERSION :: forall a. Integral a => a
$mEXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_SPEC_VERSION = 1
type EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_EXTENSION_NAME = "VK_EXT_attachment_feedback_loop_dynamic_state"
pattern EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mEXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_ATTACHMENT_FEEDBACK_LOOP_DYNAMIC_STATE_EXTENSION_NAME = "VK_EXT_attachment_feedback_loop_dynamic_state"