module Graphics.Vulkan.Types.Struct.SubresourceLayout
(VkSubresourceLayout(..)) where
import Foreign.Storable (Storable (..))
import GHC.Base (Addr#, ByteArray#,
byteArrayContents#,
plusAddr#)
import Graphics.Vulkan.Marshal
import Graphics.Vulkan.Marshal.Internal
import Graphics.Vulkan.Types.BaseTypes (VkDeviceSize)
import System.IO.Unsafe (unsafeDupablePerformIO)
data VkSubresourceLayout = VkSubresourceLayout# Addr# ByteArray#
instance Eq VkSubresourceLayout where
(VkSubresourceLayout# a _) == x@(VkSubresourceLayout# b _)
= EQ == cmpBytes# (sizeOf x) a b
instance Ord VkSubresourceLayout where
(VkSubresourceLayout# a _) `compare` x@(VkSubresourceLayout# b _)
= cmpBytes# (sizeOf x) a b
instance Storable VkSubresourceLayout where
sizeOf ~_ = (40)
alignment ~_ = (8)
peek = peekVkData#
poke = pokeVkData#
instance VulkanMarshalPrim VkSubresourceLayout where
unsafeAddr (VkSubresourceLayout# a _) = a
unsafeByteArray (VkSubresourceLayout# _ b) = b
unsafeFromByteArrayOffset off b
= VkSubresourceLayout# (plusAddr# (byteArrayContents# b) off) b
instance VulkanMarshal VkSubresourceLayout where
type StructFields VkSubresourceLayout =
'["offset", "size", "rowPitch", "arrayPitch", "depthPitch"]
type CUnionType VkSubresourceLayout = 'False
type ReturnedOnly VkSubresourceLayout = 'True
type StructExtends VkSubresourceLayout = '[]
instance HasField "offset" VkSubresourceLayout
where
type FieldType "offset" VkSubresourceLayout = VkDeviceSize
type FieldOptional "offset" VkSubresourceLayout = 'False
type FieldOffset "offset" VkSubresourceLayout =
(0)
type FieldIsArray "offset" VkSubresourceLayout = 'False
fieldOptional = False
fieldOffset = (0)
instance
CanReadField "offset" VkSubresourceLayout where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (0))
readField p
= peekByteOff p (0)
instance
CanWriteField "offset" VkSubresourceLayout where
writeField p
= pokeByteOff p (0)
instance HasField "size" VkSubresourceLayout
where
type FieldType "size" VkSubresourceLayout = VkDeviceSize
type FieldOptional "size" VkSubresourceLayout = 'False
type FieldOffset "size" VkSubresourceLayout =
(8)
type FieldIsArray "size" VkSubresourceLayout = 'False
fieldOptional = False
fieldOffset = (8)
instance
CanReadField "size" VkSubresourceLayout where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (8))
readField p
= peekByteOff p (8)
instance
CanWriteField "size" VkSubresourceLayout where
writeField p
= pokeByteOff p (8)
instance
HasField "rowPitch" VkSubresourceLayout where
type FieldType "rowPitch" VkSubresourceLayout = VkDeviceSize
type FieldOptional "rowPitch" VkSubresourceLayout = 'False
type FieldOffset "rowPitch" VkSubresourceLayout =
(16)
type FieldIsArray "rowPitch" VkSubresourceLayout = 'False
fieldOptional = False
fieldOffset = (16)
instance
CanReadField "rowPitch" VkSubresourceLayout where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (16))
readField p
= peekByteOff p (16)
instance
CanWriteField "rowPitch" VkSubresourceLayout where
writeField p
= pokeByteOff p (16)
instance
HasField "arrayPitch" VkSubresourceLayout where
type FieldType "arrayPitch" VkSubresourceLayout = VkDeviceSize
type FieldOptional "arrayPitch" VkSubresourceLayout = 'False
type FieldOffset "arrayPitch" VkSubresourceLayout =
(24)
type FieldIsArray "arrayPitch" VkSubresourceLayout = 'False
fieldOptional = False
fieldOffset = (24)
instance
CanReadField "arrayPitch" VkSubresourceLayout where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (24))
readField p
= peekByteOff p (24)
instance
CanWriteField "arrayPitch" VkSubresourceLayout where
writeField p
= pokeByteOff p (24)
instance
HasField "depthPitch" VkSubresourceLayout where
type FieldType "depthPitch" VkSubresourceLayout = VkDeviceSize
type FieldOptional "depthPitch" VkSubresourceLayout = 'False
type FieldOffset "depthPitch" VkSubresourceLayout =
(32)
type FieldIsArray "depthPitch" VkSubresourceLayout = 'False
fieldOptional = False
fieldOffset = (32)
instance
CanReadField "depthPitch" VkSubresourceLayout where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (32))
readField p
= peekByteOff p (32)
instance
CanWriteField "depthPitch" VkSubresourceLayout where
writeField p
= pokeByteOff p (32)
instance Show VkSubresourceLayout where
showsPrec d x
= showString "VkSubresourceLayout {" .
showString "offset = " .
showsPrec d (getField @"offset" x) .
showString ", " .
showString "size = " .
showsPrec d (getField @"size" x) .
showString ", " .
showString "rowPitch = " .
showsPrec d (getField @"rowPitch" x) .
showString ", " .
showString "arrayPitch = " .
showsPrec d (getField @"arrayPitch" x) .
showString ", " .
showString "depthPitch = " .
showsPrec d (getField @"depthPitch" x) . showChar '}'