{-# language CPP #-}
-- | = Name
--
-- XR_KHR_vulkan_enable - instance extension
--
-- = Specification
--
-- See
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_KHR_vulkan_enable  XR_KHR_vulkan_enable>
-- in the main specification for complete information.
--
-- = Registered Extension Number
--
-- 26
--
-- = Revision
--
-- 7
--
-- = Extension and Version Dependencies
--
-- -   Requires OpenXR 1.0
--
-- = See Also
--
-- 'GraphicsBindingVulkanKHR', 'GraphicsRequirementsVulkanKHR',
-- 'SwapchainImageVulkanKHR', 'getVulkanDeviceExtensionsKHR',
-- 'getVulkanGraphicsDeviceKHR', 'getVulkanGraphicsRequirementsKHR',
-- 'getVulkanInstanceExtensionsKHR'
--
-- = Document Notes
--
-- For more information, see the
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XR_KHR_vulkan_enable OpenXR Specification>
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module OpenXR.Extensions.XR_KHR_vulkan_enable  ( getVulkanInstanceExtensionsKHR
                                               , getVulkanDeviceExtensionsKHR
                                               , getVulkanGraphicsDeviceKHR
                                               , getVulkanGraphicsRequirementsKHR
                                               , GraphicsBindingVulkanKHR(..)
                                               , SwapchainImageVulkanKHR(..)
                                               , GraphicsRequirementsVulkanKHR(..)
                                               , KHR_vulkan_enable_SPEC_VERSION
                                               , pattern KHR_vulkan_enable_SPEC_VERSION
                                               , KHR_VULKAN_ENABLE_EXTENSION_NAME
                                               , pattern KHR_VULKAN_ENABLE_EXTENSION_NAME
                                               ) where

import OpenXR.Internal.Utils (traceAroundEvent)
import qualified OpenXR.VulkanTypes (Device_T)
import qualified OpenXR.VulkanTypes (Image)
import qualified OpenXR.VulkanTypes (Instance_T)
import qualified OpenXR.VulkanTypes (PhysicalDevice_T)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Foreign.Marshal.Alloc (allocaBytesAligned)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Data.ByteString (packCString)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
import Foreign.C.Types (CChar(..))
import OpenXR.CStruct (FromCStruct)
import OpenXR.CStruct (FromCStruct(..))
import OpenXR.CStruct (ToCStruct)
import OpenXR.CStruct (ToCStruct(..))
import OpenXR.Zero (Zero(..))
import Control.Monad.IO.Class (MonadIO)
import Data.String (IsString)
import Data.Typeable (Typeable)
import Foreign.C.Types (CChar)
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 Foreign.Ptr (FunPtr)
import Foreign.Ptr (Ptr)
import Data.Word (Word32)
import Data.ByteString (ByteString)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import OpenXR.NamedType ((:::))
import OpenXR.Core10.Handles (Instance)
import OpenXR.Core10.Handles (Instance(..))
import OpenXR.Dynamic (InstanceCmds(pXrGetVulkanDeviceExtensionsKHR))
import OpenXR.Dynamic (InstanceCmds(pXrGetVulkanGraphicsDeviceKHR))
import OpenXR.Dynamic (InstanceCmds(pXrGetVulkanGraphicsRequirementsKHR))
import OpenXR.Dynamic (InstanceCmds(pXrGetVulkanInstanceExtensionsKHR))
import OpenXR.Core10.Handles (Instance_T)
import OpenXR.Core10.Image (IsSwapchainImage(..))
import OpenXR.Exception (OpenXrException(..))
import OpenXR.Core10.Enums.Result (Result)
import OpenXR.Core10.Enums.Result (Result(..))
import OpenXR.Core10.Enums.StructureType (StructureType)
import OpenXR.Core10.Image (SwapchainImageBaseHeader(..))
import OpenXR.Core10.Device (SystemId)
import OpenXR.Core10.Device (SystemId(..))
import OpenXR.Version (Version)
import OpenXR.Core10.Enums.Result (Result(SUCCESS))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_GRAPHICS_BINDING_VULKAN_KHR))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHR))
import OpenXR.Core10.Enums.StructureType (StructureType(TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkXrGetVulkanInstanceExtensionsKHR
  :: FunPtr (Ptr Instance_T -> SystemId -> Word32 -> Ptr Word32 -> Ptr CChar -> IO Result) -> Ptr Instance_T -> SystemId -> Word32 -> Ptr Word32 -> Ptr CChar -> IO Result

-- | xrGetVulkanInstanceExtensionsKHR - Get list of required Vulkan instance
-- extensions for an OpenXR instance and system
--
-- == Parameter Descriptions
--
-- -   @instance@ is an 'OpenXR.Core10.Handles.Instance' handle previously
--     created with 'OpenXR.Core10.Instance.createInstance'.
--
-- -   @systemId@ is an
--     <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSystemId >
--     handle for the system which will be used to create a session.
--
-- -   @bufferCapacityInput@ is the capacity of the @buffer@, or 0 to
--     indicate a request to retrieve the required capacity.
--
-- -   @bufferCountOutput@ is a pointer to the count of characters written
--     (including terminating @\\0@), or a pointer to the required capacity
--     in the case that @bufferCapacityInput@ is 0.
--
-- -   @buffer@ is a pointer to an array of characters, but /can/ be @NULL@
--     if @bufferCapacityInput@ is 0. The format of the output is a single
--     space (ASCII @0x20@) delimited string of extension names.
--
-- -   See
--     <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#buffer-size-parameters Buffer Size Parameters>
--     chapter for a detailed description of retrieving the required
--     @buffer@ size.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-xrGetVulkanInstanceExtensionsKHR-extension-notenabled# The @@
--     extension /must/ be enabled prior to calling
--     'getVulkanInstanceExtensionsKHR'
--
-- -   #VUID-xrGetVulkanInstanceExtensionsKHR-instance-parameter#
--     @instance@ /must/ be a valid 'OpenXR.Core10.Handles.Instance' handle
--
-- -   #VUID-xrGetVulkanInstanceExtensionsKHR-bufferCountOutput-parameter#
--     @bufferCountOutput@ /must/ be a pointer to a @uint32_t@ value
--
-- -   #VUID-xrGetVulkanInstanceExtensionsKHR-buffer-parameter# If
--     @bufferCapacityInput@ is not @0@, @buffer@ /must/ be a pointer to an
--     array of @bufferCapacityInput@ null-terminated UTF-8 strings
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-successcodes Success>]
--
--     -   'OpenXR.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-errorcodes Failure>]
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_INSTANCE_LOST'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_RUNTIME_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_HANDLE_INVALID'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_SYSTEM_INVALID'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_VALIDATION_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_SIZE_INSUFFICIENT'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_FUNCTION_UNSUPPORTED'
--
-- = See Also
--
-- 'OpenXR.Core10.Handles.Instance',
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSystemId >,
-- 'getVulkanDeviceExtensionsKHR'
getVulkanInstanceExtensionsKHR :: forall io
                                . (MonadIO io)
                               => -- No documentation found for Nested "xrGetVulkanInstanceExtensionsKHR" "instance"
                                  Instance
                               -> -- No documentation found for Nested "xrGetVulkanInstanceExtensionsKHR" "systemId"
                                  SystemId
                               -> io (("buffer" ::: ByteString))
getVulkanInstanceExtensionsKHR :: Instance -> SystemId -> io ("buffer" ::: ByteString)
getVulkanInstanceExtensionsKHR instance' :: Instance
instance' systemId :: SystemId
systemId = IO ("buffer" ::: ByteString) -> io ("buffer" ::: ByteString)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ("buffer" ::: ByteString) -> io ("buffer" ::: ByteString))
-> (ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
    -> IO ("buffer" ::: ByteString))
-> ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
-> io ("buffer" ::: ByteString)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
-> IO ("buffer" ::: ByteString)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
 -> io ("buffer" ::: ByteString))
-> ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
-> io ("buffer" ::: ByteString)
forall a b. (a -> b) -> a -> b
$ do
  let xrGetVulkanInstanceExtensionsKHRPtr :: FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("bufferCapacityInput" ::: Word32)
   -> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
   -> ("buffer" ::: Ptr CChar)
   -> IO Result)
xrGetVulkanInstanceExtensionsKHRPtr = InstanceCmds
-> FunPtr
     (Ptr Instance_T
      -> SystemId
      -> ("bufferCapacityInput" ::: Word32)
      -> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
      -> ("buffer" ::: Ptr CChar)
      -> IO Result)
pXrGetVulkanInstanceExtensionsKHR (Instance -> InstanceCmds
instanceCmds (Instance
instance' :: Instance))
  IO () -> ContT ("buffer" ::: ByteString) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("buffer" ::: ByteString) IO ())
-> IO () -> ContT ("buffer" ::: ByteString) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("bufferCapacityInput" ::: Word32)
   -> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
   -> ("buffer" ::: Ptr CChar)
   -> IO Result)
xrGetVulkanInstanceExtensionsKHRPtr FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("bufferCapacityInput" ::: Word32)
   -> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
   -> ("buffer" ::: Ptr CChar)
   -> IO Result)
-> FunPtr
     (Ptr Instance_T
      -> SystemId
      -> ("bufferCapacityInput" ::: Word32)
      -> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
      -> ("buffer" ::: Ptr CChar)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("bufferCapacityInput" ::: Word32)
   -> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
   -> ("buffer" ::: Ptr CChar)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for xrGetVulkanInstanceExtensionsKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let xrGetVulkanInstanceExtensionsKHR' :: Ptr Instance_T
-> SystemId
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr CChar)
-> IO Result
xrGetVulkanInstanceExtensionsKHR' = FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("bufferCapacityInput" ::: Word32)
   -> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
   -> ("buffer" ::: Ptr CChar)
   -> IO Result)
-> Ptr Instance_T
-> SystemId
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr CChar)
-> IO Result
mkXrGetVulkanInstanceExtensionsKHR FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("bufferCapacityInput" ::: Word32)
   -> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
   -> ("buffer" ::: Ptr CChar)
   -> IO Result)
xrGetVulkanInstanceExtensionsKHRPtr
  let instance'' :: Ptr Instance_T
instance'' = Instance -> Ptr Instance_T
instanceHandle (Instance
instance')
  "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
pBufferCountOutput <- ((("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
  -> IO ("buffer" ::: ByteString))
 -> IO ("buffer" ::: ByteString))
-> ContT
     ("buffer" ::: ByteString)
     IO
     ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
   -> IO ("buffer" ::: ByteString))
  -> IO ("buffer" ::: ByteString))
 -> ContT
      ("buffer" ::: ByteString)
      IO
      ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)))
-> ((("bufferCountOutput"
      ::: Ptr ("bufferCapacityInput" ::: Word32))
     -> IO ("buffer" ::: ByteString))
    -> IO ("buffer" ::: ByteString))
-> ContT
     ("buffer" ::: ByteString)
     IO
     ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
forall a b. (a -> b) -> a -> b
$ IO ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> (("bufferCountOutput"
     ::: Ptr ("bufferCapacityInput" ::: Word32))
    -> IO ())
-> (("bufferCountOutput"
     ::: Ptr ("bufferCapacityInput" ::: Word32))
    -> IO ("buffer" ::: ByteString))
-> IO ("buffer" ::: ByteString)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int
-> IO
     ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
forall a. Int -> IO (Ptr a)
callocBytes @Word32 4) ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result -> ContT ("buffer" ::: ByteString) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT ("buffer" ::: ByteString) IO Result)
-> IO Result -> ContT ("buffer" ::: ByteString) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrGetVulkanInstanceExtensionsKHR" (Ptr Instance_T
-> SystemId
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr CChar)
-> IO Result
xrGetVulkanInstanceExtensionsKHR' Ptr Instance_T
instance'' (SystemId
systemId) (0) ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
pBufferCountOutput) ("buffer" ::: Ptr CChar
forall a. Ptr a
nullPtr))
  IO () -> ContT ("buffer" ::: ByteString) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("buffer" ::: ByteString) IO ())
-> IO () -> ContT ("buffer" ::: ByteString) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (OpenXrException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> OpenXrException
OpenXrException Result
r))
  "bufferCapacityInput" ::: Word32
bufferCountOutput <- IO ("bufferCapacityInput" ::: Word32)
-> ContT
     ("buffer" ::: ByteString) IO ("bufferCapacityInput" ::: Word32)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("bufferCapacityInput" ::: Word32)
 -> ContT
      ("buffer" ::: ByteString) IO ("bufferCapacityInput" ::: Word32))
-> IO ("bufferCapacityInput" ::: Word32)
-> ContT
     ("buffer" ::: ByteString) IO ("bufferCapacityInput" ::: Word32)
forall a b. (a -> b) -> a -> b
$ ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ("bufferCapacityInput" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
pBufferCountOutput
  "buffer" ::: Ptr CChar
pBuffer <- ((("buffer" ::: Ptr CChar) -> IO ("buffer" ::: ByteString))
 -> IO ("buffer" ::: ByteString))
-> ContT ("buffer" ::: ByteString) IO ("buffer" ::: Ptr CChar)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("buffer" ::: Ptr CChar) -> IO ("buffer" ::: ByteString))
  -> IO ("buffer" ::: ByteString))
 -> ContT ("buffer" ::: ByteString) IO ("buffer" ::: Ptr CChar))
-> ((("buffer" ::: Ptr CChar) -> IO ("buffer" ::: ByteString))
    -> IO ("buffer" ::: ByteString))
-> ContT ("buffer" ::: ByteString) IO ("buffer" ::: Ptr CChar)
forall a b. (a -> b) -> a -> b
$ IO ("buffer" ::: Ptr CChar)
-> (("buffer" ::: Ptr CChar) -> IO ())
-> (("buffer" ::: Ptr CChar) -> IO ("buffer" ::: ByteString))
-> IO ("buffer" ::: ByteString)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("buffer" ::: Ptr CChar)
forall a. Int -> IO (Ptr a)
callocBytes @CChar (("bufferCapacityInput" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral ("bufferCapacityInput" ::: Word32
bufferCountOutput))) ("buffer" ::: Ptr CChar) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r' <- IO Result -> ContT ("buffer" ::: ByteString) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT ("buffer" ::: ByteString) IO Result)
-> IO Result -> ContT ("buffer" ::: ByteString) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrGetVulkanInstanceExtensionsKHR" (Ptr Instance_T
-> SystemId
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr CChar)
-> IO Result
xrGetVulkanInstanceExtensionsKHR' Ptr Instance_T
instance'' (SystemId
systemId) (("bufferCapacityInput" ::: Word32
bufferCountOutput)) ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
pBufferCountOutput) ("buffer" ::: Ptr CChar
pBuffer))
  IO () -> ContT ("buffer" ::: ByteString) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("buffer" ::: ByteString) IO ())
-> IO () -> ContT ("buffer" ::: ByteString) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r' Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (OpenXrException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> OpenXrException
OpenXrException Result
r'))
  "buffer" ::: ByteString
buffer' <- IO ("buffer" ::: ByteString)
-> ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("buffer" ::: ByteString)
 -> ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString))
-> IO ("buffer" ::: ByteString)
-> ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
forall a b. (a -> b) -> a -> b
$ ("buffer" ::: Ptr CChar) -> IO ("buffer" ::: ByteString)
packCString "buffer" ::: Ptr CChar
pBuffer
  ("buffer" ::: ByteString)
-> ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("buffer" ::: ByteString)
 -> ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString))
-> ("buffer" ::: ByteString)
-> ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
forall a b. (a -> b) -> a -> b
$ ("buffer" ::: ByteString
buffer')


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkXrGetVulkanDeviceExtensionsKHR
  :: FunPtr (Ptr Instance_T -> SystemId -> Word32 -> Ptr Word32 -> Ptr CChar -> IO Result) -> Ptr Instance_T -> SystemId -> Word32 -> Ptr Word32 -> Ptr CChar -> IO Result

-- | xrGetVulkanDeviceExtensionsKHR - Get list of required Vulkan device
-- extensions for an OpenXR instance and system
--
-- == Parameter Descriptions
--
-- -   @instance@ is an 'OpenXR.Core10.Handles.Instance' handle previously
--     created with 'OpenXR.Core10.Instance.createInstance'.
--
-- -   @systemId@ is an
--     <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSystemId >
--     handle for the system which will be used to create a session.
--
-- -   @bufferCapacityInput@ is the capacity of the @buffer@, or 0 to
--     indicate a request to retrieve the required capacity.
--
-- -   @bufferCountOutput@ is a pointer to the count of characters written
--     (including terminating @\\0@), or a pointer to the required capacity
--     in the case that @bufferCapacityInput@ is 0.
--
-- -   @buffer@ is a pointer to an array of characters, but /can/ be @NULL@
--     if @bufferCapacityInput@ is 0. The format of the output is a single
--     space (ASCII @0x20@) delimited string of extension names.
--
-- -   See
--     <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#buffer-size-parameters Buffer Size Parameters>
--     chapter for a detailed description of retrieving the required
--     @buffer@ size.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-xrGetVulkanDeviceExtensionsKHR-extension-notenabled# The @@
--     extension /must/ be enabled prior to calling
--     'getVulkanDeviceExtensionsKHR'
--
-- -   #VUID-xrGetVulkanDeviceExtensionsKHR-instance-parameter# @instance@
--     /must/ be a valid 'OpenXR.Core10.Handles.Instance' handle
--
-- -   #VUID-xrGetVulkanDeviceExtensionsKHR-bufferCountOutput-parameter#
--     @bufferCountOutput@ /must/ be a pointer to a @uint32_t@ value
--
-- -   #VUID-xrGetVulkanDeviceExtensionsKHR-buffer-parameter# If
--     @bufferCapacityInput@ is not @0@, @buffer@ /must/ be a pointer to an
--     array of @bufferCapacityInput@ null-terminated UTF-8 strings
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-successcodes Success>]
--
--     -   'OpenXR.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-errorcodes Failure>]
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_INSTANCE_LOST'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_RUNTIME_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_HANDLE_INVALID'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_SYSTEM_INVALID'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_VALIDATION_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_SIZE_INSUFFICIENT'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_FUNCTION_UNSUPPORTED'
--
-- = See Also
--
-- 'OpenXR.Core10.Handles.Instance',
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSystemId >,
-- 'getVulkanInstanceExtensionsKHR'
getVulkanDeviceExtensionsKHR :: forall io
                              . (MonadIO io)
                             => -- No documentation found for Nested "xrGetVulkanDeviceExtensionsKHR" "instance"
                                Instance
                             -> -- No documentation found for Nested "xrGetVulkanDeviceExtensionsKHR" "systemId"
                                SystemId
                             -> io (("buffer" ::: ByteString))
getVulkanDeviceExtensionsKHR :: Instance -> SystemId -> io ("buffer" ::: ByteString)
getVulkanDeviceExtensionsKHR instance' :: Instance
instance' systemId :: SystemId
systemId = IO ("buffer" ::: ByteString) -> io ("buffer" ::: ByteString)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ("buffer" ::: ByteString) -> io ("buffer" ::: ByteString))
-> (ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
    -> IO ("buffer" ::: ByteString))
-> ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
-> io ("buffer" ::: ByteString)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
-> IO ("buffer" ::: ByteString)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
 -> io ("buffer" ::: ByteString))
-> ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
-> io ("buffer" ::: ByteString)
forall a b. (a -> b) -> a -> b
$ do
  let xrGetVulkanDeviceExtensionsKHRPtr :: FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("bufferCapacityInput" ::: Word32)
   -> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
   -> ("buffer" ::: Ptr CChar)
   -> IO Result)
xrGetVulkanDeviceExtensionsKHRPtr = InstanceCmds
-> FunPtr
     (Ptr Instance_T
      -> SystemId
      -> ("bufferCapacityInput" ::: Word32)
      -> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
      -> ("buffer" ::: Ptr CChar)
      -> IO Result)
pXrGetVulkanDeviceExtensionsKHR (Instance -> InstanceCmds
instanceCmds (Instance
instance' :: Instance))
  IO () -> ContT ("buffer" ::: ByteString) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("buffer" ::: ByteString) IO ())
-> IO () -> ContT ("buffer" ::: ByteString) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("bufferCapacityInput" ::: Word32)
   -> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
   -> ("buffer" ::: Ptr CChar)
   -> IO Result)
xrGetVulkanDeviceExtensionsKHRPtr FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("bufferCapacityInput" ::: Word32)
   -> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
   -> ("buffer" ::: Ptr CChar)
   -> IO Result)
-> FunPtr
     (Ptr Instance_T
      -> SystemId
      -> ("bufferCapacityInput" ::: Word32)
      -> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
      -> ("buffer" ::: Ptr CChar)
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("bufferCapacityInput" ::: Word32)
   -> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
   -> ("buffer" ::: Ptr CChar)
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for xrGetVulkanDeviceExtensionsKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let xrGetVulkanDeviceExtensionsKHR' :: Ptr Instance_T
-> SystemId
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr CChar)
-> IO Result
xrGetVulkanDeviceExtensionsKHR' = FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("bufferCapacityInput" ::: Word32)
   -> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
   -> ("buffer" ::: Ptr CChar)
   -> IO Result)
-> Ptr Instance_T
-> SystemId
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr CChar)
-> IO Result
mkXrGetVulkanDeviceExtensionsKHR FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("bufferCapacityInput" ::: Word32)
   -> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
   -> ("buffer" ::: Ptr CChar)
   -> IO Result)
xrGetVulkanDeviceExtensionsKHRPtr
  let instance'' :: Ptr Instance_T
instance'' = Instance -> Ptr Instance_T
instanceHandle (Instance
instance')
  "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
pBufferCountOutput <- ((("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
  -> IO ("buffer" ::: ByteString))
 -> IO ("buffer" ::: ByteString))
-> ContT
     ("buffer" ::: ByteString)
     IO
     ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
   -> IO ("buffer" ::: ByteString))
  -> IO ("buffer" ::: ByteString))
 -> ContT
      ("buffer" ::: ByteString)
      IO
      ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)))
-> ((("bufferCountOutput"
      ::: Ptr ("bufferCapacityInput" ::: Word32))
     -> IO ("buffer" ::: ByteString))
    -> IO ("buffer" ::: ByteString))
-> ContT
     ("buffer" ::: ByteString)
     IO
     ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
forall a b. (a -> b) -> a -> b
$ IO ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> (("bufferCountOutput"
     ::: Ptr ("bufferCapacityInput" ::: Word32))
    -> IO ())
-> (("bufferCountOutput"
     ::: Ptr ("bufferCapacityInput" ::: Word32))
    -> IO ("buffer" ::: ByteString))
-> IO ("buffer" ::: ByteString)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int
-> IO
     ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
forall a. Int -> IO (Ptr a)
callocBytes @Word32 4) ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result -> ContT ("buffer" ::: ByteString) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT ("buffer" ::: ByteString) IO Result)
-> IO Result -> ContT ("buffer" ::: ByteString) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrGetVulkanDeviceExtensionsKHR" (Ptr Instance_T
-> SystemId
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr CChar)
-> IO Result
xrGetVulkanDeviceExtensionsKHR' Ptr Instance_T
instance'' (SystemId
systemId) (0) ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
pBufferCountOutput) ("buffer" ::: Ptr CChar
forall a. Ptr a
nullPtr))
  IO () -> ContT ("buffer" ::: ByteString) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("buffer" ::: ByteString) IO ())
-> IO () -> ContT ("buffer" ::: ByteString) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (OpenXrException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> OpenXrException
OpenXrException Result
r))
  "bufferCapacityInput" ::: Word32
bufferCountOutput <- IO ("bufferCapacityInput" ::: Word32)
-> ContT
     ("buffer" ::: ByteString) IO ("bufferCapacityInput" ::: Word32)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("bufferCapacityInput" ::: Word32)
 -> ContT
      ("buffer" ::: ByteString) IO ("bufferCapacityInput" ::: Word32))
-> IO ("bufferCapacityInput" ::: Word32)
-> ContT
     ("buffer" ::: ByteString) IO ("bufferCapacityInput" ::: Word32)
forall a b. (a -> b) -> a -> b
$ ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ("bufferCapacityInput" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
pBufferCountOutput
  "buffer" ::: Ptr CChar
pBuffer <- ((("buffer" ::: Ptr CChar) -> IO ("buffer" ::: ByteString))
 -> IO ("buffer" ::: ByteString))
-> ContT ("buffer" ::: ByteString) IO ("buffer" ::: Ptr CChar)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("buffer" ::: Ptr CChar) -> IO ("buffer" ::: ByteString))
  -> IO ("buffer" ::: ByteString))
 -> ContT ("buffer" ::: ByteString) IO ("buffer" ::: Ptr CChar))
-> ((("buffer" ::: Ptr CChar) -> IO ("buffer" ::: ByteString))
    -> IO ("buffer" ::: ByteString))
-> ContT ("buffer" ::: ByteString) IO ("buffer" ::: Ptr CChar)
forall a b. (a -> b) -> a -> b
$ IO ("buffer" ::: Ptr CChar)
-> (("buffer" ::: Ptr CChar) -> IO ())
-> (("buffer" ::: Ptr CChar) -> IO ("buffer" ::: ByteString))
-> IO ("buffer" ::: ByteString)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int -> IO ("buffer" ::: Ptr CChar)
forall a. Int -> IO (Ptr a)
callocBytes @CChar (("bufferCapacityInput" ::: Word32) -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral ("bufferCapacityInput" ::: Word32
bufferCountOutput))) ("buffer" ::: Ptr CChar) -> IO ()
forall a. Ptr a -> IO ()
free
  Result
r' <- IO Result -> ContT ("buffer" ::: ByteString) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT ("buffer" ::: ByteString) IO Result)
-> IO Result -> ContT ("buffer" ::: ByteString) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrGetVulkanDeviceExtensionsKHR" (Ptr Instance_T
-> SystemId
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("buffer" ::: Ptr CChar)
-> IO Result
xrGetVulkanDeviceExtensionsKHR' Ptr Instance_T
instance'' (SystemId
systemId) (("bufferCapacityInput" ::: Word32
bufferCountOutput)) ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
pBufferCountOutput) ("buffer" ::: Ptr CChar
pBuffer))
  IO () -> ContT ("buffer" ::: ByteString) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT ("buffer" ::: ByteString) IO ())
-> IO () -> ContT ("buffer" ::: ByteString) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r' Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (OpenXrException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> OpenXrException
OpenXrException Result
r'))
  "buffer" ::: ByteString
buffer' <- IO ("buffer" ::: ByteString)
-> ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("buffer" ::: ByteString)
 -> ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString))
-> IO ("buffer" ::: ByteString)
-> ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
forall a b. (a -> b) -> a -> b
$ ("buffer" ::: Ptr CChar) -> IO ("buffer" ::: ByteString)
packCString "buffer" ::: Ptr CChar
pBuffer
  ("buffer" ::: ByteString)
-> ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("buffer" ::: ByteString)
 -> ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString))
-> ("buffer" ::: ByteString)
-> ContT ("buffer" ::: ByteString) IO ("buffer" ::: ByteString)
forall a b. (a -> b) -> a -> b
$ ("buffer" ::: ByteString
buffer')


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkXrGetVulkanGraphicsDeviceKHR
  :: FunPtr (Ptr Instance_T -> SystemId -> Ptr OpenXR.VulkanTypes.Instance_T -> Ptr (Ptr OpenXR.VulkanTypes.PhysicalDevice_T) -> IO Result) -> Ptr Instance_T -> SystemId -> Ptr OpenXR.VulkanTypes.Instance_T -> Ptr (Ptr OpenXR.VulkanTypes.PhysicalDevice_T) -> IO Result

-- | xrGetVulkanGraphicsDeviceKHR - Retrieve the Vulkan physical device
-- associated with an OpenXR instance and system
--
-- == Parameter Descriptions
--
-- = Description
--
-- 'getVulkanGraphicsDeviceKHR' function identifies to the application what
-- graphics device (Vulkan @VkPhysicalDevice@) needs to be used.
-- 'getVulkanGraphicsDeviceKHR' /must/ be called prior to calling
-- 'OpenXR.Core10.Device.createSession', and the @VkPhysicalDevice@ that
-- 'getVulkanGraphicsDeviceKHR' returns should be passed to
-- 'OpenXR.Core10.Device.createSession' in the 'GraphicsBindingVulkanKHR'.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-xrGetVulkanGraphicsDeviceKHR-extension-notenabled# The @@
--     extension /must/ be enabled prior to calling
--     'getVulkanGraphicsDeviceKHR'
--
-- -   #VUID-xrGetVulkanGraphicsDeviceKHR-instance-parameter# @instance@
--     /must/ be a valid 'OpenXR.Core10.Handles.Instance' handle
--
-- -   #VUID-xrGetVulkanGraphicsDeviceKHR-vkInstance-parameter#
--     @vkInstance@ /must/ be a valid @VkInstance@ value
--
-- -   #VUID-xrGetVulkanGraphicsDeviceKHR-vkPhysicalDevice-parameter#
--     @vkPhysicalDevice@ /must/ be a pointer to a @VkPhysicalDevice@ value
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-successcodes Success>]
--
--     -   'OpenXR.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-errorcodes Failure>]
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_HANDLE_INVALID'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_INSTANCE_LOST'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_RUNTIME_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_SYSTEM_INVALID'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_VALIDATION_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_FUNCTION_UNSUPPORTED'
--
-- = See Also
--
-- 'OpenXR.Core10.Handles.Instance',
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSystemId >
getVulkanGraphicsDeviceKHR :: forall io
                            . (MonadIO io)
                           => -- | @instance@ is an 'OpenXR.Core10.Handles.Instance' handle previously
                              -- created with 'OpenXR.Core10.Instance.createInstance'.
                              Instance
                           -> -- | @systemId@ is an
                              -- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSystemId >
                              -- handle for the system which will be used to create a session.
                              SystemId
                           -> -- | @vkInstance@ is a valid Vulkan @VkInstance@.
                              ("vkInstance" ::: Ptr OpenXR.VulkanTypes.Instance_T)
                           -> io (("vkPhysicalDevice" ::: Ptr OpenXR.VulkanTypes.PhysicalDevice_T))
getVulkanGraphicsDeviceKHR :: Instance
-> SystemId
-> ("vkInstance" ::: Ptr Instance_T)
-> io ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
getVulkanGraphicsDeviceKHR instance' :: Instance
instance' systemId :: SystemId
systemId vkInstance :: "vkInstance" ::: Ptr Instance_T
vkInstance = IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
-> io ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
 -> io ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> (ContT
      ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
      IO
      ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
    -> IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> ContT
     ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
     IO
     ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
-> io ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
  IO
  ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
-> IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
   IO
   ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
 -> io ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> ContT
     ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
     IO
     ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
-> io ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
forall a b. (a -> b) -> a -> b
$ do
  let xrGetVulkanGraphicsDeviceKHRPtr :: FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("vkInstance" ::: Ptr Instance_T)
   -> ("vkPhysicalDevice"
       ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
   -> IO Result)
xrGetVulkanGraphicsDeviceKHRPtr = InstanceCmds
-> FunPtr
     (Ptr Instance_T
      -> SystemId
      -> ("vkInstance" ::: Ptr Instance_T)
      -> ("vkPhysicalDevice"
          ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
      -> IO Result)
pXrGetVulkanGraphicsDeviceKHR (Instance -> InstanceCmds
instanceCmds (Instance
instance' :: Instance))
  IO () -> ContT ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T) IO ())
-> IO ()
-> ContT ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("vkInstance" ::: Ptr Instance_T)
   -> ("vkPhysicalDevice"
       ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
   -> IO Result)
xrGetVulkanGraphicsDeviceKHRPtr FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("vkInstance" ::: Ptr Instance_T)
   -> ("vkPhysicalDevice"
       ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
   -> IO Result)
-> FunPtr
     (Ptr Instance_T
      -> SystemId
      -> ("vkInstance" ::: Ptr Instance_T)
      -> ("vkPhysicalDevice"
          ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("vkInstance" ::: Ptr Instance_T)
   -> ("vkPhysicalDevice"
       ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for xrGetVulkanGraphicsDeviceKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let xrGetVulkanGraphicsDeviceKHR' :: Ptr Instance_T
-> SystemId
-> ("vkInstance" ::: Ptr Instance_T)
-> ("vkPhysicalDevice"
    ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> IO Result
xrGetVulkanGraphicsDeviceKHR' = FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("vkInstance" ::: Ptr Instance_T)
   -> ("vkPhysicalDevice"
       ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
   -> IO Result)
-> Ptr Instance_T
-> SystemId
-> ("vkInstance" ::: Ptr Instance_T)
-> ("vkPhysicalDevice"
    ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> IO Result
mkXrGetVulkanGraphicsDeviceKHR FunPtr
  (Ptr Instance_T
   -> SystemId
   -> ("vkInstance" ::: Ptr Instance_T)
   -> ("vkPhysicalDevice"
       ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
   -> IO Result)
xrGetVulkanGraphicsDeviceKHRPtr
  "vkPhysicalDevice"
::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
pVkPhysicalDevice <- ((("vkPhysicalDevice"
   ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
  -> IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
 -> IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> ContT
     ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
     IO
     ("vkPhysicalDevice"
      ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((("vkPhysicalDevice"
    ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
   -> IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
  -> IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
 -> ContT
      ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
      IO
      ("vkPhysicalDevice"
       ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)))
-> ((("vkPhysicalDevice"
      ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
     -> IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
    -> IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> ContT
     ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
     IO
     ("vkPhysicalDevice"
      ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
forall a b. (a -> b) -> a -> b
$ IO
  ("vkPhysicalDevice"
   ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> (("vkPhysicalDevice"
     ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
    -> IO ())
-> (("vkPhysicalDevice"
     ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
    -> IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
forall a b c. IO a -> (a -> IO b) -> (a -> IO c) -> IO c
bracket (Int
-> IO
     ("vkPhysicalDevice"
      ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
forall a. Int -> IO (Ptr a)
callocBytes @(Ptr OpenXR.VulkanTypes.PhysicalDevice_T) 8) ("vkPhysicalDevice"
 ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> IO ()
forall a. Ptr a -> IO ()
free
  Result
r <- IO Result
-> ContT ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T) IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result
 -> ContT ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T) IO Result)
-> IO Result
-> ContT ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T) IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrGetVulkanGraphicsDeviceKHR" (Ptr Instance_T
-> SystemId
-> ("vkInstance" ::: Ptr Instance_T)
-> ("vkPhysicalDevice"
    ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> IO Result
xrGetVulkanGraphicsDeviceKHR' (Instance -> Ptr Instance_T
instanceHandle (Instance
instance')) (SystemId
systemId) ("vkInstance" ::: Ptr Instance_T
vkInstance) ("vkPhysicalDevice"
::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
pVkPhysicalDevice))
  IO () -> ContT ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T) IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ()
 -> ContT ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T) IO ())
-> IO ()
-> ContT ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T) IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (OpenXrException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> OpenXrException
OpenXrException Result
r))
  "vkPhysicalDevice" ::: Ptr PhysicalDevice_T
vkPhysicalDevice <- IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
-> ContT
     ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
     IO
     ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
 -> ContT
      ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
      IO
      ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
-> ContT
     ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
     IO
     ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
forall a b. (a -> b) -> a -> b
$ ("vkPhysicalDevice"
 ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr OpenXR.VulkanTypes.PhysicalDevice_T) "vkPhysicalDevice"
::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
pVkPhysicalDevice
  ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
-> ContT
     ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
     IO
     ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
forall (f :: * -> *) a. Applicative f => a -> f a
pure (("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
 -> ContT
      ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
      IO
      ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
-> ContT
     ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
     IO
     ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
forall a b. (a -> b) -> a -> b
$ ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T
vkPhysicalDevice)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkXrGetVulkanGraphicsRequirementsKHR
  :: FunPtr (Ptr Instance_T -> SystemId -> Ptr GraphicsRequirementsVulkanKHR -> IO Result) -> Ptr Instance_T -> SystemId -> Ptr GraphicsRequirementsVulkanKHR -> IO Result

-- | xrGetVulkanGraphicsRequirementsKHR - Retrieve the Vulkan version
-- requirements for an instance and system
--
-- == Parameter Descriptions
--
-- = Description
--
-- The 'getVulkanGraphicsRequirementsKHR' function identifies to the
-- application the minimum Vulkan version requirement and the highest known
-- tested Vulkan version. The runtime /must/ return
-- 'OpenXR.Core10.Enums.Result.ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING'
-- ('OpenXR.Core10.Enums.Result.ERROR_VALIDATION_FAILURE' /may/ be returned
-- due to legacy behavior) on calls to 'OpenXR.Core10.Device.createSession'
-- if 'getVulkanGraphicsRequirementsKHR' has not been called for the same
-- @instance@ and @systemId@.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-xrGetVulkanGraphicsRequirementsKHR-extension-notenabled# The
--     @@ extension /must/ be enabled prior to calling
--     'getVulkanGraphicsRequirementsKHR'
--
-- -   #VUID-xrGetVulkanGraphicsRequirementsKHR-instance-parameter#
--     @instance@ /must/ be a valid 'OpenXR.Core10.Handles.Instance' handle
--
-- -   #VUID-xrGetVulkanGraphicsRequirementsKHR-graphicsRequirements-parameter#
--     @graphicsRequirements@ /must/ be a pointer to an
--     'GraphicsRequirementsVulkanKHR' structure
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-successcodes Success>]
--
--     -   'OpenXR.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#fundamentals-errorcodes Failure>]
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_HANDLE_INVALID'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_INSTANCE_LOST'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_RUNTIME_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_SYSTEM_INVALID'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_VALIDATION_FAILURE'
--
--     -   'OpenXR.Core10.Enums.Result.ERROR_FUNCTION_UNSUPPORTED'
--
-- = See Also
--
-- 'GraphicsRequirementsVulkanKHR', 'OpenXR.Core10.Handles.Instance',
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSystemId >
getVulkanGraphicsRequirementsKHR :: forall io
                                  . (MonadIO io)
                                 => -- | @instance@ is an 'OpenXR.Core10.Handles.Instance' handle previously
                                    -- created with 'OpenXR.Core10.Instance.createInstance'.
                                    Instance
                                 -> -- | @systemId@ is an
                                    -- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrSystemId >
                                    -- handle for the system which will be used to create a session.
                                    SystemId
                                 -> io (GraphicsRequirementsVulkanKHR)
getVulkanGraphicsRequirementsKHR :: Instance -> SystemId -> io GraphicsRequirementsVulkanKHR
getVulkanGraphicsRequirementsKHR instance' :: Instance
instance' systemId :: SystemId
systemId = IO GraphicsRequirementsVulkanKHR
-> io GraphicsRequirementsVulkanKHR
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GraphicsRequirementsVulkanKHR
 -> io GraphicsRequirementsVulkanKHR)
-> (ContT
      GraphicsRequirementsVulkanKHR IO GraphicsRequirementsVulkanKHR
    -> IO GraphicsRequirementsVulkanKHR)
-> ContT
     GraphicsRequirementsVulkanKHR IO GraphicsRequirementsVulkanKHR
-> io GraphicsRequirementsVulkanKHR
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT
  GraphicsRequirementsVulkanKHR IO GraphicsRequirementsVulkanKHR
-> IO GraphicsRequirementsVulkanKHR
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT
   GraphicsRequirementsVulkanKHR IO GraphicsRequirementsVulkanKHR
 -> io GraphicsRequirementsVulkanKHR)
-> ContT
     GraphicsRequirementsVulkanKHR IO GraphicsRequirementsVulkanKHR
-> io GraphicsRequirementsVulkanKHR
forall a b. (a -> b) -> a -> b
$ do
  let xrGetVulkanGraphicsRequirementsKHRPtr :: FunPtr
  (Ptr Instance_T
   -> SystemId -> Ptr GraphicsRequirementsVulkanKHR -> IO Result)
xrGetVulkanGraphicsRequirementsKHRPtr = InstanceCmds
-> FunPtr
     (Ptr Instance_T
      -> SystemId -> Ptr GraphicsRequirementsVulkanKHR -> IO Result)
pXrGetVulkanGraphicsRequirementsKHR (Instance -> InstanceCmds
instanceCmds (Instance
instance' :: Instance))
  IO () -> ContT GraphicsRequirementsVulkanKHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT GraphicsRequirementsVulkanKHR IO ())
-> IO () -> ContT GraphicsRequirementsVulkanKHR IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Instance_T
   -> SystemId -> Ptr GraphicsRequirementsVulkanKHR -> IO Result)
xrGetVulkanGraphicsRequirementsKHRPtr FunPtr
  (Ptr Instance_T
   -> SystemId -> Ptr GraphicsRequirementsVulkanKHR -> IO Result)
-> FunPtr
     (Ptr Instance_T
      -> SystemId -> Ptr GraphicsRequirementsVulkanKHR -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Instance_T
   -> SystemId -> Ptr GraphicsRequirementsVulkanKHR -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (IOException -> IO ()) -> IOException -> IO ()
forall a b. (a -> b) -> a -> b
$ Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOException
IOError Maybe Handle
forall a. Maybe a
Nothing IOErrorType
InvalidArgument "" "The function pointer for xrGetVulkanGraphicsRequirementsKHR is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let xrGetVulkanGraphicsRequirementsKHR' :: Ptr Instance_T
-> SystemId -> Ptr GraphicsRequirementsVulkanKHR -> IO Result
xrGetVulkanGraphicsRequirementsKHR' = FunPtr
  (Ptr Instance_T
   -> SystemId -> Ptr GraphicsRequirementsVulkanKHR -> IO Result)
-> Ptr Instance_T
-> SystemId
-> Ptr GraphicsRequirementsVulkanKHR
-> IO Result
mkXrGetVulkanGraphicsRequirementsKHR FunPtr
  (Ptr Instance_T
   -> SystemId -> Ptr GraphicsRequirementsVulkanKHR -> IO Result)
xrGetVulkanGraphicsRequirementsKHRPtr
  Ptr GraphicsRequirementsVulkanKHR
pGraphicsRequirements <- ((Ptr GraphicsRequirementsVulkanKHR
  -> IO GraphicsRequirementsVulkanKHR)
 -> IO GraphicsRequirementsVulkanKHR)
-> ContT
     GraphicsRequirementsVulkanKHR
     IO
     (Ptr GraphicsRequirementsVulkanKHR)
forall k (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (forall b.
ToCStruct GraphicsRequirementsVulkanKHR =>
(Ptr GraphicsRequirementsVulkanKHR -> IO b) -> IO b
forall a b. ToCStruct a => (Ptr a -> IO b) -> IO b
withZeroCStruct @GraphicsRequirementsVulkanKHR)
  Result
r <- IO Result -> ContT GraphicsRequirementsVulkanKHR IO Result
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO Result -> ContT GraphicsRequirementsVulkanKHR IO Result)
-> IO Result -> ContT GraphicsRequirementsVulkanKHR IO Result
forall a b. (a -> b) -> a -> b
$ String -> IO Result -> IO Result
forall a. String -> IO a -> IO a
traceAroundEvent "xrGetVulkanGraphicsRequirementsKHR" (Ptr Instance_T
-> SystemId -> Ptr GraphicsRequirementsVulkanKHR -> IO Result
xrGetVulkanGraphicsRequirementsKHR' (Instance -> Ptr Instance_T
instanceHandle (Instance
instance')) (SystemId
systemId) (Ptr GraphicsRequirementsVulkanKHR
pGraphicsRequirements))
  IO () -> ContT GraphicsRequirementsVulkanKHR IO ()
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT GraphicsRequirementsVulkanKHR IO ())
-> IO () -> ContT GraphicsRequirementsVulkanKHR IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
when (Result
r Result -> Result -> Bool
forall a. Ord a => a -> a -> Bool
< Result
SUCCESS) (OpenXrException -> IO ()
forall e a. Exception e => e -> IO a
throwIO (Result -> OpenXrException
OpenXrException Result
r))
  GraphicsRequirementsVulkanKHR
graphicsRequirements <- IO GraphicsRequirementsVulkanKHR
-> ContT
     GraphicsRequirementsVulkanKHR IO GraphicsRequirementsVulkanKHR
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO GraphicsRequirementsVulkanKHR
 -> ContT
      GraphicsRequirementsVulkanKHR IO GraphicsRequirementsVulkanKHR)
-> IO GraphicsRequirementsVulkanKHR
-> ContT
     GraphicsRequirementsVulkanKHR IO GraphicsRequirementsVulkanKHR
forall a b. (a -> b) -> a -> b
$ Ptr GraphicsRequirementsVulkanKHR
-> IO GraphicsRequirementsVulkanKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct @GraphicsRequirementsVulkanKHR Ptr GraphicsRequirementsVulkanKHR
pGraphicsRequirements
  GraphicsRequirementsVulkanKHR
-> ContT
     GraphicsRequirementsVulkanKHR IO GraphicsRequirementsVulkanKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GraphicsRequirementsVulkanKHR
 -> ContT
      GraphicsRequirementsVulkanKHR IO GraphicsRequirementsVulkanKHR)
-> GraphicsRequirementsVulkanKHR
-> ContT
     GraphicsRequirementsVulkanKHR IO GraphicsRequirementsVulkanKHR
forall a b. (a -> b) -> a -> b
$ (GraphicsRequirementsVulkanKHR
graphicsRequirements)


-- | XrGraphicsBindingVulkanKHR - The graphics binding structure to be passed
-- at session creation to use Vulkan
--
-- == Member Descriptions
--
-- = Description
--
-- When creating a Vulkan-backed 'OpenXR.Core10.Handles.Session', the
-- application will provide a pointer to an 'GraphicsBindingVulkanKHR' in
-- the @next@ chain of the 'OpenXR.Core10.Device.SessionCreateInfo'.
--
-- == Valid Usage
--
-- -   @instance@ /must/ have enabled a Vulkan API version in the range
--     specified by 'GraphicsBindingVulkanKHR'
--
-- -   @instance@ /must/ have enabled all the instance extensions specified
--     by 'getVulkanInstanceExtensionsKHR'
--
-- -   @physicalDevice@ @VkPhysicalDevice@ /must/ match the device
--     specified by 'getVulkanGraphicsDeviceKHR'
--
-- -   @device@ /must/ have enabled all the device extensions specified by
--     'getVulkanDeviceExtensionsKHR'
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrGraphicsBindingVulkanKHR-extension-notenabled# The @@
--     extension /must/ be enabled prior to using
--     'GraphicsBindingVulkanKHR'
--
-- -   #VUID-XrGraphicsBindingVulkanKHR-type-type# @type@ /must/ be
--     'OpenXR.Core10.Enums.StructureType.TYPE_GRAPHICS_BINDING_VULKAN_KHR'
--
-- -   #VUID-XrGraphicsBindingVulkanKHR-next-next# @next@ /must/ be @NULL@
--     or a valid pointer to the
--     <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#valid-usage-for-structure-pointer-chains next structure in a structure chain>
--
-- -   #VUID-XrGraphicsBindingVulkanKHR-instance-parameter# @instance@
--     /must/ be a valid @VkInstance@ value
--
-- -   #VUID-XrGraphicsBindingVulkanKHR-physicalDevice-parameter#
--     @physicalDevice@ /must/ be a valid @VkPhysicalDevice@ value
--
-- -   #VUID-XrGraphicsBindingVulkanKHR-device-parameter# @device@ /must/
--     be a valid @VkDevice@ value
--
-- = See Also
--
-- 'OpenXR.Core10.Enums.StructureType.StructureType',
-- 'OpenXR.Core10.Device.createSession'
data GraphicsBindingVulkanKHR = GraphicsBindingVulkanKHR
  { -- | @instance@ is a valid Vulkan @VkInstance@.
    GraphicsBindingVulkanKHR -> "vkInstance" ::: Ptr Instance_T
instance' :: Ptr OpenXR.VulkanTypes.Instance_T
  , -- | @physicalDevice@ is a valid Vulkan @VkPhysicalDevice@.
    GraphicsBindingVulkanKHR
-> "vkPhysicalDevice" ::: Ptr PhysicalDevice_T
physicalDevice :: Ptr OpenXR.VulkanTypes.PhysicalDevice_T
  , -- | @device@ is a valid Vulkan @VkDevice@.
    GraphicsBindingVulkanKHR -> Ptr Device_T
device :: Ptr OpenXR.VulkanTypes.Device_T
  , -- | @queueFamilyIndex@ is a valid queue family index on @device@.
    GraphicsBindingVulkanKHR -> "bufferCapacityInput" ::: Word32
queueFamilyIndex :: Word32
  , -- | @queueIndex@ is a valid queue index on @device@ to be used for
    -- synchronization.
    GraphicsBindingVulkanKHR -> "bufferCapacityInput" ::: Word32
queueIndex :: Word32
  }
  deriving (Typeable, GraphicsBindingVulkanKHR -> GraphicsBindingVulkanKHR -> Bool
(GraphicsBindingVulkanKHR -> GraphicsBindingVulkanKHR -> Bool)
-> (GraphicsBindingVulkanKHR -> GraphicsBindingVulkanKHR -> Bool)
-> Eq GraphicsBindingVulkanKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GraphicsBindingVulkanKHR -> GraphicsBindingVulkanKHR -> Bool
$c/= :: GraphicsBindingVulkanKHR -> GraphicsBindingVulkanKHR -> Bool
== :: GraphicsBindingVulkanKHR -> GraphicsBindingVulkanKHR -> Bool
$c== :: GraphicsBindingVulkanKHR -> GraphicsBindingVulkanKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GraphicsBindingVulkanKHR)
#endif
deriving instance Show GraphicsBindingVulkanKHR

instance ToCStruct GraphicsBindingVulkanKHR where
  withCStruct :: GraphicsBindingVulkanKHR
-> (Ptr GraphicsBindingVulkanKHR -> IO b) -> IO b
withCStruct x :: GraphicsBindingVulkanKHR
x f :: Ptr GraphicsBindingVulkanKHR -> IO b
f = Int -> Int -> (Ptr GraphicsBindingVulkanKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 48 8 ((Ptr GraphicsBindingVulkanKHR -> IO b) -> IO b)
-> (Ptr GraphicsBindingVulkanKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr GraphicsBindingVulkanKHR
p -> Ptr GraphicsBindingVulkanKHR
-> GraphicsBindingVulkanKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GraphicsBindingVulkanKHR
p GraphicsBindingVulkanKHR
x (Ptr GraphicsBindingVulkanKHR -> IO b
f Ptr GraphicsBindingVulkanKHR
p)
  pokeCStruct :: Ptr GraphicsBindingVulkanKHR
-> GraphicsBindingVulkanKHR -> IO b -> IO b
pokeCStruct p :: Ptr GraphicsBindingVulkanKHR
p GraphicsBindingVulkanKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_GRAPHICS_BINDING_VULKAN_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("vkInstance" ::: Ptr Instance_T)
-> ("vkInstance" ::: Ptr Instance_T) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR
-> Int -> Ptr ("vkInstance" ::: Ptr Instance_T)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr OpenXR.VulkanTypes.Instance_T))) ("vkInstance" ::: Ptr Instance_T
instance')
    ("vkPhysicalDevice"
 ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR
-> Int
-> "vkPhysicalDevice"
   ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr OpenXR.VulkanTypes.PhysicalDevice_T))) ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T
physicalDevice)
    Ptr (Ptr Device_T) -> Ptr Device_T -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR -> Int -> Ptr (Ptr Device_T)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr OpenXR.VulkanTypes.Device_T))) (Ptr Device_T
device)
    ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("bufferCapacityInput" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR
-> Int
-> "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32)) ("bufferCapacityInput" ::: Word32
queueFamilyIndex)
    ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("bufferCapacityInput" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR
-> Int
-> "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32)) ("bufferCapacityInput" ::: Word32
queueIndex)
    IO b
f
  cStructSize :: Int
cStructSize = 48
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr GraphicsBindingVulkanKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr GraphicsBindingVulkanKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_GRAPHICS_BINDING_VULKAN_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr ("vkInstance" ::: Ptr Instance_T)
-> ("vkInstance" ::: Ptr Instance_T) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR
-> Int -> Ptr ("vkInstance" ::: Ptr Instance_T)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr OpenXR.VulkanTypes.Instance_T))) ("vkInstance" ::: Ptr Instance_T
forall a. Zero a => a
zero)
    ("vkPhysicalDevice"
 ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR
-> Int
-> "vkPhysicalDevice"
   ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr OpenXR.VulkanTypes.PhysicalDevice_T))) ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T
forall a. Zero a => a
zero)
    Ptr (Ptr Device_T) -> Ptr Device_T -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR -> Int -> Ptr (Ptr Device_T)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr OpenXR.VulkanTypes.Device_T))) (Ptr Device_T
forall a. Zero a => a
zero)
    ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("bufferCapacityInput" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR
-> Int
-> "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32)) ("bufferCapacityInput" ::: Word32
forall a. Zero a => a
zero)
    ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> ("bufferCapacityInput" ::: Word32) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR
-> Int
-> "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32)) ("bufferCapacityInput" ::: Word32
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct GraphicsBindingVulkanKHR where
  peekCStruct :: Ptr GraphicsBindingVulkanKHR -> IO GraphicsBindingVulkanKHR
peekCStruct p :: Ptr GraphicsBindingVulkanKHR
p = do
    "vkInstance" ::: Ptr Instance_T
instance' <- Ptr ("vkInstance" ::: Ptr Instance_T)
-> IO ("vkInstance" ::: Ptr Instance_T)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr OpenXR.VulkanTypes.Instance_T) ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR
-> Int -> Ptr ("vkInstance" ::: Ptr Instance_T)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr (Ptr OpenXR.VulkanTypes.Instance_T)))
    "vkPhysicalDevice" ::: Ptr PhysicalDevice_T
physicalDevice <- ("vkPhysicalDevice"
 ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T))
-> IO ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr OpenXR.VulkanTypes.PhysicalDevice_T) ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR
-> Int
-> "vkPhysicalDevice"
   ::: Ptr ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr (Ptr OpenXR.VulkanTypes.PhysicalDevice_T)))
    Ptr Device_T
device <- Ptr (Ptr Device_T) -> IO (Ptr Device_T)
forall a. Storable a => Ptr a -> IO a
peek @(Ptr OpenXR.VulkanTypes.Device_T) ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR -> Int -> Ptr (Ptr Device_T)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 32 :: Ptr (Ptr OpenXR.VulkanTypes.Device_T)))
    "bufferCapacityInput" ::: Word32
queueFamilyIndex <- ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ("bufferCapacityInput" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR
-> Int
-> "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 40 :: Ptr Word32))
    "bufferCapacityInput" ::: Word32
queueIndex <- ("bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32))
-> IO ("bufferCapacityInput" ::: Word32)
forall a. Storable a => Ptr a -> IO a
peek @Word32 ((Ptr GraphicsBindingVulkanKHR
p Ptr GraphicsBindingVulkanKHR
-> Int
-> "bufferCountOutput" ::: Ptr ("bufferCapacityInput" ::: Word32)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 44 :: Ptr Word32))
    GraphicsBindingVulkanKHR -> IO GraphicsBindingVulkanKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GraphicsBindingVulkanKHR -> IO GraphicsBindingVulkanKHR)
-> GraphicsBindingVulkanKHR -> IO GraphicsBindingVulkanKHR
forall a b. (a -> b) -> a -> b
$ ("vkInstance" ::: Ptr Instance_T)
-> ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
-> Ptr Device_T
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCapacityInput" ::: Word32)
-> GraphicsBindingVulkanKHR
GraphicsBindingVulkanKHR
             "vkInstance" ::: Ptr Instance_T
instance' "vkPhysicalDevice" ::: Ptr PhysicalDevice_T
physicalDevice Ptr Device_T
device "bufferCapacityInput" ::: Word32
queueFamilyIndex "bufferCapacityInput" ::: Word32
queueIndex

instance Storable GraphicsBindingVulkanKHR where
  sizeOf :: GraphicsBindingVulkanKHR -> Int
sizeOf ~GraphicsBindingVulkanKHR
_ = 48
  alignment :: GraphicsBindingVulkanKHR -> Int
alignment ~GraphicsBindingVulkanKHR
_ = 8
  peek :: Ptr GraphicsBindingVulkanKHR -> IO GraphicsBindingVulkanKHR
peek = Ptr GraphicsBindingVulkanKHR -> IO GraphicsBindingVulkanKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr GraphicsBindingVulkanKHR -> GraphicsBindingVulkanKHR -> IO ()
poke ptr :: Ptr GraphicsBindingVulkanKHR
ptr poked :: GraphicsBindingVulkanKHR
poked = Ptr GraphicsBindingVulkanKHR
-> GraphicsBindingVulkanKHR -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GraphicsBindingVulkanKHR
ptr GraphicsBindingVulkanKHR
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero GraphicsBindingVulkanKHR where
  zero :: GraphicsBindingVulkanKHR
zero = ("vkInstance" ::: Ptr Instance_T)
-> ("vkPhysicalDevice" ::: Ptr PhysicalDevice_T)
-> Ptr Device_T
-> ("bufferCapacityInput" ::: Word32)
-> ("bufferCapacityInput" ::: Word32)
-> GraphicsBindingVulkanKHR
GraphicsBindingVulkanKHR
           "vkInstance" ::: Ptr Instance_T
forall a. Zero a => a
zero
           "vkPhysicalDevice" ::: Ptr PhysicalDevice_T
forall a. Zero a => a
zero
           Ptr Device_T
forall a. Zero a => a
zero
           "bufferCapacityInput" ::: Word32
forall a. Zero a => a
zero
           "bufferCapacityInput" ::: Word32
forall a. Zero a => a
zero


-- | XrSwapchainImageVulkanKHR - Vulkan-specific swapchain image structure
--
-- == Member Descriptions
--
-- = Description
--
-- If a given session was created with 'GraphicsBindingVulkanKHR', the
-- following conditions /must/ apply.
--
-- -   Calls to 'OpenXR.Core10.Image.enumerateSwapchainImages' on an
--     'OpenXR.Core10.Handles.Swapchain' in that session /must/ return an
--     array of 'SwapchainImageVulkanKHR' structures.
--
-- -   Whenever an OpenXR function accepts an
--     'OpenXR.Core10.Image.SwapchainImageBaseHeader' pointer as a
--     parameter in that session, the runtime /must/ also accept a pointer
--     to an 'SwapchainImageVulkanKHR'.
--
-- The OpenXR runtime /must/ interpret the top-left corner of the swapchain
-- image as the coordinate origin unless specified otherwise by extension
-- functionality.
--
-- The OpenXR runtime /must/ interpret the swapchain images in a clip space
-- of positive Y pointing down, near Z plane at 0, and far Z plane at 1.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrSwapchainImageVulkanKHR-extension-notenabled# The @@
--     extension /must/ be enabled prior to using 'SwapchainImageVulkanKHR'
--
-- -   #VUID-XrSwapchainImageVulkanKHR-type-type# @type@ /must/ be
--     'OpenXR.Core10.Enums.StructureType.TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR'
--
-- -   #VUID-XrSwapchainImageVulkanKHR-next-next# @next@ /must/ be @NULL@
--     or a valid pointer to the
--     <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#valid-usage-for-structure-pointer-chains next structure in a structure chain>
--
-- -   #VUID-XrSwapchainImageVulkanKHR-image-parameter# @image@ /must/ be a
--     valid @VkImage@ value
--
-- = See Also
--
-- 'OpenXR.Core10.Enums.StructureType.StructureType',
-- 'OpenXR.Core10.Image.SwapchainImageBaseHeader'
data SwapchainImageVulkanKHR = SwapchainImageVulkanKHR
  { -- | @image@ is a valid Vulkan @VkImage@ to use.
    SwapchainImageVulkanKHR -> Image
image :: OpenXR.VulkanTypes.Image }
  deriving (Typeable, SwapchainImageVulkanKHR -> SwapchainImageVulkanKHR -> Bool
(SwapchainImageVulkanKHR -> SwapchainImageVulkanKHR -> Bool)
-> (SwapchainImageVulkanKHR -> SwapchainImageVulkanKHR -> Bool)
-> Eq SwapchainImageVulkanKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SwapchainImageVulkanKHR -> SwapchainImageVulkanKHR -> Bool
$c/= :: SwapchainImageVulkanKHR -> SwapchainImageVulkanKHR -> Bool
== :: SwapchainImageVulkanKHR -> SwapchainImageVulkanKHR -> Bool
$c== :: SwapchainImageVulkanKHR -> SwapchainImageVulkanKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (SwapchainImageVulkanKHR)
#endif
deriving instance Show SwapchainImageVulkanKHR

instance IsSwapchainImage SwapchainImageVulkanKHR where
  toSwapchainImageBaseHeader :: SwapchainImageVulkanKHR -> SwapchainImageBaseHeader
toSwapchainImageBaseHeader SwapchainImageVulkanKHR{} = $WSwapchainImageBaseHeader :: StructureType -> SwapchainImageBaseHeader
SwapchainImageBaseHeader{$sel:type':SwapchainImageBaseHeader :: StructureType
type' = StructureType
TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR}

instance ToCStruct SwapchainImageVulkanKHR where
  withCStruct :: SwapchainImageVulkanKHR
-> (Ptr SwapchainImageVulkanKHR -> IO b) -> IO b
withCStruct x :: SwapchainImageVulkanKHR
x f :: Ptr SwapchainImageVulkanKHR -> IO b
f = Int -> Int -> (Ptr SwapchainImageVulkanKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 24 8 ((Ptr SwapchainImageVulkanKHR -> IO b) -> IO b)
-> (Ptr SwapchainImageVulkanKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr SwapchainImageVulkanKHR
p -> Ptr SwapchainImageVulkanKHR
-> SwapchainImageVulkanKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SwapchainImageVulkanKHR
p SwapchainImageVulkanKHR
x (Ptr SwapchainImageVulkanKHR -> IO b
f Ptr SwapchainImageVulkanKHR
p)
  pokeCStruct :: Ptr SwapchainImageVulkanKHR
-> SwapchainImageVulkanKHR -> IO b -> IO b
pokeCStruct p :: Ptr SwapchainImageVulkanKHR
p SwapchainImageVulkanKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainImageVulkanKHR
p Ptr SwapchainImageVulkanKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainImageVulkanKHR
p Ptr SwapchainImageVulkanKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainImageVulkanKHR
p Ptr SwapchainImageVulkanKHR -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr OpenXR.VulkanTypes.Image)) (Image
image)
    IO b
f
  cStructSize :: Int
cStructSize = 24
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr SwapchainImageVulkanKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr SwapchainImageVulkanKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainImageVulkanKHR
p Ptr SwapchainImageVulkanKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_SWAPCHAIN_IMAGE_VULKAN_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainImageVulkanKHR
p Ptr SwapchainImageVulkanKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Image -> Image -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr SwapchainImageVulkanKHR
p Ptr SwapchainImageVulkanKHR -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr OpenXR.VulkanTypes.Image)) (Image
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct SwapchainImageVulkanKHR where
  peekCStruct :: Ptr SwapchainImageVulkanKHR -> IO SwapchainImageVulkanKHR
peekCStruct p :: Ptr SwapchainImageVulkanKHR
p = do
    Image
image <- Ptr Image -> IO Image
forall a. Storable a => Ptr a -> IO a
peek @OpenXR.VulkanTypes.Image ((Ptr SwapchainImageVulkanKHR
p Ptr SwapchainImageVulkanKHR -> Int -> Ptr Image
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr OpenXR.VulkanTypes.Image))
    SwapchainImageVulkanKHR -> IO SwapchainImageVulkanKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (SwapchainImageVulkanKHR -> IO SwapchainImageVulkanKHR)
-> SwapchainImageVulkanKHR -> IO SwapchainImageVulkanKHR
forall a b. (a -> b) -> a -> b
$ Image -> SwapchainImageVulkanKHR
SwapchainImageVulkanKHR
             Image
image

instance Storable SwapchainImageVulkanKHR where
  sizeOf :: SwapchainImageVulkanKHR -> Int
sizeOf ~SwapchainImageVulkanKHR
_ = 24
  alignment :: SwapchainImageVulkanKHR -> Int
alignment ~SwapchainImageVulkanKHR
_ = 8
  peek :: Ptr SwapchainImageVulkanKHR -> IO SwapchainImageVulkanKHR
peek = Ptr SwapchainImageVulkanKHR -> IO SwapchainImageVulkanKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr SwapchainImageVulkanKHR -> SwapchainImageVulkanKHR -> IO ()
poke ptr :: Ptr SwapchainImageVulkanKHR
ptr poked :: SwapchainImageVulkanKHR
poked = Ptr SwapchainImageVulkanKHR
-> SwapchainImageVulkanKHR -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr SwapchainImageVulkanKHR
ptr SwapchainImageVulkanKHR
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero SwapchainImageVulkanKHR where
  zero :: SwapchainImageVulkanKHR
zero = Image -> SwapchainImageVulkanKHR
SwapchainImageVulkanKHR
           Image
forall a. Zero a => a
zero


-- | XrGraphicsRequirementsVulkanKHR - Vulkan API version requirements
--
-- == Member Descriptions
--
-- = Description
--
-- 'GraphicsRequirementsVulkanKHR' is populated by
-- 'getVulkanGraphicsRequirementsKHR' with the runtime’s Vulkan API version
-- requirements.
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-XrGraphicsRequirementsVulkanKHR-extension-notenabled# The @@
--     extension /must/ be enabled prior to using
--     'GraphicsRequirementsVulkanKHR'
--
-- -   #VUID-XrGraphicsRequirementsVulkanKHR-type-type# @type@ /must/ be
--     'OpenXR.Core10.Enums.StructureType.TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHR'
--
-- -   #VUID-XrGraphicsRequirementsVulkanKHR-next-next# @next@ /must/ be
--     @NULL@ or a valid pointer to the
--     <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#valid-usage-for-structure-pointer-chains next structure in a structure chain>
--
-- = See Also
--
-- 'OpenXR.Core10.Enums.StructureType.StructureType',
-- <https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#XrVersion >,
-- 'OpenXR.Extensions.XR_KHR_vulkan_enable2.getVulkanGraphicsRequirements2KHR',
-- 'getVulkanGraphicsRequirementsKHR'
data GraphicsRequirementsVulkanKHR = GraphicsRequirementsVulkanKHR
  { -- | @minApiVersionSupported@ is the minimum Vulkan Instance API version that
    -- the runtime supports. Uses 'OpenXR.Version.MAKE_VERSION' on major and
    -- minor API version, ignoring any patch version component.
    GraphicsRequirementsVulkanKHR -> Version
minApiVersionSupported :: Version
  , -- | @maxApiVersionSupported@ is the maximum Vulkan Instance API version that
    -- the runtime has been tested on and is known to support. Newer Vulkan
    -- Instance API versions might work if they are compatible. Uses
    -- 'OpenXR.Version.MAKE_VERSION' on major and minor API version, ignoring
    -- any patch version component.
    GraphicsRequirementsVulkanKHR -> Version
maxApiVersionSupported :: Version
  }
  deriving (Typeable, GraphicsRequirementsVulkanKHR
-> GraphicsRequirementsVulkanKHR -> Bool
(GraphicsRequirementsVulkanKHR
 -> GraphicsRequirementsVulkanKHR -> Bool)
-> (GraphicsRequirementsVulkanKHR
    -> GraphicsRequirementsVulkanKHR -> Bool)
-> Eq GraphicsRequirementsVulkanKHR
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GraphicsRequirementsVulkanKHR
-> GraphicsRequirementsVulkanKHR -> Bool
$c/= :: GraphicsRequirementsVulkanKHR
-> GraphicsRequirementsVulkanKHR -> Bool
== :: GraphicsRequirementsVulkanKHR
-> GraphicsRequirementsVulkanKHR -> Bool
$c== :: GraphicsRequirementsVulkanKHR
-> GraphicsRequirementsVulkanKHR -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (GraphicsRequirementsVulkanKHR)
#endif
deriving instance Show GraphicsRequirementsVulkanKHR

instance ToCStruct GraphicsRequirementsVulkanKHR where
  withCStruct :: GraphicsRequirementsVulkanKHR
-> (Ptr GraphicsRequirementsVulkanKHR -> IO b) -> IO b
withCStruct x :: GraphicsRequirementsVulkanKHR
x f :: Ptr GraphicsRequirementsVulkanKHR -> IO b
f = Int -> Int -> (Ptr GraphicsRequirementsVulkanKHR -> IO b) -> IO b
forall a b. Int -> Int -> (Ptr a -> IO b) -> IO b
allocaBytesAligned 32 8 ((Ptr GraphicsRequirementsVulkanKHR -> IO b) -> IO b)
-> (Ptr GraphicsRequirementsVulkanKHR -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \p :: Ptr GraphicsRequirementsVulkanKHR
p -> Ptr GraphicsRequirementsVulkanKHR
-> GraphicsRequirementsVulkanKHR -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GraphicsRequirementsVulkanKHR
p GraphicsRequirementsVulkanKHR
x (Ptr GraphicsRequirementsVulkanKHR -> IO b
f Ptr GraphicsRequirementsVulkanKHR
p)
  pokeCStruct :: Ptr GraphicsRequirementsVulkanKHR
-> GraphicsRequirementsVulkanKHR -> IO b -> IO b
pokeCStruct p :: Ptr GraphicsRequirementsVulkanKHR
p GraphicsRequirementsVulkanKHR{..} f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsVulkanKHR
p Ptr GraphicsRequirementsVulkanKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsVulkanKHR
p Ptr GraphicsRequirementsVulkanKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Version -> Version -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsVulkanKHR
p Ptr GraphicsRequirementsVulkanKHR -> Int -> Ptr Version
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Version)) (Version
minApiVersionSupported)
    Ptr Version -> Version -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsVulkanKHR
p Ptr GraphicsRequirementsVulkanKHR -> Int -> Ptr Version
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Version)) (Version
maxApiVersionSupported)
    IO b
f
  cStructSize :: Int
cStructSize = 32
  cStructAlignment :: Int
cStructAlignment = 8
  pokeZeroCStruct :: Ptr GraphicsRequirementsVulkanKHR -> IO b -> IO b
pokeZeroCStruct p :: Ptr GraphicsRequirementsVulkanKHR
p f :: IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsVulkanKHR
p Ptr GraphicsRequirementsVulkanKHR -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0 :: Ptr StructureType)) (StructureType
TYPE_GRAPHICS_REQUIREMENTS_VULKAN_KHR)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsVulkanKHR
p Ptr GraphicsRequirementsVulkanKHR -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Version -> Version -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsVulkanKHR
p Ptr GraphicsRequirementsVulkanKHR -> Int -> Ptr Version
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Version)) (Version
forall a. Zero a => a
zero)
    Ptr Version -> Version -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr GraphicsRequirementsVulkanKHR
p Ptr GraphicsRequirementsVulkanKHR -> Int -> Ptr Version
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Version)) (Version
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct GraphicsRequirementsVulkanKHR where
  peekCStruct :: Ptr GraphicsRequirementsVulkanKHR
-> IO GraphicsRequirementsVulkanKHR
peekCStruct p :: Ptr GraphicsRequirementsVulkanKHR
p = do
    Version
minApiVersionSupported <- Ptr Version -> IO Version
forall a. Storable a => Ptr a -> IO a
peek @Version ((Ptr GraphicsRequirementsVulkanKHR
p Ptr GraphicsRequirementsVulkanKHR -> Int -> Ptr Version
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16 :: Ptr Version))
    Version
maxApiVersionSupported <- Ptr Version -> IO Version
forall a. Storable a => Ptr a -> IO a
peek @Version ((Ptr GraphicsRequirementsVulkanKHR
p Ptr GraphicsRequirementsVulkanKHR -> Int -> Ptr Version
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24 :: Ptr Version))
    GraphicsRequirementsVulkanKHR -> IO GraphicsRequirementsVulkanKHR
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GraphicsRequirementsVulkanKHR -> IO GraphicsRequirementsVulkanKHR)
-> GraphicsRequirementsVulkanKHR
-> IO GraphicsRequirementsVulkanKHR
forall a b. (a -> b) -> a -> b
$ Version -> Version -> GraphicsRequirementsVulkanKHR
GraphicsRequirementsVulkanKHR
             Version
minApiVersionSupported Version
maxApiVersionSupported

instance Storable GraphicsRequirementsVulkanKHR where
  sizeOf :: GraphicsRequirementsVulkanKHR -> Int
sizeOf ~GraphicsRequirementsVulkanKHR
_ = 32
  alignment :: GraphicsRequirementsVulkanKHR -> Int
alignment ~GraphicsRequirementsVulkanKHR
_ = 8
  peek :: Ptr GraphicsRequirementsVulkanKHR
-> IO GraphicsRequirementsVulkanKHR
peek = Ptr GraphicsRequirementsVulkanKHR
-> IO GraphicsRequirementsVulkanKHR
forall a. FromCStruct a => Ptr a -> IO a
peekCStruct
  poke :: Ptr GraphicsRequirementsVulkanKHR
-> GraphicsRequirementsVulkanKHR -> IO ()
poke ptr :: Ptr GraphicsRequirementsVulkanKHR
ptr poked :: GraphicsRequirementsVulkanKHR
poked = Ptr GraphicsRequirementsVulkanKHR
-> GraphicsRequirementsVulkanKHR -> IO () -> IO ()
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr GraphicsRequirementsVulkanKHR
ptr GraphicsRequirementsVulkanKHR
poked (() -> IO ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ())

instance Zero GraphicsRequirementsVulkanKHR where
  zero :: GraphicsRequirementsVulkanKHR
zero = Version -> Version -> GraphicsRequirementsVulkanKHR
GraphicsRequirementsVulkanKHR
           Version
forall a. Zero a => a
zero
           Version
forall a. Zero a => a
zero


type KHR_vulkan_enable_SPEC_VERSION = 7

-- No documentation found for TopLevel "XR_KHR_vulkan_enable_SPEC_VERSION"
pattern KHR_vulkan_enable_SPEC_VERSION :: forall a . Integral a => a
pattern $bKHR_vulkan_enable_SPEC_VERSION :: a
$mKHR_vulkan_enable_SPEC_VERSION :: forall r a. Integral a => a -> (Void# -> r) -> (Void# -> r) -> r
KHR_vulkan_enable_SPEC_VERSION = 7


type KHR_VULKAN_ENABLE_EXTENSION_NAME = "XR_KHR_vulkan_enable"

-- No documentation found for TopLevel "XR_KHR_VULKAN_ENABLE_EXTENSION_NAME"
pattern KHR_VULKAN_ENABLE_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $bKHR_VULKAN_ENABLE_EXTENSION_NAME :: a
$mKHR_VULKAN_ENABLE_EXTENSION_NAME :: forall r a.
(Eq a, IsString a) =>
a -> (Void# -> r) -> (Void# -> r) -> r
KHR_VULKAN_ENABLE_EXTENSION_NAME = "XR_KHR_vulkan_enable"