{-# language CPP #-}
module Vulkan.Extensions.VK_KHR_global_priority ( pattern QUEUE_GLOBAL_PRIORITY_LOW_EXT
, pattern QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT
, pattern QUEUE_GLOBAL_PRIORITY_HIGH_EXT
, pattern QUEUE_GLOBAL_PRIORITY_REALTIME_EXT
, DeviceQueueGlobalPriorityCreateInfoKHR(..)
, PhysicalDeviceGlobalPriorityQueryFeaturesKHR(..)
, QueueFamilyGlobalPriorityPropertiesKHR(..)
, QueueGlobalPriorityKHR( QUEUE_GLOBAL_PRIORITY_LOW_KHR
, QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR
, QUEUE_GLOBAL_PRIORITY_HIGH_KHR
, QUEUE_GLOBAL_PRIORITY_REALTIME_KHR
, ..
)
, KHR_GLOBAL_PRIORITY_SPEC_VERSION
, pattern KHR_GLOBAL_PRIORITY_SPEC_VERSION
, KHR_GLOBAL_PRIORITY_EXTENSION_NAME
, pattern KHR_GLOBAL_PRIORITY_EXTENSION_NAME
, MAX_GLOBAL_PRIORITY_SIZE_KHR
, pattern MAX_GLOBAL_PRIORITY_SIZE_KHR
) where
import Vulkan.CStruct.Utils (FixedArray)
import Vulkan.Internal.Utils (enumReadPrec)
import Vulkan.Internal.Utils (enumShowsPrec)
import Control.Monad (unless)
import Foreign.Marshal.Alloc (allocaBytes)
import GHC.IO (throwIO)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import GHC.Show (showsPrec)
import Data.Vector (generateM)
import qualified Data.Vector (imapM_)
import qualified Data.Vector (length)
import Vulkan.CStruct (FromCStruct)
import Vulkan.CStruct (FromCStruct(..))
import Vulkan.CStruct (ToCStruct)
import Vulkan.CStruct (ToCStruct(..))
import Vulkan.Zero (Zero)
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 GHC.IO.Exception (IOErrorType(..))
import GHC.IO.Exception (IOException(..))
import Data.Int (Int32)
import Foreign.Ptr (Ptr)
import GHC.Read (Read(readPrec))
import GHC.Show (Show(showsPrec))
import Data.Word (Word32)
import Data.Kind (Type)
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Utils (lowerArrayPtr)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.Core10.APIConstants (MAX_GLOBAL_PRIORITY_SIZE_KHR)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Core10.APIConstants (pattern MAX_GLOBAL_PRIORITY_SIZE_KHR)
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR))
import Vulkan.Core10.APIConstants (MAX_GLOBAL_PRIORITY_SIZE_KHR)
import Vulkan.Core10.APIConstants (pattern MAX_GLOBAL_PRIORITY_SIZE_KHR)
pattern $bQUEUE_GLOBAL_PRIORITY_LOW_EXT :: QueueGlobalPriorityKHR
$mQUEUE_GLOBAL_PRIORITY_LOW_EXT :: forall {r}.
QueueGlobalPriorityKHR -> ((# #) -> r) -> ((# #) -> r) -> r
QUEUE_GLOBAL_PRIORITY_LOW_EXT = QUEUE_GLOBAL_PRIORITY_LOW_KHR
pattern $bQUEUE_GLOBAL_PRIORITY_MEDIUM_EXT :: QueueGlobalPriorityKHR
$mQUEUE_GLOBAL_PRIORITY_MEDIUM_EXT :: forall {r}.
QueueGlobalPriorityKHR -> ((# #) -> r) -> ((# #) -> r) -> r
QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT = QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR
pattern $bQUEUE_GLOBAL_PRIORITY_HIGH_EXT :: QueueGlobalPriorityKHR
$mQUEUE_GLOBAL_PRIORITY_HIGH_EXT :: forall {r}.
QueueGlobalPriorityKHR -> ((# #) -> r) -> ((# #) -> r) -> r
QUEUE_GLOBAL_PRIORITY_HIGH_EXT = QUEUE_GLOBAL_PRIORITY_HIGH_KHR
pattern $bQUEUE_GLOBAL_PRIORITY_REALTIME_EXT :: QueueGlobalPriorityKHR
$mQUEUE_GLOBAL_PRIORITY_REALTIME_EXT :: forall {r}.
QueueGlobalPriorityKHR -> ((# #) -> r) -> ((# #) -> r) -> r
QUEUE_GLOBAL_PRIORITY_REALTIME_EXT = QUEUE_GLOBAL_PRIORITY_REALTIME_KHR
data DeviceQueueGlobalPriorityCreateInfoKHR = DeviceQueueGlobalPriorityCreateInfoKHR
{
DeviceQueueGlobalPriorityCreateInfoKHR -> QueueGlobalPriorityKHR
globalPriority :: QueueGlobalPriorityKHR }
deriving (Typeable, DeviceQueueGlobalPriorityCreateInfoKHR
-> DeviceQueueGlobalPriorityCreateInfoKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceQueueGlobalPriorityCreateInfoKHR
-> DeviceQueueGlobalPriorityCreateInfoKHR -> Bool
$c/= :: DeviceQueueGlobalPriorityCreateInfoKHR
-> DeviceQueueGlobalPriorityCreateInfoKHR -> Bool
== :: DeviceQueueGlobalPriorityCreateInfoKHR
-> DeviceQueueGlobalPriorityCreateInfoKHR -> Bool
$c== :: DeviceQueueGlobalPriorityCreateInfoKHR
-> DeviceQueueGlobalPriorityCreateInfoKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (DeviceQueueGlobalPriorityCreateInfoKHR)
#endif
deriving instance Show DeviceQueueGlobalPriorityCreateInfoKHR
instance ToCStruct DeviceQueueGlobalPriorityCreateInfoKHR where
withCStruct :: forall b.
DeviceQueueGlobalPriorityCreateInfoKHR
-> (Ptr DeviceQueueGlobalPriorityCreateInfoKHR -> IO b) -> IO b
withCStruct DeviceQueueGlobalPriorityCreateInfoKHR
x Ptr DeviceQueueGlobalPriorityCreateInfoKHR -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr DeviceQueueGlobalPriorityCreateInfoKHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceQueueGlobalPriorityCreateInfoKHR
p DeviceQueueGlobalPriorityCreateInfoKHR
x (Ptr DeviceQueueGlobalPriorityCreateInfoKHR -> IO b
f Ptr DeviceQueueGlobalPriorityCreateInfoKHR
p)
pokeCStruct :: forall b.
Ptr DeviceQueueGlobalPriorityCreateInfoKHR
-> DeviceQueueGlobalPriorityCreateInfoKHR -> IO b -> IO b
pokeCStruct Ptr DeviceQueueGlobalPriorityCreateInfoKHR
p DeviceQueueGlobalPriorityCreateInfoKHR{QueueGlobalPriorityKHR
globalPriority :: QueueGlobalPriorityKHR
$sel:globalPriority:DeviceQueueGlobalPriorityCreateInfoKHR :: DeviceQueueGlobalPriorityCreateInfoKHR -> QueueGlobalPriorityKHR
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceQueueGlobalPriorityCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceQueueGlobalPriorityCreateInfoKHR
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 DeviceQueueGlobalPriorityCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr QueueGlobalPriorityKHR)) (QueueGlobalPriorityKHR
globalPriority)
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr DeviceQueueGlobalPriorityCreateInfoKHR -> IO b -> IO b
pokeZeroCStruct Ptr DeviceQueueGlobalPriorityCreateInfoKHR
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceQueueGlobalPriorityCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr DeviceQueueGlobalPriorityCreateInfoKHR
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 DeviceQueueGlobalPriorityCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr QueueGlobalPriorityKHR)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct DeviceQueueGlobalPriorityCreateInfoKHR where
peekCStruct :: Ptr DeviceQueueGlobalPriorityCreateInfoKHR
-> IO DeviceQueueGlobalPriorityCreateInfoKHR
peekCStruct Ptr DeviceQueueGlobalPriorityCreateInfoKHR
p = do
QueueGlobalPriorityKHR
globalPriority <- forall a. Storable a => Ptr a -> IO a
peek @QueueGlobalPriorityKHR ((Ptr DeviceQueueGlobalPriorityCreateInfoKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr QueueGlobalPriorityKHR))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ QueueGlobalPriorityKHR -> DeviceQueueGlobalPriorityCreateInfoKHR
DeviceQueueGlobalPriorityCreateInfoKHR
QueueGlobalPriorityKHR
globalPriority
instance Storable DeviceQueueGlobalPriorityCreateInfoKHR where
sizeOf :: DeviceQueueGlobalPriorityCreateInfoKHR -> Int
sizeOf ~DeviceQueueGlobalPriorityCreateInfoKHR
_ = Int
24
alignment :: DeviceQueueGlobalPriorityCreateInfoKHR -> Int
alignment ~DeviceQueueGlobalPriorityCreateInfoKHR
_ = Int
8
peek :: Ptr DeviceQueueGlobalPriorityCreateInfoKHR
-> IO DeviceQueueGlobalPriorityCreateInfoKHR
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr DeviceQueueGlobalPriorityCreateInfoKHR
-> DeviceQueueGlobalPriorityCreateInfoKHR -> IO ()
poke Ptr DeviceQueueGlobalPriorityCreateInfoKHR
ptr DeviceQueueGlobalPriorityCreateInfoKHR
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr DeviceQueueGlobalPriorityCreateInfoKHR
ptr DeviceQueueGlobalPriorityCreateInfoKHR
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero DeviceQueueGlobalPriorityCreateInfoKHR where
zero :: DeviceQueueGlobalPriorityCreateInfoKHR
zero = QueueGlobalPriorityKHR -> DeviceQueueGlobalPriorityCreateInfoKHR
DeviceQueueGlobalPriorityCreateInfoKHR
forall a. Zero a => a
zero
data PhysicalDeviceGlobalPriorityQueryFeaturesKHR = PhysicalDeviceGlobalPriorityQueryFeaturesKHR
{
PhysicalDeviceGlobalPriorityQueryFeaturesKHR -> Bool
globalPriorityQuery :: Bool }
deriving (Typeable, PhysicalDeviceGlobalPriorityQueryFeaturesKHR
-> PhysicalDeviceGlobalPriorityQueryFeaturesKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhysicalDeviceGlobalPriorityQueryFeaturesKHR
-> PhysicalDeviceGlobalPriorityQueryFeaturesKHR -> Bool
$c/= :: PhysicalDeviceGlobalPriorityQueryFeaturesKHR
-> PhysicalDeviceGlobalPriorityQueryFeaturesKHR -> Bool
== :: PhysicalDeviceGlobalPriorityQueryFeaturesKHR
-> PhysicalDeviceGlobalPriorityQueryFeaturesKHR -> Bool
$c== :: PhysicalDeviceGlobalPriorityQueryFeaturesKHR
-> PhysicalDeviceGlobalPriorityQueryFeaturesKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (PhysicalDeviceGlobalPriorityQueryFeaturesKHR)
#endif
deriving instance Show PhysicalDeviceGlobalPriorityQueryFeaturesKHR
instance ToCStruct PhysicalDeviceGlobalPriorityQueryFeaturesKHR where
withCStruct :: forall b.
PhysicalDeviceGlobalPriorityQueryFeaturesKHR
-> (Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR -> IO b)
-> IO b
withCStruct PhysicalDeviceGlobalPriorityQueryFeaturesKHR
x Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 forall a b. (a -> b) -> a -> b
$ \Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
p PhysicalDeviceGlobalPriorityQueryFeaturesKHR
x (Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR -> IO b
f Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
p)
pokeCStruct :: forall b.
Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
-> PhysicalDeviceGlobalPriorityQueryFeaturesKHR -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
p PhysicalDeviceGlobalPriorityQueryFeaturesKHR{Bool
globalPriorityQuery :: Bool
$sel:globalPriorityQuery:PhysicalDeviceGlobalPriorityQueryFeaturesKHR :: PhysicalDeviceGlobalPriorityQueryFeaturesKHR -> Bool
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
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 PhysicalDeviceGlobalPriorityQueryFeaturesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
globalPriorityQuery))
IO b
f
cStructSize :: Int
cStructSize = Int
24
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR -> IO b -> IO b
pokeZeroCStruct Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
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 PhysicalDeviceGlobalPriorityQueryFeaturesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (forall a. Zero a => a
zero))
IO b
f
instance FromCStruct PhysicalDeviceGlobalPriorityQueryFeaturesKHR where
peekCStruct :: Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
-> IO PhysicalDeviceGlobalPriorityQueryFeaturesKHR
peekCStruct Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
p = do
Bool32
globalPriorityQuery <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Bool -> PhysicalDeviceGlobalPriorityQueryFeaturesKHR
PhysicalDeviceGlobalPriorityQueryFeaturesKHR
(Bool32 -> Bool
bool32ToBool Bool32
globalPriorityQuery)
instance Storable PhysicalDeviceGlobalPriorityQueryFeaturesKHR where
sizeOf :: PhysicalDeviceGlobalPriorityQueryFeaturesKHR -> Int
sizeOf ~PhysicalDeviceGlobalPriorityQueryFeaturesKHR
_ = Int
24
alignment :: PhysicalDeviceGlobalPriorityQueryFeaturesKHR -> Int
alignment ~PhysicalDeviceGlobalPriorityQueryFeaturesKHR
_ = Int
8
peek :: Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
-> IO PhysicalDeviceGlobalPriorityQueryFeaturesKHR
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
-> PhysicalDeviceGlobalPriorityQueryFeaturesKHR -> IO ()
poke Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
ptr PhysicalDeviceGlobalPriorityQueryFeaturesKHR
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero PhysicalDeviceGlobalPriorityQueryFeaturesKHR where
zero :: PhysicalDeviceGlobalPriorityQueryFeaturesKHR
zero = Bool -> PhysicalDeviceGlobalPriorityQueryFeaturesKHR
PhysicalDeviceGlobalPriorityQueryFeaturesKHR
forall a. Zero a => a
zero
data QueueFamilyGlobalPriorityPropertiesKHR = QueueFamilyGlobalPriorityPropertiesKHR
{
QueueFamilyGlobalPriorityPropertiesKHR -> Word32
priorityCount :: Word32
,
QueueFamilyGlobalPriorityPropertiesKHR
-> Vector QueueGlobalPriorityKHR
priorities :: Vector QueueGlobalPriorityKHR
}
deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (QueueFamilyGlobalPriorityPropertiesKHR)
#endif
deriving instance Show QueueFamilyGlobalPriorityPropertiesKHR
instance ToCStruct QueueFamilyGlobalPriorityPropertiesKHR where
withCStruct :: forall b.
QueueFamilyGlobalPriorityPropertiesKHR
-> (Ptr QueueFamilyGlobalPriorityPropertiesKHR -> IO b) -> IO b
withCStruct QueueFamilyGlobalPriorityPropertiesKHR
x Ptr QueueFamilyGlobalPriorityPropertiesKHR -> IO b
f = forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
88 forall a b. (a -> b) -> a -> b
$ \Ptr QueueFamilyGlobalPriorityPropertiesKHR
p -> forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr QueueFamilyGlobalPriorityPropertiesKHR
p QueueFamilyGlobalPriorityPropertiesKHR
x (Ptr QueueFamilyGlobalPriorityPropertiesKHR -> IO b
f Ptr QueueFamilyGlobalPriorityPropertiesKHR
p)
pokeCStruct :: forall b.
Ptr QueueFamilyGlobalPriorityPropertiesKHR
-> QueueFamilyGlobalPriorityPropertiesKHR -> IO b -> IO b
pokeCStruct Ptr QueueFamilyGlobalPriorityPropertiesKHR
p QueueFamilyGlobalPriorityPropertiesKHR{Word32
Vector QueueGlobalPriorityKHR
priorities :: Vector QueueGlobalPriorityKHR
priorityCount :: Word32
$sel:priorities:QueueFamilyGlobalPriorityPropertiesKHR :: QueueFamilyGlobalPriorityPropertiesKHR
-> Vector QueueGlobalPriorityKHR
$sel:priorityCount:QueueFamilyGlobalPriorityPropertiesKHR :: QueueFamilyGlobalPriorityPropertiesKHR -> Word32
..} IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr QueueFamilyGlobalPriorityPropertiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr QueueFamilyGlobalPriorityPropertiesKHR
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 QueueFamilyGlobalPriorityPropertiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (Word32
priorityCount)
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless ((forall a. Vector a -> Int
Data.Vector.length forall a b. (a -> b) -> a -> b
$ (Vector QueueGlobalPriorityKHR
priorities)) forall a. Ord a => a -> a -> Bool
<= forall a. Integral a => a
MAX_GLOBAL_PRIORITY_SIZE_KHR) forall a b. (a -> b) -> a -> b
$
forall e a. Exception e => e -> IO a
throwIO forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError forall a. Maybe a
Nothing IOErrorType
InvalidArgument String
"" String
"priorities is too long, a maximum of MAX_GLOBAL_PRIORITY_SIZE_KHR elements are allowed" forall a. Maybe a
Nothing forall a. Maybe a
Nothing
forall (m :: * -> *) a b.
Monad m =>
(Int -> a -> m b) -> Vector a -> m ()
Data.Vector.imapM_ (\Int
i QueueGlobalPriorityKHR
e -> forall a. Storable a => Ptr a -> a -> IO ()
poke ((forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr ((Ptr QueueFamilyGlobalPriorityPropertiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr (FixedArray MAX_GLOBAL_PRIORITY_SIZE_KHR QueueGlobalPriorityKHR)))) forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr QueueGlobalPriorityKHR) (QueueGlobalPriorityKHR
e)) (Vector QueueGlobalPriorityKHR
priorities)
IO b
f
cStructSize :: Int
cStructSize = Int
88
cStructAlignment :: Int
cStructAlignment = Int
8
pokeZeroCStruct :: forall b.
Ptr QueueFamilyGlobalPriorityPropertiesKHR -> IO b -> IO b
pokeZeroCStruct Ptr QueueFamilyGlobalPriorityPropertiesKHR
p IO b
f = do
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr QueueFamilyGlobalPriorityPropertiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR)
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr QueueFamilyGlobalPriorityPropertiesKHR
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 QueueFamilyGlobalPriorityPropertiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32)) (forall a. Zero a => a
zero)
IO b
f
instance FromCStruct QueueFamilyGlobalPriorityPropertiesKHR where
peekCStruct :: Ptr QueueFamilyGlobalPriorityPropertiesKHR
-> IO QueueFamilyGlobalPriorityPropertiesKHR
peekCStruct Ptr QueueFamilyGlobalPriorityPropertiesKHR
p = do
Word32
priorityCount <- forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr QueueFamilyGlobalPriorityPropertiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Word32))
Vector QueueGlobalPriorityKHR
priorities <- forall (m :: * -> *) a.
Monad m =>
Int -> (Int -> m a) -> m (Vector a)
generateM (forall a. Integral a => a
MAX_GLOBAL_PRIORITY_SIZE_KHR) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @QueueGlobalPriorityKHR (((forall a (n :: Nat). Ptr (FixedArray n a) -> Ptr a
lowerArrayPtr @QueueGlobalPriorityKHR ((Ptr QueueFamilyGlobalPriorityPropertiesKHR
p forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
20 :: Ptr (FixedArray MAX_GLOBAL_PRIORITY_SIZE_KHR QueueGlobalPriorityKHR)))) forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
4 forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr QueueGlobalPriorityKHR)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Word32
-> Vector QueueGlobalPriorityKHR
-> QueueFamilyGlobalPriorityPropertiesKHR
QueueFamilyGlobalPriorityPropertiesKHR
Word32
priorityCount Vector QueueGlobalPriorityKHR
priorities
instance Storable QueueFamilyGlobalPriorityPropertiesKHR where
sizeOf :: QueueFamilyGlobalPriorityPropertiesKHR -> Int
sizeOf ~QueueFamilyGlobalPriorityPropertiesKHR
_ = Int
88
alignment :: QueueFamilyGlobalPriorityPropertiesKHR -> Int
alignment ~QueueFamilyGlobalPriorityPropertiesKHR
_ = Int
8
peek :: Ptr QueueFamilyGlobalPriorityPropertiesKHR
-> IO QueueFamilyGlobalPriorityPropertiesKHR
peek = forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
poke :: Ptr QueueFamilyGlobalPriorityPropertiesKHR
-> QueueFamilyGlobalPriorityPropertiesKHR -> IO ()
poke Ptr QueueFamilyGlobalPriorityPropertiesKHR
ptr QueueFamilyGlobalPriorityPropertiesKHR
poked = forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr QueueFamilyGlobalPriorityPropertiesKHR
ptr QueueFamilyGlobalPriorityPropertiesKHR
poked (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
instance Zero QueueFamilyGlobalPriorityPropertiesKHR where
zero :: QueueFamilyGlobalPriorityPropertiesKHR
zero = Word32
-> Vector QueueGlobalPriorityKHR
-> QueueFamilyGlobalPriorityPropertiesKHR
QueueFamilyGlobalPriorityPropertiesKHR
forall a. Zero a => a
zero
forall a. Monoid a => a
mempty
newtype QueueGlobalPriorityKHR = QueueGlobalPriorityKHR Int32
deriving newtype (QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Bool
$c/= :: QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Bool
== :: QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Bool
$c== :: QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Bool
Eq, Eq QueueGlobalPriorityKHR
QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Bool
QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Ordering
QueueGlobalPriorityKHR
-> QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: QueueGlobalPriorityKHR
-> QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR
$cmin :: QueueGlobalPriorityKHR
-> QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR
max :: QueueGlobalPriorityKHR
-> QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR
$cmax :: QueueGlobalPriorityKHR
-> QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR
>= :: QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Bool
$c>= :: QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Bool
> :: QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Bool
$c> :: QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Bool
<= :: QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Bool
$c<= :: QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Bool
< :: QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Bool
$c< :: QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Bool
compare :: QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Ordering
$ccompare :: QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> Ordering
Ord, Ptr QueueGlobalPriorityKHR -> IO QueueGlobalPriorityKHR
Ptr QueueGlobalPriorityKHR -> Int -> IO QueueGlobalPriorityKHR
Ptr QueueGlobalPriorityKHR
-> Int -> QueueGlobalPriorityKHR -> IO ()
Ptr QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> IO ()
QueueGlobalPriorityKHR -> Int
forall b. Ptr b -> Int -> IO QueueGlobalPriorityKHR
forall b. Ptr b -> Int -> QueueGlobalPriorityKHR -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
poke :: Ptr QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> IO ()
$cpoke :: Ptr QueueGlobalPriorityKHR -> QueueGlobalPriorityKHR -> IO ()
peek :: Ptr QueueGlobalPriorityKHR -> IO QueueGlobalPriorityKHR
$cpeek :: Ptr QueueGlobalPriorityKHR -> IO QueueGlobalPriorityKHR
pokeByteOff :: forall b. Ptr b -> Int -> QueueGlobalPriorityKHR -> IO ()
$cpokeByteOff :: forall b. Ptr b -> Int -> QueueGlobalPriorityKHR -> IO ()
peekByteOff :: forall b. Ptr b -> Int -> IO QueueGlobalPriorityKHR
$cpeekByteOff :: forall b. Ptr b -> Int -> IO QueueGlobalPriorityKHR
pokeElemOff :: Ptr QueueGlobalPriorityKHR
-> Int -> QueueGlobalPriorityKHR -> IO ()
$cpokeElemOff :: Ptr QueueGlobalPriorityKHR
-> Int -> QueueGlobalPriorityKHR -> IO ()
peekElemOff :: Ptr QueueGlobalPriorityKHR -> Int -> IO QueueGlobalPriorityKHR
$cpeekElemOff :: Ptr QueueGlobalPriorityKHR -> Int -> IO QueueGlobalPriorityKHR
alignment :: QueueGlobalPriorityKHR -> Int
$calignment :: QueueGlobalPriorityKHR -> Int
sizeOf :: QueueGlobalPriorityKHR -> Int
$csizeOf :: QueueGlobalPriorityKHR -> Int
Storable, QueueGlobalPriorityKHR
forall a. a -> Zero a
zero :: QueueGlobalPriorityKHR
$czero :: QueueGlobalPriorityKHR
Zero)
pattern $bQUEUE_GLOBAL_PRIORITY_LOW_KHR :: QueueGlobalPriorityKHR
$mQUEUE_GLOBAL_PRIORITY_LOW_KHR :: forall {r}.
QueueGlobalPriorityKHR -> ((# #) -> r) -> ((# #) -> r) -> r
QUEUE_GLOBAL_PRIORITY_LOW_KHR = QueueGlobalPriorityKHR 128
pattern $bQUEUE_GLOBAL_PRIORITY_MEDIUM_KHR :: QueueGlobalPriorityKHR
$mQUEUE_GLOBAL_PRIORITY_MEDIUM_KHR :: forall {r}.
QueueGlobalPriorityKHR -> ((# #) -> r) -> ((# #) -> r) -> r
QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR = QueueGlobalPriorityKHR 256
pattern $bQUEUE_GLOBAL_PRIORITY_HIGH_KHR :: QueueGlobalPriorityKHR
$mQUEUE_GLOBAL_PRIORITY_HIGH_KHR :: forall {r}.
QueueGlobalPriorityKHR -> ((# #) -> r) -> ((# #) -> r) -> r
QUEUE_GLOBAL_PRIORITY_HIGH_KHR = QueueGlobalPriorityKHR 512
pattern $bQUEUE_GLOBAL_PRIORITY_REALTIME_KHR :: QueueGlobalPriorityKHR
$mQUEUE_GLOBAL_PRIORITY_REALTIME_KHR :: forall {r}.
QueueGlobalPriorityKHR -> ((# #) -> r) -> ((# #) -> r) -> r
QUEUE_GLOBAL_PRIORITY_REALTIME_KHR = QueueGlobalPriorityKHR 1024
{-# COMPLETE
QUEUE_GLOBAL_PRIORITY_LOW_KHR
, QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR
, QUEUE_GLOBAL_PRIORITY_HIGH_KHR
, QUEUE_GLOBAL_PRIORITY_REALTIME_KHR ::
QueueGlobalPriorityKHR
#-}
conNameQueueGlobalPriorityKHR :: String
conNameQueueGlobalPriorityKHR :: String
conNameQueueGlobalPriorityKHR = String
"QueueGlobalPriorityKHR"
enumPrefixQueueGlobalPriorityKHR :: String
enumPrefixQueueGlobalPriorityKHR :: String
enumPrefixQueueGlobalPriorityKHR = String
"QUEUE_GLOBAL_PRIORITY_"
showTableQueueGlobalPriorityKHR :: [(QueueGlobalPriorityKHR, String)]
showTableQueueGlobalPriorityKHR :: [(QueueGlobalPriorityKHR, String)]
showTableQueueGlobalPriorityKHR =
[ (QueueGlobalPriorityKHR
QUEUE_GLOBAL_PRIORITY_LOW_KHR, String
"LOW_KHR")
,
( QueueGlobalPriorityKHR
QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR
, String
"MEDIUM_KHR"
)
, (QueueGlobalPriorityKHR
QUEUE_GLOBAL_PRIORITY_HIGH_KHR, String
"HIGH_KHR")
,
( QueueGlobalPriorityKHR
QUEUE_GLOBAL_PRIORITY_REALTIME_KHR
, String
"REALTIME_KHR"
)
]
instance Show QueueGlobalPriorityKHR where
showsPrec :: Int -> QueueGlobalPriorityKHR -> ShowS
showsPrec =
forall a i.
Eq a =>
String
-> [(a, String)]
-> String
-> (a -> i)
-> (i -> ShowS)
-> Int
-> a
-> ShowS
enumShowsPrec
String
enumPrefixQueueGlobalPriorityKHR
[(QueueGlobalPriorityKHR, String)]
showTableQueueGlobalPriorityKHR
String
conNameQueueGlobalPriorityKHR
(\(QueueGlobalPriorityKHR Int32
x) -> Int32
x)
(forall a. Show a => Int -> a -> ShowS
showsPrec Int
11)
instance Read QueueGlobalPriorityKHR where
readPrec :: ReadPrec QueueGlobalPriorityKHR
readPrec =
forall i a.
Read i =>
String -> [(a, String)] -> String -> (i -> a) -> ReadPrec a
enumReadPrec
String
enumPrefixQueueGlobalPriorityKHR
[(QueueGlobalPriorityKHR, String)]
showTableQueueGlobalPriorityKHR
String
conNameQueueGlobalPriorityKHR
Int32 -> QueueGlobalPriorityKHR
QueueGlobalPriorityKHR
type KHR_GLOBAL_PRIORITY_SPEC_VERSION = 1
pattern KHR_GLOBAL_PRIORITY_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_GLOBAL_PRIORITY_SPEC_VERSION :: forall a. Integral a => a
$mKHR_GLOBAL_PRIORITY_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
KHR_GLOBAL_PRIORITY_SPEC_VERSION = 1
type KHR_GLOBAL_PRIORITY_EXTENSION_NAME = "VK_KHR_global_priority"
pattern KHR_GLOBAL_PRIORITY_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_GLOBAL_PRIORITY_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
$mKHR_GLOBAL_PRIORITY_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
KHR_GLOBAL_PRIORITY_EXTENSION_NAME = "VK_KHR_global_priority"