{-# language CPP #-}
module Vulkan.Extensions.VK_EXT_physical_device_drm  ( PhysicalDeviceDrmPropertiesEXT(..)
                                                     , EXT_PHYSICAL_DEVICE_DRM_SPEC_VERSION
                                                     , pattern EXT_PHYSICAL_DEVICE_DRM_SPEC_VERSION
                                                     , EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME
                                                     , pattern EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME
                                                     ) where
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero(..))
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.Storable (Storable)
import Foreign.Storable (Storable(peek))
import Foreign.Storable (Storable(poke))
import qualified Foreign.Storable (Storable(..))
import GHC.Generics (Generic)
import Data.Int (Int64)
import Foreign.Ptr (Ptr)
import Data.Kind (Type)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT))
data PhysicalDeviceDrmPropertiesEXT = PhysicalDeviceDrmPropertiesEXT
  { 
    
    PhysicalDeviceDrmPropertiesEXT -> Bool
hasPrimary :: Bool
  , 
    
    PhysicalDeviceDrmPropertiesEXT -> Bool
hasRender :: Bool
  , 
    PhysicalDeviceDrmPropertiesEXT -> Int64
primaryMajor :: Int64
  , 
    PhysicalDeviceDrmPropertiesEXT -> Int64
primaryMinor :: Int64
  , 
    PhysicalDeviceDrmPropertiesEXT -> Int64
renderMajor :: Int64
  , 
    PhysicalDeviceDrmPropertiesEXT -> Int64
renderMinor :: Int64
  }
  deriving (Typeable, PhysicalDeviceDrmPropertiesEXT
-> PhysicalDeviceDrmPropertiesEXT -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceDrmPropertiesEXT
-> PhysicalDeviceDrmPropertiesEXT -> Bool
$c/= :: PhysicalDeviceDrmPropertiesEXT
-> PhysicalDeviceDrmPropertiesEXT -> Bool
== :: PhysicalDeviceDrmPropertiesEXT
-> PhysicalDeviceDrmPropertiesEXT -> Bool
$c== :: PhysicalDeviceDrmPropertiesEXT
-> PhysicalDeviceDrmPropertiesEXT -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceDrmPropertiesEXT)
#endif
deriving instance Show PhysicalDeviceDrmPropertiesEXT
instance ToCStruct PhysicalDeviceDrmPropertiesEXT where
  withCStruct :: forall b.
PhysicalDeviceDrmPropertiesEXT
-> (Ptr PhysicalDeviceDrmPropertiesEXT -> IO b) -> IO b
withCStruct PhysicalDeviceDrmPropertiesEXT
x Ptr PhysicalDeviceDrmPropertiesEXT -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceDrmPropertiesEXT
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDrmPropertiesEXT
p PhysicalDeviceDrmPropertiesEXT
x (Ptr PhysicalDeviceDrmPropertiesEXT -> IO b
f Ptr PhysicalDeviceDrmPropertiesEXT
p)
  pokeCStruct :: forall b.
Ptr PhysicalDeviceDrmPropertiesEXT
-> PhysicalDeviceDrmPropertiesEXT -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDrmPropertiesEXT
p PhysicalDeviceDrmPropertiesEXT{Bool
Int64
renderMinor :: Int64
renderMajor :: Int64
primaryMinor :: Int64
primaryMajor :: Int64
hasRender :: Bool
hasPrimary :: Bool
$sel:renderMinor:PhysicalDeviceDrmPropertiesEXT :: PhysicalDeviceDrmPropertiesEXT -> Int64
$sel:renderMajor:PhysicalDeviceDrmPropertiesEXT :: PhysicalDeviceDrmPropertiesEXT -> Int64
$sel:primaryMinor:PhysicalDeviceDrmPropertiesEXT :: PhysicalDeviceDrmPropertiesEXT -> Int64
$sel:primaryMajor:PhysicalDeviceDrmPropertiesEXT :: PhysicalDeviceDrmPropertiesEXT -> Int64
$sel:hasRender:PhysicalDeviceDrmPropertiesEXT :: PhysicalDeviceDrmPropertiesEXT -> Bool
$sel:hasPrimary:PhysicalDeviceDrmPropertiesEXT :: PhysicalDeviceDrmPropertiesEXT -> Bool
..} IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
hasPrimary))
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
hasRender))
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Int64)) (Int64
primaryMajor)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Int64)) (Int64
primaryMinor)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Int64)) (Int64
renderMajor)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Int64)) (Int64
renderMinor)
    IO b
f
  cStructSize :: Int
cStructSize = Int
56
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr PhysicalDeviceDrmPropertiesEXT -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceDrmPropertiesEXT
p IO b
f = do
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (forall a. Ptr a
nullPtr)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Int64)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Int64)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Int64)) (forall a. Zero a => a
zero)
    forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Int64)) (forall a. Zero a => a
zero)
    IO b
f
instance FromCStruct PhysicalDeviceDrmPropertiesEXT where
  peekCStruct :: Ptr PhysicalDeviceDrmPropertiesEXT
-> IO PhysicalDeviceDrmPropertiesEXT
peekCStruct Ptr PhysicalDeviceDrmPropertiesEXT
p = do
    Bool32
hasPrimary <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    Bool32
hasRender <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32))
    Int64
primaryMajor <- forall a. Storable a => Ptr a -> IO a
peek @Int64 ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Int64))
    Int64
primaryMinor <- forall a. Storable a => Ptr a -> IO a
peek @Int64 ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Int64))
    Int64
renderMajor <- forall a. Storable a => Ptr a -> IO a
peek @Int64 ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Int64))
    Int64
renderMinor <- forall a. Storable a => Ptr a -> IO a
peek @Int64 ((Ptr PhysicalDeviceDrmPropertiesEXT
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Int64))
    forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Bool
-> Bool
-> Int64
-> Int64
-> Int64
-> Int64
-> PhysicalDeviceDrmPropertiesEXT
PhysicalDeviceDrmPropertiesEXT
             (Bool32 -> Bool
bool32ToBool Bool32
hasPrimary)
             (Bool32 -> Bool
bool32ToBool Bool32
hasRender)
             Int64
primaryMajor
             Int64
primaryMinor
             Int64
renderMajor
             Int64
renderMinor
instance Storable PhysicalDeviceDrmPropertiesEXT where
  sizeOf :: PhysicalDeviceDrmPropertiesEXT -> Int
sizeOf ~PhysicalDeviceDrmPropertiesEXT
_ = Int
56
  alignment :: PhysicalDeviceDrmPropertiesEXT -> Int
alignment ~PhysicalDeviceDrmPropertiesEXT
_ = Int
8
  peek :: Ptr PhysicalDeviceDrmPropertiesEXT
-> IO PhysicalDeviceDrmPropertiesEXT
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr PhysicalDeviceDrmPropertiesEXT
-> PhysicalDeviceDrmPropertiesEXT -> IO ()
poke Ptr PhysicalDeviceDrmPropertiesEXT
ptr PhysicalDeviceDrmPropertiesEXT
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDrmPropertiesEXT
ptr PhysicalDeviceDrmPropertiesEXT
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceDrmPropertiesEXT where
  zero :: PhysicalDeviceDrmPropertiesEXT
zero = Bool
-> Bool
-> Int64
-> Int64
-> Int64
-> Int64
-> PhysicalDeviceDrmPropertiesEXT
PhysicalDeviceDrmPropertiesEXT
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
           forall a. Zero a => a
zero
type EXT_PHYSICAL_DEVICE_DRM_SPEC_VERSION = 1
pattern EXT_PHYSICAL_DEVICE_DRM_SPEC_VERSION :: forall a . Integral a => a
pattern $bEXT_PHYSICAL_DEVICE_DRM_SPEC_VERSION :: forall a. Integral a => a
$mEXT_PHYSICAL_DEVICE_DRM_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_PHYSICAL_DEVICE_DRM_SPEC_VERSION = 1
type EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME = "VK_EXT_physical_device_drm"
pattern EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bEXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mEXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME = "VK_EXT_physical_device_drm"