{-# 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
(PhysicalDeviceDrmPropertiesEXT
-> PhysicalDeviceDrmPropertiesEXT -> Bool)
-> (PhysicalDeviceDrmPropertiesEXT
-> PhysicalDeviceDrmPropertiesEXT -> Bool)
-> Eq PhysicalDeviceDrmPropertiesEXT
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 :: PhysicalDeviceDrmPropertiesEXT
-> (Ptr PhysicalDeviceDrmPropertiesEXT -> IO b) -> IO b
withCStruct PhysicalDeviceDrmPropertiesEXT
x Ptr PhysicalDeviceDrmPropertiesEXT -> IO b
f = Int -> (Ptr PhysicalDeviceDrmPropertiesEXT -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
56 ((Ptr PhysicalDeviceDrmPropertiesEXT -> IO b) -> IO b)
-> (Ptr PhysicalDeviceDrmPropertiesEXT -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceDrmPropertiesEXT
p -> Ptr PhysicalDeviceDrmPropertiesEXT
-> PhysicalDeviceDrmPropertiesEXT -> IO b -> IO b
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 :: 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
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
hasPrimary))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
hasRender))
Ptr Int64 -> Int64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Int64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Int64)) (Int64
primaryMajor)
Ptr Int64 -> Int64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Int64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Int64)) (Int64
primaryMinor)
Ptr Int64 -> Int64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Int64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Int64)) (Int64
renderMajor)
Ptr Int64 -> Int64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Int64
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 :: Ptr PhysicalDeviceDrmPropertiesEXT -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceDrmPropertiesEXT
p IO b
f = do
Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT)
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
Ptr Int64 -> Int64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Int64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Int64)) (Int64
forall a. Zero a => a
zero)
Ptr Int64 -> Int64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Int64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Int64)) (Int64
forall a. Zero a => a
zero)
Ptr Int64 -> Int64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Int64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Int64)) (Int64
forall a. Zero a => a
zero)
Ptr Int64 -> Int64 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Int64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Int64)) (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 <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
Bool32
hasRender <- Ptr Bool32 -> IO Bool32
forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr Bool32))
Int64
primaryMajor <- Ptr Int64 -> IO Int64
forall a. Storable a => Ptr a -> IO a
peek @Int64 ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Int64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Int64))
Int64
primaryMinor <- Ptr Int64 -> IO Int64
forall a. Storable a => Ptr a -> IO a
peek @Int64 ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Int64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Int64))
Int64
renderMajor <- Ptr Int64 -> IO Int64
forall a. Storable a => Ptr a -> IO a
peek @Int64 ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Int64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Int64))
Int64
renderMinor <- Ptr Int64 -> IO Int64
forall a. Storable a => Ptr a -> IO a
peek @Int64 ((Ptr PhysicalDeviceDrmPropertiesEXT
p Ptr PhysicalDeviceDrmPropertiesEXT -> Int -> Ptr Int64
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Int64))
PhysicalDeviceDrmPropertiesEXT -> IO PhysicalDeviceDrmPropertiesEXT
forall (f :: * -> *) a. Applicative f => a -> f a
pure (PhysicalDeviceDrmPropertiesEXT
-> IO PhysicalDeviceDrmPropertiesEXT)
-> PhysicalDeviceDrmPropertiesEXT
-> IO PhysicalDeviceDrmPropertiesEXT
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 = Ptr PhysicalDeviceDrmPropertiesEXT
-> IO PhysicalDeviceDrmPropertiesEXT
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceDrmPropertiesEXT
-> PhysicalDeviceDrmPropertiesEXT -> IO ()
poke Ptr PhysicalDeviceDrmPropertiesEXT
ptr PhysicalDeviceDrmPropertiesEXT
poked = Ptr PhysicalDeviceDrmPropertiesEXT
-> PhysicalDeviceDrmPropertiesEXT -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceDrmPropertiesEXT
ptr PhysicalDeviceDrmPropertiesEXT
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceDrmPropertiesEXT where
zero :: PhysicalDeviceDrmPropertiesEXT
zero = Bool
-> Bool
-> Int64
-> Int64
-> Int64
-> Int64
-> PhysicalDeviceDrmPropertiesEXT
PhysicalDeviceDrmPropertiesEXT
Bool
forall a. Zero a => a
zero
Bool
forall a. Zero a => a
zero
Int64
forall a. Zero a => a
zero
Int64
forall a. Zero a => a
zero
Int64
forall a. Zero a => a
zero
Int64
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 :: a
$mEXT_PHYSICAL_DEVICE_DRM_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> 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 :: a
$mEXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME = "VK_EXT_physical_device_drm"