module Graphics.Vulkan.Types.Struct.Attachment
(VkAttachmentDescription(..), VkAttachmentReference(..),
VkAttachmentSampleLocationsEXT(..))
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.Attachment (VkAttachmentDescriptionFlags,
VkAttachmentLoadOp,
VkAttachmentStoreOp)
import Graphics.Vulkan.Types.Enum.Format (VkFormat)
import Graphics.Vulkan.Types.Enum.Image (VkImageLayout)
import Graphics.Vulkan.Types.Enum.SampleCountFlags (VkSampleCountFlagBits)
import Graphics.Vulkan.Types.Struct.SampleLocation (VkSampleLocationsInfoEXT)
import System.IO.Unsafe (unsafeDupablePerformIO)
data VkAttachmentDescription = VkAttachmentDescription# Addr#
ByteArray#
instance Eq VkAttachmentDescription where
(VkAttachmentDescription# a _) == x@(VkAttachmentDescription# b _)
= EQ == cmpBytes# (sizeOf x) a b
instance Ord VkAttachmentDescription where
(VkAttachmentDescription# a _) `compare`
x@(VkAttachmentDescription# b _) = cmpBytes# (sizeOf x) a b
instance Storable VkAttachmentDescription where
sizeOf ~_ = (36)
alignment ~_ = (4)
peek = peekVkData#
poke = pokeVkData#
instance VulkanMarshalPrim VkAttachmentDescription where
unsafeAddr (VkAttachmentDescription# a _) = a
unsafeByteArray (VkAttachmentDescription# _ b) = b
unsafeFromByteArrayOffset off b
= VkAttachmentDescription# (plusAddr# (byteArrayContents# b) off) b
instance VulkanMarshal VkAttachmentDescription where
type StructFields VkAttachmentDescription =
'["flags", "format", "samples", "loadOp", "storeOp",
"stencilLoadOp", "stencilStoreOp", "initialLayout", "finalLayout"]
type CUnionType VkAttachmentDescription = 'False
type ReturnedOnly VkAttachmentDescription = 'False
type StructExtends VkAttachmentDescription = '[]
instance
HasField "flags" VkAttachmentDescription where
type FieldType "flags" VkAttachmentDescription =
VkAttachmentDescriptionFlags
type FieldOptional "flags" VkAttachmentDescription = 'True
type FieldOffset "flags" VkAttachmentDescription =
(0)
type FieldIsArray "flags" VkAttachmentDescription = 'False
fieldOptional = True
fieldOffset = (0)
instance
CanReadField "flags" VkAttachmentDescription where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (0))
readField p
= peekByteOff p (0)
instance
CanWriteField "flags" VkAttachmentDescription where
writeField p
= pokeByteOff p (0)
instance
HasField "format" VkAttachmentDescription where
type FieldType "format" VkAttachmentDescription = VkFormat
type FieldOptional "format" VkAttachmentDescription = 'False
type FieldOffset "format" VkAttachmentDescription =
(4)
type FieldIsArray "format" VkAttachmentDescription = 'False
fieldOptional = False
fieldOffset = (4)
instance
CanReadField "format" VkAttachmentDescription where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (4))
readField p
= peekByteOff p (4)
instance
CanWriteField "format" VkAttachmentDescription where
writeField p
= pokeByteOff p (4)
instance
HasField "samples" VkAttachmentDescription where
type FieldType "samples" VkAttachmentDescription =
VkSampleCountFlagBits
type FieldOptional "samples" VkAttachmentDescription = 'False
type FieldOffset "samples" VkAttachmentDescription =
(8)
type FieldIsArray "samples" VkAttachmentDescription = 'False
fieldOptional = False
fieldOffset
= (8)
instance
CanReadField "samples" VkAttachmentDescription where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (8))
readField p
= peekByteOff p (8)
instance
CanWriteField "samples" VkAttachmentDescription where
writeField p
= pokeByteOff p (8)
instance
HasField "loadOp" VkAttachmentDescription where
type FieldType "loadOp" VkAttachmentDescription =
VkAttachmentLoadOp
type FieldOptional "loadOp" VkAttachmentDescription = 'False
type FieldOffset "loadOp" VkAttachmentDescription =
(12)
type FieldIsArray "loadOp" VkAttachmentDescription = 'False
fieldOptional = False
fieldOffset = (12)
instance
CanReadField "loadOp" VkAttachmentDescription where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (12))
readField p
= peekByteOff p (12)
instance
CanWriteField "loadOp" VkAttachmentDescription where
writeField p
= pokeByteOff p (12)
instance
HasField "storeOp" VkAttachmentDescription where
type FieldType "storeOp" VkAttachmentDescription =
VkAttachmentStoreOp
type FieldOptional "storeOp" VkAttachmentDescription = 'False
type FieldOffset "storeOp" VkAttachmentDescription =
(16)
type FieldIsArray "storeOp" VkAttachmentDescription = 'False
fieldOptional = False
fieldOffset
= (16)
instance
CanReadField "storeOp" VkAttachmentDescription where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (16))
readField p
= peekByteOff p (16)
instance
CanWriteField "storeOp" VkAttachmentDescription where
writeField p
= pokeByteOff p (16)
instance
HasField "stencilLoadOp" VkAttachmentDescription where
type FieldType "stencilLoadOp" VkAttachmentDescription =
VkAttachmentLoadOp
type FieldOptional "stencilLoadOp" VkAttachmentDescription = 'False
type FieldOffset "stencilLoadOp" VkAttachmentDescription =
(20)
type FieldIsArray "stencilLoadOp" VkAttachmentDescription = 'False
fieldOptional = False
fieldOffset
= (20)
instance
CanReadField "stencilLoadOp" VkAttachmentDescription where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (20))
readField p
= peekByteOff p (20)
instance
CanWriteField "stencilLoadOp" VkAttachmentDescription where
writeField p
= pokeByteOff p (20)
instance
HasField "stencilStoreOp" VkAttachmentDescription where
type FieldType "stencilStoreOp" VkAttachmentDescription =
VkAttachmentStoreOp
type FieldOptional "stencilStoreOp" VkAttachmentDescription =
'False
type FieldOffset "stencilStoreOp" VkAttachmentDescription =
(24)
type FieldIsArray "stencilStoreOp" VkAttachmentDescription = 'False
fieldOptional = False
fieldOffset
= (24)
instance
CanReadField "stencilStoreOp" VkAttachmentDescription where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (24))
readField p
= peekByteOff p (24)
instance
CanWriteField "stencilStoreOp" VkAttachmentDescription where
writeField p
= pokeByteOff p (24)
instance
HasField "initialLayout" VkAttachmentDescription where
type FieldType "initialLayout" VkAttachmentDescription =
VkImageLayout
type FieldOptional "initialLayout" VkAttachmentDescription = 'False
type FieldOffset "initialLayout" VkAttachmentDescription =
(28)
type FieldIsArray "initialLayout" VkAttachmentDescription = 'False
fieldOptional = False
fieldOffset
= (28)
instance
CanReadField "initialLayout" VkAttachmentDescription where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (28))
readField p
= peekByteOff p (28)
instance
CanWriteField "initialLayout" VkAttachmentDescription where
writeField p
= pokeByteOff p (28)
instance
HasField "finalLayout" VkAttachmentDescription where
type FieldType "finalLayout" VkAttachmentDescription =
VkImageLayout
type FieldOptional "finalLayout" VkAttachmentDescription = 'False
type FieldOffset "finalLayout" VkAttachmentDescription =
(32)
type FieldIsArray "finalLayout" VkAttachmentDescription = 'False
fieldOptional = False
fieldOffset
= (32)
instance
CanReadField "finalLayout" VkAttachmentDescription where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (32))
readField p
= peekByteOff p (32)
instance
CanWriteField "finalLayout" VkAttachmentDescription where
writeField p
= pokeByteOff p (32)
instance Show VkAttachmentDescription where
showsPrec d x
= showString "VkAttachmentDescription {" .
showString "flags = " .
showsPrec d (getField @"flags" x) .
showString ", " .
showString "format = " .
showsPrec d (getField @"format" x) .
showString ", " .
showString "samples = " .
showsPrec d (getField @"samples" x) .
showString ", " .
showString "loadOp = " .
showsPrec d (getField @"loadOp" x) .
showString ", " .
showString "storeOp = " .
showsPrec d (getField @"storeOp" x) .
showString ", " .
showString "stencilLoadOp = " .
showsPrec d (getField @"stencilLoadOp" x) .
showString ", " .
showString "stencilStoreOp = " .
showsPrec d (getField @"stencilStoreOp" x) .
showString ", " .
showString "initialLayout = " .
showsPrec d (getField @"initialLayout" x)
.
showString ", " .
showString "finalLayout = " .
showsPrec d
(getField @"finalLayout" x)
. showChar '}'
data VkAttachmentReference = VkAttachmentReference# Addr#
ByteArray#
instance Eq VkAttachmentReference where
(VkAttachmentReference# a _) == x@(VkAttachmentReference# b _)
= EQ == cmpBytes# (sizeOf x) a b
instance Ord VkAttachmentReference where
(VkAttachmentReference# a _) `compare`
x@(VkAttachmentReference# b _) = cmpBytes# (sizeOf x) a b
instance Storable VkAttachmentReference where
sizeOf ~_ = (8)
alignment ~_ = (4)
peek = peekVkData#
poke = pokeVkData#
instance VulkanMarshalPrim VkAttachmentReference where
unsafeAddr (VkAttachmentReference# a _) = a
unsafeByteArray (VkAttachmentReference# _ b) = b
unsafeFromByteArrayOffset off b
= VkAttachmentReference# (plusAddr# (byteArrayContents# b) off) b
instance VulkanMarshal VkAttachmentReference where
type StructFields VkAttachmentReference = '["attachment", "layout"]
type CUnionType VkAttachmentReference = 'False
type ReturnedOnly VkAttachmentReference = 'False
type StructExtends VkAttachmentReference = '[]
instance
HasField "attachment" VkAttachmentReference where
type FieldType "attachment" VkAttachmentReference = Word32
type FieldOptional "attachment" VkAttachmentReference = 'False
type FieldOffset "attachment" VkAttachmentReference =
(0)
type FieldIsArray "attachment" VkAttachmentReference = 'False
fieldOptional = False
fieldOffset
= (0)
instance
CanReadField "attachment" VkAttachmentReference where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (0))
readField p
= peekByteOff p (0)
instance
CanWriteField "attachment" VkAttachmentReference where
writeField p
= pokeByteOff p (0)
instance
HasField "layout" VkAttachmentReference where
type FieldType "layout" VkAttachmentReference = VkImageLayout
type FieldOptional "layout" VkAttachmentReference = 'False
type FieldOffset "layout" VkAttachmentReference =
(4)
type FieldIsArray "layout" VkAttachmentReference = 'False
fieldOptional = False
fieldOffset = (4)
instance
CanReadField "layout" VkAttachmentReference where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (4))
readField p
= peekByteOff p (4)
instance
CanWriteField "layout" VkAttachmentReference where
writeField p
= pokeByteOff p (4)
instance Show VkAttachmentReference where
showsPrec d x
= showString "VkAttachmentReference {" .
showString "attachment = " .
showsPrec d (getField @"attachment" x) .
showString ", " .
showString "layout = " .
showsPrec d (getField @"layout" x) . showChar '}'
data VkAttachmentSampleLocationsEXT = VkAttachmentSampleLocationsEXT# Addr#
ByteArray#
instance Eq VkAttachmentSampleLocationsEXT where
(VkAttachmentSampleLocationsEXT# a _) ==
x@(VkAttachmentSampleLocationsEXT# b _)
= EQ == cmpBytes# (sizeOf x) a b
instance Ord VkAttachmentSampleLocationsEXT where
(VkAttachmentSampleLocationsEXT# a _) `compare`
x@(VkAttachmentSampleLocationsEXT# b _) = cmpBytes# (sizeOf x) a b
instance Storable VkAttachmentSampleLocationsEXT where
sizeOf ~_ = (48)
alignment ~_
= (8)
peek = peekVkData#
poke = pokeVkData#
instance VulkanMarshalPrim VkAttachmentSampleLocationsEXT where
unsafeAddr (VkAttachmentSampleLocationsEXT# a _) = a
unsafeByteArray (VkAttachmentSampleLocationsEXT# _ b) = b
unsafeFromByteArrayOffset off b
= VkAttachmentSampleLocationsEXT#
(plusAddr# (byteArrayContents# b) off)
b
instance VulkanMarshal VkAttachmentSampleLocationsEXT where
type StructFields VkAttachmentSampleLocationsEXT =
'["attachmentIndex", "sampleLocationsInfo"]
type CUnionType VkAttachmentSampleLocationsEXT = 'False
type ReturnedOnly VkAttachmentSampleLocationsEXT = 'False
type StructExtends VkAttachmentSampleLocationsEXT = '[]
instance
HasField "attachmentIndex" VkAttachmentSampleLocationsEXT where
type FieldType "attachmentIndex" VkAttachmentSampleLocationsEXT =
Word32
type FieldOptional "attachmentIndex" VkAttachmentSampleLocationsEXT
= 'False
type FieldOffset "attachmentIndex" VkAttachmentSampleLocationsEXT =
(0)
type FieldIsArray "attachmentIndex" VkAttachmentSampleLocationsEXT
= 'False
fieldOptional = False
fieldOffset
= (0)
instance
CanReadField "attachmentIndex" VkAttachmentSampleLocationsEXT where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (0))
readField p
= peekByteOff p (0)
instance
CanWriteField "attachmentIndex" VkAttachmentSampleLocationsEXT
where
writeField p
= pokeByteOff p (0)
instance
HasField "sampleLocationsInfo" VkAttachmentSampleLocationsEXT where
type FieldType "sampleLocationsInfo" VkAttachmentSampleLocationsEXT
= VkSampleLocationsInfoEXT
type FieldOptional "sampleLocationsInfo"
VkAttachmentSampleLocationsEXT
= 'False
type FieldOffset "sampleLocationsInfo"
VkAttachmentSampleLocationsEXT
=
(8)
type FieldIsArray "sampleLocationsInfo"
VkAttachmentSampleLocationsEXT
= 'False
fieldOptional = False
fieldOffset
= (8)
instance
CanReadField "sampleLocationsInfo" VkAttachmentSampleLocationsEXT
where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (8))
readField p
= peekByteOff p (8)
instance
CanWriteField "sampleLocationsInfo" VkAttachmentSampleLocationsEXT
where
writeField p
= pokeByteOff p (8)
instance Show VkAttachmentSampleLocationsEXT where
showsPrec d x
= showString "VkAttachmentSampleLocationsEXT {" .
showString "attachmentIndex = " .
showsPrec d (getField @"attachmentIndex" x) .
showString ", " .
showString "sampleLocationsInfo = " .
showsPrec d (getField @"sampleLocationsInfo" x) . showChar '}'