{-# LINE 1 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}


{-# LANGUAGE DataKinds             #-}
{-# LANGUAGE FlexibleInstances     #-}
{-# LANGUAGE MagicHash             #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE Strict                #-}
{-# LANGUAGE TypeApplications      #-}
{-# LANGUAGE TypeFamilies          #-}
module Graphics.Vulkan.Types.Struct.ProtectedSubmitInfo
       (VkProtectedSubmitInfo(..)) 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          (VkBool32)
import           Graphics.Vulkan.Types.Enum.StructureType (VkStructureType)
import           Graphics.Vulkan.Types.Struct.SubmitInfo  (VkSubmitInfo)
import           System.IO.Unsafe                         (unsafeDupablePerformIO)

-- | > typedef struct VkProtectedSubmitInfo {
--   >     VkStructureType sType;
--   >     const void*                     pNext;
--   >     VkBool32                        protectedSubmit;
--   > } VkProtectedSubmitInfo;
--
--   <https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VkProtectedSubmitInfo VkProtectedSubmitInfo registry at www.khronos.org>
data VkProtectedSubmitInfo = VkProtectedSubmitInfo# Addr#
                                                    ByteArray#

instance Eq VkProtectedSubmitInfo where
        (VkProtectedSubmitInfo# Addr#
a ByteArray#
_) == :: VkProtectedSubmitInfo -> VkProtectedSubmitInfo -> Bool
== x :: VkProtectedSubmitInfo
x@(VkProtectedSubmitInfo# Addr#
b ByteArray#
_)
          = Ordering
EQ Ordering -> Ordering -> Bool
forall a. Eq a => a -> a -> Bool
== Int -> Addr# -> Addr# -> Ordering
cmpBytes# (VkProtectedSubmitInfo -> Int
forall a. Storable a => a -> Int
sizeOf VkProtectedSubmitInfo
x) Addr#
a Addr#
b

        {-# INLINE (==) #-}

instance Ord VkProtectedSubmitInfo where
        (VkProtectedSubmitInfo# Addr#
a ByteArray#
_) compare :: VkProtectedSubmitInfo -> VkProtectedSubmitInfo -> Ordering
`compare`
          x :: VkProtectedSubmitInfo
x@(VkProtectedSubmitInfo# Addr#
b ByteArray#
_) = Int -> Addr# -> Addr# -> Ordering
cmpBytes# (VkProtectedSubmitInfo -> Int
forall a. Storable a => a -> Int
sizeOf VkProtectedSubmitInfo
x) Addr#
a Addr#
b

        {-# INLINE compare #-}

instance Storable VkProtectedSubmitInfo where
        sizeOf :: VkProtectedSubmitInfo -> Int
sizeOf ~VkProtectedSubmitInfo
_ = (Int
24)
{-# LINE 47 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}

        {-# INLINE sizeOf #-}
        alignment :: VkProtectedSubmitInfo -> Int
alignment ~VkProtectedSubmitInfo
_ = Int
8
{-# LINE 50 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}

        {-# INLINE alignment #-}
        peek :: Ptr VkProtectedSubmitInfo -> IO VkProtectedSubmitInfo
peek = Ptr VkProtectedSubmitInfo -> IO VkProtectedSubmitInfo
forall a. (Storable a, VulkanMarshalPrim a) => Ptr a -> IO a
peekVkData#

        {-# INLINE peek #-}
        poke :: Ptr VkProtectedSubmitInfo -> VkProtectedSubmitInfo -> IO ()
poke = Ptr VkProtectedSubmitInfo -> VkProtectedSubmitInfo -> IO ()
forall a. (Storable a, VulkanMarshalPrim a) => Ptr a -> a -> IO ()
pokeVkData#

        {-# INLINE poke #-}

instance VulkanMarshalPrim VkProtectedSubmitInfo where
        unsafeAddr :: VkProtectedSubmitInfo -> Addr#
unsafeAddr (VkProtectedSubmitInfo# Addr#
a ByteArray#
_) = Addr#
a

        {-# INLINE unsafeAddr #-}
        unsafeByteArray :: VkProtectedSubmitInfo -> ByteArray#
unsafeByteArray (VkProtectedSubmitInfo# Addr#
_ ByteArray#
b) = ByteArray#
b

        {-# INLINE unsafeByteArray #-}
        unsafeFromByteArrayOffset :: Int# -> ByteArray# -> VkProtectedSubmitInfo
unsafeFromByteArrayOffset Int#
off ByteArray#
b
          = Addr# -> ByteArray# -> VkProtectedSubmitInfo
VkProtectedSubmitInfo# (Addr# -> Int# -> Addr#
plusAddr# (ByteArray# -> Addr#
byteArrayContents# ByteArray#
b) Int#
off) ByteArray#
b

        {-# INLINE unsafeFromByteArrayOffset #-}

instance VulkanMarshal VkProtectedSubmitInfo where
        type StructFields VkProtectedSubmitInfo =
             '["sType", "pNext", "protectedSubmit"] -- ' closing tick for hsc2hs
        type CUnionType VkProtectedSubmitInfo = 'False -- ' closing tick for hsc2hs
        type ReturnedOnly VkProtectedSubmitInfo = 'False -- ' closing tick for hsc2hs
        type StructExtends VkProtectedSubmitInfo = '[VkSubmitInfo] -- ' closing tick for hsc2hs

instance {-# OVERLAPPING #-} HasField "sType" VkProtectedSubmitInfo
         where
        type FieldType "sType" VkProtectedSubmitInfo = VkStructureType
        type FieldOptional "sType" VkProtectedSubmitInfo = 'False -- ' closing tick for hsc2hs
        type FieldOffset "sType" VkProtectedSubmitInfo =
             (0)
{-# LINE 84 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}
        type FieldIsArray "sType" VkProtectedSubmitInfo = 'False -- ' closing tick for hsc2hs

        {-# INLINE fieldOptional #-}
        fieldOptional :: Bool
fieldOptional = Bool
False

        {-# INLINE fieldOffset #-}
        fieldOffset :: Int
fieldOffset = (Int
0)
{-# LINE 91 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}

instance {-# OVERLAPPING #-}
         CanReadField "sType" VkProtectedSubmitInfo where
        {-# NOINLINE getField #-}
        getField :: VkProtectedSubmitInfo -> FieldType "sType" VkProtectedSubmitInfo
getField VkProtectedSubmitInfo
x
          = IO VkStructureType -> VkStructureType
forall a. IO a -> a
unsafeDupablePerformIO
              (Ptr VkProtectedSubmitInfo -> Int -> IO VkStructureType
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff (VkProtectedSubmitInfo -> Ptr VkProtectedSubmitInfo
forall a. VulkanMarshal a => a -> Ptr a
unsafePtr VkProtectedSubmitInfo
x) (Int
0))
{-# LINE 98 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}

        {-# INLINE readField #-}
        readField :: Ptr VkProtectedSubmitInfo
-> IO (FieldType "sType" VkProtectedSubmitInfo)
readField Ptr VkProtectedSubmitInfo
p
          = Ptr VkProtectedSubmitInfo -> Int -> IO VkStructureType
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr VkProtectedSubmitInfo
p (Int
0)
{-# LINE 102 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}

instance {-# OVERLAPPING #-}
         CanWriteField "sType" VkProtectedSubmitInfo where
        {-# INLINE writeField #-}
        writeField :: Ptr VkProtectedSubmitInfo
-> FieldType "sType" VkProtectedSubmitInfo -> IO ()
writeField Ptr VkProtectedSubmitInfo
p
          = Ptr VkProtectedSubmitInfo -> Int -> VkStructureType -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr VkProtectedSubmitInfo
p (Int
0)
{-# LINE 108 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}

instance {-# OVERLAPPING #-} HasField "pNext" VkProtectedSubmitInfo
         where
        type FieldType "pNext" VkProtectedSubmitInfo = Ptr Void
        type FieldOptional "pNext" VkProtectedSubmitInfo = 'False -- ' closing tick for hsc2hs
        type FieldOffset "pNext" VkProtectedSubmitInfo =
             (8)
{-# LINE 115 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}
        type FieldIsArray "pNext" VkProtectedSubmitInfo = 'False -- ' closing tick for hsc2hs

        {-# INLINE fieldOptional #-}
        fieldOptional :: Bool
fieldOptional = Bool
False

        {-# INLINE fieldOffset #-}
        fieldOffset :: Int
fieldOffset = (Int
8)
{-# LINE 122 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}

instance {-# OVERLAPPING #-}
         CanReadField "pNext" VkProtectedSubmitInfo where
        {-# NOINLINE getField #-}
        getField :: VkProtectedSubmitInfo -> FieldType "pNext" VkProtectedSubmitInfo
getField VkProtectedSubmitInfo
x
          = IO (Ptr Void) -> Ptr Void
forall a. IO a -> a
unsafeDupablePerformIO
              (Ptr VkProtectedSubmitInfo -> Int -> IO (Ptr Void)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff (VkProtectedSubmitInfo -> Ptr VkProtectedSubmitInfo
forall a. VulkanMarshal a => a -> Ptr a
unsafePtr VkProtectedSubmitInfo
x) (Int
8))
{-# LINE 129 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}

        {-# INLINE readField #-}
        readField :: Ptr VkProtectedSubmitInfo
-> IO (FieldType "pNext" VkProtectedSubmitInfo)
readField Ptr VkProtectedSubmitInfo
p
          = Ptr VkProtectedSubmitInfo -> Int -> IO (Ptr Void)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr VkProtectedSubmitInfo
p (Int
8)
{-# LINE 133 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}

instance {-# OVERLAPPING #-}
         CanWriteField "pNext" VkProtectedSubmitInfo where
        {-# INLINE writeField #-}
        writeField :: Ptr VkProtectedSubmitInfo
-> FieldType "pNext" VkProtectedSubmitInfo -> IO ()
writeField Ptr VkProtectedSubmitInfo
p
          = Ptr VkProtectedSubmitInfo -> Int -> Ptr Void -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr VkProtectedSubmitInfo
p (Int
8)
{-# LINE 139 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}

instance {-# OVERLAPPING #-}
         HasField "protectedSubmit" VkProtectedSubmitInfo where
        type FieldType "protectedSubmit" VkProtectedSubmitInfo = VkBool32
        type FieldOptional "protectedSubmit" VkProtectedSubmitInfo = 'False -- ' closing tick for hsc2hs
        type FieldOffset "protectedSubmit" VkProtectedSubmitInfo =
             (16)
{-# LINE 146 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}
        type FieldIsArray "protectedSubmit" VkProtectedSubmitInfo = 'False -- ' closing tick for hsc2hs

        {-# INLINE fieldOptional #-}
        fieldOptional :: Bool
fieldOptional = Bool
False

        {-# INLINE fieldOffset #-}
        fieldOffset :: Int
fieldOffset
          = (Int
16)
{-# LINE 154 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}

instance {-# OVERLAPPING #-}
         CanReadField "protectedSubmit" VkProtectedSubmitInfo where
        {-# NOINLINE getField #-}
        getField :: VkProtectedSubmitInfo
-> FieldType "protectedSubmit" VkProtectedSubmitInfo
getField VkProtectedSubmitInfo
x
          = IO VkBool32 -> VkBool32
forall a. IO a -> a
unsafeDupablePerformIO
              (Ptr VkProtectedSubmitInfo -> Int -> IO VkBool32
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff (VkProtectedSubmitInfo -> Ptr VkProtectedSubmitInfo
forall a. VulkanMarshal a => a -> Ptr a
unsafePtr VkProtectedSubmitInfo
x) (Int
16))
{-# LINE 161 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}

        {-# INLINE readField #-}
        readField :: Ptr VkProtectedSubmitInfo
-> IO (FieldType "protectedSubmit" VkProtectedSubmitInfo)
readField Ptr VkProtectedSubmitInfo
p
          = Ptr VkProtectedSubmitInfo -> Int -> IO VkBool32
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr VkProtectedSubmitInfo
p (Int
16)
{-# LINE 165 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}

instance {-# OVERLAPPING #-}
         CanWriteField "protectedSubmit" VkProtectedSubmitInfo where
        {-# INLINE writeField #-}
        writeField :: Ptr VkProtectedSubmitInfo
-> FieldType "protectedSubmit" VkProtectedSubmitInfo -> IO ()
writeField Ptr VkProtectedSubmitInfo
p
          = Ptr VkProtectedSubmitInfo -> Int -> VkBool32 -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr VkProtectedSubmitInfo
p (Int
16)
{-# LINE 171 "src-gen/Graphics/Vulkan/Types/Struct/ProtectedSubmitInfo.hsc" #-}

instance Show VkProtectedSubmitInfo where
        showsPrec :: Int -> VkProtectedSubmitInfo -> ShowS
showsPrec Int
d VkProtectedSubmitInfo
x
          = String -> ShowS
showString String
"VkProtectedSubmitInfo {" ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
              String -> ShowS
showString String
"sType = " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
                Int -> VkStructureType -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
d (VkProtectedSubmitInfo -> FieldType "sType" VkProtectedSubmitInfo
forall (fname :: Symbol) a.
CanReadField fname a =>
a -> FieldType fname a
getField @"sType" VkProtectedSubmitInfo
x) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
                  String -> ShowS
showString String
", " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
                    String -> ShowS
showString String
"pNext = " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
                      Int -> Ptr Void -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
d (VkProtectedSubmitInfo -> FieldType "pNext" VkProtectedSubmitInfo
forall (fname :: Symbol) a.
CanReadField fname a =>
a -> FieldType fname a
getField @"pNext" VkProtectedSubmitInfo
x) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
                        String -> ShowS
showString String
", " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
                          String -> ShowS
showString String
"protectedSubmit = " ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
                            Int -> VkBool32 -> ShowS
forall a. Show a => Int -> a -> ShowS
showsPrec Int
d (VkProtectedSubmitInfo
-> FieldType "protectedSubmit" VkProtectedSubmitInfo
forall (fname :: Symbol) a.
CanReadField fname a =>
a -> FieldType fname a
getField @"protectedSubmit" VkProtectedSubmitInfo
x) ShowS -> ShowS -> ShowS
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Char -> ShowS
showChar Char
'}'