module Graphics.Vulkan.Types.Struct.VertexInput
(VkVertexInputAttributeDescription(..),
VkVertexInputBindingDescription(..),
VkVertexInputBindingDivisorDescriptionEXT(..))
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.Enum.Format (VkFormat)
import Graphics.Vulkan.Types.Enum.VertexInputRate (VkVertexInputRate)
import System.IO.Unsafe (unsafeDupablePerformIO)
data VkVertexInputAttributeDescription = VkVertexInputAttributeDescription# Addr#
ByteArray#
instance Eq VkVertexInputAttributeDescription where
(VkVertexInputAttributeDescription# a _) ==
x@(VkVertexInputAttributeDescription# b _)
= EQ == cmpBytes# (sizeOf x) a b
instance Ord VkVertexInputAttributeDescription where
(VkVertexInputAttributeDescription# a _) `compare`
x@(VkVertexInputAttributeDescription# b _)
= cmpBytes# (sizeOf x) a b
instance Storable VkVertexInputAttributeDescription where
sizeOf ~_ = (16)
alignment ~_
= (4)
peek = peekVkData#
poke = pokeVkData#
instance VulkanMarshalPrim VkVertexInputAttributeDescription where
unsafeAddr (VkVertexInputAttributeDescription# a _) = a
unsafeByteArray (VkVertexInputAttributeDescription# _ b) = b
unsafeFromByteArrayOffset off b
= VkVertexInputAttributeDescription#
(plusAddr# (byteArrayContents# b) off)
b
instance VulkanMarshal VkVertexInputAttributeDescription where
type StructFields VkVertexInputAttributeDescription =
'["location", "binding", "format", "offset"]
type CUnionType VkVertexInputAttributeDescription = 'False
type ReturnedOnly VkVertexInputAttributeDescription = 'False
type StructExtends VkVertexInputAttributeDescription = '[]
instance
HasField "location" VkVertexInputAttributeDescription where
type FieldType "location" VkVertexInputAttributeDescription =
Word32
type FieldOptional "location" VkVertexInputAttributeDescription =
'False
type FieldOffset "location" VkVertexInputAttributeDescription =
(0)
type FieldIsArray "location" VkVertexInputAttributeDescription =
'False
fieldOptional = False
fieldOffset
= (0)
instance
CanReadField "location" VkVertexInputAttributeDescription where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (0))
readField p
= peekByteOff p (0)
instance
CanWriteField "location" VkVertexInputAttributeDescription where
writeField p
= pokeByteOff p (0)
instance
HasField "binding" VkVertexInputAttributeDescription where
type FieldType "binding" VkVertexInputAttributeDescription = Word32
type FieldOptional "binding" VkVertexInputAttributeDescription =
'False
type FieldOffset "binding" VkVertexInputAttributeDescription =
(4)
type FieldIsArray "binding" VkVertexInputAttributeDescription =
'False
fieldOptional = False
fieldOffset
= (4)
instance
CanReadField "binding" VkVertexInputAttributeDescription where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (4))
readField p
= peekByteOff p (4)
instance
CanWriteField "binding" VkVertexInputAttributeDescription where
writeField p
= pokeByteOff p (4)
instance
HasField "format" VkVertexInputAttributeDescription where
type FieldType "format" VkVertexInputAttributeDescription =
VkFormat
type FieldOptional "format" VkVertexInputAttributeDescription =
'False
type FieldOffset "format" VkVertexInputAttributeDescription =
(8)
type FieldIsArray "format" VkVertexInputAttributeDescription =
'False
fieldOptional = False
fieldOffset
= (8)
instance
CanReadField "format" VkVertexInputAttributeDescription where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (8))
readField p
= peekByteOff p (8)
instance
CanWriteField "format" VkVertexInputAttributeDescription where
writeField p
= pokeByteOff p (8)
instance
HasField "offset" VkVertexInputAttributeDescription where
type FieldType "offset" VkVertexInputAttributeDescription = Word32
type FieldOptional "offset" VkVertexInputAttributeDescription =
'False
type FieldOffset "offset" VkVertexInputAttributeDescription =
(12)
type FieldIsArray "offset" VkVertexInputAttributeDescription =
'False
fieldOptional = False
fieldOffset
= (12)
instance
CanReadField "offset" VkVertexInputAttributeDescription where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (12))
readField p
= peekByteOff p (12)
instance
CanWriteField "offset" VkVertexInputAttributeDescription where
writeField p
= pokeByteOff p (12)
instance Show VkVertexInputAttributeDescription where
showsPrec d x
= showString "VkVertexInputAttributeDescription {" .
showString "location = " .
showsPrec d (getField @"location" x) .
showString ", " .
showString "binding = " .
showsPrec d (getField @"binding" x) .
showString ", " .
showString "format = " .
showsPrec d (getField @"format" x) .
showString ", " .
showString "offset = " .
showsPrec d (getField @"offset" x) . showChar '}'
data VkVertexInputBindingDescription = VkVertexInputBindingDescription# Addr#
ByteArray#
instance Eq VkVertexInputBindingDescription where
(VkVertexInputBindingDescription# a _) ==
x@(VkVertexInputBindingDescription# b _)
= EQ == cmpBytes# (sizeOf x) a b
instance Ord VkVertexInputBindingDescription where
(VkVertexInputBindingDescription# a _) `compare`
x@(VkVertexInputBindingDescription# b _) = cmpBytes# (sizeOf x) a b
instance Storable VkVertexInputBindingDescription where
sizeOf ~_ = (12)
alignment ~_
= (4)
peek = peekVkData#
poke = pokeVkData#
instance VulkanMarshalPrim VkVertexInputBindingDescription where
unsafeAddr (VkVertexInputBindingDescription# a _) = a
unsafeByteArray (VkVertexInputBindingDescription# _ b) = b
unsafeFromByteArrayOffset off b
= VkVertexInputBindingDescription#
(plusAddr# (byteArrayContents# b) off)
b
instance VulkanMarshal VkVertexInputBindingDescription where
type StructFields VkVertexInputBindingDescription =
'["binding", "stride", "inputRate"]
type CUnionType VkVertexInputBindingDescription = 'False
type ReturnedOnly VkVertexInputBindingDescription = 'False
type StructExtends VkVertexInputBindingDescription = '[]
instance
HasField "binding" VkVertexInputBindingDescription where
type FieldType "binding" VkVertexInputBindingDescription = Word32
type FieldOptional "binding" VkVertexInputBindingDescription =
'False
type FieldOffset "binding" VkVertexInputBindingDescription =
(0)
type FieldIsArray "binding" VkVertexInputBindingDescription =
'False
fieldOptional = False
fieldOffset
= (0)
instance
CanReadField "binding" VkVertexInputBindingDescription where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (0))
readField p
= peekByteOff p (0)
instance
CanWriteField "binding" VkVertexInputBindingDescription where
writeField p
= pokeByteOff p (0)
instance
HasField "stride" VkVertexInputBindingDescription where
type FieldType "stride" VkVertexInputBindingDescription = Word32
type FieldOptional "stride" VkVertexInputBindingDescription =
'False
type FieldOffset "stride" VkVertexInputBindingDescription =
(4)
type FieldIsArray "stride" VkVertexInputBindingDescription = 'False
fieldOptional = False
fieldOffset
= (4)
instance
CanReadField "stride" VkVertexInputBindingDescription where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (4))
readField p
= peekByteOff p (4)
instance
CanWriteField "stride" VkVertexInputBindingDescription where
writeField p
= pokeByteOff p (4)
instance
HasField "inputRate" VkVertexInputBindingDescription where
type FieldType "inputRate" VkVertexInputBindingDescription =
VkVertexInputRate
type FieldOptional "inputRate" VkVertexInputBindingDescription =
'False
type FieldOffset "inputRate" VkVertexInputBindingDescription =
(8)
type FieldIsArray "inputRate" VkVertexInputBindingDescription =
'False
fieldOptional = False
fieldOffset
= (8)
instance
CanReadField "inputRate" VkVertexInputBindingDescription where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (8))
readField p
= peekByteOff p (8)
instance
CanWriteField "inputRate" VkVertexInputBindingDescription where
writeField p
= pokeByteOff p (8)
instance Show VkVertexInputBindingDescription where
showsPrec d x
= showString "VkVertexInputBindingDescription {" .
showString "binding = " .
showsPrec d (getField @"binding" x) .
showString ", " .
showString "stride = " .
showsPrec d (getField @"stride" x) .
showString ", " .
showString "inputRate = " .
showsPrec d (getField @"inputRate" x) . showChar '}'
data VkVertexInputBindingDivisorDescriptionEXT = VkVertexInputBindingDivisorDescriptionEXT# Addr#
ByteArray#
instance Eq VkVertexInputBindingDivisorDescriptionEXT where
(VkVertexInputBindingDivisorDescriptionEXT# a _) ==
x@(VkVertexInputBindingDivisorDescriptionEXT# b _)
= EQ == cmpBytes# (sizeOf x) a b
instance Ord VkVertexInputBindingDivisorDescriptionEXT where
(VkVertexInputBindingDivisorDescriptionEXT# a _) `compare`
x@(VkVertexInputBindingDivisorDescriptionEXT# b _)
= cmpBytes# (sizeOf x) a b
instance Storable VkVertexInputBindingDivisorDescriptionEXT where
sizeOf ~_
= (8)
alignment ~_
= (4)
peek = peekVkData#
poke = pokeVkData#
instance VulkanMarshalPrim
VkVertexInputBindingDivisorDescriptionEXT
where
unsafeAddr (VkVertexInputBindingDivisorDescriptionEXT# a _) = a
unsafeByteArray (VkVertexInputBindingDivisorDescriptionEXT# _ b)
= b
unsafeFromByteArrayOffset off b
= VkVertexInputBindingDivisorDescriptionEXT#
(plusAddr# (byteArrayContents# b) off)
b
instance VulkanMarshal VkVertexInputBindingDivisorDescriptionEXT
where
type StructFields VkVertexInputBindingDivisorDescriptionEXT =
'["binding", "divisor"]
type CUnionType VkVertexInputBindingDivisorDescriptionEXT = 'False
type ReturnedOnly VkVertexInputBindingDivisorDescriptionEXT =
'False
type StructExtends VkVertexInputBindingDivisorDescriptionEXT = '[]
instance
HasField "binding" VkVertexInputBindingDivisorDescriptionEXT where
type FieldType "binding" VkVertexInputBindingDivisorDescriptionEXT
= Word32
type FieldOptional "binding"
VkVertexInputBindingDivisorDescriptionEXT
= 'False
type FieldOffset "binding"
VkVertexInputBindingDivisorDescriptionEXT
=
(0)
type FieldIsArray "binding"
VkVertexInputBindingDivisorDescriptionEXT
= 'False
fieldOptional = False
fieldOffset
= (0)
instance
CanReadField "binding" VkVertexInputBindingDivisorDescriptionEXT
where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (0))
readField p
= peekByteOff p (0)
instance
CanWriteField "binding" VkVertexInputBindingDivisorDescriptionEXT
where
writeField p
= pokeByteOff p (0)
instance
HasField "divisor" VkVertexInputBindingDivisorDescriptionEXT where
type FieldType "divisor" VkVertexInputBindingDivisorDescriptionEXT
= Word32
type FieldOptional "divisor"
VkVertexInputBindingDivisorDescriptionEXT
= 'False
type FieldOffset "divisor"
VkVertexInputBindingDivisorDescriptionEXT
=
(4)
type FieldIsArray "divisor"
VkVertexInputBindingDivisorDescriptionEXT
= 'False
fieldOptional = False
fieldOffset
= (4)
instance
CanReadField "divisor" VkVertexInputBindingDivisorDescriptionEXT
where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (4))
readField p
= peekByteOff p (4)
instance
CanWriteField "divisor" VkVertexInputBindingDivisorDescriptionEXT
where
writeField p
= pokeByteOff p (4)
instance Show VkVertexInputBindingDivisorDescriptionEXT where
showsPrec d x
= showString "VkVertexInputBindingDivisorDescriptionEXT {" .
showString "binding = " .
showsPrec d (getField @"binding" x) .
showString ", " .
showString "divisor = " .
showsPrec d (getField @"divisor" x) . showChar '}'