{-# language CPP #-}
module Vulkan.Extensions.VK_NVX_image_view_handle ( getImageViewHandleNVX
, getImageViewHandle64NVX
, getImageViewAddressNVX
, getDeviceCombinedImageSamplerIndexNVX
, ImageViewHandleInfoNVX(..)
, ImageViewAddressPropertiesNVX(..)
, NVX_IMAGE_VIEW_HANDLE_SPEC_VERSION
, pattern NVX_IMAGE_VIEW_HANDLE_SPEC_VERSION
, NVX_IMAGE_VIEW_HANDLE_EXTENSION_NAME
, pattern NVX_IMAGE_VIEW_HANDLE_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.Base (when)
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 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.Word (Word64)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Vulkan.NamedType ((:::))
import Vulkan.Core10.Enums.DescriptorType (DescriptorType)
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Core10.FundamentalTypes (DeviceAddress)
import Vulkan.Dynamic (DeviceCmds(pVkGetDeviceCombinedImageSamplerIndexNVX))
import Vulkan.Dynamic (DeviceCmds(pVkGetImageViewAddressNVX))
import Vulkan.Dynamic (DeviceCmds(pVkGetImageViewHandle64NVX))
import Vulkan.Dynamic (DeviceCmds(pVkGetImageViewHandleNVX))
import Vulkan.Core10.FundamentalTypes (DeviceSize)
import Vulkan.Core10.Handles (Device_T)
import Vulkan.Core10.Handles (ImageView)
import Vulkan.Core10.Handles (ImageView(..))
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.Core10.Handles (Sampler)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetImageViewHandleNVX
:: FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word32) -> Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word32
getImageViewHandleNVX :: forall io
. (MonadIO io)
=>
Device
->
ImageViewHandleInfoNVX
-> io (Word32)
getImageViewHandleNVX :: forall (io :: * -> *).
MonadIO io =>
Device -> ImageViewHandleInfoNVX -> io Word32
getImageViewHandleNVX Device
device ImageViewHandleInfoNVX
info = IO Word32 -> io Word32
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> io Word32)
-> (ContT Word32 IO Word32 -> IO Word32)
-> ContT Word32 IO Word32
-> io Word32
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT Word32 IO Word32 -> IO Word32
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT Word32 IO Word32 -> io Word32)
-> ContT Word32 IO Word32 -> io Word32
forall a b. (a -> b) -> a -> b
$ do
let vkGetImageViewHandleNVXPtr :: FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word32)
vkGetImageViewHandleNVXPtr = DeviceCmds
-> FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word32)
pVkGetImageViewHandleNVX (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT Word32 IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT Word32 m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Word32 IO ()) -> IO () -> ContT Word32 IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word32)
vkGetImageViewHandleNVXPtr FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word32)
-> FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word32)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word32)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. (HasCallStack, 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 vkGetImageViewHandleNVX is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetImageViewHandleNVX' :: Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word32
vkGetImageViewHandleNVX' = FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word32)
-> Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word32
mkVkGetImageViewHandleNVX FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word32)
vkGetImageViewHandleNVXPtr
pInfo <- ((Ptr ImageViewHandleInfoNVX -> IO Word32) -> IO Word32)
-> ContT Word32 IO (Ptr ImageViewHandleInfoNVX)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ImageViewHandleInfoNVX -> IO Word32) -> IO Word32)
-> ContT Word32 IO (Ptr ImageViewHandleInfoNVX))
-> ((Ptr ImageViewHandleInfoNVX -> IO Word32) -> IO Word32)
-> ContT Word32 IO (Ptr ImageViewHandleInfoNVX)
forall a b. (a -> b) -> a -> b
$ ImageViewHandleInfoNVX
-> (Ptr ImageViewHandleInfoNVX -> IO Word32) -> IO Word32
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
ImageViewHandleInfoNVX
-> (Ptr ImageViewHandleInfoNVX -> IO b) -> IO b
withCStruct (ImageViewHandleInfoNVX
info)
r <- lift $ traceAroundEvent "vkGetImageViewHandleNVX" (vkGetImageViewHandleNVX'
(deviceHandle (device))
pInfo)
pure $ (r)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetImageViewHandle64NVX
:: FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word64) -> Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word64
getImageViewHandle64NVX :: forall io
. (MonadIO io)
=>
Device
->
ImageViewHandleInfoNVX
-> io (Word64)
getImageViewHandle64NVX :: forall (io :: * -> *).
MonadIO io =>
Device -> ImageViewHandleInfoNVX -> io Word64
getImageViewHandle64NVX Device
device ImageViewHandleInfoNVX
info = IO Word64 -> io Word64
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> io Word64)
-> (ContT Word64 IO Word64 -> IO Word64)
-> ContT Word64 IO Word64
-> io Word64
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT Word64 IO Word64 -> IO Word64
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT Word64 IO Word64 -> io Word64)
-> ContT Word64 IO Word64 -> io Word64
forall a b. (a -> b) -> a -> b
$ do
let vkGetImageViewHandle64NVXPtr :: FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word64)
vkGetImageViewHandle64NVXPtr = DeviceCmds
-> FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word64)
pVkGetImageViewHandle64NVX (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT Word64 IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT Word64 m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT Word64 IO ()) -> IO () -> ContT Word64 IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word64)
vkGetImageViewHandle64NVXPtr FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word64)
-> FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word64)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word64)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. (HasCallStack, 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 vkGetImageViewHandle64NVX is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetImageViewHandle64NVX' :: Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word64
vkGetImageViewHandle64NVX' = FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word64)
-> Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word64
mkVkGetImageViewHandle64NVX FunPtr (Ptr Device_T -> Ptr ImageViewHandleInfoNVX -> IO Word64)
vkGetImageViewHandle64NVXPtr
pInfo <- ((Ptr ImageViewHandleInfoNVX -> IO Word64) -> IO Word64)
-> ContT Word64 IO (Ptr ImageViewHandleInfoNVX)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr ImageViewHandleInfoNVX -> IO Word64) -> IO Word64)
-> ContT Word64 IO (Ptr ImageViewHandleInfoNVX))
-> ((Ptr ImageViewHandleInfoNVX -> IO Word64) -> IO Word64)
-> ContT Word64 IO (Ptr ImageViewHandleInfoNVX)
forall a b. (a -> b) -> a -> b
$ ImageViewHandleInfoNVX
-> (Ptr ImageViewHandleInfoNVX -> IO Word64) -> IO Word64
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
ImageViewHandleInfoNVX
-> (Ptr ImageViewHandleInfoNVX -> IO b) -> IO b
withCStruct (ImageViewHandleInfoNVX
info)
r <- lift $ traceAroundEvent "vkGetImageViewHandle64NVX" (vkGetImageViewHandle64NVX'
(deviceHandle (device))
pInfo)
pure $ (r)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetImageViewAddressNVX
:: FunPtr (Ptr Device_T -> ImageView -> Ptr ImageViewAddressPropertiesNVX -> IO Result) -> Ptr Device_T -> ImageView -> Ptr ImageViewAddressPropertiesNVX -> IO Result
getImageViewAddressNVX :: forall io
. (MonadIO io)
=>
Device
->
ImageView
-> io (ImageViewAddressPropertiesNVX)
getImageViewAddressNVX :: forall (io :: * -> *).
MonadIO io =>
Device -> ImageView -> io ImageViewAddressPropertiesNVX
getImageViewAddressNVX Device
device ImageView
imageView = IO ImageViewAddressPropertiesNVX
-> io ImageViewAddressPropertiesNVX
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ImageViewAddressPropertiesNVX
-> io ImageViewAddressPropertiesNVX)
-> (ContT
ImageViewAddressPropertiesNVX IO ImageViewAddressPropertiesNVX
-> IO ImageViewAddressPropertiesNVX)
-> ContT
ImageViewAddressPropertiesNVX IO ImageViewAddressPropertiesNVX
-> io ImageViewAddressPropertiesNVX
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
ImageViewAddressPropertiesNVX IO ImageViewAddressPropertiesNVX
-> IO ImageViewAddressPropertiesNVX
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
ImageViewAddressPropertiesNVX IO ImageViewAddressPropertiesNVX
-> io ImageViewAddressPropertiesNVX)
-> ContT
ImageViewAddressPropertiesNVX IO ImageViewAddressPropertiesNVX
-> io ImageViewAddressPropertiesNVX
forall a b. (a -> b) -> a -> b
$ do
let vkGetImageViewAddressNVXPtr :: FunPtr
(Ptr Device_T
-> ImageView -> Ptr ImageViewAddressPropertiesNVX -> IO Result)
vkGetImageViewAddressNVXPtr = DeviceCmds
-> FunPtr
(Ptr Device_T
-> ImageView -> Ptr ImageViewAddressPropertiesNVX -> IO Result)
pVkGetImageViewAddressNVX (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT ImageViewAddressPropertiesNVX IO ()
forall (m :: * -> *) a.
Monad m =>
m a -> ContT ImageViewAddressPropertiesNVX m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ImageViewAddressPropertiesNVX IO ())
-> IO () -> ContT ImageViewAddressPropertiesNVX IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr Device_T
-> ImageView -> Ptr ImageViewAddressPropertiesNVX -> IO Result)
vkGetImageViewAddressNVXPtr FunPtr
(Ptr Device_T
-> ImageView -> Ptr ImageViewAddressPropertiesNVX -> IO Result)
-> FunPtr
(Ptr Device_T
-> ImageView -> Ptr ImageViewAddressPropertiesNVX -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr Device_T
-> ImageView -> Ptr ImageViewAddressPropertiesNVX -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. (HasCallStack, 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 vkGetImageViewAddressNVX is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetImageViewAddressNVX' :: Ptr Device_T
-> ImageView -> Ptr ImageViewAddressPropertiesNVX -> IO Result
vkGetImageViewAddressNVX' = FunPtr
(Ptr Device_T
-> ImageView -> Ptr ImageViewAddressPropertiesNVX -> IO Result)
-> Ptr Device_T
-> ImageView
-> Ptr ImageViewAddressPropertiesNVX
-> IO Result
mkVkGetImageViewAddressNVX FunPtr
(Ptr Device_T
-> ImageView -> Ptr ImageViewAddressPropertiesNVX -> IO Result)
vkGetImageViewAddressNVXPtr
pPProperties <- ((Ptr ImageViewAddressPropertiesNVX
-> IO ImageViewAddressPropertiesNVX)
-> IO ImageViewAddressPropertiesNVX)
-> ContT
ImageViewAddressPropertiesNVX
IO
(Ptr ImageViewAddressPropertiesNVX)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @ImageViewAddressPropertiesNVX)
r <- lift $ traceAroundEvent "vkGetImageViewAddressNVX" (vkGetImageViewAddressNVX'
(deviceHandle (device))
(imageView)
(pPProperties))
lift $ when (r < SUCCESS) (throwIO (VulkanException r))
pProperties <- lift $ peekCStruct @ImageViewAddressPropertiesNVX pPProperties
pure $ (pProperties)
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkGetDeviceCombinedImageSamplerIndexNVX
:: FunPtr (Ptr Device_T -> Word64 -> Word64 -> IO Word64) -> Ptr Device_T -> Word64 -> Word64 -> IO Word64
getDeviceCombinedImageSamplerIndexNVX :: forall io
. (MonadIO io)
=>
Device
->
("imageViewIndex" ::: Word64)
->
("samplerIndex" ::: Word64)
-> io (Word64)
getDeviceCombinedImageSamplerIndexNVX :: forall (io :: * -> *).
MonadIO io =>
Device -> Word64 -> Word64 -> io Word64
getDeviceCombinedImageSamplerIndexNVX Device
device
Word64
imageViewIndex
Word64
samplerIndex = IO Word64 -> io Word64
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> io Word64) -> IO Word64 -> io Word64
forall a b. (a -> b) -> a -> b
$ do
let vkGetDeviceCombinedImageSamplerIndexNVXPtr :: FunPtr (Ptr Device_T -> Word64 -> Word64 -> IO Word64)
vkGetDeviceCombinedImageSamplerIndexNVXPtr = DeviceCmds
-> FunPtr (Ptr Device_T -> Word64 -> Word64 -> IO Word64)
pVkGetDeviceCombinedImageSamplerIndexNVX (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr Device_T -> Word64 -> Word64 -> IO Word64)
vkGetDeviceCombinedImageSamplerIndexNVXPtr FunPtr (Ptr Device_T -> Word64 -> Word64 -> IO Word64)
-> FunPtr (Ptr Device_T -> Word64 -> Word64 -> IO Word64) -> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr (Ptr Device_T -> Word64 -> Word64 -> IO Word64)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
IOException -> IO ()
forall e a. (HasCallStack, 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 vkGetDeviceCombinedImageSamplerIndexNVX is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkGetDeviceCombinedImageSamplerIndexNVX' :: Ptr Device_T -> Word64 -> Word64 -> IO Word64
vkGetDeviceCombinedImageSamplerIndexNVX' = FunPtr (Ptr Device_T -> Word64 -> Word64 -> IO Word64)
-> Ptr Device_T -> Word64 -> Word64 -> IO Word64
mkVkGetDeviceCombinedImageSamplerIndexNVX FunPtr (Ptr Device_T -> Word64 -> Word64 -> IO Word64)
vkGetDeviceCombinedImageSamplerIndexNVXPtr
r <- String -> IO Word64 -> IO Word64
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkGetDeviceCombinedImageSamplerIndexNVX" (Ptr Device_T -> Word64 -> Word64 -> IO Word64
vkGetDeviceCombinedImageSamplerIndexNVX'
(Device -> Ptr Device_T
deviceHandle (Device
device))
(Word64
imageViewIndex)
(Word64
samplerIndex))
pure $ (r)
data ImageViewHandleInfoNVX = ImageViewHandleInfoNVX
{
ImageViewHandleInfoNVX -> ImageView
imageView :: ImageView
,
ImageViewHandleInfoNVX -> DescriptorType
descriptorType :: DescriptorType
,
ImageViewHandleInfoNVX -> Sampler
sampler :: Sampler
}
deriving (Typeable, ImageViewHandleInfoNVX -> ImageViewHandleInfoNVX -> Bool
(ImageViewHandleInfoNVX -> ImageViewHandleInfoNVX -> Bool)
-> (ImageViewHandleInfoNVX -> ImageViewHandleInfoNVX -> Bool)
-> Eq ImageViewHandleInfoNVX
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ImageViewHandleInfoNVX -> ImageViewHandleInfoNVX -> Bool
== :: ImageViewHandleInfoNVX -> ImageViewHandleInfoNVX -> Bool
$c/= :: ImageViewHandleInfoNVX -> ImageViewHandleInfoNVX -> Bool
/= :: ImageViewHandleInfoNVX -> ImageViewHandleInfoNVX -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImageViewHandleInfoNVX)
#endif
deriving instance Show ImageViewHandleInfoNVX
instance ToCStruct ImageViewHandleInfoNVX where
withCStruct :: forall b.
ImageViewHandleInfoNVX
-> (Ptr ImageViewHandleInfoNVX -> IO b) -> IO b
withCStruct ImageViewHandleInfoNVX
x Ptr ImageViewHandleInfoNVX -> IO b
f = Int -> (Ptr ImageViewHandleInfoNVX -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr ImageViewHandleInfoNVX -> IO b) -> IO b)
-> (Ptr ImageViewHandleInfoNVX -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr ImageViewHandleInfoNVX
p -> Ptr ImageViewHandleInfoNVX
-> ImageViewHandleInfoNVX -> IO b -> IO b
forall b.
Ptr ImageViewHandleInfoNVX
-> ImageViewHandleInfoNVX -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageViewHandleInfoNVX
p ImageViewHandleInfoNVX
x (Ptr ImageViewHandleInfoNVX -> IO b
f Ptr ImageViewHandleInfoNVX
p)
pokeCStruct :: forall b.
Ptr ImageViewHandleInfoNVX
-> ImageViewHandleInfoNVX -> IO b -> IO b
pokeCStruct Ptr ImageViewHandleInfoNVX
p ImageViewHandleInfoNVX{DescriptorType
Sampler
ImageView
imageView :: ImageViewHandleInfoNVX -> ImageView
descriptorType :: ImageViewHandleInfoNVX -> DescriptorType
sampler :: ImageViewHandleInfoNVX -> Sampler
imageView :: ImageView
descriptorType :: DescriptorType
sampler :: Sampler
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewHandleInfoNVX
p Ptr ImageViewHandleInfoNVX -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewHandleInfoNVX
p Ptr ImageViewHandleInfoNVX -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ImageView -> ImageView -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewHandleInfoNVX
p Ptr ImageViewHandleInfoNVX -> Int -> Ptr ImageView
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageView)) (ImageView
imageView)
Ptr DescriptorType -> DescriptorType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewHandleInfoNVX
p Ptr ImageViewHandleInfoNVX -> Int -> Ptr DescriptorType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DescriptorType)) (DescriptorType
descriptorType)
Ptr Sampler -> Sampler -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewHandleInfoNVX
p Ptr ImageViewHandleInfoNVX -> Int -> Ptr Sampler
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Sampler)) (Sampler
sampler)
IO b
f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr ImageViewHandleInfoNVX -> IO b -> IO b
pokeZeroCStruct Ptr ImageViewHandleInfoNVX
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewHandleInfoNVX
p Ptr ImageViewHandleInfoNVX -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_VIEW_HANDLE_INFO_NVX)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewHandleInfoNVX
p Ptr ImageViewHandleInfoNVX -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr ImageView -> ImageView -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewHandleInfoNVX
p Ptr ImageViewHandleInfoNVX -> Int -> Ptr ImageView
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageView)) (ImageView
forall a. Zero a => a
zero)
Ptr DescriptorType -> DescriptorType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewHandleInfoNVX
p Ptr ImageViewHandleInfoNVX -> Int -> Ptr DescriptorType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DescriptorType)) (DescriptorType
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ImageViewHandleInfoNVX where
peekCStruct :: Ptr ImageViewHandleInfoNVX -> IO ImageViewHandleInfoNVX
peekCStruct Ptr ImageViewHandleInfoNVX
p = do
imageView <- forall a. Storable a => Ptr a -> IO a
peek @ImageView ((Ptr ImageViewHandleInfoNVX
p Ptr ImageViewHandleInfoNVX -> Int -> Ptr ImageView
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr ImageView))
descriptorType <- peek @DescriptorType ((p `plusPtr` 24 :: Ptr DescriptorType))
sampler <- peek @Sampler ((p `plusPtr` 32 :: Ptr Sampler))
pure $ ImageViewHandleInfoNVX
imageView descriptorType sampler
instance Storable ImageViewHandleInfoNVX where
sizeOf :: ImageViewHandleInfoNVX -> Int
sizeOf ~ImageViewHandleInfoNVX
_ = Int
40
alignment :: ImageViewHandleInfoNVX -> Int
alignment ~ImageViewHandleInfoNVX
_ = Int
8
peek :: Ptr ImageViewHandleInfoNVX -> IO ImageViewHandleInfoNVX
peek = Ptr ImageViewHandleInfoNVX -> IO ImageViewHandleInfoNVX
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ImageViewHandleInfoNVX -> ImageViewHandleInfoNVX -> IO ()
poke Ptr ImageViewHandleInfoNVX
ptr ImageViewHandleInfoNVX
poked = Ptr ImageViewHandleInfoNVX
-> ImageViewHandleInfoNVX -> IO () -> IO ()
forall b.
Ptr ImageViewHandleInfoNVX
-> ImageViewHandleInfoNVX -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageViewHandleInfoNVX
ptr ImageViewHandleInfoNVX
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ImageViewHandleInfoNVX where
zero :: ImageViewHandleInfoNVX
zero = ImageView -> DescriptorType -> Sampler -> ImageViewHandleInfoNVX
ImageViewHandleInfoNVX
ImageView
forall a. Zero a => a
zero
DescriptorType
forall a. Zero a => a
zero
Sampler
forall a. Zero a => a
zero
data ImageViewAddressPropertiesNVX = ImageViewAddressPropertiesNVX
{
ImageViewAddressPropertiesNVX -> Word64
deviceAddress :: DeviceAddress
,
ImageViewAddressPropertiesNVX -> Word64
size :: DeviceSize
}
deriving (Typeable, ImageViewAddressPropertiesNVX
-> ImageViewAddressPropertiesNVX -> Bool
(ImageViewAddressPropertiesNVX
-> ImageViewAddressPropertiesNVX -> Bool)
-> (ImageViewAddressPropertiesNVX
-> ImageViewAddressPropertiesNVX -> Bool)
-> Eq ImageViewAddressPropertiesNVX
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ImageViewAddressPropertiesNVX
-> ImageViewAddressPropertiesNVX -> Bool
== :: ImageViewAddressPropertiesNVX
-> ImageViewAddressPropertiesNVX -> Bool
$c/= :: ImageViewAddressPropertiesNVX
-> ImageViewAddressPropertiesNVX -> Bool
/= :: ImageViewAddressPropertiesNVX
-> ImageViewAddressPropertiesNVX -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (ImageViewAddressPropertiesNVX)
#endif
deriving instance Show ImageViewAddressPropertiesNVX
instance ToCStruct ImageViewAddressPropertiesNVX where
withCStruct :: forall b.
ImageViewAddressPropertiesNVX
-> (Ptr ImageViewAddressPropertiesNVX -> IO b) -> IO b
withCStruct ImageViewAddressPropertiesNVX
x Ptr ImageViewAddressPropertiesNVX -> IO b
f = Int -> (Ptr ImageViewAddressPropertiesNVX -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr ImageViewAddressPropertiesNVX -> IO b) -> IO b)
-> (Ptr ImageViewAddressPropertiesNVX -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr ImageViewAddressPropertiesNVX
p -> Ptr ImageViewAddressPropertiesNVX
-> ImageViewAddressPropertiesNVX -> IO b -> IO b
forall b.
Ptr ImageViewAddressPropertiesNVX
-> ImageViewAddressPropertiesNVX -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageViewAddressPropertiesNVX
p ImageViewAddressPropertiesNVX
x (Ptr ImageViewAddressPropertiesNVX -> IO b
f Ptr ImageViewAddressPropertiesNVX
p)
pokeCStruct :: forall b.
Ptr ImageViewAddressPropertiesNVX
-> ImageViewAddressPropertiesNVX -> IO b -> IO b
pokeCStruct Ptr ImageViewAddressPropertiesNVX
p ImageViewAddressPropertiesNVX{Word64
deviceAddress :: ImageViewAddressPropertiesNVX -> Word64
size :: ImageViewAddressPropertiesNVX -> Word64
deviceAddress :: Word64
size :: Word64
..} IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewAddressPropertiesNVX
p Ptr ImageViewAddressPropertiesNVX -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewAddressPropertiesNVX
p Ptr ImageViewAddressPropertiesNVX -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewAddressPropertiesNVX
p Ptr ImageViewAddressPropertiesNVX -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceAddress)) (Word64
deviceAddress)
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewAddressPropertiesNVX
p Ptr ImageViewAddressPropertiesNVX -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize)) (Word64
size)
IO b
f
cStructSize :: Int
cStructSize = Int
32
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr ImageViewAddressPropertiesNVX -> IO b -> IO b
pokeZeroCStruct Ptr ImageViewAddressPropertiesNVX
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewAddressPropertiesNVX
p Ptr ImageViewAddressPropertiesNVX -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_IMAGE_VIEW_ADDRESS_PROPERTIES_NVX)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewAddressPropertiesNVX
p Ptr ImageViewAddressPropertiesNVX -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewAddressPropertiesNVX
p Ptr ImageViewAddressPropertiesNVX -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceAddress)) (Word64
forall a. Zero a => a
zero)
Ptr Word64 -> Word64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr ImageViewAddressPropertiesNVX
p Ptr ImageViewAddressPropertiesNVX -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize)) (Word64
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct ImageViewAddressPropertiesNVX where
peekCStruct :: Ptr ImageViewAddressPropertiesNVX
-> IO ImageViewAddressPropertiesNVX
peekCStruct Ptr ImageViewAddressPropertiesNVX
p = do
deviceAddress <- forall a. Storable a => Ptr a -> IO a
peek @DeviceAddress ((Ptr ImageViewAddressPropertiesNVX
p Ptr ImageViewAddressPropertiesNVX -> Int -> Ptr Word64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceAddress))
size <- peek @DeviceSize ((p `plusPtr` 24 :: Ptr DeviceSize))
pure $ ImageViewAddressPropertiesNVX
deviceAddress size
instance Storable ImageViewAddressPropertiesNVX where
sizeOf :: ImageViewAddressPropertiesNVX -> Int
sizeOf ~ImageViewAddressPropertiesNVX
_ = Int
32
alignment :: ImageViewAddressPropertiesNVX -> Int
alignment ~ImageViewAddressPropertiesNVX
_ = Int
8
peek :: Ptr ImageViewAddressPropertiesNVX
-> IO ImageViewAddressPropertiesNVX
peek = Ptr ImageViewAddressPropertiesNVX
-> IO ImageViewAddressPropertiesNVX
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr ImageViewAddressPropertiesNVX
-> ImageViewAddressPropertiesNVX -> IO ()
poke Ptr ImageViewAddressPropertiesNVX
ptr ImageViewAddressPropertiesNVX
poked = Ptr ImageViewAddressPropertiesNVX
-> ImageViewAddressPropertiesNVX -> IO () -> IO ()
forall b.
Ptr ImageViewAddressPropertiesNVX
-> ImageViewAddressPropertiesNVX -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr ImageViewAddressPropertiesNVX
ptr ImageViewAddressPropertiesNVX
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero ImageViewAddressPropertiesNVX where
zero :: ImageViewAddressPropertiesNVX
zero = Word64 -> Word64 -> ImageViewAddressPropertiesNVX
ImageViewAddressPropertiesNVX
Word64
forall a. Zero a => a
zero
Word64
forall a. Zero a => a
zero
type NVX_IMAGE_VIEW_HANDLE_SPEC_VERSION = 4
pattern NVX_IMAGE_VIEW_HANDLE_SPEC_VERSION :: forall a . Integral a => a
pattern $mNVX_IMAGE_VIEW_HANDLE_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bNVX_IMAGE_VIEW_HANDLE_SPEC_VERSION :: forall a. Integral a => a
NVX_IMAGE_VIEW_HANDLE_SPEC_VERSION = 4
type NVX_IMAGE_VIEW_HANDLE_EXTENSION_NAME = "VK_NVX_image_view_handle"
pattern NVX_IMAGE_VIEW_HANDLE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mNVX_IMAGE_VIEW_HANDLE_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bNVX_IMAGE_VIEW_HANDLE_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
NVX_IMAGE_VIEW_HANDLE_EXTENSION_NAME = "VK_NVX_image_view_handle"