{-# language CPP #-}
module Vulkan.Extensions.VK_HUAWEI_invocation_mask ( cmdBindInvocationMaskHUAWEI
, PhysicalDeviceInvocationMaskFeaturesHUAWEI(..)
, HUAWEI_INVOCATION_MASK_SPEC_VERSION
, pattern HUAWEI_INVOCATION_MASK_SPEC_VERSION
, HUAWEI_INVOCATION_MASK_EXTENSION_NAME
, pattern HUAWEI_INVOCATION_MASK_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.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(pVkCmdBindInvocationMaskHUAWEI))
import Vulkan.Core10.Enums.ImageLayout (ImageLayout)
import Vulkan.Core10.Enums.ImageLayout (ImageLayout(..))
import Vulkan.Core10.Handles (ImageView)
import Vulkan.Core10.Handles (ImageView(..))
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdBindInvocationMaskHUAWEI
:: FunPtr (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ()) -> Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ()
cmdBindInvocationMaskHUAWEI :: forall io
. (MonadIO io)
=>
CommandBuffer
->
ImageView
->
ImageLayout
-> io ()
cmdBindInvocationMaskHUAWEI :: CommandBuffer -> ImageView -> ImageLayout -> io ()
cmdBindInvocationMaskHUAWEI CommandBuffer
commandBuffer ImageView
imageView ImageLayout
imageLayout = IO () -> io ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ()) -> IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdBindInvocationMaskHUAWEIPtr :: FunPtr (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
vkCmdBindInvocationMaskHUAWEIPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
pVkCmdBindInvocationMaskHUAWEI (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
vkCmdBindInvocationMaskHUAWEIPtr FunPtr (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
-> FunPtr
(Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"The function pointer for vkCmdBindInvocationMaskHUAWEI is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdBindInvocationMaskHUAWEI' :: Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ()
vkCmdBindInvocationMaskHUAWEI' = FunPtr (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
-> Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ()
mkVkCmdBindInvocationMaskHUAWEI FunPtr (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ())
vkCmdBindInvocationMaskHUAWEIPtr
String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdBindInvocationMaskHUAWEI" (Ptr CommandBuffer_T -> ImageView -> ImageLayout -> IO ()
vkCmdBindInvocationMaskHUAWEI' (CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer)) (ImageView
imageView) (ImageLayout
imageLayout))
() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ()
data PhysicalDeviceInvocationMaskFeaturesHUAWEI = PhysicalDeviceInvocationMaskFeaturesHUAWEI
{
PhysicalDeviceInvocationMaskFeaturesHUAWEI -> Bool
invocationMask :: Bool }
deriving (Typeable, PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> PhysicalDeviceInvocationMaskFeaturesHUAWEI -> Bool
(PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> PhysicalDeviceInvocationMaskFeaturesHUAWEI -> Bool)
-> (PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> PhysicalDeviceInvocationMaskFeaturesHUAWEI -> Bool)
-> Eq PhysicalDeviceInvocationMaskFeaturesHUAWEI
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> PhysicalDeviceInvocationMaskFeaturesHUAWEI -> Bool
$c/= :: PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> PhysicalDeviceInvocationMaskFeaturesHUAWEI -> Bool
== :: PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> PhysicalDeviceInvocationMaskFeaturesHUAWEI -> Bool
$c== :: PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> PhysicalDeviceInvocationMaskFeaturesHUAWEI -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceInvocationMaskFeaturesHUAWEI)
#endif
deriving instance Show PhysicalDeviceInvocationMaskFeaturesHUAWEI
instance ToCStruct PhysicalDeviceInvocationMaskFeaturesHUAWEI where
withCStruct :: PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> (Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI -> IO b) -> IO b
withCStruct PhysicalDeviceInvocationMaskFeaturesHUAWEI
x Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI -> IO b
f = Int
-> (Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI -> IO b) -> IO b)
-> (Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
p -> Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> PhysicalDeviceInvocationMaskFeaturesHUAWEI -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
p PhysicalDeviceInvocationMaskFeaturesHUAWEI
x (Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI -> IO b
f Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
p)
pokeCStruct :: Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> PhysicalDeviceInvocationMaskFeaturesHUAWEI -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
p PhysicalDeviceInvocationMaskFeaturesHUAWEI{Bool
invocationMask :: Bool
$sel:invocationMask:PhysicalDeviceInvocationMaskFeaturesHUAWEI :: PhysicalDeviceInvocationMaskFeaturesHUAWEI -> Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
p Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
p Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> 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 PhysicalDeviceInvocationMaskFeaturesHUAWEI
p Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
invocationMask))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
p Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
p Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> 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 PhysicalDeviceInvocationMaskFeaturesHUAWEI
p Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI -> 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 PhysicalDeviceInvocationMaskFeaturesHUAWEI where
peekCStruct :: Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> IO PhysicalDeviceInvocationMaskFeaturesHUAWEI
peekCStruct Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
p = do
Bool32
invocationMask <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
p Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> IO PhysicalDeviceInvocationMaskFeaturesHUAWEI
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> IO PhysicalDeviceInvocationMaskFeaturesHUAWEI)
-> PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> IO PhysicalDeviceInvocationMaskFeaturesHUAWEI
forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceInvocationMaskFeaturesHUAWEI
PhysicalDeviceInvocationMaskFeaturesHUAWEI
(Bool32 -> Bool
bool32ToBool Bool32
invocationMask)
instance Storable PhysicalDeviceInvocationMaskFeaturesHUAWEI where
sizeOf :: PhysicalDeviceInvocationMaskFeaturesHUAWEI -> Int
sizeOf ~PhysicalDeviceInvocationMaskFeaturesHUAWEI
_ = Int
24
alignment :: PhysicalDeviceInvocationMaskFeaturesHUAWEI -> Int
alignment ~PhysicalDeviceInvocationMaskFeaturesHUAWEI
_ = Int
8
peek :: Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> IO PhysicalDeviceInvocationMaskFeaturesHUAWEI
peek = Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> IO PhysicalDeviceInvocationMaskFeaturesHUAWEI
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> PhysicalDeviceInvocationMaskFeaturesHUAWEI -> IO ()
poke Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
poked = Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
-> PhysicalDeviceInvocationMaskFeaturesHUAWEI -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
ptr PhysicalDeviceInvocationMaskFeaturesHUAWEI
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceInvocationMaskFeaturesHUAWEI where
zero :: PhysicalDeviceInvocationMaskFeaturesHUAWEI
zero = Bool -> PhysicalDeviceInvocationMaskFeaturesHUAWEI
PhysicalDeviceInvocationMaskFeaturesHUAWEI
Bool
forall a. Zero a => a
zero
type HUAWEI_INVOCATION_MASK_SPEC_VERSION = 1
pattern HUAWEI_INVOCATION_MASK_SPEC_VERSION :: forall a . Integral a => a
pattern $bHUAWEI_INVOCATION_MASK_SPEC_VERSION :: a
$mHUAWEI_INVOCATION_MASK_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
HUAWEI_INVOCATION_MASK_SPEC_VERSION = 1
type HUAWEI_INVOCATION_MASK_EXTENSION_NAME = "VK_HUAWEI_invocation_mask"
pattern HUAWEI_INVOCATION_MASK_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bHUAWEI_INVOCATION_MASK_EXTENSION_NAME :: a
$mHUAWEI_INVOCATION_MASK_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
HUAWEI_INVOCATION_MASK_EXTENSION_NAME = "VK_HUAWEI_invocation_mask"