{-# language CPP #-}
module Vulkan.Extensions.VK_NV_inherited_viewport_scissor ( PhysicalDeviceInheritedViewportScissorFeaturesNV(..)
, CommandBufferInheritanceViewportScissorInfoNV(..)
, NV_INHERITED_VIEWPORT_SCISSOR_SPEC_VERSION
, pattern NV_INHERITED_VIEWPORT_SCISSOR_SPEC_VERSION
, NV_INHERITED_VIEWPORT_SCISSOR_EXTENSION_NAME
, pattern NV_INHERITED_VIEWPORT_SCISSOR_EXTENSION_NAME
) where
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
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.Word (Word32)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Pipeline (Viewport)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV))
data PhysicalDeviceInheritedViewportScissorFeaturesNV = PhysicalDeviceInheritedViewportScissorFeaturesNV
{
PhysicalDeviceInheritedViewportScissorFeaturesNV -> Bool
inheritedViewportScissor2D :: Bool }
deriving (Typeable, PhysicalDeviceInheritedViewportScissorFeaturesNV
-> PhysicalDeviceInheritedViewportScissorFeaturesNV -> Bool
(PhysicalDeviceInheritedViewportScissorFeaturesNV
-> PhysicalDeviceInheritedViewportScissorFeaturesNV -> Bool)
-> (PhysicalDeviceInheritedViewportScissorFeaturesNV
-> PhysicalDeviceInheritedViewportScissorFeaturesNV -> Bool)
-> Eq PhysicalDeviceInheritedViewportScissorFeaturesNV
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceInheritedViewportScissorFeaturesNV
-> PhysicalDeviceInheritedViewportScissorFeaturesNV -> Bool
$c/= :: PhysicalDeviceInheritedViewportScissorFeaturesNV
-> PhysicalDeviceInheritedViewportScissorFeaturesNV -> Bool
== :: PhysicalDeviceInheritedViewportScissorFeaturesNV
-> PhysicalDeviceInheritedViewportScissorFeaturesNV -> Bool
$c== :: PhysicalDeviceInheritedViewportScissorFeaturesNV
-> PhysicalDeviceInheritedViewportScissorFeaturesNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceInheritedViewportScissorFeaturesNV)
#endif
deriving instance Show PhysicalDeviceInheritedViewportScissorFeaturesNV
instance ToCStruct PhysicalDeviceInheritedViewportScissorFeaturesNV where
withCStruct :: PhysicalDeviceInheritedViewportScissorFeaturesNV
-> (Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV -> IO b)
-> IO b
withCStruct PhysicalDeviceInheritedViewportScissorFeaturesNV
x Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV -> IO b
f = Int
-> (Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV -> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV -> IO b)
-> IO b)
-> (Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
p -> Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
-> PhysicalDeviceInheritedViewportScissorFeaturesNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
p PhysicalDeviceInheritedViewportScissorFeaturesNV
x (Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV -> IO b
f Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
p)
pokeCStruct :: Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
-> PhysicalDeviceInheritedViewportScissorFeaturesNV -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
p PhysicalDeviceInheritedViewportScissorFeaturesNV{Bool
inheritedViewportScissor2D :: Bool
$sel:inheritedViewportScissor2D:PhysicalDeviceInheritedViewportScissorFeaturesNV :: PhysicalDeviceInheritedViewportScissorFeaturesNV -> Bool
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
p Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
p Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
-> 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 PhysicalDeviceInheritedViewportScissorFeaturesNV
p Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
inheritedViewportScissor2D))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
-> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
p Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
p Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
-> 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 PhysicalDeviceInheritedViewportScissorFeaturesNV
p Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
-> 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 PhysicalDeviceInheritedViewportScissorFeaturesNV where
peekCStruct :: Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
-> IO PhysicalDeviceInheritedViewportScissorFeaturesNV
peekCStruct Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
p = do
Bool32
inheritedViewportScissor2D <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
p Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
PhysicalDeviceInheritedViewportScissorFeaturesNV
-> IO PhysicalDeviceInheritedViewportScissorFeaturesNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceInheritedViewportScissorFeaturesNV
-> IO PhysicalDeviceInheritedViewportScissorFeaturesNV)
-> PhysicalDeviceInheritedViewportScissorFeaturesNV
-> IO PhysicalDeviceInheritedViewportScissorFeaturesNV
forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceInheritedViewportScissorFeaturesNV
PhysicalDeviceInheritedViewportScissorFeaturesNV
(Bool32 -> Bool
bool32ToBool Bool32
inheritedViewportScissor2D)
instance Storable PhysicalDeviceInheritedViewportScissorFeaturesNV where
sizeOf :: PhysicalDeviceInheritedViewportScissorFeaturesNV -> Int
sizeOf ~PhysicalDeviceInheritedViewportScissorFeaturesNV
_ = Int
24
alignment :: PhysicalDeviceInheritedViewportScissorFeaturesNV -> Int
alignment ~PhysicalDeviceInheritedViewportScissorFeaturesNV
_ = Int
8
peek :: Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
-> IO PhysicalDeviceInheritedViewportScissorFeaturesNV
peek = Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
-> IO PhysicalDeviceInheritedViewportScissorFeaturesNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
-> PhysicalDeviceInheritedViewportScissorFeaturesNV -> IO ()
poke Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
poked = Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
-> PhysicalDeviceInheritedViewportScissorFeaturesNV
-> IO ()
-> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
ptr PhysicalDeviceInheritedViewportScissorFeaturesNV
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceInheritedViewportScissorFeaturesNV where
zero :: PhysicalDeviceInheritedViewportScissorFeaturesNV
zero = Bool -> PhysicalDeviceInheritedViewportScissorFeaturesNV
PhysicalDeviceInheritedViewportScissorFeaturesNV
Bool
forall a. Zero a => a
zero
data CommandBufferInheritanceViewportScissorInfoNV = CommandBufferInheritanceViewportScissorInfoNV
{
CommandBufferInheritanceViewportScissorInfoNV -> Bool
viewportScissor2D :: Bool
,
CommandBufferInheritanceViewportScissorInfoNV -> Word32
viewportDepthCount :: Word32
,
CommandBufferInheritanceViewportScissorInfoNV -> Viewport
viewportDepths :: Viewport
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CommandBufferInheritanceViewportScissorInfoNV)
#endif
deriving instance Show CommandBufferInheritanceViewportScissorInfoNV
instance ToCStruct CommandBufferInheritanceViewportScissorInfoNV where
withCStruct :: CommandBufferInheritanceViewportScissorInfoNV
-> (Ptr CommandBufferInheritanceViewportScissorInfoNV -> IO b)
-> IO b
withCStruct CommandBufferInheritanceViewportScissorInfoNV
x Ptr CommandBufferInheritanceViewportScissorInfoNV -> IO b
f = Int
-> (Ptr CommandBufferInheritanceViewportScissorInfoNV -> IO b)
-> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr CommandBufferInheritanceViewportScissorInfoNV -> IO b)
-> IO b)
-> (Ptr CommandBufferInheritanceViewportScissorInfoNV -> IO b)
-> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr CommandBufferInheritanceViewportScissorInfoNV
p -> Ptr CommandBufferInheritanceViewportScissorInfoNV
-> CommandBufferInheritanceViewportScissorInfoNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CommandBufferInheritanceViewportScissorInfoNV
p CommandBufferInheritanceViewportScissorInfoNV
x (Ptr CommandBufferInheritanceViewportScissorInfoNV -> IO b
f Ptr CommandBufferInheritanceViewportScissorInfoNV
p)
pokeCStruct :: Ptr CommandBufferInheritanceViewportScissorInfoNV
-> CommandBufferInheritanceViewportScissorInfoNV -> IO b -> IO b
pokeCStruct Ptr CommandBufferInheritanceViewportScissorInfoNV
p CommandBufferInheritanceViewportScissorInfoNV{Bool
Word32
Viewport
viewportDepths :: Viewport
viewportDepthCount :: Word32
viewportScissor2D :: Bool
$sel:viewportDepths:CommandBufferInheritanceViewportScissorInfoNV :: CommandBufferInheritanceViewportScissorInfoNV -> Viewport
$sel:viewportDepthCount:CommandBufferInheritanceViewportScissorInfoNV :: CommandBufferInheritanceViewportScissorInfoNV -> Word32
$sel:viewportScissor2D:CommandBufferInheritanceViewportScissorInfoNV :: CommandBufferInheritanceViewportScissorInfoNV -> Bool
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceViewportScissorInfoNV
p Ptr CommandBufferInheritanceViewportScissorInfoNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceViewportScissorInfoNV
p Ptr CommandBufferInheritanceViewportScissorInfoNV
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceViewportScissorInfoNV
p Ptr CommandBufferInheritanceViewportScissorInfoNV
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
viewportScissor2D))
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceViewportScissorInfoNV
p Ptr CommandBufferInheritanceViewportScissorInfoNV
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (Word32
viewportDepthCount)
Ptr Viewport
pViewportDepths'' <- ((Ptr Viewport -> IO b) -> IO b) -> ContT b IO (Ptr Viewport)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Viewport -> IO b) -> IO b) -> ContT b IO (Ptr Viewport))
-> ((Ptr Viewport -> IO b) -> IO b) -> ContT b IO (Ptr Viewport)
forall a b. (a -> b) -> a -> b
$ Viewport -> (Ptr Viewport -> IO b) -> IO b
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (Viewport
viewportDepths)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr Viewport) -> Ptr Viewport -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceViewportScissorInfoNV
p Ptr CommandBufferInheritanceViewportScissorInfoNV
-> Int -> Ptr (Ptr Viewport)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Viewport))) Ptr Viewport
pViewportDepths''
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: Ptr CommandBufferInheritanceViewportScissorInfoNV -> IO b -> IO b
pokeZeroCStruct Ptr CommandBufferInheritanceViewportScissorInfoNV
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceViewportScissorInfoNV
p Ptr CommandBufferInheritanceViewportScissorInfoNV
-> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceViewportScissorInfoNV
p Ptr CommandBufferInheritanceViewportScissorInfoNV
-> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceViewportScissorInfoNV
p Ptr CommandBufferInheritanceViewportScissorInfoNV
-> 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 () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceViewportScissorInfoNV
p Ptr CommandBufferInheritanceViewportScissorInfoNV
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
Ptr Viewport
pViewportDepths'' <- ((Ptr Viewport -> IO b) -> IO b) -> ContT b IO (Ptr Viewport)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr Viewport -> IO b) -> IO b) -> ContT b IO (Ptr Viewport))
-> ((Ptr Viewport -> IO b) -> IO b) -> ContT b IO (Ptr Viewport)
forall a b. (a -> b) -> a -> b
$ Viewport -> (Ptr Viewport -> IO b) -> IO b
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
withCStruct (Viewport
forall a. Zero a => a
zero)
IO () -> ContT b IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr Viewport) -> Ptr Viewport -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CommandBufferInheritanceViewportScissorInfoNV
p Ptr CommandBufferInheritanceViewportScissorInfoNV
-> Int -> Ptr (Ptr Viewport)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Viewport))) Ptr Viewport
pViewportDepths''
IO b -> ContT b IO b
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO b -> ContT b IO b) -> IO b -> ContT b IO b
forall a b. (a -> b) -> a -> b
$ IO b
f
instance FromCStruct CommandBufferInheritanceViewportScissorInfoNV where
peekCStruct :: Ptr CommandBufferInheritanceViewportScissorInfoNV
-> IO CommandBufferInheritanceViewportScissorInfoNV
peekCStruct Ptr CommandBufferInheritanceViewportScissorInfoNV
p = do
Bool32
viewportScissor2D <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr CommandBufferInheritanceViewportScissorInfoNV
p Ptr CommandBufferInheritanceViewportScissorInfoNV
-> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
Word32
viewportDepthCount <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr CommandBufferInheritanceViewportScissorInfoNV
p Ptr CommandBufferInheritanceViewportScissorInfoNV
-> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Word32))
Viewport
pViewportDepths <- FromCStruct Viewport => Ptr Viewport -> IO Viewport
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @Viewport (Ptr Viewport -> IO Viewport) -> IO (Ptr Viewport) -> IO Viewport
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<< Ptr (Ptr Viewport) -> IO (Ptr Viewport)
forall a. Storable a => Ptr a -> IO a
peek ((Ptr CommandBufferInheritanceViewportScissorInfoNV
p Ptr CommandBufferInheritanceViewportScissorInfoNV
-> Int -> Ptr (Ptr Viewport)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr (Ptr Viewport)))
CommandBufferInheritanceViewportScissorInfoNV
-> IO CommandBufferInheritanceViewportScissorInfoNV
forall (f :: * -> *) a. Applicative f => a -> f a
pure (CommandBufferInheritanceViewportScissorInfoNV
-> IO CommandBufferInheritanceViewportScissorInfoNV)
-> CommandBufferInheritanceViewportScissorInfoNV
-> IO CommandBufferInheritanceViewportScissorInfoNV
forall a b. (a -> b) -> a -> b
$ Bool
-> Word32
-> Viewport
-> CommandBufferInheritanceViewportScissorInfoNV
CommandBufferInheritanceViewportScissorInfoNV
(Bool32 -> Bool
bool32ToBool Bool32
viewportScissor2D) Word32
viewportDepthCount Viewport
pViewportDepths
instance Zero CommandBufferInheritanceViewportScissorInfoNV where
zero :: CommandBufferInheritanceViewportScissorInfoNV
zero = Bool
-> Word32
-> Viewport
-> CommandBufferInheritanceViewportScissorInfoNV
CommandBufferInheritanceViewportScissorInfoNV
Bool
forall a. Zero a => a
zero
Word32
forall a. Zero a => a
zero
Viewport
forall a. Zero a => a
zero
type NV_INHERITED_VIEWPORT_SCISSOR_SPEC_VERSION = 1
pattern NV_INHERITED_VIEWPORT_SCISSOR_SPEC_VERSION :: forall a . Integral a => a
pattern $bNV_INHERITED_VIEWPORT_SCISSOR_SPEC_VERSION :: a
$mNV_INHERITED_VIEWPORT_SCISSOR_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
NV_INHERITED_VIEWPORT_SCISSOR_SPEC_VERSION = 1
type NV_INHERITED_VIEWPORT_SCISSOR_EXTENSION_NAME = "VK_NV_inherited_viewport_scissor"
pattern NV_INHERITED_VIEWPORT_SCISSOR_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bNV_INHERITED_VIEWPORT_SCISSOR_EXTENSION_NAME :: a
$mNV_INHERITED_VIEWPORT_SCISSOR_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
NV_INHERITED_VIEWPORT_SCISSOR_EXTENSION_NAME = "VK_NV_inherited_viewport_scissor"