{-# language CPP #-}
-- | = Name
--
-- VK_KHR_global_priority - device extension
--
-- == VK_KHR_global_priority
--
-- [__Name String__]
--     @VK_KHR_global_priority@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     189
--
-- [__Revision__]
--     1
--
-- [__Ratification Status__]
--     Ratified
--
-- [__Extension and Version Dependencies__]
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_get_physical_device_properties2 VK_KHR_get_physical_device_properties2>
--
-- [__Contact__]
--
--     -   Tobias Hector
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_KHR_global_priority] @tobski%0A*Here describe the issue or question you have about the VK_KHR_global_priority extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2021-10-22
--
-- [__Contributors__]
--
--     -   Tobias Hector, AMD
--
--     -   Contributors to @VK_EXT_global_priority@
--
--     -   Contributors to @VK_EXT_global_priority_query@
--
-- == Description
--
-- In Vulkan, users can specify device-scope queue priorities. In some
-- cases it may be useful to extend this concept to a system-wide scope.
-- This device extension allows applications to query the global queue
-- priorities supported by a queue family, and then set a priority when
-- creating queues. The default queue priority is
-- 'QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT'.
--
-- Implementations can report which global priority levels are treated
-- differently by the implementation. It is intended primarily for use in
-- system integration along with certain platform-specific priority
-- enforcement rules.
--
-- The driver implementation will attempt to skew hardware resource
-- allocation in favour of the higher-priority task. Therefore,
-- higher-priority work may retain similar latency and throughput
-- characteristics even if the system is congested with lower priority
-- work.
--
-- The global priority level of a queue shall take precedence over the
-- per-process queue priority
-- ('Vulkan.Core10.Device.DeviceQueueCreateInfo'::@pQueuePriorities@).
--
-- Abuse of this feature may result in starving the rest of the system from
-- hardware resources. Therefore, the driver implementation may deny
-- requests to acquire a priority above the default priority
-- ('QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT') if the caller does not have
-- sufficient privileges. In this scenario
-- 'Vulkan.Extensions.VK_EXT_global_priority.ERROR_NOT_PERMITTED_EXT' is
-- returned.
--
-- The driver implementation may fail the queue allocation request if
-- resources required to complete the operation have been exhausted (either
-- by the same process or a different process). In this scenario
-- 'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED' is returned.
--
-- == New Structures
--
-- -   Extending 'Vulkan.Core10.Device.DeviceQueueCreateInfo':
--
--     -   'DeviceQueueGlobalPriorityCreateInfoKHR'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2',
--     'Vulkan.Core10.Device.DeviceCreateInfo':
--
--     -   'PhysicalDeviceGlobalPriorityQueryFeaturesKHR'
--
-- -   Extending
--     'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.QueueFamilyProperties2':
--
--     -   'QueueFamilyGlobalPriorityPropertiesKHR'
--
-- == New Enums
--
-- -   'QueueGlobalPriorityKHR'
--
-- == New Enum Constants
--
-- -   'KHR_GLOBAL_PRIORITY_EXTENSION_NAME'
--
-- -   'KHR_GLOBAL_PRIORITY_SPEC_VERSION'
--
-- -   'Vulkan.Core10.APIConstants.MAX_GLOBAL_PRIORITY_SIZE_KHR'
--
-- -   Extending 'Vulkan.Core10.Enums.Result.Result':
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_NOT_PERMITTED_KHR'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR'
--
-- == Issues
--
-- 1) Can we additionally query whether a caller is permitted to acquire a
-- specific global queue priority in this extension?
--
-- __RESOLVED__: No. Whether a caller has enough privilege goes with the
-- OS, and the Vulkan driver cannot really guarantee that the privilege
-- will not change in between this query and the actual queue creation
-- call.
--
-- 2) If more than 1 queue using global priority is requested, is there a
-- good way to know which queue is failing the device creation?
--
-- __RESOLVED__: No. There is not a good way at this moment, and it is also
-- not quite actionable for the applications to know that because the
-- information may not be accurate. Queue creation can fail because of
-- runtime constraints like insufficient privilege or lack of resource, and
-- the failure is not necessarily tied to that particular queue
-- configuration requested.
--
-- == Version History
--
-- -   Revision 1, 2021-10-22 (Tobias Hector)
--
--     -   Initial draft
--
-- == See Also
--
-- 'Vulkan.Core10.APIConstants.MAX_GLOBAL_PRIORITY_SIZE_KHR',
-- 'DeviceQueueGlobalPriorityCreateInfoKHR',
-- 'PhysicalDeviceGlobalPriorityQueryFeaturesKHR',
-- 'QueueFamilyGlobalPriorityPropertiesKHR', 'QueueGlobalPriorityKHR'
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#VK_KHR_global_priority Vulkan Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
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)
-- No documentation found for TopLevel "VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT"
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


-- No documentation found for TopLevel "VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT"
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


-- No documentation found for TopLevel "VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT"
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


-- No documentation found for TopLevel "VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT"
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


-- | VkDeviceQueueGlobalPriorityCreateInfoKHR - Specify a system wide
-- priority
--
-- = Description
--
-- Queues created without specifying
-- 'DeviceQueueGlobalPriorityCreateInfoKHR' will default to
-- 'QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR'.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_global_priority VK_EXT_global_priority>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_global_priority VK_KHR_global_priority>,
-- 'QueueGlobalPriorityKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data DeviceQueueGlobalPriorityCreateInfoKHR = DeviceQueueGlobalPriorityCreateInfoKHR
  { -- | @globalPriority@ is the system-wide priority associated to these queues
    -- as specified by
    -- 'Vulkan.Extensions.VK_EXT_global_priority.QueueGlobalPriorityEXT'
    --
    -- #VUID-VkDeviceQueueGlobalPriorityCreateInfoKHR-globalPriority-parameter#
    -- @globalPriority@ /must/ be a valid 'QueueGlobalPriorityKHR' value
    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


-- | VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR - Structure describing
-- whether global priority query can be supported by an implementation
--
-- = Members
--
-- This structure describes the following feature:
--
-- = Description
--
-- If the 'PhysicalDeviceGlobalPriorityQueryFeaturesKHR' structure is
-- included in the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.PhysicalDeviceFeatures2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceFeatures2',
-- it is filled in to indicate whether each corresponding feature is
-- supported. 'PhysicalDeviceGlobalPriorityQueryFeaturesKHR' /can/ also be
-- used in the @pNext@ chain of 'Vulkan.Core10.Device.DeviceCreateInfo' to
-- selectively enable these features.
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_global_priority VK_KHR_global_priority>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data PhysicalDeviceGlobalPriorityQueryFeaturesKHR = PhysicalDeviceGlobalPriorityQueryFeaturesKHR
  { -- | #features-globalPriorityQuery# @globalPriorityQuery@ indicates whether
    -- the implementation supports the ability to query global queue
    -- priorities.
    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


-- | VkQueueFamilyGlobalPriorityPropertiesKHR - Return structure for queue
-- family global priority information query
--
-- = Description
--
-- If the 'QueueFamilyGlobalPriorityPropertiesKHR' structure is included in
-- the @pNext@ chain of the
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.QueueFamilyProperties2'
-- structure passed to
-- 'Vulkan.Core11.Promoted_From_VK_KHR_get_physical_device_properties2.getPhysicalDeviceQueueFamilyProperties2',
-- it is filled in with the list of supported global queue priorities for
-- the indicated family.
--
-- The valid elements of @priorities@ /must/ not contain any duplicate
-- values.
--
-- The valid elements of @priorities@ /must/ be a continuous sequence of
-- 'QueueGlobalPriorityKHR' enums in the ascending order.
--
-- Note
--
-- For example, returning @priorityCount@ as 3 with supported @priorities@
-- as 'QUEUE_GLOBAL_PRIORITY_LOW_KHR', 'QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR'
-- and 'QUEUE_GLOBAL_PRIORITY_REALTIME_KHR' is not allowed.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkQueueFamilyGlobalPriorityPropertiesKHR-sType-sType# @sType@
--     /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR'
--
-- -   #VUID-VkQueueFamilyGlobalPriorityPropertiesKHR-priorities-parameter#
--     Each element of @priorities@ /must/ be a valid
--     'QueueGlobalPriorityKHR' value
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_global_priority VK_KHR_global_priority>,
-- 'QueueGlobalPriorityKHR',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data QueueFamilyGlobalPriorityPropertiesKHR = QueueFamilyGlobalPriorityPropertiesKHR
  { -- | @priorityCount@ is the number of supported global queue priorities in
    -- this queue family, and it /must/ be greater than 0.
    QueueFamilyGlobalPriorityPropertiesKHR -> Word32
priorityCount :: Word32
  , -- | @priorities@ is an array of
    -- 'Vulkan.Core10.APIConstants.MAX_GLOBAL_PRIORITY_SIZE_EXT'
    -- 'Vulkan.Extensions.VK_EXT_global_priority.QueueGlobalPriorityEXT' enums
    -- representing all supported global queue priorities in this queue family.
    -- The first @priorityCount@ elements of the array will be valid.
    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


-- | VkQueueGlobalPriorityKHR - Values specifying a system-wide queue
-- priority
--
-- = Description
--
-- Priority values are sorted in ascending order. A comparison operation on
-- the enum values can be used to determine the priority order.
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_global_priority VK_EXT_global_priority>,
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_KHR_global_priority VK_KHR_global_priority>,
-- 'DeviceQueueGlobalPriorityCreateInfoKHR',
-- 'QueueFamilyGlobalPriorityPropertiesKHR'
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)

-- Note that the zero instance does not produce a valid value, passing 'zero' to Vulkan will result in an error

-- | 'QUEUE_GLOBAL_PRIORITY_LOW_KHR' is below the system default. Useful for
-- non-interactive tasks.
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

-- | 'QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR' is the system default priority.
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

-- | 'QUEUE_GLOBAL_PRIORITY_HIGH_KHR' is above the system default.
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

-- | 'QUEUE_GLOBAL_PRIORITY_REALTIME_KHR' is the highest priority. Useful for
-- critical tasks.
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

-- No documentation found for TopLevel "VK_KHR_GLOBAL_PRIORITY_SPEC_VERSION"
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"

-- No documentation found for TopLevel "VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME"
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"