{-# language CPP #-}
module Vulkan.Extensions.VK_NV_scissor_exclusive ( cmdSetExclusiveScissorNV
, cmdSetExclusiveScissorEnableNV
, PhysicalDeviceExclusiveScissorFeaturesNV(..)
, PipelineViewportExclusiveScissorStateCreateInfoNV(..)
, NV_SCISSOR_EXCLUSIVE_SPEC_VERSION
, pattern NV_SCISSOR_EXCLUSIVE_SPEC_VERSION
, NV_SCISSOR_EXCLUSIVE_EXTENSION_NAME
, pattern NV_SCISSOR_EXCLUSIVE_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 Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
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.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.FundamentalTypes (Bool32)
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(pVkCmdSetExclusiveScissorEnableNV))
import Vulkan.Dynamic (DeviceCmds(pVkCmdSetExclusiveScissorNV))
import Vulkan.Core10.FundamentalTypes (Rect2D)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdSetExclusiveScissorNV
:: FunPtr (Ptr CommandBuffer_T -> Word32 -> Word32 -> Ptr Rect2D -> IO ()) -> Ptr CommandBuffer_T -> Word32 -> Word32 -> Ptr Rect2D -> IO ()
cmdSetExclusiveScissorNV :: forall io
. (MonadIO io)
=>
CommandBuffer
->
("firstExclusiveScissor" ::: Word32)
->
("exclusiveScissors" ::: Vector Rect2D)
-> io ()
cmdSetExclusiveScissorNV :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer
-> ("firstExclusiveScissor" ::: Word32)
-> ("exclusiveScissors" ::: Vector Rect2D)
-> io ()
cmdSetExclusiveScissorNV CommandBuffer
commandBuffer
"firstExclusiveScissor" ::: Word32
firstExclusiveScissor
"exclusiveScissors" ::: Vector Rect2D
exclusiveScissors = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let vkCmdSetExclusiveScissorNVPtr :: FunPtr
(Ptr CommandBuffer_T
-> ("firstExclusiveScissor" ::: Word32)
-> ("firstExclusiveScissor" ::: Word32)
-> ("pExclusiveScissors" ::: Ptr Rect2D)
-> IO ())
vkCmdSetExclusiveScissorNVPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("firstExclusiveScissor" ::: Word32)
-> ("firstExclusiveScissor" ::: Word32)
-> ("pExclusiveScissors" ::: Ptr Rect2D)
-> IO ())
pVkCmdSetExclusiveScissorNV (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("firstExclusiveScissor" ::: Word32)
-> ("firstExclusiveScissor" ::: Word32)
-> ("pExclusiveScissors" ::: Ptr Rect2D)
-> IO ())
vkCmdSetExclusiveScissorNVPtr 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 vkCmdSetExclusiveScissorNV is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCmdSetExclusiveScissorNV' :: Ptr CommandBuffer_T
-> ("firstExclusiveScissor" ::: Word32)
-> ("firstExclusiveScissor" ::: Word32)
-> ("pExclusiveScissors" ::: Ptr Rect2D)
-> IO ()
vkCmdSetExclusiveScissorNV' = FunPtr
(Ptr CommandBuffer_T
-> ("firstExclusiveScissor" ::: Word32)
-> ("firstExclusiveScissor" ::: Word32)
-> ("pExclusiveScissors" ::: Ptr Rect2D)
-> IO ())
-> Ptr CommandBuffer_T
-> ("firstExclusiveScissor" ::: Word32)
-> ("firstExclusiveScissor" ::: Word32)
-> ("pExclusiveScissors" ::: Ptr Rect2D)
-> IO ()
mkVkCmdSetExclusiveScissorNV FunPtr
(Ptr CommandBuffer_T
-> ("firstExclusiveScissor" ::: Word32)
-> ("firstExclusiveScissor" ::: Word32)
-> ("pExclusiveScissors" ::: Ptr Rect2D)
-> IO ())
vkCmdSetExclusiveScissorNVPtr
"pExclusiveScissors" ::: Ptr Rect2D
pPExclusiveScissors <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Rect2D ((forall a. Vector a -> Int
Data.Vector.length ("exclusiveScissors" ::: Vector Rect2D
exclusiveScissors)) forall a. Num a => a -> a -> a
* Int
16)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Rect2D
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke ("pExclusiveScissors" ::: Ptr Rect2D
pPExclusiveScissors forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
16 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Rect2D) (Rect2D
e)) ("exclusiveScissors" ::: Vector Rect2D
exclusiveScissors)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdSetExclusiveScissorNV" (Ptr CommandBuffer_T
-> ("firstExclusiveScissor" ::: Word32)
-> ("firstExclusiveScissor" ::: Word32)
-> ("pExclusiveScissors" ::: Ptr Rect2D)
-> IO ()
vkCmdSetExclusiveScissorNV'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
("firstExclusiveScissor" ::: Word32
firstExclusiveScissor)
((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("exclusiveScissors" ::: Vector Rect2D
exclusiveScissors)) :: Word32))
("pExclusiveScissors" ::: Ptr Rect2D
pPExclusiveScissors))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdSetExclusiveScissorEnableNV
:: FunPtr (Ptr CommandBuffer_T -> Word32 -> Word32 -> Ptr Bool32 -> IO ()) -> Ptr CommandBuffer_T -> Word32 -> Word32 -> Ptr Bool32 -> IO ()
cmdSetExclusiveScissorEnableNV :: forall io
. (MonadIO io)
=>
CommandBuffer
->
("firstExclusiveScissor" ::: Word32)
->
("exclusiveScissorEnables" ::: Vector Bool)
-> io ()
cmdSetExclusiveScissorEnableNV :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer
-> ("firstExclusiveScissor" ::: Word32)
-> ("exclusiveScissorEnables" ::: Vector Bool)
-> io ()
cmdSetExclusiveScissorEnableNV CommandBuffer
commandBuffer
"firstExclusiveScissor" ::: Word32
firstExclusiveScissor
"exclusiveScissorEnables" ::: Vector Bool
exclusiveScissorEnables = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
let vkCmdSetExclusiveScissorEnableNVPtr :: FunPtr
(Ptr CommandBuffer_T
-> ("firstExclusiveScissor" ::: Word32)
-> ("firstExclusiveScissor" ::: Word32)
-> ("pExclusiveScissorEnables" ::: Ptr Bool32)
-> IO ())
vkCmdSetExclusiveScissorEnableNVPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("firstExclusiveScissor" ::: Word32)
-> ("firstExclusiveScissor" ::: Word32)
-> ("pExclusiveScissorEnables" ::: Ptr Bool32)
-> IO ())
pVkCmdSetExclusiveScissorEnableNV (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
$sel:deviceCmds:CommandBuffer :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("firstExclusiveScissor" ::: Word32)
-> ("firstExclusiveScissor" ::: Word32)
-> ("pExclusiveScissorEnables" ::: Ptr Bool32)
-> IO ())
vkCmdSetExclusiveScissorEnableNVPtr 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 vkCmdSetExclusiveScissorEnableNV is null" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
let vkCmdSetExclusiveScissorEnableNV' :: Ptr CommandBuffer_T
-> ("firstExclusiveScissor" ::: Word32)
-> ("firstExclusiveScissor" ::: Word32)
-> ("pExclusiveScissorEnables" ::: Ptr Bool32)
-> IO ()
vkCmdSetExclusiveScissorEnableNV' = FunPtr
(Ptr CommandBuffer_T
-> ("firstExclusiveScissor" ::: Word32)
-> ("firstExclusiveScissor" ::: Word32)
-> ("pExclusiveScissorEnables" ::: Ptr Bool32)
-> IO ())
-> Ptr CommandBuffer_T
-> ("firstExclusiveScissor" ::: Word32)
-> ("firstExclusiveScissor" ::: Word32)
-> ("pExclusiveScissorEnables" ::: Ptr Bool32)
-> IO ()
mkVkCmdSetExclusiveScissorEnableNV FunPtr
(Ptr CommandBuffer_T
-> ("firstExclusiveScissor" ::: Word32)
-> ("firstExclusiveScissor" ::: Word32)
-> ("pExclusiveScissorEnables" ::: Ptr Bool32)
-> IO ())
vkCmdSetExclusiveScissorEnableNVPtr
"pExclusiveScissorEnables" ::: Ptr Bool32
pPExclusiveScissorEnables <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Bool32 ((forall a. Vector a -> Int
Data.Vector.length ("exclusiveScissorEnables" ::: Vector Bool
exclusiveScissorEnables)) forall a. Num a => a -> a -> a
* Int
4)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Bool
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke ("pExclusiveScissorEnables" ::: Ptr Bool32
pPExclusiveScissorEnables forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Bool32) (Bool -> Bool32
boolToBool32 (Bool
e))) ("exclusiveScissorEnables" ::: Vector Bool
exclusiveScissorEnables)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdSetExclusiveScissorEnableNV" (Ptr CommandBuffer_T
-> ("firstExclusiveScissor" ::: Word32)
-> ("firstExclusiveScissor" ::: Word32)
-> ("pExclusiveScissorEnables" ::: Ptr Bool32)
-> IO ()
vkCmdSetExclusiveScissorEnableNV'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
("firstExclusiveScissor" ::: Word32
firstExclusiveScissor)
((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("exclusiveScissorEnables" ::: Vector Bool
exclusiveScissorEnables)) :: Word32))
("pExclusiveScissorEnables" ::: Ptr Bool32
pPExclusiveScissorEnables))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ()
data PhysicalDeviceExclusiveScissorFeaturesNV = PhysicalDeviceExclusiveScissorFeaturesNV
{
PhysicalDeviceExclusiveScissorFeaturesNV -> Bool
exclusiveScissor :: Bool }
deriving (Typeable, PhysicalDeviceExclusiveScissorFeaturesNV
-> PhysicalDeviceExclusiveScissorFeaturesNV -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceExclusiveScissorFeaturesNV
-> PhysicalDeviceExclusiveScissorFeaturesNV -> Bool
$c/= :: PhysicalDeviceExclusiveScissorFeaturesNV
-> PhysicalDeviceExclusiveScissorFeaturesNV -> Bool
== :: PhysicalDeviceExclusiveScissorFeaturesNV
-> PhysicalDeviceExclusiveScissorFeaturesNV -> Bool
$c== :: PhysicalDeviceExclusiveScissorFeaturesNV
-> PhysicalDeviceExclusiveScissorFeaturesNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceExclusiveScissorFeaturesNV)
#endif
deriving instance Show PhysicalDeviceExclusiveScissorFeaturesNV
instance ToCStruct PhysicalDeviceExclusiveScissorFeaturesNV where
withCStruct :: forall b.
PhysicalDeviceExclusiveScissorFeaturesNV
-> (Ptr PhysicalDeviceExclusiveScissorFeaturesNV -> IO b) -> IO b
withCStruct PhysicalDeviceExclusiveScissorFeaturesNV
x Ptr PhysicalDeviceExclusiveScissorFeaturesNV -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceExclusiveScissorFeaturesNV
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceExclusiveScissorFeaturesNV
p PhysicalDeviceExclusiveScissorFeaturesNV
x (Ptr PhysicalDeviceExclusiveScissorFeaturesNV -> IO b
f Ptr PhysicalDeviceExclusiveScissorFeaturesNV
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceExclusiveScissorFeaturesNV
-> PhysicalDeviceExclusiveScissorFeaturesNV -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceExclusiveScissorFeaturesNV
p PhysicalDeviceExclusiveScissorFeaturesNV{Bool
exclusiveScissor :: Bool
$sel:exclusiveScissor:PhysicalDeviceExclusiveScissorFeaturesNV :: PhysicalDeviceExclusiveScissorFeaturesNV -> Bool
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExclusiveScissorFeaturesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExclusiveScissorFeaturesNV
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 PhysicalDeviceExclusiveScissorFeaturesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
exclusiveScissor))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceExclusiveScissorFeaturesNV -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceExclusiveScissorFeaturesNV
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExclusiveScissorFeaturesNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceExclusiveScissorFeaturesNV
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 PhysicalDeviceExclusiveScissorFeaturesNV
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 PhysicalDeviceExclusiveScissorFeaturesNV where
peekCStruct :: Ptr PhysicalDeviceExclusiveScissorFeaturesNV
-> IO PhysicalDeviceExclusiveScissorFeaturesNV
peekCStruct Ptr PhysicalDeviceExclusiveScissorFeaturesNV
p = do
Bool32
exclusiveScissor <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceExclusiveScissorFeaturesNV
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 -> PhysicalDeviceExclusiveScissorFeaturesNV
PhysicalDeviceExclusiveScissorFeaturesNV
(Bool32 -> Bool
bool32ToBool Bool32
exclusiveScissor)
instance Storable PhysicalDeviceExclusiveScissorFeaturesNV where
sizeOf :: PhysicalDeviceExclusiveScissorFeaturesNV -> Int
sizeOf ~PhysicalDeviceExclusiveScissorFeaturesNV
_ = Int
24
alignment :: PhysicalDeviceExclusiveScissorFeaturesNV -> Int
alignment ~PhysicalDeviceExclusiveScissorFeaturesNV
_ = Int
8
peek :: Ptr PhysicalDeviceExclusiveScissorFeaturesNV
-> IO PhysicalDeviceExclusiveScissorFeaturesNV
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceExclusiveScissorFeaturesNV
-> PhysicalDeviceExclusiveScissorFeaturesNV -> IO ()
poke Ptr PhysicalDeviceExclusiveScissorFeaturesNV
ptr PhysicalDeviceExclusiveScissorFeaturesNV
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceExclusiveScissorFeaturesNV
ptr PhysicalDeviceExclusiveScissorFeaturesNV
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceExclusiveScissorFeaturesNV where
zero :: PhysicalDeviceExclusiveScissorFeaturesNV
zero = Bool -> PhysicalDeviceExclusiveScissorFeaturesNV
PhysicalDeviceExclusiveScissorFeaturesNV
forall a. Zero a => a
zero
data PipelineViewportExclusiveScissorStateCreateInfoNV = PipelineViewportExclusiveScissorStateCreateInfoNV
{
PipelineViewportExclusiveScissorStateCreateInfoNV
-> "exclusiveScissors" ::: Vector Rect2D
exclusiveScissors :: Vector Rect2D }
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PipelineViewportExclusiveScissorStateCreateInfoNV)
#endif
deriving instance Show PipelineViewportExclusiveScissorStateCreateInfoNV
instance ToCStruct PipelineViewportExclusiveScissorStateCreateInfoNV where
withCStruct :: forall b.
PipelineViewportExclusiveScissorStateCreateInfoNV
-> (Ptr PipelineViewportExclusiveScissorStateCreateInfoNV -> IO b)
-> IO b
withCStruct PipelineViewportExclusiveScissorStateCreateInfoNV
x Ptr PipelineViewportExclusiveScissorStateCreateInfoNV -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 forall a b. (a -> b) -> a -> b
$ \Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
p PipelineViewportExclusiveScissorStateCreateInfoNV
x (Ptr PipelineViewportExclusiveScissorStateCreateInfoNV -> IO b
f Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
p)
pokeCStruct :: forall b.
Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
-> PipelineViewportExclusiveScissorStateCreateInfoNV
-> IO b
-> IO b
pokeCStruct Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
p PipelineViewportExclusiveScissorStateCreateInfoNV{"exclusiveScissors" ::: Vector Rect2D
exclusiveScissors :: "exclusiveScissors" ::: Vector Rect2D
$sel:exclusiveScissors:PipelineViewportExclusiveScissorStateCreateInfoNV :: PipelineViewportExclusiveScissorStateCreateInfoNV
-> "exclusiveScissors" ::: Vector Rect2D
..} IO b
f = forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT forall a b. (a -> b) -> a -> b
$ do
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) ((forall a b. (Integral a, Num b) => a -> b
fromIntegral (forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ ("exclusiveScissors" ::: Vector Rect2D
exclusiveScissors)) :: Word32))
"pExclusiveScissors" ::: Ptr Rect2D
pPExclusiveScissors' <- forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @Rect2D ((forall a. Vector a -> Int
Data.Vector.length ("exclusiveScissors" ::: Vector Rect2D
exclusiveScissors)) forall a. Num a => a -> a -> a
* Int
16)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i Rect2D
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke ("pExclusiveScissors" ::: Ptr Rect2D
pPExclusiveScissors' forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
16 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Rect2D) (Rect2D
e)) ("exclusiveScissors" ::: Vector Rect2D
exclusiveScissors)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Rect2D))) ("pExclusiveScissors" ::: Ptr Rect2D
pPExclusiveScissors')
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
-> IO b -> IO b
pokeZeroCStruct Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
IO b
f
instance FromCStruct PipelineViewportExclusiveScissorStateCreateInfoNV where
peekCStruct :: Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
-> IO PipelineViewportExclusiveScissorStateCreateInfoNV
peekCStruct Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
p = do
"firstExclusiveScissor" ::: Word32
exclusiveScissorCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
"pExclusiveScissors" ::: Ptr Rect2D
pExclusiveScissors <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr Rect2D) ((Ptr PipelineViewportExclusiveScissorStateCreateInfoNV
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Rect2D)))
"exclusiveScissors" ::: Vector Rect2D
pExclusiveScissors' <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a b. (Integral a, Num b) => a -> b
fromIntegral "firstExclusiveScissor" ::: Word32
exclusiveScissorCount) (\Int
i -> forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Rect2D (("pExclusiveScissors" ::: Ptr Rect2D
pExclusiveScissors forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
16 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr Rect2D)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ ("exclusiveScissors" ::: Vector Rect2D)
-> PipelineViewportExclusiveScissorStateCreateInfoNV
PipelineViewportExclusiveScissorStateCreateInfoNV
"exclusiveScissors" ::: Vector Rect2D
pExclusiveScissors'
instance Zero PipelineViewportExclusiveScissorStateCreateInfoNV where
zero :: PipelineViewportExclusiveScissorStateCreateInfoNV
zero = ("exclusiveScissors" ::: Vector Rect2D)
-> PipelineViewportExclusiveScissorStateCreateInfoNV
PipelineViewportExclusiveScissorStateCreateInfoNV
forall a. Monoid a => a
mempty
type NV_SCISSOR_EXCLUSIVE_SPEC_VERSION = 2
pattern NV_SCISSOR_EXCLUSIVE_SPEC_VERSION :: forall a . Integral a => a
pattern $bNV_SCISSOR_EXCLUSIVE_SPEC_VERSION :: forall a. Integral a => a
$mNV_SCISSOR_EXCLUSIVE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
NV_SCISSOR_EXCLUSIVE_SPEC_VERSION = 2
type NV_SCISSOR_EXCLUSIVE_EXTENSION_NAME = "VK_NV_scissor_exclusive"
pattern NV_SCISSOR_EXCLUSIVE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bNV_SCISSOR_EXCLUSIVE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mNV_SCISSOR_EXCLUSIVE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
NV_SCISSOR_EXCLUSIVE_EXTENSION_NAME = "VK_NV_scissor_exclusive"