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