{-# language CPP #-}
module Vulkan.Extensions.VK_NV_memory_decompression ( cmdDecompressMemoryNV
, cmdDecompressMemoryIndirectCountNV
, pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV
, pattern STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV
, DecompressMemoryRegionNV(..)
, MemoryDecompressionMethodFlagsNV
, MemoryDecompressionMethodFlagBitsNV
, PhysicalDeviceMemoryDecompressionFeaturesNV
, PhysicalDeviceMemoryDecompressionPropertiesNV
, NV_MEMORY_DECOMPRESSION_SPEC_VERSION
, pattern NV_MEMORY_DECOMPRESSION_SPEC_VERSION
, NV_MEMORY_DECOMPRESSION_EXTENSION_NAME
, pattern NV_MEMORY_DECOMPRESSION_EXTENSION_NAME
, PhysicalDeviceMemoryDecompressionFeaturesEXT(..)
, PhysicalDeviceMemoryDecompressionPropertiesEXT(..)
, MemoryDecompressionMethodFlagBitsEXT(..)
, MemoryDecompressionMethodFlagsEXT
) 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 (plusPtr)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
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.NamedType ((:::))
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer(CommandBuffer))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Core10.FundamentalTypes (DeviceAddress)
import Vulkan.Dynamic (DeviceCmds(pVkCmdDecompressMemoryIndirectCountNV))
import Vulkan.Dynamic (DeviceCmds(pVkCmdDecompressMemoryNV))
import Vulkan.Core10.FundamentalTypes (DeviceSize)
import Vulkan.Extensions.VK_EXT_memory_decompression (MemoryDecompressionMethodFlagBitsEXT)
import Vulkan.Extensions.VK_EXT_memory_decompression (MemoryDecompressionMethodFlagsEXT)
import Vulkan.Extensions.VK_EXT_memory_decompression (PhysicalDeviceMemoryDecompressionFeaturesEXT)
import Vulkan.Extensions.VK_EXT_memory_decompression (PhysicalDeviceMemoryDecompressionPropertiesEXT)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_EXT))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_EXT))
import Vulkan.Extensions.VK_EXT_memory_decompression (MemoryDecompressionMethodFlagBitsEXT(..))
import Vulkan.Extensions.VK_EXT_memory_decompression (MemoryDecompressionMethodFlagsEXT)
import Vulkan.Extensions.VK_EXT_memory_decompression (PhysicalDeviceMemoryDecompressionFeaturesEXT(..))
import Vulkan.Extensions.VK_EXT_memory_decompression (PhysicalDeviceMemoryDecompressionPropertiesEXT(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdDecompressMemoryNV
:: FunPtr (Ptr CommandBuffer_T -> Word32 -> Ptr DecompressMemoryRegionNV -> IO ()) -> Ptr CommandBuffer_T -> Word32 -> Ptr DecompressMemoryRegionNV -> IO ()
cmdDecompressMemoryNV :: forall io
. (MonadIO io)
=>
CommandBuffer
->
("decompressMemoryRegions" ::: Vector DecompressMemoryRegionNV)
-> io ()
cmdDecompressMemoryNV :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer
-> ("decompressMemoryRegions" ::: Vector DecompressMemoryRegionNV)
-> io ()
cmdDecompressMemoryNV CommandBuffer
commandBuffer
"decompressMemoryRegions" ::: Vector DecompressMemoryRegionNV
decompressMemoryRegions = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdDecompressMemoryNVPtr :: FunPtr
(Ptr CommandBuffer_T
-> Word32 -> Ptr DecompressMemoryRegionNV -> IO ())
vkCmdDecompressMemoryNVPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> Word32 -> Ptr DecompressMemoryRegionNV -> IO ())
pVkCmdDecompressMemoryNV (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> Word32 -> Ptr DecompressMemoryRegionNV -> IO ())
vkCmdDecompressMemoryNVPtr FunPtr
(Ptr CommandBuffer_T
-> Word32 -> Ptr DecompressMemoryRegionNV -> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> Word32 -> Ptr DecompressMemoryRegionNV -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> Word32 -> Ptr DecompressMemoryRegionNV -> IO ())
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 vkCmdDecompressMemoryNV is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdDecompressMemoryNV' :: Ptr CommandBuffer_T
-> Word32 -> Ptr DecompressMemoryRegionNV -> IO ()
vkCmdDecompressMemoryNV' = FunPtr
(Ptr CommandBuffer_T
-> Word32 -> Ptr DecompressMemoryRegionNV -> IO ())
-> Ptr CommandBuffer_T
-> Word32
-> Ptr DecompressMemoryRegionNV
-> IO ()
mkVkCmdDecompressMemoryNV FunPtr
(Ptr CommandBuffer_T
-> Word32 -> Ptr DecompressMemoryRegionNV -> IO ())
vkCmdDecompressMemoryNVPtr
pPDecompressMemoryRegions <- ((Ptr DecompressMemoryRegionNV -> IO ()) -> IO ())
-> ContT () IO (Ptr DecompressMemoryRegionNV)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr DecompressMemoryRegionNV -> IO ()) -> IO ())
-> ContT () IO (Ptr DecompressMemoryRegionNV))
-> ((Ptr DecompressMemoryRegionNV -> IO ()) -> IO ())
-> ContT () IO (Ptr DecompressMemoryRegionNV)
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @DecompressMemoryRegionNV ((("decompressMemoryRegions" ::: Vector DecompressMemoryRegionNV)
-> Int
forall a. Vector a -> Int
Data.Vector.length ("decompressMemoryRegions" ::: Vector DecompressMemoryRegionNV
decompressMemoryRegions)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
40)
lift $ Data.Vector.imapM_ (\Int
i DecompressMemoryRegionNV
e -> Ptr DecompressMemoryRegionNV -> DecompressMemoryRegionNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DecompressMemoryRegionNV
pPDecompressMemoryRegions Ptr DecompressMemoryRegionNV -> Int -> Ptr DecompressMemoryRegionNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
40 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr DecompressMemoryRegionNV) (DecompressMemoryRegionNV
e)) (decompressMemoryRegions)
lift $ traceAroundEvent "vkCmdDecompressMemoryNV" (vkCmdDecompressMemoryNV'
(commandBufferHandle (commandBuffer))
((fromIntegral (Data.Vector.length $ (decompressMemoryRegions)) :: Word32))
(pPDecompressMemoryRegions))
pure $ ()
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
unsafe
#endif
"dynamic" mkVkCmdDecompressMemoryIndirectCountNV
:: FunPtr (Ptr CommandBuffer_T -> DeviceAddress -> DeviceAddress -> Word32 -> IO ()) -> Ptr CommandBuffer_T -> DeviceAddress -> DeviceAddress -> Word32 -> IO ()
cmdDecompressMemoryIndirectCountNV :: forall io
. (MonadIO io)
=>
CommandBuffer
->
("indirectCommandsAddress" ::: DeviceAddress)
->
("indirectCommandsCountAddress" ::: DeviceAddress)
->
("stride" ::: Word32)
-> io ()
cmdDecompressMemoryIndirectCountNV :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> Word32
-> io ()
cmdDecompressMemoryIndirectCountNV CommandBuffer
commandBuffer
"indirectCommandsAddress" ::: DeviceAddress
indirectCommandsAddress
"indirectCommandsAddress" ::: DeviceAddress
indirectCommandsCountAddress
Word32
stride = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ()) -> IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
let vkCmdDecompressMemoryIndirectCountNVPtr :: FunPtr
(Ptr CommandBuffer_T
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> Word32
-> IO ())
vkCmdDecompressMemoryIndirectCountNVPtr = DeviceCmds
-> FunPtr
(Ptr CommandBuffer_T
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> Word32
-> IO ())
pVkCmdDecompressMemoryIndirectCountNV (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
(Ptr CommandBuffer_T
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> Word32
-> IO ())
vkCmdDecompressMemoryIndirectCountNVPtr FunPtr
(Ptr CommandBuffer_T
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> Word32
-> IO ())
-> FunPtr
(Ptr CommandBuffer_T
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> Word32
-> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
(Ptr CommandBuffer_T
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> Word32
-> IO ())
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 vkCmdDecompressMemoryIndirectCountNV is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
let vkCmdDecompressMemoryIndirectCountNV' :: Ptr CommandBuffer_T
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> Word32
-> IO ()
vkCmdDecompressMemoryIndirectCountNV' = FunPtr
(Ptr CommandBuffer_T
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> Word32
-> IO ())
-> Ptr CommandBuffer_T
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> Word32
-> IO ()
mkVkCmdDecompressMemoryIndirectCountNV FunPtr
(Ptr CommandBuffer_T
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> Word32
-> IO ())
vkCmdDecompressMemoryIndirectCountNVPtr
String -> IO () -> IO ()
forall a. String -> IO a -> IO a
traceAroundEvent String
"vkCmdDecompressMemoryIndirectCountNV" (Ptr CommandBuffer_T
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> Word32
-> IO ()
vkCmdDecompressMemoryIndirectCountNV'
(CommandBuffer -> Ptr CommandBuffer_T
commandBufferHandle (CommandBuffer
commandBuffer))
("indirectCommandsAddress" ::: DeviceAddress
indirectCommandsAddress)
("indirectCommandsAddress" ::: DeviceAddress
indirectCommandsCountAddress)
(Word32
stride))
() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (() -> IO ()) -> () -> IO ()
forall a b. (a -> b) -> a -> b
$ ()
pattern $mSTRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV :: forall {r}. StructureType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSTRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV :: StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV = STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_EXT
pattern $mSTRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV :: forall {r}. StructureType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSTRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV :: StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV = STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_EXT
data DecompressMemoryRegionNV = DecompressMemoryRegionNV
{
DecompressMemoryRegionNV
-> "indirectCommandsAddress" ::: DeviceAddress
srcAddress :: DeviceAddress
,
DecompressMemoryRegionNV
-> "indirectCommandsAddress" ::: DeviceAddress
dstAddress :: DeviceAddress
,
DecompressMemoryRegionNV
-> "indirectCommandsAddress" ::: DeviceAddress
compressedSize :: DeviceSize
,
DecompressMemoryRegionNV
-> "indirectCommandsAddress" ::: DeviceAddress
decompressedSize :: DeviceSize
,
DecompressMemoryRegionNV -> MemoryDecompressionMethodFlagsNV
decompressionMethod :: MemoryDecompressionMethodFlagsNV
}
deriving (Typeable, DecompressMemoryRegionNV -> DecompressMemoryRegionNV -> Bool
(DecompressMemoryRegionNV -> DecompressMemoryRegionNV -> Bool)
-> (DecompressMemoryRegionNV -> DecompressMemoryRegionNV -> Bool)
-> Eq DecompressMemoryRegionNV
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DecompressMemoryRegionNV -> DecompressMemoryRegionNV -> Bool
== :: DecompressMemoryRegionNV -> DecompressMemoryRegionNV -> Bool
$c/= :: DecompressMemoryRegionNV -> DecompressMemoryRegionNV -> Bool
/= :: DecompressMemoryRegionNV -> DecompressMemoryRegionNV -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DecompressMemoryRegionNV)
#endif
deriving instance Show DecompressMemoryRegionNV
instance ToCStruct DecompressMemoryRegionNV where
withCStruct :: forall b.
DecompressMemoryRegionNV
-> (Ptr DecompressMemoryRegionNV -> IO b) -> IO b
withCStruct DecompressMemoryRegionNV
x Ptr DecompressMemoryRegionNV -> IO b
f = Int -> (Ptr DecompressMemoryRegionNV -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
40 ((Ptr DecompressMemoryRegionNV -> IO b) -> IO b)
-> (Ptr DecompressMemoryRegionNV -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr DecompressMemoryRegionNV
p -> Ptr DecompressMemoryRegionNV
-> DecompressMemoryRegionNV -> IO b -> IO b
forall b.
Ptr DecompressMemoryRegionNV
-> DecompressMemoryRegionNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DecompressMemoryRegionNV
p DecompressMemoryRegionNV
x (Ptr DecompressMemoryRegionNV -> IO b
f Ptr DecompressMemoryRegionNV
p)
pokeCStruct :: forall b.
Ptr DecompressMemoryRegionNV
-> DecompressMemoryRegionNV -> IO b -> IO b
pokeCStruct Ptr DecompressMemoryRegionNV
p DecompressMemoryRegionNV{"indirectCommandsAddress" ::: DeviceAddress
MemoryDecompressionMethodFlagsNV
srcAddress :: DecompressMemoryRegionNV
-> "indirectCommandsAddress" ::: DeviceAddress
dstAddress :: DecompressMemoryRegionNV
-> "indirectCommandsAddress" ::: DeviceAddress
compressedSize :: DecompressMemoryRegionNV
-> "indirectCommandsAddress" ::: DeviceAddress
decompressedSize :: DecompressMemoryRegionNV
-> "indirectCommandsAddress" ::: DeviceAddress
decompressionMethod :: DecompressMemoryRegionNV -> MemoryDecompressionMethodFlagsNV
srcAddress :: "indirectCommandsAddress" ::: DeviceAddress
dstAddress :: "indirectCommandsAddress" ::: DeviceAddress
compressedSize :: "indirectCommandsAddress" ::: DeviceAddress
decompressedSize :: "indirectCommandsAddress" ::: DeviceAddress
decompressionMethod :: MemoryDecompressionMethodFlagsNV
..} IO b
f = do
Ptr ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DecompressMemoryRegionNV
p Ptr DecompressMemoryRegionNV
-> Int -> Ptr ("indirectCommandsAddress" ::: DeviceAddress)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceAddress)) ("indirectCommandsAddress" ::: DeviceAddress
srcAddress)
Ptr ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DecompressMemoryRegionNV
p Ptr DecompressMemoryRegionNV
-> Int -> Ptr ("indirectCommandsAddress" ::: DeviceAddress)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceAddress)) ("indirectCommandsAddress" ::: DeviceAddress
dstAddress)
Ptr ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DecompressMemoryRegionNV
p Ptr DecompressMemoryRegionNV
-> Int -> Ptr ("indirectCommandsAddress" ::: DeviceAddress)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) ("indirectCommandsAddress" ::: DeviceAddress
compressedSize)
Ptr ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DecompressMemoryRegionNV
p Ptr DecompressMemoryRegionNV
-> Int -> Ptr ("indirectCommandsAddress" ::: DeviceAddress)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize)) ("indirectCommandsAddress" ::: DeviceAddress
decompressedSize)
Ptr MemoryDecompressionMethodFlagsNV
-> MemoryDecompressionMethodFlagsNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DecompressMemoryRegionNV
p Ptr DecompressMemoryRegionNV
-> Int -> Ptr MemoryDecompressionMethodFlagsNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr MemoryDecompressionMethodFlagsNV)) (MemoryDecompressionMethodFlagsNV
decompressionMethod)
IO b
f
cStructSize :: Int
cStructSize = Int
40
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b. Ptr DecompressMemoryRegionNV -> IO b -> IO b
pokeZeroCStruct Ptr DecompressMemoryRegionNV
p IO b
f = do
Ptr ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DecompressMemoryRegionNV
p Ptr DecompressMemoryRegionNV
-> Int -> Ptr ("indirectCommandsAddress" ::: DeviceAddress)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceAddress)) ("indirectCommandsAddress" ::: DeviceAddress
forall a. Zero a => a
zero)
Ptr ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DecompressMemoryRegionNV
p Ptr DecompressMemoryRegionNV
-> Int -> Ptr ("indirectCommandsAddress" ::: DeviceAddress)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr DeviceAddress)) ("indirectCommandsAddress" ::: DeviceAddress
forall a. Zero a => a
zero)
Ptr ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DecompressMemoryRegionNV
p Ptr DecompressMemoryRegionNV
-> Int -> Ptr ("indirectCommandsAddress" ::: DeviceAddress)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr DeviceSize)) ("indirectCommandsAddress" ::: DeviceAddress
forall a. Zero a => a
zero)
Ptr ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DecompressMemoryRegionNV
p Ptr DecompressMemoryRegionNV
-> Int -> Ptr ("indirectCommandsAddress" ::: DeviceAddress)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr DeviceSize)) ("indirectCommandsAddress" ::: DeviceAddress
forall a. Zero a => a
zero)
Ptr MemoryDecompressionMethodFlagsNV
-> MemoryDecompressionMethodFlagsNV -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DecompressMemoryRegionNV
p Ptr DecompressMemoryRegionNV
-> Int -> Ptr MemoryDecompressionMethodFlagsNV
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr MemoryDecompressionMethodFlagsNV)) (MemoryDecompressionMethodFlagsNV
forall a. Zero a => a
zero)
IO b
f
instance FromCStruct DecompressMemoryRegionNV where
peekCStruct :: Ptr DecompressMemoryRegionNV -> IO DecompressMemoryRegionNV
peekCStruct Ptr DecompressMemoryRegionNV
p = do
srcAddress <- forall a. Storable a => Ptr a -> IO a
peek @DeviceAddress ((Ptr DecompressMemoryRegionNV
p Ptr DecompressMemoryRegionNV
-> Int -> Ptr ("indirectCommandsAddress" ::: DeviceAddress)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr DeviceAddress))
dstAddress <- peek @DeviceAddress ((p `plusPtr` 8 :: Ptr DeviceAddress))
compressedSize <- peek @DeviceSize ((p `plusPtr` 16 :: Ptr DeviceSize))
decompressedSize <- peek @DeviceSize ((p `plusPtr` 24 :: Ptr DeviceSize))
decompressionMethod <- peek @MemoryDecompressionMethodFlagsNV ((p `plusPtr` 32 :: Ptr MemoryDecompressionMethodFlagsNV))
pure $ DecompressMemoryRegionNV
srcAddress
dstAddress
compressedSize
decompressedSize
decompressionMethod
instance Storable DecompressMemoryRegionNV where
sizeOf :: DecompressMemoryRegionNV -> Int
sizeOf ~DecompressMemoryRegionNV
_ = Int
40
alignment :: DecompressMemoryRegionNV -> Int
alignment ~DecompressMemoryRegionNV
_ = Int
8
peek :: Ptr DecompressMemoryRegionNV -> IO DecompressMemoryRegionNV
peek = Ptr DecompressMemoryRegionNV -> IO DecompressMemoryRegionNV
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr DecompressMemoryRegionNV -> DecompressMemoryRegionNV -> IO ()
poke Ptr DecompressMemoryRegionNV
ptr DecompressMemoryRegionNV
poked = Ptr DecompressMemoryRegionNV
-> DecompressMemoryRegionNV -> IO () -> IO ()
forall b.
Ptr DecompressMemoryRegionNV
-> DecompressMemoryRegionNV -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DecompressMemoryRegionNV
ptr DecompressMemoryRegionNV
poked (() -> IO ()
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero DecompressMemoryRegionNV where
zero :: DecompressMemoryRegionNV
zero = ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> ("indirectCommandsAddress" ::: DeviceAddress)
-> MemoryDecompressionMethodFlagsNV
-> DecompressMemoryRegionNV
DecompressMemoryRegionNV
"indirectCommandsAddress" ::: DeviceAddress
forall a. Zero a => a
zero
"indirectCommandsAddress" ::: DeviceAddress
forall a. Zero a => a
zero
"indirectCommandsAddress" ::: DeviceAddress
forall a. Zero a => a
zero
"indirectCommandsAddress" ::: DeviceAddress
forall a. Zero a => a
zero
MemoryDecompressionMethodFlagsNV
forall a. Zero a => a
zero
type MemoryDecompressionMethodFlagsNV = MemoryDecompressionMethodFlagsEXT
type MemoryDecompressionMethodFlagBitsNV = MemoryDecompressionMethodFlagBitsEXT
type PhysicalDeviceMemoryDecompressionFeaturesNV = PhysicalDeviceMemoryDecompressionFeaturesEXT
type PhysicalDeviceMemoryDecompressionPropertiesNV = PhysicalDeviceMemoryDecompressionPropertiesEXT
type NV_MEMORY_DECOMPRESSION_SPEC_VERSION = 1
pattern NV_MEMORY_DECOMPRESSION_SPEC_VERSION :: forall a . Integral a => a
pattern $mNV_MEMORY_DECOMPRESSION_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bNV_MEMORY_DECOMPRESSION_SPEC_VERSION :: forall a. Integral a => a
NV_MEMORY_DECOMPRESSION_SPEC_VERSION = 1
type NV_MEMORY_DECOMPRESSION_EXTENSION_NAME = "VK_NV_memory_decompression"
pattern NV_MEMORY_DECOMPRESSION_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mNV_MEMORY_DECOMPRESSION_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bNV_MEMORY_DECOMPRESSION_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
NV_MEMORY_DECOMPRESSION_EXTENSION_NAME = "VK_NV_memory_decompression"