Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module is not part of auto-generated code based on vk.xml. Instead, it is hand-written to provide common types and classes.
DANGER! This is an internal module; it can change a lot between package versions; it provides low-level functions, most of which have user-friendly analogues.
- class VulkanMarshalPrim a where
- fromForeignPtr# :: forall a. (Storable a, VulkanMarshalPrim a) => ForeignPtr a -> IO a
- toForeignPtr# :: VulkanMarshalPrim a => a -> IO (ForeignPtr a)
- toPlainForeignPtr# :: VulkanMarshalPrim a => a -> IO (ForeignPtr a)
- touchVkData# :: VulkanMarshalPrim a => a -> IO ()
- cmpBytes# :: Int -> Addr# -> Addr# -> Ordering
- newVkData# :: forall a. (Storable a, VulkanMarshalPrim a) => (Ptr a -> IO ()) -> IO a
- mallocVkData# :: forall a. (Storable a, VulkanMarshalPrim a) => IO a
- mallocVkDataArray# :: forall a. (Storable a, VulkanMarshalPrim a) => Int -> IO (Ptr a, [a])
- peekVkData# :: forall a. (Storable a, VulkanMarshalPrim a) => Ptr a -> IO a
- pokeVkData# :: forall a. (Storable a, VulkanMarshalPrim a) => Ptr a -> a -> IO ()
Documentation
class VulkanMarshalPrim a where Source #
This class gives low-level access to memory location occupied by Vulkan data.
Meant for internal use only.
unsafeAddr :: a -> Addr# Source #
Get address of vulkan structure. Note, the address is only valid as long as a given vulkan structure exists. Structures created with newVkData are stored in pinned byte arrays, so their memory is maintained by Haskell GC.
unsafeByteArray :: a -> ByteArray# Source #
Get a ByteArray#
that keeps the data.
Note, the data structure does not necessarily starts at zero offset.
unsafeFromByteArrayOffset :: Int# -> ByteArray# -> a Source #
Combine a vulkan structure from ByteArray and an offset in this array.
fromForeignPtr# :: forall a. (Storable a, VulkanMarshalPrim a) => ForeignPtr a -> IO a Source #
Create a ByteArray#
-based type from ForeignPtr
.
Try to not copy data, but do it if necessary.
toForeignPtr# :: VulkanMarshalPrim a => a -> IO (ForeignPtr a) Source #
Create a ForeignPtr
referencing the structure without copying data.
toPlainForeignPtr# :: VulkanMarshalPrim a => a -> IO (ForeignPtr a) Source #
Create a ForeignPtr
referencing the structure without copying data.
This version of a pointer carries no finalizers.
It is not possible to add a finalizer to a ForeignPtr created with
toPlainForeignPtr
.
Attempts to add a finalizer to a ForeignPtr created this way, or to
finalize such a pointer, will throw an exception.
touchVkData# :: VulkanMarshalPrim a => a -> IO () Source #
Make sure the region of memory is not collected at this moment in time.
cmpBytes# :: Int -> Addr# -> Addr# -> Ordering Source #
Internal function used to implement Eq and Ord instances for Vulkan structs. Compares first n bytes of two memory areas.
Uses lexicographic ordering (c memcmp inside).
This is a helper that should be used in VulkanMarshal instances only.
newVkData# :: forall a. (Storable a, VulkanMarshalPrim a) => (Ptr a -> IO ()) -> IO a Source #
mallocVkData# :: forall a. (Storable a, VulkanMarshalPrim a) => IO a Source #
mallocVkDataArray# :: forall a. (Storable a, VulkanMarshalPrim a) => Int -> IO (Ptr a, [a]) Source #
peekVkData# :: forall a. (Storable a, VulkanMarshalPrim a) => Ptr a -> IO a Source #
pokeVkData# :: forall a. (Storable a, VulkanMarshalPrim a) => Ptr a -> a -> IO () Source #