#include "vulkan/vulkan.h" {-# LANGUAGE DataKinds #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE Strict #-} {-# LANGUAGE TypeFamilies #-} module Graphics.Vulkan.Types.Struct.VkExportMemoryAllocateInfoKHR (VkExportMemoryAllocateInfoKHR(..)) where import Foreign.Storable (Storable (..)) import GHC.Prim import Graphics.Vulkan.Marshal import Graphics.Vulkan.Marshal.Internal import Graphics.Vulkan.Types.Enum.VkExternalMemoryHandleTypeFlagsKHR (VkExternalMemoryHandleTypeFlagsKHR) import Graphics.Vulkan.Types.Enum.VkStructureType (VkStructureType) import Graphics.Vulkan.Types.Struct.VkMemoryAllocateInfo (VkMemoryAllocateInfo) import Graphics.Vulkan.Types.StructMembers import System.IO.Unsafe (unsafeDupablePerformIO) -- | > typedef struct VkExportMemoryAllocateInfoKHR { -- > VkStructureType sType; -- > const void* pNext; -- > VkExternalMemoryHandleTypeFlagsKHR handleTypes; -- > } VkExportMemoryAllocateInfoKHR; -- -- data VkExportMemoryAllocateInfoKHR = VkExportMemoryAllocateInfoKHR## Addr## ByteArray## instance Eq VkExportMemoryAllocateInfoKHR where (VkExportMemoryAllocateInfoKHR## a _) == x@(VkExportMemoryAllocateInfoKHR## b _) = EQ == cmpBytes## (sizeOf x) a b {-# INLINE (==) #-} instance Ord VkExportMemoryAllocateInfoKHR where (VkExportMemoryAllocateInfoKHR## a _) `compare` x@(VkExportMemoryAllocateInfoKHR## b _) = cmpBytes## (sizeOf x) a b {-# INLINE compare #-} instance Storable VkExportMemoryAllocateInfoKHR where sizeOf ~_ = #{size VkExportMemoryAllocateInfoKHR} {-# INLINE sizeOf #-} alignment ~_ = #{alignment VkExportMemoryAllocateInfoKHR} {-# INLINE alignment #-} peek = peekVkData## {-# INLINE peek #-} poke = pokeVkData## {-# INLINE poke #-} instance VulkanMarshalPrim VkExportMemoryAllocateInfoKHR where unsafeAddr (VkExportMemoryAllocateInfoKHR## a _) = a {-# INLINE unsafeAddr #-} unsafeByteArray (VkExportMemoryAllocateInfoKHR## _ b) = b {-# INLINE unsafeByteArray #-} unsafeFromByteArrayOffset off b = VkExportMemoryAllocateInfoKHR## (plusAddr## (byteArrayContents## b) off) b {-# INLINE unsafeFromByteArrayOffset #-} instance VulkanMarshal VkExportMemoryAllocateInfoKHR where type StructFields VkExportMemoryAllocateInfoKHR = '["sType", "pNext", "handleTypes"] -- ' closing tick for hsc2hs type CUnionType VkExportMemoryAllocateInfoKHR = 'False -- ' closing tick for hsc2hs type ReturnedOnly VkExportMemoryAllocateInfoKHR = 'False -- ' closing tick for hsc2hs type StructExtends VkExportMemoryAllocateInfoKHR = '[VkMemoryAllocateInfo] -- ' closing tick for hsc2hs instance {-# OVERLAPPING #-} HasVkSType VkExportMemoryAllocateInfoKHR where type VkSTypeMType VkExportMemoryAllocateInfoKHR = VkStructureType {-# NOINLINE vkSType #-} vkSType x = unsafeDupablePerformIO (peekByteOff (unsafePtr x) #{offset VkExportMemoryAllocateInfoKHR, sType}) {-# INLINE vkSTypeByteOffset #-} vkSTypeByteOffset ~_ = #{offset VkExportMemoryAllocateInfoKHR, sType} {-# INLINE readVkSType #-} readVkSType p = peekByteOff p #{offset VkExportMemoryAllocateInfoKHR, sType} {-# INLINE writeVkSType #-} writeVkSType p = pokeByteOff p #{offset VkExportMemoryAllocateInfoKHR, sType} instance {-# OVERLAPPING #-} HasField "sType" VkExportMemoryAllocateInfoKHR where type FieldType "sType" VkExportMemoryAllocateInfoKHR = VkStructureType type FieldOptional "sType" VkExportMemoryAllocateInfoKHR = 'False -- ' closing tick for hsc2hs type FieldOffset "sType" VkExportMemoryAllocateInfoKHR = #{offset VkExportMemoryAllocateInfoKHR, sType} type FieldIsArray "sType" VkExportMemoryAllocateInfoKHR = 'False -- ' closing tick for hsc2hs {-# INLINE fieldOptional #-} fieldOptional = False {-# INLINE fieldOffset #-} fieldOffset = #{offset VkExportMemoryAllocateInfoKHR, sType} instance CanReadField "sType" VkExportMemoryAllocateInfoKHR where {-# INLINE getField #-} getField = vkSType {-# INLINE readField #-} readField = readVkSType instance CanWriteField "sType" VkExportMemoryAllocateInfoKHR where {-# INLINE writeField #-} writeField = writeVkSType instance {-# OVERLAPPING #-} HasVkPNext VkExportMemoryAllocateInfoKHR where type VkPNextMType VkExportMemoryAllocateInfoKHR = Ptr Void {-# NOINLINE vkPNext #-} vkPNext x = unsafeDupablePerformIO (peekByteOff (unsafePtr x) #{offset VkExportMemoryAllocateInfoKHR, pNext}) {-# INLINE vkPNextByteOffset #-} vkPNextByteOffset ~_ = #{offset VkExportMemoryAllocateInfoKHR, pNext} {-# INLINE readVkPNext #-} readVkPNext p = peekByteOff p #{offset VkExportMemoryAllocateInfoKHR, pNext} {-# INLINE writeVkPNext #-} writeVkPNext p = pokeByteOff p #{offset VkExportMemoryAllocateInfoKHR, pNext} instance {-# OVERLAPPING #-} HasField "pNext" VkExportMemoryAllocateInfoKHR where type FieldType "pNext" VkExportMemoryAllocateInfoKHR = Ptr Void type FieldOptional "pNext" VkExportMemoryAllocateInfoKHR = 'False -- ' closing tick for hsc2hs type FieldOffset "pNext" VkExportMemoryAllocateInfoKHR = #{offset VkExportMemoryAllocateInfoKHR, pNext} type FieldIsArray "pNext" VkExportMemoryAllocateInfoKHR = 'False -- ' closing tick for hsc2hs {-# INLINE fieldOptional #-} fieldOptional = False {-# INLINE fieldOffset #-} fieldOffset = #{offset VkExportMemoryAllocateInfoKHR, pNext} instance CanReadField "pNext" VkExportMemoryAllocateInfoKHR where {-# INLINE getField #-} getField = vkPNext {-# INLINE readField #-} readField = readVkPNext instance CanWriteField "pNext" VkExportMemoryAllocateInfoKHR where {-# INLINE writeField #-} writeField = writeVkPNext instance {-# OVERLAPPING #-} HasVkHandleTypes VkExportMemoryAllocateInfoKHR where type VkHandleTypesMType VkExportMemoryAllocateInfoKHR = VkExternalMemoryHandleTypeFlagsKHR {-# NOINLINE vkHandleTypes #-} vkHandleTypes x = unsafeDupablePerformIO (peekByteOff (unsafePtr x) #{offset VkExportMemoryAllocateInfoKHR, handleTypes}) {-# INLINE vkHandleTypesByteOffset #-} vkHandleTypesByteOffset ~_ = #{offset VkExportMemoryAllocateInfoKHR, handleTypes} {-# INLINE readVkHandleTypes #-} readVkHandleTypes p = peekByteOff p #{offset VkExportMemoryAllocateInfoKHR, handleTypes} {-# INLINE writeVkHandleTypes #-} writeVkHandleTypes p = pokeByteOff p #{offset VkExportMemoryAllocateInfoKHR, handleTypes} instance {-# OVERLAPPING #-} HasField "handleTypes" VkExportMemoryAllocateInfoKHR where type FieldType "handleTypes" VkExportMemoryAllocateInfoKHR = VkExternalMemoryHandleTypeFlagsKHR type FieldOptional "handleTypes" VkExportMemoryAllocateInfoKHR = 'True -- ' closing tick for hsc2hs type FieldOffset "handleTypes" VkExportMemoryAllocateInfoKHR = #{offset VkExportMemoryAllocateInfoKHR, handleTypes} type FieldIsArray "handleTypes" VkExportMemoryAllocateInfoKHR = 'False -- ' closing tick for hsc2hs {-# INLINE fieldOptional #-} fieldOptional = True {-# INLINE fieldOffset #-} fieldOffset = #{offset VkExportMemoryAllocateInfoKHR, handleTypes} instance CanReadField "handleTypes" VkExportMemoryAllocateInfoKHR where {-# INLINE getField #-} getField = vkHandleTypes {-# INLINE readField #-} readField = readVkHandleTypes instance CanWriteField "handleTypes" VkExportMemoryAllocateInfoKHR where {-# INLINE writeField #-} writeField = writeVkHandleTypes instance Show VkExportMemoryAllocateInfoKHR where showsPrec d x = showString "VkExportMemoryAllocateInfoKHR {" . showString "vkSType = " . showsPrec d (vkSType x) . showString ", " . showString "vkPNext = " . showsPrec d (vkPNext x) . showString ", " . showString "vkHandleTypes = " . showsPrec d (vkHandleTypes x) . showChar '}'