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