{-# language CPP #-}
-- | = Name
--
-- VK_NVX_binary_import - device extension
--
-- = VK_NVX_binary_import
--
-- [__Name String__]
--     @VK_NVX_binary_import@
--
-- [__Extension Type__]
--     Device extension
--
-- [__Registered Extension Number__]
--     30
--
-- [__Revision__]
--     2
--
-- [__Ratification Status__]
--     Not ratified
--
-- [__Extension and Version Dependencies__]
--     None
--
-- [__API Interactions__]
--
--     -   Interacts with VK_EXT_debug_report
--
-- [__Contact__]
--
--     -   Eric Werness
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_NVX_binary_import] @ewerness-nv%0A*Here describe the issue or question you have about the VK_NVX_binary_import extension* >
--
--     -   Liam Middlebrook
--         <https://github.com/KhronosGroup/Vulkan-Docs/issues/new?body=[VK_NVX_binary_import] @liam-middlebrook%0A*Here describe the issue or question you have about the VK_NVX_binary_import extension* >
--
-- == Other Extension Metadata
--
-- [__Last Modified Date__]
--     2024-11-04
--
-- [__Contributors__]
--
--     -   Eric Werness, NVIDIA
--
--     -   Liam Middlebrook, NVIDIA
--
-- == Description
--
-- This extension allows applications to import CuBIN binaries and execute
-- them.
--
-- There is currently no specification language written for this extension.
-- The links to APIs defined by the extension are to stubs that only
-- include generated content such as API declarations and implicit valid
-- usage statements.
--
-- == New Object Types
--
-- -   'Vulkan.Extensions.Handles.CuFunctionNVX'
--
-- -   'Vulkan.Extensions.Handles.CuModuleNVX'
--
-- == New Commands
--
-- -   'cmdCuLaunchKernelNVX'
--
-- -   'createCuFunctionNVX'
--
-- -   'createCuModuleNVX'
--
-- -   'destroyCuFunctionNVX'
--
-- -   'destroyCuModuleNVX'
--
-- == New Structures
--
-- -   'CuFunctionCreateInfoNVX'
--
-- -   'CuLaunchInfoNVX'
--
-- -   'CuModuleCreateInfoNVX'
--
-- -   Extending 'CuModuleCreateInfoNVX':
--
--     -   'CuModuleTexturingModeCreateInfoNVX'
--
-- == New Enum Constants
--
-- -   'NVX_BINARY_IMPORT_EXTENSION_NAME'
--
-- -   'NVX_BINARY_IMPORT_SPEC_VERSION'
--
-- -   Extending 'Vulkan.Core10.Enums.ObjectType.ObjectType':
--
--     -   'Vulkan.Core10.Enums.ObjectType.OBJECT_TYPE_CU_FUNCTION_NVX'
--
--     -   'Vulkan.Core10.Enums.ObjectType.OBJECT_TYPE_CU_MODULE_NVX'
--
-- -   Extending 'Vulkan.Core10.Enums.StructureType.StructureType':
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX'
--
--     -   'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_CU_MODULE_TEXTURING_MODE_CREATE_INFO_NVX'
--
-- If
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_EXT_debug_report VK_EXT_debug_report>
-- is supported:
--
-- -   Extending
--     'Vulkan.Extensions.VK_EXT_debug_report.DebugReportObjectTypeEXT':
--
--     -   'Vulkan.Extensions.VK_EXT_debug_report.DEBUG_REPORT_OBJECT_TYPE_CU_FUNCTION_NVX_EXT'
--
--     -   'Vulkan.Extensions.VK_EXT_debug_report.DEBUG_REPORT_OBJECT_TYPE_CU_MODULE_NVX_EXT'
--
-- == Stub API References
--
-- There is currently no specification language written for this type. This
-- section acts only as placeholder and to avoid dead links in the
-- specification and reference pages.
--
-- > // Provided by VK_NVX_binary_import
-- > VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCuFunctionNVX)
--
-- There is currently no specification language written for this type. This
-- section acts only as placeholder and to avoid dead links in the
-- specification and reference pages.
--
-- > // Provided by VK_NVX_binary_import
-- > VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCuModuleNVX)
--
-- There is currently no specification language written for this command.
-- This section acts only as placeholder and to avoid dead links in the
-- specification and reference pages.
--
-- > // Provided by VK_NVX_binary_import
-- > VkResult vkCreateCuFunctionNVX(
-- >     VkDevice                                    device,
-- >     const VkCuFunctionCreateInfoNVX*            pCreateInfo,
-- >     const VkAllocationCallbacks*                pAllocator,
-- >     VkCuFunctionNVX*                            pFunction);
--
-- === Valid Usage (Implicit)
--
-- -   #VUID-vkCreateCuFunctionNVX-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCreateCuFunctionNVX-pCreateInfo-parameter# @pCreateInfo@
--     /must/ be a valid pointer to a valid 'CuFunctionCreateInfoNVX'
--     structure
--
-- -   #VUID-vkCreateCuFunctionNVX-pAllocator-parameter# If @pAllocator@ is
--     not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkCreateCuFunctionNVX-pFunction-parameter# @pFunction@ /must/
--     be a valid pointer to a 'Vulkan.Extensions.Handles.CuFunctionNVX'
--     handle
--
-- -   #VUID-vkCreateCuFunctionNVX-device-queuecount# The device /must/
--     have been created with at least @1@ queue
--
-- === Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- There is currently no specification language written for this type. This
-- section acts only as placeholder and to avoid dead links in the
-- specification and reference pages.
--
-- > // Provided by VK_NVX_binary_import
-- > typedef struct VkCuFunctionCreateInfoNVX {
-- >     VkStructureType    sType;
-- >     const void*        pNext;
-- >     VkCuModuleNVX      module;
-- >     const char*        pName;
-- > } VkCuFunctionCreateInfoNVX;
--
-- === Valid Usage (Implicit)
--
-- -   #VUID-VkCuFunctionCreateInfoNVX-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX'
--
-- -   #VUID-VkCuFunctionCreateInfoNVX-pNext-pNext# @pNext@ /must/ be
--     @NULL@
--
-- -   #VUID-VkCuFunctionCreateInfoNVX-module-parameter# @module@ /must/ be
--     a valid 'Vulkan.Extensions.Handles.CuModuleNVX' handle
--
-- -   #VUID-VkCuFunctionCreateInfoNVX-pName-parameter# @pName@ /must/ be a
--     null-terminated UTF-8 string
--
-- There is currently no specification language written for this command.
-- This section acts only as placeholder and to avoid dead links in the
-- specification and reference pages.
--
-- > // Provided by VK_NVX_binary_import
-- > void vkDestroyCuFunctionNVX(
-- >     VkDevice                                    device,
-- >     VkCuFunctionNVX                             function,
-- >     const VkAllocationCallbacks*                pAllocator);
--
-- === Valid Usage (Implicit)
--
-- -   #VUID-vkDestroyCuFunctionNVX-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkDestroyCuFunctionNVX-function-parameter# @function@ /must/
--     be a valid 'Vulkan.Extensions.Handles.CuFunctionNVX' handle
--
-- -   #VUID-vkDestroyCuFunctionNVX-pAllocator-parameter# If @pAllocator@
--     is not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkDestroyCuFunctionNVX-function-parent# @function@ /must/ have
--     been created, allocated, or retrieved from @device@
--
-- There is currently no specification language written for this command.
-- This section acts only as placeholder and to avoid dead links in the
-- specification and reference pages.
--
-- > // Provided by VK_NVX_binary_import
-- > VkResult vkCreateCuModuleNVX(
-- >     VkDevice                                    device,
-- >     const VkCuModuleCreateInfoNVX*              pCreateInfo,
-- >     const VkAllocationCallbacks*                pAllocator,
-- >     VkCuModuleNVX*                              pModule);
--
-- === Valid Usage (Implicit)
--
-- -   #VUID-vkCreateCuModuleNVX-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCreateCuModuleNVX-pCreateInfo-parameter# @pCreateInfo@
--     /must/ be a valid pointer to a valid 'CuModuleCreateInfoNVX'
--     structure
--
-- -   #VUID-vkCreateCuModuleNVX-pAllocator-parameter# If @pAllocator@ is
--     not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkCreateCuModuleNVX-pModule-parameter# @pModule@ /must/ be a
--     valid pointer to a 'Vulkan.Extensions.Handles.CuModuleNVX' handle
--
-- -   #VUID-vkCreateCuModuleNVX-device-queuecount# The device /must/ have
--     been created with at least @1@ queue
--
-- === Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- There is currently no specification language written for this type. This
-- section acts only as placeholder and to avoid dead links in the
-- specification and reference pages.
--
-- > // Provided by VK_NVX_binary_import
-- > typedef struct VkCuModuleCreateInfoNVX {
-- >     VkStructureType    sType;
-- >     const void*        pNext;
-- >     size_t             dataSize;
-- >     const void*        pData;
-- > } VkCuModuleCreateInfoNVX;
--
-- === Valid Usage (Implicit)
--
-- -   #VUID-VkCuModuleCreateInfoNVX-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX'
--
-- -   #VUID-VkCuModuleCreateInfoNVX-pNext-pNext# @pNext@ /must/ be @NULL@
--     or a pointer to a valid instance of
--     'CuModuleTexturingModeCreateInfoNVX'
--
-- -   #VUID-VkCuModuleCreateInfoNVX-sType-unique# The @sType@ value of
--     each structure in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkCuModuleCreateInfoNVX-pData-parameter# If @dataSize@ is not
--     @0@, @pData@ /must/ be a valid pointer to an array of @dataSize@
--     bytes
--
-- There is currently no specification language written for this type. This
-- section acts only as placeholder and to avoid dead links in the
-- specification and reference pages.
--
-- > // Provided by VK_NVX_binary_import
-- > typedef struct VkCuModuleTexturingModeCreateInfoNVX {
-- >     VkStructureType    sType;
-- >     const void*        pNext;
-- >     VkBool32           use64bitTexturing;
-- > } VkCuModuleTexturingModeCreateInfoNVX;
--
-- === Valid Usage (Implicit)
--
-- -   #VUID-VkCuModuleTexturingModeCreateInfoNVX-sType-sType# @sType@
--     /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_CU_MODULE_TEXTURING_MODE_CREATE_INFO_NVX'
--
-- There is currently no specification language written for this command.
-- This section acts only as placeholder and to avoid dead links in the
-- specification and reference pages.
--
-- > // Provided by VK_NVX_binary_import
-- > void vkDestroyCuModuleNVX(
-- >     VkDevice                                    device,
-- >     VkCuModuleNVX                               module,
-- >     const VkAllocationCallbacks*                pAllocator);
--
-- === Valid Usage (Implicit)
--
-- -   #VUID-vkDestroyCuModuleNVX-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkDestroyCuModuleNVX-module-parameter# @module@ /must/ be a
--     valid 'Vulkan.Extensions.Handles.CuModuleNVX' handle
--
-- -   #VUID-vkDestroyCuModuleNVX-pAllocator-parameter# If @pAllocator@ is
--     not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkDestroyCuModuleNVX-module-parent# @module@ /must/ have been
--     created, allocated, or retrieved from @device@
--
-- There is currently no specification language written for this command.
-- This section acts only as placeholder and to avoid dead links in the
-- specification and reference pages.
--
-- > // Provided by VK_NVX_binary_import
-- > void vkCmdCuLaunchKernelNVX(
-- >     VkCommandBuffer                             commandBuffer,
-- >     const VkCuLaunchInfoNVX*                    pLaunchInfo);
--
-- === Valid Usage (Implicit)
--
-- -   #VUID-vkCmdCuLaunchKernelNVX-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdCuLaunchKernelNVX-pLaunchInfo-parameter# @pLaunchInfo@
--     /must/ be a valid pointer to a valid 'CuLaunchInfoNVX' structure
--
-- -   #VUID-vkCmdCuLaunchKernelNVX-commandBuffer-recording#
--     @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdCuLaunchKernelNVX-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_COMPUTE_BIT', or
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT' operations
--
-- -   #VUID-vkCmdCuLaunchKernelNVX-suspended# This command /must/ not be
--     called between suspended render pass instances
--
-- -   #VUID-vkCmdCuLaunchKernelNVX-videocoding# This command /must/ only
--     be called outside of a video coding scope
--
-- === Host Synchronization
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- === Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Both                                                                                                                   | Outside                                                                                                                     | VK_QUEUE_COMPUTE_BIT                                                                                                  | Action                                                                                                                                 |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             | VK_QUEUE_GRAPHICS_BIT                                                                                                 |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- === Conditional Rendering
--
-- vkCmdCuLaunchKernelNVX is not affected by
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#drawing-conditional-rendering conditional rendering>
--
-- There is currently no specification language written for this type. This
-- section acts only as placeholder and to avoid dead links in the
-- specification and reference pages.
--
-- > // Provided by VK_NVX_binary_import
-- > typedef struct VkCuLaunchInfoNVX {
-- >     VkStructureType        sType;
-- >     const void*            pNext;
-- >     VkCuFunctionNVX        function;
-- >     uint32_t               gridDimX;
-- >     uint32_t               gridDimY;
-- >     uint32_t               gridDimZ;
-- >     uint32_t               blockDimX;
-- >     uint32_t               blockDimY;
-- >     uint32_t               blockDimZ;
-- >     uint32_t               sharedMemBytes;
-- >     size_t                 paramCount;
-- >     const void* const *    pParams;
-- >     size_t                 extraCount;
-- >     const void* const *    pExtras;
-- > } VkCuLaunchInfoNVX;
--
-- === Valid Usage (Implicit)
--
-- -   #VUID-VkCuLaunchInfoNVX-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX'
--
-- -   #VUID-VkCuLaunchInfoNVX-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkCuLaunchInfoNVX-function-parameter# @function@ /must/ be a
--     valid 'Vulkan.Extensions.Handles.CuFunctionNVX' handle
--
-- -   #VUID-VkCuLaunchInfoNVX-pParams-parameter# If @paramCount@ is not
--     @0@, @pParams@ /must/ be a valid pointer to an array of @paramCount@
--     bytes
--
-- -   #VUID-VkCuLaunchInfoNVX-pExtras-parameter# If @extraCount@ is not
--     @0@, @pExtras@ /must/ be a valid pointer to an array of @extraCount@
--     bytes
--
-- == Version History
--
-- -   Revision 2, 2024-11-04 (Liam Middlebrook)
--
--     -   Add 'CuModuleTexturingModeCreateInfoNVX'
--
-- -   Revision 1, 2021-04-09 (Eric Werness)
--
--     -   Internal revisions
--
-- == See Also
--
-- No cross-references are available
--
-- == Document Notes
--
-- For more information, see the
-- <https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#VK_NVX_binary_import Vulkan Specification>.
--
-- This page is a generated document. Fixes and changes should be made to
-- the generator scripts, not directly.
module Vulkan.Extensions.VK_NVX_binary_import  ( createCuModuleNVX
                                               , withCuModuleNVX
                                               , createCuFunctionNVX
                                               , withCuFunctionNVX
                                               , destroyCuModuleNVX
                                               , destroyCuFunctionNVX
                                               , cmdCuLaunchKernelNVX
                                               , CuModuleCreateInfoNVX(..)
                                               , CuModuleTexturingModeCreateInfoNVX(..)
                                               , CuFunctionCreateInfoNVX(..)
                                               , CuLaunchInfoNVX(..)
                                               , NVX_BINARY_IMPORT_SPEC_VERSION
                                               , pattern NVX_BINARY_IMPORT_SPEC_VERSION
                                               , NVX_BINARY_IMPORT_EXTENSION_NAME
                                               , pattern NVX_BINARY_IMPORT_EXTENSION_NAME
                                               , CuModuleNVX(..)
                                               , CuFunctionNVX(..)
                                               , DebugReportObjectTypeEXT(..)
                                               ) where

import Vulkan.Internal.Utils (traceAroundEvent)
import Control.Exception.Base (bracket)
import Control.Monad (unless)
import Control.Monad.IO.Class (liftIO)
import Data.Typeable (eqT)
import Foreign.Marshal.Alloc (allocaBytes)
import Foreign.Marshal.Alloc (callocBytes)
import Foreign.Marshal.Alloc (free)
import GHC.Base (when)
import GHC.IO (throwIO)
import GHC.Ptr (castPtr)
import GHC.Ptr (nullFunPtr)
import Foreign.Ptr (nullPtr)
import Foreign.Ptr (plusPtr)
import Data.ByteString (packCString)
import Data.ByteString (useAsCString)
import Data.Coerce (coerce)
import Control.Monad.Trans.Class (lift)
import Control.Monad.Trans.Cont (evalContT)
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 Control.Monad.IO.Class (MonadIO)
import Data.String (IsString)
import Data.Type.Equality ((:~:)(Refl))
import Data.Typeable (Typeable)
import Foreign.C.Types (CChar)
import Foreign.C.Types (CSize)
import Foreign.C.Types (CSize(..))
import Foreign.C.Types (CSize(CSize))
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.Word (Word64)
import Data.ByteString (ByteString)
import Data.Kind (Type)
import Control.Monad.Trans.Cont (ContT(..))
import Data.Vector (Vector)
import Vulkan.CStruct.Utils (advancePtrBytes)
import Vulkan.Core10.FundamentalTypes (bool32ToBool)
import Vulkan.Core10.FundamentalTypes (boolToBool32)
import Vulkan.CStruct.Extends (forgetExtensions)
import Vulkan.NamedType ((:::))
import Vulkan.Core10.AllocationCallbacks (AllocationCallbacks)
import Vulkan.Core10.FundamentalTypes (Bool32)
import Vulkan.CStruct.Extends (Chain)
import Vulkan.Core10.Handles (CommandBuffer)
import Vulkan.Core10.Handles (CommandBuffer(..))
import Vulkan.Core10.Handles (CommandBuffer(CommandBuffer))
import Vulkan.Core10.Handles (CommandBuffer_T)
import Vulkan.Extensions.Handles (CuFunctionNVX)
import Vulkan.Extensions.Handles (CuFunctionNVX(..))
import Vulkan.Extensions.Handles (CuModuleNVX)
import Vulkan.Extensions.Handles (CuModuleNVX(..))
import Vulkan.Core10.Handles (Device)
import Vulkan.Core10.Handles (Device(..))
import Vulkan.Core10.Handles (Device(Device))
import Vulkan.Dynamic (DeviceCmds(pVkCmdCuLaunchKernelNVX))
import Vulkan.Dynamic (DeviceCmds(pVkCreateCuFunctionNVX))
import Vulkan.Dynamic (DeviceCmds(pVkCreateCuModuleNVX))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyCuFunctionNVX))
import Vulkan.Dynamic (DeviceCmds(pVkDestroyCuModuleNVX))
import Vulkan.Core10.Handles (Device_T)
import Vulkan.CStruct.Extends (Extends)
import Vulkan.CStruct.Extends (Extendss)
import Vulkan.CStruct.Extends (Extensible(..))
import Vulkan.CStruct.Extends (PeekChain)
import Vulkan.CStruct.Extends (PeekChain(..))
import Vulkan.CStruct.Extends (PokeChain)
import Vulkan.CStruct.Extends (PokeChain(..))
import Vulkan.Core10.Enums.Result (Result)
import Vulkan.Core10.Enums.Result (Result(..))
import Vulkan.CStruct.Extends (SomeStruct)
import Vulkan.Core10.Enums.StructureType (StructureType)
import Vulkan.Exception (VulkanException(..))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX))
import Vulkan.Core10.Enums.StructureType (StructureType(STRUCTURE_TYPE_CU_MODULE_TEXTURING_MODE_CREATE_INFO_NVX))
import Vulkan.Core10.Enums.Result (Result(SUCCESS))
import Vulkan.Extensions.Handles (CuFunctionNVX(..))
import Vulkan.Extensions.Handles (CuModuleNVX(..))
import Vulkan.Extensions.VK_EXT_debug_report (DebugReportObjectTypeEXT(..))
foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCreateCuModuleNVX
  :: FunPtr (Ptr Device_T -> Ptr (SomeStruct CuModuleCreateInfoNVX) -> Ptr AllocationCallbacks -> Ptr CuModuleNVX -> IO Result) -> Ptr Device_T -> Ptr (SomeStruct CuModuleCreateInfoNVX) -> Ptr AllocationCallbacks -> Ptr CuModuleNVX -> IO Result

-- | vkCreateCuModuleNVX - Stub description of vkCreateCuModuleNVX
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreateCuModuleNVX-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCreateCuModuleNVX-pCreateInfo-parameter# @pCreateInfo@
--     /must/ be a valid pointer to a valid 'CuModuleCreateInfoNVX'
--     structure
--
-- -   #VUID-vkCreateCuModuleNVX-pAllocator-parameter# If @pAllocator@ is
--     not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkCreateCuModuleNVX-pModule-parameter# @pModule@ /must/ be a
--     valid pointer to a 'Vulkan.Extensions.Handles.CuModuleNVX' handle
--
-- -   #VUID-vkCreateCuModuleNVX-device-queuecount# The device /must/ have
--     been created with at least @1@ queue
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NVX_binary_import VK_NVX_binary_import>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'CuModuleCreateInfoNVX', 'Vulkan.Extensions.Handles.CuModuleNVX',
-- 'Vulkan.Core10.Handles.Device'
createCuModuleNVX :: forall a io
                   . (Extendss CuModuleCreateInfoNVX a, PokeChain a, MonadIO io)
                  => -- No documentation found for Nested "vkCreateCuModuleNVX" "device"
                     Device
                  -> -- No documentation found for Nested "vkCreateCuModuleNVX" "pCreateInfo"
                     (CuModuleCreateInfoNVX a)
                  -> -- No documentation found for Nested "vkCreateCuModuleNVX" "pAllocator"
                     ("allocator" ::: Maybe AllocationCallbacks)
                  -> io (CuModuleNVX)
createCuModuleNVX :: forall (a :: [*]) (io :: * -> *).
(Extendss CuModuleCreateInfoNVX a, PokeChain a, MonadIO io) =>
Device
-> CuModuleCreateInfoNVX a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io CuModuleNVX
createCuModuleNVX Device
device CuModuleCreateInfoNVX a
createInfo "allocator" ::: Maybe AllocationCallbacks
allocator = IO CuModuleNVX -> io CuModuleNVX
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CuModuleNVX -> io CuModuleNVX)
-> (ContT CuModuleNVX IO CuModuleNVX -> IO CuModuleNVX)
-> ContT CuModuleNVX IO CuModuleNVX
-> io CuModuleNVX
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT CuModuleNVX IO CuModuleNVX -> IO CuModuleNVX
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT CuModuleNVX IO CuModuleNVX -> io CuModuleNVX)
-> ContT CuModuleNVX IO CuModuleNVX -> io CuModuleNVX
forall a b. (a -> b) -> a -> b
$ do
  let vkCreateCuModuleNVXPtr :: FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct CuModuleCreateInfoNVX)
   -> Ptr AllocationCallbacks
   -> Ptr CuModuleNVX
   -> IO Result)
vkCreateCuModuleNVXPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> Ptr (SomeStruct CuModuleCreateInfoNVX)
      -> Ptr AllocationCallbacks
      -> Ptr CuModuleNVX
      -> IO Result)
pVkCreateCuModuleNVX (case Device
device of Device{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT CuModuleNVX IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT CuModuleNVX m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT CuModuleNVX IO ())
-> IO () -> ContT CuModuleNVX IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct CuModuleCreateInfoNVX)
   -> Ptr AllocationCallbacks
   -> Ptr CuModuleNVX
   -> IO Result)
vkCreateCuModuleNVXPtr FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct CuModuleCreateInfoNVX)
   -> Ptr AllocationCallbacks
   -> Ptr CuModuleNVX
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> Ptr (SomeStruct CuModuleCreateInfoNVX)
      -> Ptr AllocationCallbacks
      -> Ptr CuModuleNVX
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct CuModuleCreateInfoNVX)
   -> Ptr AllocationCallbacks
   -> Ptr CuModuleNVX
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, 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 String
"" String
"The function pointer for vkCreateCuModuleNVX is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCreateCuModuleNVX' :: Ptr Device_T
-> Ptr (SomeStruct CuModuleCreateInfoNVX)
-> Ptr AllocationCallbacks
-> Ptr CuModuleNVX
-> IO Result
vkCreateCuModuleNVX' = FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct CuModuleCreateInfoNVX)
   -> Ptr AllocationCallbacks
   -> Ptr CuModuleNVX
   -> IO Result)
-> Ptr Device_T
-> Ptr (SomeStruct CuModuleCreateInfoNVX)
-> Ptr AllocationCallbacks
-> Ptr CuModuleNVX
-> IO Result
mkVkCreateCuModuleNVX FunPtr
  (Ptr Device_T
   -> Ptr (SomeStruct CuModuleCreateInfoNVX)
   -> Ptr AllocationCallbacks
   -> Ptr CuModuleNVX
   -> IO Result)
vkCreateCuModuleNVXPtr
  pCreateInfo <- ((Ptr (CuModuleCreateInfoNVX a) -> IO CuModuleNVX)
 -> IO CuModuleNVX)
-> ContT CuModuleNVX IO (Ptr (CuModuleCreateInfoNVX a))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (CuModuleCreateInfoNVX a) -> IO CuModuleNVX)
  -> IO CuModuleNVX)
 -> ContT CuModuleNVX IO (Ptr (CuModuleCreateInfoNVX a)))
-> ((Ptr (CuModuleCreateInfoNVX a) -> IO CuModuleNVX)
    -> IO CuModuleNVX)
-> ContT CuModuleNVX IO (Ptr (CuModuleCreateInfoNVX a))
forall a b. (a -> b) -> a -> b
$ CuModuleCreateInfoNVX a
-> (Ptr (CuModuleCreateInfoNVX a) -> IO CuModuleNVX)
-> IO CuModuleNVX
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
CuModuleCreateInfoNVX a
-> (Ptr (CuModuleCreateInfoNVX a) -> IO b) -> IO b
withCStruct (CuModuleCreateInfoNVX a
createInfo)
  pAllocator <- case (allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> Ptr AllocationCallbacks
-> ContT CuModuleNVX IO (Ptr AllocationCallbacks)
forall a. a -> ContT CuModuleNVX IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> ((Ptr AllocationCallbacks -> IO CuModuleNVX) -> IO CuModuleNVX)
-> ContT CuModuleNVX IO (Ptr AllocationCallbacks)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AllocationCallbacks -> IO CuModuleNVX) -> IO CuModuleNVX)
 -> ContT CuModuleNVX IO (Ptr AllocationCallbacks))
-> ((Ptr AllocationCallbacks -> IO CuModuleNVX) -> IO CuModuleNVX)
-> ContT CuModuleNVX IO (Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (Ptr AllocationCallbacks -> IO CuModuleNVX) -> IO CuModuleNVX
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
AllocationCallbacks -> (Ptr AllocationCallbacks -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  pPModule <- ContT $ bracket (callocBytes @CuModuleNVX 8) free
  r <- lift $ traceAroundEvent "vkCreateCuModuleNVX" (vkCreateCuModuleNVX'
                                                        (deviceHandle (device))
                                                        (forgetExtensions pCreateInfo)
                                                        pAllocator
                                                        (pPModule))
  lift $ when (r < SUCCESS) (throwIO (VulkanException r))
  pModule <- lift $ peek @CuModuleNVX pPModule
  pure $ (pModule)

-- | A convenience wrapper to make a compatible pair of calls to
-- 'createCuModuleNVX' and 'destroyCuModuleNVX'
--
-- To ensure that 'destroyCuModuleNVX' is always called: pass
-- 'Control.Exception.bracket' (or the allocate function from your
-- favourite resource management library) as the last argument.
-- To just extract the pair pass '(,)' as the last argument.
--
withCuModuleNVX :: forall a io r . (Extendss CuModuleCreateInfoNVX a, PokeChain a, MonadIO io) => Device -> CuModuleCreateInfoNVX a -> Maybe AllocationCallbacks -> (io CuModuleNVX -> (CuModuleNVX -> io ()) -> r) -> r
withCuModuleNVX :: forall (a :: [*]) (io :: * -> *) r.
(Extendss CuModuleCreateInfoNVX a, PokeChain a, MonadIO io) =>
Device
-> CuModuleCreateInfoNVX a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io CuModuleNVX -> (CuModuleNVX -> io ()) -> r)
-> r
withCuModuleNVX Device
device CuModuleCreateInfoNVX a
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator io CuModuleNVX -> (CuModuleNVX -> io ()) -> r
b =
  io CuModuleNVX -> (CuModuleNVX -> io ()) -> r
b (Device
-> CuModuleCreateInfoNVX a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io CuModuleNVX
forall (a :: [*]) (io :: * -> *).
(Extendss CuModuleCreateInfoNVX a, PokeChain a, MonadIO io) =>
Device
-> CuModuleCreateInfoNVX a
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io CuModuleNVX
createCuModuleNVX Device
device CuModuleCreateInfoNVX a
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
    (\(CuModuleNVX
o0) -> Device
-> CuModuleNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
forall (io :: * -> *).
MonadIO io =>
Device
-> CuModuleNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyCuModuleNVX Device
device CuModuleNVX
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCreateCuFunctionNVX
  :: FunPtr (Ptr Device_T -> Ptr CuFunctionCreateInfoNVX -> Ptr AllocationCallbacks -> Ptr CuFunctionNVX -> IO Result) -> Ptr Device_T -> Ptr CuFunctionCreateInfoNVX -> Ptr AllocationCallbacks -> Ptr CuFunctionNVX -> IO Result

-- | vkCreateCuFunctionNVX - Stub description of vkCreateCuFunctionNVX
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCreateCuFunctionNVX-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkCreateCuFunctionNVX-pCreateInfo-parameter# @pCreateInfo@
--     /must/ be a valid pointer to a valid 'CuFunctionCreateInfoNVX'
--     structure
--
-- -   #VUID-vkCreateCuFunctionNVX-pAllocator-parameter# If @pAllocator@ is
--     not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkCreateCuFunctionNVX-pFunction-parameter# @pFunction@ /must/
--     be a valid pointer to a 'Vulkan.Extensions.Handles.CuFunctionNVX'
--     handle
--
-- -   #VUID-vkCreateCuFunctionNVX-device-queuecount# The device /must/
--     have been created with at least @1@ queue
--
-- == Return Codes
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-successcodes Success>]
--
--     -   'Vulkan.Core10.Enums.Result.SUCCESS'
--
-- [<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-errorcodes Failure>]
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_INITIALIZATION_FAILED'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_OUT_OF_HOST_MEMORY'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_UNKNOWN'
--
--     -   'Vulkan.Core10.Enums.Result.ERROR_VALIDATION_FAILED'
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NVX_binary_import VK_NVX_binary_import>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'CuFunctionCreateInfoNVX', 'Vulkan.Extensions.Handles.CuFunctionNVX',
-- 'Vulkan.Core10.Handles.Device'
createCuFunctionNVX :: forall io
                     . (MonadIO io)
                    => -- No documentation found for Nested "vkCreateCuFunctionNVX" "device"
                       Device
                    -> -- No documentation found for Nested "vkCreateCuFunctionNVX" "pCreateInfo"
                       CuFunctionCreateInfoNVX
                    -> -- No documentation found for Nested "vkCreateCuFunctionNVX" "pAllocator"
                       ("allocator" ::: Maybe AllocationCallbacks)
                    -> io (CuFunctionNVX)
createCuFunctionNVX :: forall (io :: * -> *).
MonadIO io =>
Device
-> CuFunctionCreateInfoNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io CuFunctionNVX
createCuFunctionNVX Device
device CuFunctionCreateInfoNVX
createInfo "allocator" ::: Maybe AllocationCallbacks
allocator = IO CuFunctionNVX -> io CuFunctionNVX
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CuFunctionNVX -> io CuFunctionNVX)
-> (ContT CuFunctionNVX IO CuFunctionNVX -> IO CuFunctionNVX)
-> ContT CuFunctionNVX IO CuFunctionNVX
-> io CuFunctionNVX
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT CuFunctionNVX IO CuFunctionNVX -> IO CuFunctionNVX
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT CuFunctionNVX IO CuFunctionNVX -> io CuFunctionNVX)
-> ContT CuFunctionNVX IO CuFunctionNVX -> io CuFunctionNVX
forall a b. (a -> b) -> a -> b
$ do
  let vkCreateCuFunctionNVXPtr :: FunPtr
  (Ptr Device_T
   -> Ptr CuFunctionCreateInfoNVX
   -> Ptr AllocationCallbacks
   -> Ptr CuFunctionNVX
   -> IO Result)
vkCreateCuFunctionNVXPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T
      -> Ptr CuFunctionCreateInfoNVX
      -> Ptr AllocationCallbacks
      -> Ptr CuFunctionNVX
      -> IO Result)
pVkCreateCuFunctionNVX (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT CuFunctionNVX IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT CuFunctionNVX m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT CuFunctionNVX IO ())
-> IO () -> ContT CuFunctionNVX IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T
   -> Ptr CuFunctionCreateInfoNVX
   -> Ptr AllocationCallbacks
   -> Ptr CuFunctionNVX
   -> IO Result)
vkCreateCuFunctionNVXPtr FunPtr
  (Ptr Device_T
   -> Ptr CuFunctionCreateInfoNVX
   -> Ptr AllocationCallbacks
   -> Ptr CuFunctionNVX
   -> IO Result)
-> FunPtr
     (Ptr Device_T
      -> Ptr CuFunctionCreateInfoNVX
      -> Ptr AllocationCallbacks
      -> Ptr CuFunctionNVX
      -> IO Result)
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T
   -> Ptr CuFunctionCreateInfoNVX
   -> Ptr AllocationCallbacks
   -> Ptr CuFunctionNVX
   -> IO Result)
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, 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 String
"" String
"The function pointer for vkCreateCuFunctionNVX is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCreateCuFunctionNVX' :: Ptr Device_T
-> Ptr CuFunctionCreateInfoNVX
-> Ptr AllocationCallbacks
-> Ptr CuFunctionNVX
-> IO Result
vkCreateCuFunctionNVX' = FunPtr
  (Ptr Device_T
   -> Ptr CuFunctionCreateInfoNVX
   -> Ptr AllocationCallbacks
   -> Ptr CuFunctionNVX
   -> IO Result)
-> Ptr Device_T
-> Ptr CuFunctionCreateInfoNVX
-> Ptr AllocationCallbacks
-> Ptr CuFunctionNVX
-> IO Result
mkVkCreateCuFunctionNVX FunPtr
  (Ptr Device_T
   -> Ptr CuFunctionCreateInfoNVX
   -> Ptr AllocationCallbacks
   -> Ptr CuFunctionNVX
   -> IO Result)
vkCreateCuFunctionNVXPtr
  pCreateInfo <- ((Ptr CuFunctionCreateInfoNVX -> IO CuFunctionNVX)
 -> IO CuFunctionNVX)
-> ContT CuFunctionNVX IO (Ptr CuFunctionCreateInfoNVX)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr CuFunctionCreateInfoNVX -> IO CuFunctionNVX)
  -> IO CuFunctionNVX)
 -> ContT CuFunctionNVX IO (Ptr CuFunctionCreateInfoNVX))
-> ((Ptr CuFunctionCreateInfoNVX -> IO CuFunctionNVX)
    -> IO CuFunctionNVX)
-> ContT CuFunctionNVX IO (Ptr CuFunctionCreateInfoNVX)
forall a b. (a -> b) -> a -> b
$ CuFunctionCreateInfoNVX
-> (Ptr CuFunctionCreateInfoNVX -> IO CuFunctionNVX)
-> IO CuFunctionNVX
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
CuFunctionCreateInfoNVX
-> (Ptr CuFunctionCreateInfoNVX -> IO b) -> IO b
withCStruct (CuFunctionCreateInfoNVX
createInfo)
  pAllocator <- case (allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> Ptr AllocationCallbacks
-> ContT CuFunctionNVX IO (Ptr AllocationCallbacks)
forall a. a -> ContT CuFunctionNVX IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> ((Ptr AllocationCallbacks -> IO CuFunctionNVX) -> IO CuFunctionNVX)
-> ContT CuFunctionNVX IO (Ptr AllocationCallbacks)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AllocationCallbacks -> IO CuFunctionNVX)
  -> IO CuFunctionNVX)
 -> ContT CuFunctionNVX IO (Ptr AllocationCallbacks))
-> ((Ptr AllocationCallbacks -> IO CuFunctionNVX)
    -> IO CuFunctionNVX)
-> ContT CuFunctionNVX IO (Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks
-> (Ptr AllocationCallbacks -> IO CuFunctionNVX)
-> IO CuFunctionNVX
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
AllocationCallbacks -> (Ptr AllocationCallbacks -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  pPFunction <- ContT $ bracket (callocBytes @CuFunctionNVX 8) free
  r <- lift $ traceAroundEvent "vkCreateCuFunctionNVX" (vkCreateCuFunctionNVX'
                                                          (deviceHandle (device))
                                                          pCreateInfo
                                                          pAllocator
                                                          (pPFunction))
  lift $ when (r < SUCCESS) (throwIO (VulkanException r))
  pFunction <- lift $ peek @CuFunctionNVX pPFunction
  pure $ (pFunction)

-- | A convenience wrapper to make a compatible pair of calls to
-- 'createCuFunctionNVX' and 'destroyCuFunctionNVX'
--
-- To ensure that 'destroyCuFunctionNVX' is always called: pass
-- 'Control.Exception.bracket' (or the allocate function from your
-- favourite resource management library) as the last argument.
-- To just extract the pair pass '(,)' as the last argument.
--
withCuFunctionNVX :: forall io r . MonadIO io => Device -> CuFunctionCreateInfoNVX -> Maybe AllocationCallbacks -> (io CuFunctionNVX -> (CuFunctionNVX -> io ()) -> r) -> r
withCuFunctionNVX :: forall (io :: * -> *) r.
MonadIO io =>
Device
-> CuFunctionCreateInfoNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> (io CuFunctionNVX -> (CuFunctionNVX -> io ()) -> r)
-> r
withCuFunctionNVX Device
device CuFunctionCreateInfoNVX
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator io CuFunctionNVX -> (CuFunctionNVX -> io ()) -> r
b =
  io CuFunctionNVX -> (CuFunctionNVX -> io ()) -> r
b (Device
-> CuFunctionCreateInfoNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io CuFunctionNVX
forall (io :: * -> *).
MonadIO io =>
Device
-> CuFunctionCreateInfoNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io CuFunctionNVX
createCuFunctionNVX Device
device CuFunctionCreateInfoNVX
pCreateInfo "allocator" ::: Maybe AllocationCallbacks
pAllocator)
    (\(CuFunctionNVX
o0) -> Device
-> CuFunctionNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
forall (io :: * -> *).
MonadIO io =>
Device
-> CuFunctionNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyCuFunctionNVX Device
device CuFunctionNVX
o0 "allocator" ::: Maybe AllocationCallbacks
pAllocator)


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkDestroyCuModuleNVX
  :: FunPtr (Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ()

-- | vkDestroyCuModuleNVX - Stub description of vkDestroyCuModuleNVX
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkDestroyCuModuleNVX-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkDestroyCuModuleNVX-module-parameter# @module@ /must/ be a
--     valid 'Vulkan.Extensions.Handles.CuModuleNVX' handle
--
-- -   #VUID-vkDestroyCuModuleNVX-pAllocator-parameter# If @pAllocator@ is
--     not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkDestroyCuModuleNVX-module-parent# @module@ /must/ have been
--     created, allocated, or retrieved from @device@
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NVX_binary_import VK_NVX_binary_import>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Extensions.Handles.CuModuleNVX', 'Vulkan.Core10.Handles.Device'
destroyCuModuleNVX :: forall io
                    . (MonadIO io)
                   => -- No documentation found for Nested "vkDestroyCuModuleNVX" "device"
                      Device
                   -> -- No documentation found for Nested "vkDestroyCuModuleNVX" "module"
                      CuModuleNVX
                   -> -- No documentation found for Nested "vkDestroyCuModuleNVX" "pAllocator"
                      ("allocator" ::: Maybe AllocationCallbacks)
                   -> io ()
destroyCuModuleNVX :: forall (io :: * -> *).
MonadIO io =>
Device
-> CuModuleNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyCuModuleNVX Device
device CuModuleNVX
module' "allocator" ::: Maybe AllocationCallbacks
allocator = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkDestroyCuModuleNVXPtr :: FunPtr
  (Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ())
vkDestroyCuModuleNVXPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ())
pVkDestroyCuModuleNVX (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ())
vkDestroyCuModuleNVXPtr FunPtr
  (Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ())
-> FunPtr
     (Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, 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 String
"" String
"The function pointer for vkDestroyCuModuleNVX is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkDestroyCuModuleNVX' :: Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ()
vkDestroyCuModuleNVX' = FunPtr
  (Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ())
-> Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ()
mkVkDestroyCuModuleNVX FunPtr
  (Ptr Device_T -> CuModuleNVX -> Ptr AllocationCallbacks -> IO ())
vkDestroyCuModuleNVXPtr
  pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> Ptr AllocationCallbacks -> ContT () IO (Ptr AllocationCallbacks)
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> ((Ptr AllocationCallbacks -> IO ()) -> IO ())
-> ContT () IO (Ptr AllocationCallbacks)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AllocationCallbacks -> IO ()) -> IO ())
 -> ContT () IO (Ptr AllocationCallbacks))
-> ((Ptr AllocationCallbacks -> IO ()) -> IO ())
-> ContT () IO (Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks -> (Ptr AllocationCallbacks -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
AllocationCallbacks -> (Ptr AllocationCallbacks -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  lift $ traceAroundEvent "vkDestroyCuModuleNVX" (vkDestroyCuModuleNVX'
                                                    (deviceHandle (device))
                                                    (module')
                                                    pAllocator)
  pure $ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkDestroyCuFunctionNVX
  :: FunPtr (Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ()) -> Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ()

-- | vkDestroyCuFunctionNVX - Stub description of vkDestroyCuFunctionNVX
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkDestroyCuFunctionNVX-device-parameter# @device@ /must/ be a
--     valid 'Vulkan.Core10.Handles.Device' handle
--
-- -   #VUID-vkDestroyCuFunctionNVX-function-parameter# @function@ /must/
--     be a valid 'Vulkan.Extensions.Handles.CuFunctionNVX' handle
--
-- -   #VUID-vkDestroyCuFunctionNVX-pAllocator-parameter# If @pAllocator@
--     is not @NULL@, @pAllocator@ /must/ be a valid pointer to a valid
--     'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks' structure
--
-- -   #VUID-vkDestroyCuFunctionNVX-function-parent# @function@ /must/ have
--     been created, allocated, or retrieved from @device@
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NVX_binary_import VK_NVX_binary_import>,
-- 'Vulkan.Core10.AllocationCallbacks.AllocationCallbacks',
-- 'Vulkan.Extensions.Handles.CuFunctionNVX',
-- 'Vulkan.Core10.Handles.Device'
destroyCuFunctionNVX :: forall io
                      . (MonadIO io)
                     => -- No documentation found for Nested "vkDestroyCuFunctionNVX" "device"
                        Device
                     -> -- No documentation found for Nested "vkDestroyCuFunctionNVX" "function"
                        CuFunctionNVX
                     -> -- No documentation found for Nested "vkDestroyCuFunctionNVX" "pAllocator"
                        ("allocator" ::: Maybe AllocationCallbacks)
                     -> io ()
destroyCuFunctionNVX :: forall (io :: * -> *).
MonadIO io =>
Device
-> CuFunctionNVX
-> ("allocator" ::: Maybe AllocationCallbacks)
-> io ()
destroyCuFunctionNVX Device
device CuFunctionNVX
function "allocator" ::: Maybe AllocationCallbacks
allocator = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkDestroyCuFunctionNVXPtr :: FunPtr
  (Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ())
vkDestroyCuFunctionNVXPtr = DeviceCmds
-> FunPtr
     (Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ())
pVkDestroyCuFunctionNVX (case Device
device of Device{DeviceCmds
deviceCmds :: Device -> DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr
  (Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ())
vkDestroyCuFunctionNVXPtr FunPtr
  (Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ())
-> FunPtr
     (Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr
  (Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, 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 String
"" String
"The function pointer for vkDestroyCuFunctionNVX is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkDestroyCuFunctionNVX' :: Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ()
vkDestroyCuFunctionNVX' = FunPtr
  (Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ())
-> Ptr Device_T
-> CuFunctionNVX
-> Ptr AllocationCallbacks
-> IO ()
mkVkDestroyCuFunctionNVX FunPtr
  (Ptr Device_T -> CuFunctionNVX -> Ptr AllocationCallbacks -> IO ())
vkDestroyCuFunctionNVXPtr
  pAllocator <- case ("allocator" ::: Maybe AllocationCallbacks
allocator) of
    "allocator" ::: Maybe AllocationCallbacks
Nothing -> Ptr AllocationCallbacks -> ContT () IO (Ptr AllocationCallbacks)
forall a. a -> ContT () IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Ptr AllocationCallbacks
forall a. Ptr a
nullPtr
    Just AllocationCallbacks
j -> ((Ptr AllocationCallbacks -> IO ()) -> IO ())
-> ContT () IO (Ptr AllocationCallbacks)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr AllocationCallbacks -> IO ()) -> IO ())
 -> ContT () IO (Ptr AllocationCallbacks))
-> ((Ptr AllocationCallbacks -> IO ()) -> IO ())
-> ContT () IO (Ptr AllocationCallbacks)
forall a b. (a -> b) -> a -> b
$ AllocationCallbacks -> (Ptr AllocationCallbacks -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b.
AllocationCallbacks -> (Ptr AllocationCallbacks -> IO b) -> IO b
withCStruct (AllocationCallbacks
j)
  lift $ traceAroundEvent "vkDestroyCuFunctionNVX" (vkDestroyCuFunctionNVX'
                                                      (deviceHandle (device))
                                                      (function)
                                                      pAllocator)
  pure $ ()


foreign import ccall
#if !defined(SAFE_FOREIGN_CALLS)
  unsafe
#endif
  "dynamic" mkVkCmdCuLaunchKernelNVX
  :: FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ()) -> Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ()

-- | vkCmdCuLaunchKernelNVX - Stub description of vkCmdCuLaunchKernelNVX
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-vkCmdCuLaunchKernelNVX-commandBuffer-parameter#
--     @commandBuffer@ /must/ be a valid
--     'Vulkan.Core10.Handles.CommandBuffer' handle
--
-- -   #VUID-vkCmdCuLaunchKernelNVX-pLaunchInfo-parameter# @pLaunchInfo@
--     /must/ be a valid pointer to a valid 'CuLaunchInfoNVX' structure
--
-- -   #VUID-vkCmdCuLaunchKernelNVX-commandBuffer-recording#
--     @commandBuffer@ /must/ be in the
--     <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#commandbuffers-lifecycle recording state>
--
-- -   #VUID-vkCmdCuLaunchKernelNVX-commandBuffer-cmdpool# The
--     'Vulkan.Core10.Handles.CommandPool' that @commandBuffer@ was
--     allocated from /must/ support
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_COMPUTE_BIT', or
--     'Vulkan.Core10.Enums.QueueFlagBits.QUEUE_GRAPHICS_BIT' operations
--
-- -   #VUID-vkCmdCuLaunchKernelNVX-suspended# This command /must/ not be
--     called between suspended render pass instances
--
-- -   #VUID-vkCmdCuLaunchKernelNVX-videocoding# This command /must/ only
--     be called outside of a video coding scope
--
-- == Host Synchronization
--
-- -   Host access to the 'Vulkan.Core10.Handles.CommandPool' that
--     @commandBuffer@ was allocated from /must/ be externally synchronized
--
-- == Command Properties
--
-- \'
--
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-- | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkCommandBufferLevel Command Buffer Levels> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginRenderPass Render Pass Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#vkCmdBeginVideoCodingKHR Video Coding Scope> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VkQueueFlagBits Supported Queue Types> | <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#fundamentals-queueoperation-command-types Command Type> |
-- +============================================================================================================================+========================================================================================================================+=============================================================================================================================+=======================================================================================================================+========================================================================================================================================+
-- | Primary                                                                                                                    | Both                                                                                                                   | Outside                                                                                                                     | VK_QUEUE_COMPUTE_BIT                                                                                                  | Action                                                                                                                                 |
-- | Secondary                                                                                                                  |                                                                                                                        |                                                                                                                             | VK_QUEUE_GRAPHICS_BIT                                                                                                 |                                                                                                                                        |
-- +----------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
--
-- == Conditional Rendering
--
-- vkCmdCuLaunchKernelNVX is not affected by
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#drawing-conditional-rendering conditional rendering>
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NVX_binary_import VK_NVX_binary_import>,
-- 'Vulkan.Core10.Handles.CommandBuffer', 'CuLaunchInfoNVX'
cmdCuLaunchKernelNVX :: forall io
                      . (MonadIO io)
                     => -- No documentation found for Nested "vkCmdCuLaunchKernelNVX" "commandBuffer"
                        CommandBuffer
                     -> -- No documentation found for Nested "vkCmdCuLaunchKernelNVX" "pLaunchInfo"
                        CuLaunchInfoNVX
                     -> io ()
cmdCuLaunchKernelNVX :: forall (io :: * -> *).
MonadIO io =>
CommandBuffer -> CuLaunchInfoNVX -> io ()
cmdCuLaunchKernelNVX CommandBuffer
commandBuffer CuLaunchInfoNVX
launchInfo = IO () -> io ()
forall a. IO a -> io a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> io ())
-> (ContT () IO () -> IO ()) -> ContT () IO () -> io ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ContT () IO () -> IO ()
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT () IO () -> io ()) -> ContT () IO () -> io ()
forall a b. (a -> b) -> a -> b
$ do
  let vkCmdCuLaunchKernelNVXPtr :: FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ())
vkCmdCuLaunchKernelNVXPtr = DeviceCmds
-> FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ())
pVkCmdCuLaunchKernelNVX (case CommandBuffer
commandBuffer of CommandBuffer{DeviceCmds
deviceCmds :: DeviceCmds
deviceCmds :: CommandBuffer -> DeviceCmds
deviceCmds} -> DeviceCmds
deviceCmds)
  IO () -> ContT () IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT () m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT () IO ()) -> IO () -> ContT () IO ()
forall a b. (a -> b) -> a -> b
$ Bool -> IO () -> IO ()
forall (f :: * -> *). Applicative f => Bool -> f () -> f ()
unless (FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ())
vkCmdCuLaunchKernelNVXPtr FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ())
-> FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ())
-> Bool
forall a. Eq a => a -> a -> Bool
/= FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ())
forall a. FunPtr a
nullFunPtr) (IO () -> IO ()) -> IO () -> IO ()
forall a b. (a -> b) -> a -> b
$
    IOException -> IO ()
forall e a. (HasCallStack, 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 String
"" String
"The function pointer for vkCmdCuLaunchKernelNVX is null" Maybe CInt
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing
  let vkCmdCuLaunchKernelNVX' :: Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ()
vkCmdCuLaunchKernelNVX' = FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ())
-> Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ()
mkVkCmdCuLaunchKernelNVX FunPtr (Ptr CommandBuffer_T -> Ptr CuLaunchInfoNVX -> IO ())
vkCmdCuLaunchKernelNVXPtr
  pLaunchInfo <- ((Ptr CuLaunchInfoNVX -> IO ()) -> IO ())
-> ContT () IO (Ptr CuLaunchInfoNVX)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr CuLaunchInfoNVX -> IO ()) -> IO ())
 -> ContT () IO (Ptr CuLaunchInfoNVX))
-> ((Ptr CuLaunchInfoNVX -> IO ()) -> IO ())
-> ContT () IO (Ptr CuLaunchInfoNVX)
forall a b. (a -> b) -> a -> b
$ CuLaunchInfoNVX -> (Ptr CuLaunchInfoNVX -> IO ()) -> IO ()
forall a b. ToCStruct a => a -> (Ptr a -> IO b) -> IO b
forall b. CuLaunchInfoNVX -> (Ptr CuLaunchInfoNVX -> IO b) -> IO b
withCStruct (CuLaunchInfoNVX
launchInfo)
  lift $ traceAroundEvent "vkCmdCuLaunchKernelNVX" (vkCmdCuLaunchKernelNVX'
                                                      (commandBufferHandle (commandBuffer))
                                                      pLaunchInfo)
  pure $ ()


-- | VkCuModuleCreateInfoNVX - Stub description of VkCuModuleCreateInfoNVX
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkCuModuleCreateInfoNVX-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX'
--
-- -   #VUID-VkCuModuleCreateInfoNVX-pNext-pNext# @pNext@ /must/ be @NULL@
--     or a pointer to a valid instance of
--     'CuModuleTexturingModeCreateInfoNVX'
--
-- -   #VUID-VkCuModuleCreateInfoNVX-sType-unique# The @sType@ value of
--     each structure in the @pNext@ chain /must/ be unique
--
-- -   #VUID-VkCuModuleCreateInfoNVX-pData-parameter# If @dataSize@ is not
--     @0@, @pData@ /must/ be a valid pointer to an array of @dataSize@
--     bytes
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NVX_binary_import VK_NVX_binary_import>,
-- 'Vulkan.Core10.Enums.StructureType.StructureType', 'createCuModuleNVX'
data CuModuleCreateInfoNVX (es :: [Type]) = CuModuleCreateInfoNVX
  { -- No documentation found for Nested "VkCuModuleCreateInfoNVX" "pNext"
    forall (es :: [*]). CuModuleCreateInfoNVX es -> Chain es
next :: Chain es
  , -- No documentation found for Nested "VkCuModuleCreateInfoNVX" "dataSize"
    forall (es :: [*]). CuModuleCreateInfoNVX es -> Word64
dataSize :: Word64
  , -- No documentation found for Nested "VkCuModuleCreateInfoNVX" "pData"
    forall (es :: [*]). CuModuleCreateInfoNVX es -> Ptr ()
data' :: Ptr ()
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CuModuleCreateInfoNVX (es :: [Type]))
#endif
deriving instance Show (Chain es) => Show (CuModuleCreateInfoNVX es)

instance Extensible CuModuleCreateInfoNVX where
  extensibleTypeName :: String
extensibleTypeName = String
"CuModuleCreateInfoNVX"
  setNext :: forall (ds :: [*]) (es :: [*]).
CuModuleCreateInfoNVX ds -> Chain es -> CuModuleCreateInfoNVX es
setNext CuModuleCreateInfoNVX{Word64
Ptr ()
Chain ds
next :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Chain es
dataSize :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Word64
data' :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Ptr ()
next :: Chain ds
dataSize :: Word64
data' :: Ptr ()
..} Chain es
next' = CuModuleCreateInfoNVX{next :: Chain es
next = Chain es
next', Word64
Ptr ()
dataSize :: Word64
data' :: Ptr ()
dataSize :: Word64
data' :: Ptr ()
..}
  getNext :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Chain es
getNext CuModuleCreateInfoNVX{Word64
Ptr ()
Chain es
next :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Chain es
dataSize :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Word64
data' :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Ptr ()
next :: Chain es
dataSize :: Word64
data' :: Ptr ()
..} = Chain es
next
  extends :: forall e b proxy. Typeable e => proxy e -> (Extends CuModuleCreateInfoNVX e => b) -> Maybe b
  extends :: forall e b (proxy :: * -> *).
Typeable e =>
proxy e -> (Extends CuModuleCreateInfoNVX e => b) -> Maybe b
extends proxy e
_ Extends CuModuleCreateInfoNVX e => b
f
    | Just e :~: CuModuleTexturingModeCreateInfoNVX
Refl <- forall {k} (a :: k) (b :: k).
(Typeable a, Typeable b) =>
Maybe (a :~: b)
forall a b. (Typeable a, Typeable b) => Maybe (a :~: b)
eqT @e @CuModuleTexturingModeCreateInfoNVX = b -> Maybe b
forall a. a -> Maybe a
Just b
Extends CuModuleCreateInfoNVX e => b
f
    | Bool
otherwise = Maybe b
forall a. Maybe a
Nothing

instance ( Extendss CuModuleCreateInfoNVX es
         , PokeChain es ) => ToCStruct (CuModuleCreateInfoNVX es) where
  withCStruct :: forall b.
CuModuleCreateInfoNVX es
-> (Ptr (CuModuleCreateInfoNVX es) -> IO b) -> IO b
withCStruct CuModuleCreateInfoNVX es
x Ptr (CuModuleCreateInfoNVX es) -> IO b
f = Int -> (Ptr (CuModuleCreateInfoNVX es) -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr (CuModuleCreateInfoNVX es) -> IO b) -> IO b)
-> (Ptr (CuModuleCreateInfoNVX es) -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr (CuModuleCreateInfoNVX es)
p -> Ptr (CuModuleCreateInfoNVX es)
-> CuModuleCreateInfoNVX es -> IO b -> IO b
forall b.
Ptr (CuModuleCreateInfoNVX es)
-> CuModuleCreateInfoNVX es -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr (CuModuleCreateInfoNVX es)
p CuModuleCreateInfoNVX es
x (Ptr (CuModuleCreateInfoNVX es) -> IO b
f Ptr (CuModuleCreateInfoNVX es)
p)
  pokeCStruct :: forall b.
Ptr (CuModuleCreateInfoNVX es)
-> CuModuleCreateInfoNVX es -> IO b -> IO b
pokeCStruct Ptr (CuModuleCreateInfoNVX es)
p CuModuleCreateInfoNVX{Word64
Ptr ()
Chain es
next :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Chain es
dataSize :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Word64
data' :: forall (es :: [*]). CuModuleCreateInfoNVX es -> Ptr ()
next :: Chain es
dataSize :: Word64
data' :: Ptr ()
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (CuModuleCreateInfoNVX es)
p Ptr (CuModuleCreateInfoNVX es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX)
    pNext'' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ Chain es -> (Ptr (Chain es) -> IO b) -> IO b
forall (es :: [*]) a.
PokeChain es =>
Chain es -> (Ptr (Chain es) -> IO a) -> IO a
forall a. Chain es -> (Ptr (Chain es) -> IO a) -> IO a
withChain (Chain es
next)
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext''
    lift $ poke ((p `plusPtr` 16 :: Ptr CSize)) (CSize (dataSize))
    lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr ()))) (data')
    lift $ f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr (CuModuleCreateInfoNVX es) -> IO b -> IO b
pokeZeroCStruct Ptr (CuModuleCreateInfoNVX es)
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr (CuModuleCreateInfoNVX es)
p Ptr (CuModuleCreateInfoNVX es) -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CU_MODULE_CREATE_INFO_NVX)
    pNext' <- (Ptr (Chain es) -> Ptr ())
-> ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> ContT b IO a -> ContT b IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Ptr (Chain es) -> Ptr ()
forall a b. Ptr a -> Ptr b
castPtr (ContT b IO (Ptr (Chain es)) -> ContT b IO (Ptr ()))
-> (((Ptr (Chain es) -> IO b) -> IO b)
    -> ContT b IO (Ptr (Chain es)))
-> ((Ptr (Chain es) -> IO b) -> IO b)
-> ContT b IO (Ptr ())
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr (Chain es))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ()))
-> ((Ptr (Chain es) -> IO b) -> IO b) -> ContT b IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ forall (es :: [*]) a.
PokeChain es =>
(Ptr (Chain es) -> IO a) -> IO a
withZeroChain @es
    lift $ poke ((p `plusPtr` 8 :: Ptr (Ptr ()))) pNext'
    lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr ()))) (zero)
    lift $ f

instance ( Extendss CuModuleCreateInfoNVX es
         , PeekChain es ) => FromCStruct (CuModuleCreateInfoNVX es) where
  peekCStruct :: Ptr (CuModuleCreateInfoNVX es) -> IO (CuModuleCreateInfoNVX es)
peekCStruct Ptr (CuModuleCreateInfoNVX es)
p = do
    pNext <- forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (CuModuleCreateInfoNVX es)
p Ptr (CuModuleCreateInfoNVX es) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ())))
    next <- peekChain (castPtr pNext)
    dataSize <- peek @CSize ((p `plusPtr` 16 :: Ptr CSize))
    pData <- peek @(Ptr ()) ((p `plusPtr` 24 :: Ptr (Ptr ())))
    pure $ CuModuleCreateInfoNVX
             next (coerce @CSize @Word64 dataSize) pData

instance es ~ '[] => Zero (CuModuleCreateInfoNVX es) where
  zero :: CuModuleCreateInfoNVX es
zero = Chain es -> Word64 -> Ptr () -> CuModuleCreateInfoNVX es
forall (es :: [*]).
Chain es -> Word64 -> Ptr () -> CuModuleCreateInfoNVX es
CuModuleCreateInfoNVX
           ()
           Word64
forall a. Zero a => a
zero
           Ptr ()
forall a. Zero a => a
zero


-- | VkCuModuleTexturingModeCreateInfoNVX - Stub description of
-- VkCuModuleTexturingModeCreateInfoNVX
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NVX_binary_import VK_NVX_binary_import>,
-- 'Vulkan.Core10.FundamentalTypes.Bool32',
-- 'Vulkan.Core10.Enums.StructureType.StructureType'
data CuModuleTexturingModeCreateInfoNVX = CuModuleTexturingModeCreateInfoNVX
  { -- No documentation found for Nested "VkCuModuleTexturingModeCreateInfoNVX" "use64bitTexturing"
    CuModuleTexturingModeCreateInfoNVX -> Bool
use64bitTexturing :: Bool }
  deriving (Typeable, CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> Bool
(CuModuleTexturingModeCreateInfoNVX
 -> CuModuleTexturingModeCreateInfoNVX -> Bool)
-> (CuModuleTexturingModeCreateInfoNVX
    -> CuModuleTexturingModeCreateInfoNVX -> Bool)
-> Eq CuModuleTexturingModeCreateInfoNVX
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> Bool
== :: CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> Bool
$c/= :: CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> Bool
/= :: CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> Bool
Eq)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CuModuleTexturingModeCreateInfoNVX)
#endif
deriving instance Show CuModuleTexturingModeCreateInfoNVX

instance ToCStruct CuModuleTexturingModeCreateInfoNVX where
  withCStruct :: forall b.
CuModuleTexturingModeCreateInfoNVX
-> (Ptr CuModuleTexturingModeCreateInfoNVX -> IO b) -> IO b
withCStruct CuModuleTexturingModeCreateInfoNVX
x Ptr CuModuleTexturingModeCreateInfoNVX -> IO b
f = Int -> (Ptr CuModuleTexturingModeCreateInfoNVX -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
24 ((Ptr CuModuleTexturingModeCreateInfoNVX -> IO b) -> IO b)
-> (Ptr CuModuleTexturingModeCreateInfoNVX -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr CuModuleTexturingModeCreateInfoNVX
p -> Ptr CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> IO b -> IO b
forall b.
Ptr CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CuModuleTexturingModeCreateInfoNVX
p CuModuleTexturingModeCreateInfoNVX
x (Ptr CuModuleTexturingModeCreateInfoNVX -> IO b
f Ptr CuModuleTexturingModeCreateInfoNVX
p)
  pokeCStruct :: forall b.
Ptr CuModuleTexturingModeCreateInfoNVX
-> CuModuleTexturingModeCreateInfoNVX -> IO b -> IO b
pokeCStruct Ptr CuModuleTexturingModeCreateInfoNVX
p CuModuleTexturingModeCreateInfoNVX{Bool
use64bitTexturing :: CuModuleTexturingModeCreateInfoNVX -> Bool
use64bitTexturing :: Bool
..} IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuModuleTexturingModeCreateInfoNVX
p Ptr CuModuleTexturingModeCreateInfoNVX -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CU_MODULE_TEXTURING_MODE_CREATE_INFO_NVX)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuModuleTexturingModeCreateInfoNVX
p Ptr CuModuleTexturingModeCreateInfoNVX -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuModuleTexturingModeCreateInfoNVX
p Ptr CuModuleTexturingModeCreateInfoNVX -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
use64bitTexturing))
    IO b
f
  cStructSize :: Int
cStructSize = Int
24
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr CuModuleTexturingModeCreateInfoNVX -> IO b -> IO b
pokeZeroCStruct Ptr CuModuleTexturingModeCreateInfoNVX
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuModuleTexturingModeCreateInfoNVX
p Ptr CuModuleTexturingModeCreateInfoNVX -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CU_MODULE_TEXTURING_MODE_CREATE_INFO_NVX)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuModuleTexturingModeCreateInfoNVX
p Ptr CuModuleTexturingModeCreateInfoNVX -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr Bool32 -> Bool32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuModuleTexturingModeCreateInfoNVX
p Ptr CuModuleTexturingModeCreateInfoNVX -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32)) (Bool -> Bool32
boolToBool32 (Bool
forall a. Zero a => a
zero))
    IO b
f

instance FromCStruct CuModuleTexturingModeCreateInfoNVX where
  peekCStruct :: Ptr CuModuleTexturingModeCreateInfoNVX
-> IO CuModuleTexturingModeCreateInfoNVX
peekCStruct Ptr CuModuleTexturingModeCreateInfoNVX
p = do
    use64bitTexturing <- forall a. Storable a => Ptr a -> IO a
peek @Bool32 ((Ptr CuModuleTexturingModeCreateInfoNVX
p Ptr CuModuleTexturingModeCreateInfoNVX -> Int -> Ptr Bool32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr Bool32))
    pure $ CuModuleTexturingModeCreateInfoNVX
             (bool32ToBool use64bitTexturing)

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

instance Zero CuModuleTexturingModeCreateInfoNVX where
  zero :: CuModuleTexturingModeCreateInfoNVX
zero = Bool -> CuModuleTexturingModeCreateInfoNVX
CuModuleTexturingModeCreateInfoNVX
           Bool
forall a. Zero a => a
zero


-- | VkCuFunctionCreateInfoNVX - Stub description of
-- VkCuFunctionCreateInfoNVX
--
-- == Valid Usage (Implicit)
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NVX_binary_import VK_NVX_binary_import>,
-- 'Vulkan.Extensions.Handles.CuModuleNVX',
-- 'Vulkan.Core10.Enums.StructureType.StructureType', 'createCuFunctionNVX'
data CuFunctionCreateInfoNVX = CuFunctionCreateInfoNVX
  { -- | #VUID-VkCuFunctionCreateInfoNVX-module-parameter# @module@ /must/ be a
    -- valid 'Vulkan.Extensions.Handles.CuModuleNVX' handle
    CuFunctionCreateInfoNVX -> CuModuleNVX
module' :: CuModuleNVX
  , -- | #VUID-VkCuFunctionCreateInfoNVX-pName-parameter# @pName@ /must/ be a
    -- null-terminated UTF-8 string
    CuFunctionCreateInfoNVX -> ByteString
name :: ByteString
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CuFunctionCreateInfoNVX)
#endif
deriving instance Show CuFunctionCreateInfoNVX

instance ToCStruct CuFunctionCreateInfoNVX where
  withCStruct :: forall b.
CuFunctionCreateInfoNVX
-> (Ptr CuFunctionCreateInfoNVX -> IO b) -> IO b
withCStruct CuFunctionCreateInfoNVX
x Ptr CuFunctionCreateInfoNVX -> IO b
f = Int -> (Ptr CuFunctionCreateInfoNVX -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
32 ((Ptr CuFunctionCreateInfoNVX -> IO b) -> IO b)
-> (Ptr CuFunctionCreateInfoNVX -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr CuFunctionCreateInfoNVX
p -> Ptr CuFunctionCreateInfoNVX
-> CuFunctionCreateInfoNVX -> IO b -> IO b
forall b.
Ptr CuFunctionCreateInfoNVX
-> CuFunctionCreateInfoNVX -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CuFunctionCreateInfoNVX
p CuFunctionCreateInfoNVX
x (Ptr CuFunctionCreateInfoNVX -> IO b
f Ptr CuFunctionCreateInfoNVX
p)
  pokeCStruct :: forall b.
Ptr CuFunctionCreateInfoNVX
-> CuFunctionCreateInfoNVX -> IO b -> IO b
pokeCStruct Ptr CuFunctionCreateInfoNVX
p CuFunctionCreateInfoNVX{ByteString
CuModuleNVX
module' :: CuFunctionCreateInfoNVX -> CuModuleNVX
name :: CuFunctionCreateInfoNVX -> ByteString
module' :: CuModuleNVX
name :: ByteString
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuFunctionCreateInfoNVX
p Ptr CuFunctionCreateInfoNVX -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuFunctionCreateInfoNVX
p Ptr CuFunctionCreateInfoNVX -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CuModuleNVX -> CuModuleNVX -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuFunctionCreateInfoNVX
p Ptr CuFunctionCreateInfoNVX -> Int -> Ptr CuModuleNVX
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CuModuleNVX)) (CuModuleNVX
module')
    pName'' <- ((Ptr CChar -> IO b) -> IO b) -> ContT b IO (Ptr CChar)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr CChar -> IO b) -> IO b) -> ContT b IO (Ptr CChar))
-> ((Ptr CChar -> IO b) -> IO b) -> ContT b IO (Ptr CChar)
forall a b. (a -> b) -> a -> b
$ ByteString -> (Ptr CChar -> IO b) -> IO b
forall a. ByteString -> (Ptr CChar -> IO a) -> IO a
useAsCString (ByteString
name)
    lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr CChar))) pName''
    lift $ f
  cStructSize :: Int
cStructSize = Int
32
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr CuFunctionCreateInfoNVX -> IO b -> IO b
pokeZeroCStruct Ptr CuFunctionCreateInfoNVX
p IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuFunctionCreateInfoNVX
p Ptr CuFunctionCreateInfoNVX -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CU_FUNCTION_CREATE_INFO_NVX)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuFunctionCreateInfoNVX
p Ptr CuFunctionCreateInfoNVX -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CuModuleNVX -> CuModuleNVX -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuFunctionCreateInfoNVX
p Ptr CuFunctionCreateInfoNVX -> Int -> Ptr CuModuleNVX
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CuModuleNVX)) (CuModuleNVX
forall a. Zero a => a
zero)
    pName'' <- ((Ptr CChar -> IO b) -> IO b) -> ContT b IO (Ptr CChar)
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr CChar -> IO b) -> IO b) -> ContT b IO (Ptr CChar))
-> ((Ptr CChar -> IO b) -> IO b) -> ContT b IO (Ptr CChar)
forall a b. (a -> b) -> a -> b
$ ByteString -> (Ptr CChar -> IO b) -> IO b
forall a. ByteString -> (Ptr CChar -> IO a) -> IO a
useAsCString (ByteString
forall a. Monoid a => a
mempty)
    lift $ poke ((p `plusPtr` 24 :: Ptr (Ptr CChar))) pName''
    lift $ f

instance FromCStruct CuFunctionCreateInfoNVX where
  peekCStruct :: Ptr CuFunctionCreateInfoNVX -> IO CuFunctionCreateInfoNVX
peekCStruct Ptr CuFunctionCreateInfoNVX
p = do
    module' <- forall a. Storable a => Ptr a -> IO a
peek @CuModuleNVX ((Ptr CuFunctionCreateInfoNVX
p Ptr CuFunctionCreateInfoNVX -> Int -> Ptr CuModuleNVX
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CuModuleNVX))
    pName <- packCString =<< peek ((p `plusPtr` 24 :: Ptr (Ptr CChar)))
    pure $ CuFunctionCreateInfoNVX
             module' pName

instance Zero CuFunctionCreateInfoNVX where
  zero :: CuFunctionCreateInfoNVX
zero = CuModuleNVX -> ByteString -> CuFunctionCreateInfoNVX
CuFunctionCreateInfoNVX
           CuModuleNVX
forall a. Zero a => a
zero
           ByteString
forall a. Monoid a => a
mempty


-- | VkCuLaunchInfoNVX - Stub description of VkCuLaunchInfoNVX
--
-- == Valid Usage (Implicit)
--
-- -   #VUID-VkCuLaunchInfoNVX-sType-sType# @sType@ /must/ be
--     'Vulkan.Core10.Enums.StructureType.STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX'
--
-- -   #VUID-VkCuLaunchInfoNVX-pNext-pNext# @pNext@ /must/ be @NULL@
--
-- -   #VUID-VkCuLaunchInfoNVX-function-parameter# @function@ /must/ be a
--     valid 'Vulkan.Extensions.Handles.CuFunctionNVX' handle
--
-- -   #VUID-VkCuLaunchInfoNVX-pParams-parameter# If @paramCount@ is not
--     @0@, @pParams@ /must/ be a valid pointer to an array of @paramCount@
--     bytes
--
-- -   #VUID-VkCuLaunchInfoNVX-pExtras-parameter# If @extraCount@ is not
--     @0@, @pExtras@ /must/ be a valid pointer to an array of @extraCount@
--     bytes
--
-- = See Also
--
-- <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VK_NVX_binary_import VK_NVX_binary_import>,
-- 'Vulkan.Extensions.Handles.CuFunctionNVX',
-- 'Vulkan.Core10.Enums.StructureType.StructureType',
-- 'cmdCuLaunchKernelNVX'
data CuLaunchInfoNVX = CuLaunchInfoNVX
  { -- No documentation found for Nested "VkCuLaunchInfoNVX" "function"
    CuLaunchInfoNVX -> CuFunctionNVX
function :: CuFunctionNVX
  , -- No documentation found for Nested "VkCuLaunchInfoNVX" "gridDimX"
    CuLaunchInfoNVX -> Word32
gridDimX :: Word32
  , -- No documentation found for Nested "VkCuLaunchInfoNVX" "gridDimY"
    CuLaunchInfoNVX -> Word32
gridDimY :: Word32
  , -- No documentation found for Nested "VkCuLaunchInfoNVX" "gridDimZ"
    CuLaunchInfoNVX -> Word32
gridDimZ :: Word32
  , -- No documentation found for Nested "VkCuLaunchInfoNVX" "blockDimX"
    CuLaunchInfoNVX -> Word32
blockDimX :: Word32
  , -- No documentation found for Nested "VkCuLaunchInfoNVX" "blockDimY"
    CuLaunchInfoNVX -> Word32
blockDimY :: Word32
  , -- No documentation found for Nested "VkCuLaunchInfoNVX" "blockDimZ"
    CuLaunchInfoNVX -> Word32
blockDimZ :: Word32
  , -- No documentation found for Nested "VkCuLaunchInfoNVX" "sharedMemBytes"
    CuLaunchInfoNVX -> Word32
sharedMemBytes :: Word32
  , -- No documentation found for Nested "VkCuLaunchInfoNVX" "pParams"
    CuLaunchInfoNVX -> Vector (Ptr ())
params :: Vector (Ptr ())
  , -- No documentation found for Nested "VkCuLaunchInfoNVX" "pExtras"
    CuLaunchInfoNVX -> Vector (Ptr ())
extras :: Vector (Ptr ())
  }
  deriving (Typeable)
#if defined(GENERIC_INSTANCES)
deriving instance Generic (CuLaunchInfoNVX)
#endif
deriving instance Show CuLaunchInfoNVX

instance ToCStruct CuLaunchInfoNVX where
  withCStruct :: forall b. CuLaunchInfoNVX -> (Ptr CuLaunchInfoNVX -> IO b) -> IO b
withCStruct CuLaunchInfoNVX
x Ptr CuLaunchInfoNVX -> IO b
f = Int -> (Ptr CuLaunchInfoNVX -> IO b) -> IO b
forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes Int
88 ((Ptr CuLaunchInfoNVX -> IO b) -> IO b)
-> (Ptr CuLaunchInfoNVX -> IO b) -> IO b
forall a b. (a -> b) -> a -> b
$ \Ptr CuLaunchInfoNVX
p -> Ptr CuLaunchInfoNVX -> CuLaunchInfoNVX -> IO b -> IO b
forall b. Ptr CuLaunchInfoNVX -> CuLaunchInfoNVX -> IO b -> IO b
forall a b. ToCStruct a => Ptr a -> a -> IO b -> IO b
pokeCStruct Ptr CuLaunchInfoNVX
p CuLaunchInfoNVX
x (Ptr CuLaunchInfoNVX -> IO b
f Ptr CuLaunchInfoNVX
p)
  pokeCStruct :: forall b. Ptr CuLaunchInfoNVX -> CuLaunchInfoNVX -> IO b -> IO b
pokeCStruct Ptr CuLaunchInfoNVX
p CuLaunchInfoNVX{Word32
Vector (Ptr ())
CuFunctionNVX
function :: CuLaunchInfoNVX -> CuFunctionNVX
gridDimX :: CuLaunchInfoNVX -> Word32
gridDimY :: CuLaunchInfoNVX -> Word32
gridDimZ :: CuLaunchInfoNVX -> Word32
blockDimX :: CuLaunchInfoNVX -> Word32
blockDimY :: CuLaunchInfoNVX -> Word32
blockDimZ :: CuLaunchInfoNVX -> Word32
sharedMemBytes :: CuLaunchInfoNVX -> Word32
params :: CuLaunchInfoNVX -> Vector (Ptr ())
extras :: CuLaunchInfoNVX -> Vector (Ptr ())
function :: CuFunctionNVX
gridDimX :: Word32
gridDimY :: Word32
gridDimZ :: Word32
blockDimX :: Word32
blockDimY :: Word32
blockDimZ :: Word32
sharedMemBytes :: Word32
params :: Vector (Ptr ())
extras :: Vector (Ptr ())
..} IO b
f = ContT b IO b -> IO b
forall (m :: * -> *) r. Monad m => ContT r m r -> m r
evalContT (ContT b IO b -> IO b) -> ContT b IO b -> IO b
forall a b. (a -> b) -> a -> b
$ do
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CuFunctionNVX -> CuFunctionNVX -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr CuFunctionNVX
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CuFunctionNVX)) (CuFunctionNVX
function)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Word32
gridDimX)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (Word32
gridDimY)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
gridDimZ)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Word32)) (Word32
blockDimX)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Word32)) (Word32
blockDimY)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Word32)) (Word32
blockDimZ)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word32)) (Word32
sharedMemBytes)
    IO () -> ContT b IO ()
forall (m :: * -> *) a. Monad m => m a -> ContT b m a
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (IO () -> ContT b IO ()) -> IO () -> ContT b IO ()
forall a b. (a -> b) -> a -> b
$ Ptr CSize -> CSize -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr CSize
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56 :: Ptr CSize)) (Int -> CSize
forall a b. (Integral a, Num b) => a -> b
fromIntegral ((Vector (Ptr ()) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (Ptr ()) -> Int) -> Vector (Ptr ()) -> Int
forall a b. (a -> b) -> a -> b
$ (Vector (Ptr ())
params))))
    pPParams' <- ((Ptr (Ptr ()) -> IO b) -> IO b) -> ContT b IO (Ptr (Ptr ()))
forall {k} (r :: k) (m :: k -> *) a.
((a -> m r) -> m r) -> ContT r m a
ContT (((Ptr (Ptr ()) -> IO b) -> IO b) -> ContT b IO (Ptr (Ptr ())))
-> ((Ptr (Ptr ()) -> IO b) -> IO b) -> ContT b IO (Ptr (Ptr ()))
forall a b. (a -> b) -> a -> b
$ forall a b. Int -> (Ptr a -> IO b) -> IO b
allocaBytes @(Ptr ()) ((Vector (Ptr ()) -> Int
forall a. Vector a -> Int
Data.Vector.length (Vector (Ptr ())
params)) Int -> Int -> Int
forall a. Num a => a -> a -> a
* Int
8)
    lift $ Data.Vector.imapM_ (\Int
i Ptr ()
e -> Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr (Ptr ())
pPParams' Ptr (Ptr ()) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (Ptr ())) (Ptr ()
e)) (params)
    lift $ poke ((p `plusPtr` 64 :: Ptr (Ptr (Ptr ())))) (pPParams')
    lift $ poke ((p `plusPtr` 72 :: Ptr CSize)) (fromIntegral ((Data.Vector.length $ (extras))))
    pPExtras' <- ContT $ allocaBytes @(Ptr ()) ((Data.Vector.length (extras)) * 8)
    lift $ Data.Vector.imapM_ (\Int
i Ptr ()
e -> Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr (Ptr ())
pPExtras' Ptr (Ptr ()) -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (Ptr ())) (Ptr ()
e)) (extras)
    lift $ poke ((p `plusPtr` 80 :: Ptr (Ptr (Ptr ())))) (pPExtras')
    lift $ f
  cStructSize :: Int
cStructSize = Int
88
  cStructAlignment :: Int
cStructAlignment = Int
8
  pokeZeroCStruct :: forall b. Ptr CuLaunchInfoNVX -> IO b -> IO b
pokeZeroCStruct Ptr CuLaunchInfoNVX
p IO b
f = do
    Ptr StructureType -> StructureType -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr StructureType
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: Ptr StructureType)) (StructureType
STRUCTURE_TYPE_CU_LAUNCH_INFO_NVX)
    Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8 :: Ptr (Ptr ()))) (Ptr ()
forall a. Ptr a
nullPtr)
    Ptr CuFunctionNVX -> CuFunctionNVX -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr CuFunctionNVX
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CuFunctionNVX)) (CuFunctionNVX
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
28 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
36 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
44 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: Ptr Word32)) (Word32
forall a. Zero a => a
zero)
    IO b
f

instance FromCStruct CuLaunchInfoNVX where
  peekCStruct :: Ptr CuLaunchInfoNVX -> IO CuLaunchInfoNVX
peekCStruct Ptr CuLaunchInfoNVX
p = do
    function <- forall a. Storable a => Ptr a -> IO a
peek @CuFunctionNVX ((Ptr CuLaunchInfoNVX
p Ptr CuLaunchInfoNVX -> Int -> Ptr CuFunctionNVX
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16 :: Ptr CuFunctionNVX))
    gridDimX <- peek @Word32 ((p `plusPtr` 24 :: Ptr Word32))
    gridDimY <- peek @Word32 ((p `plusPtr` 28 :: Ptr Word32))
    gridDimZ <- peek @Word32 ((p `plusPtr` 32 :: Ptr Word32))
    blockDimX <- peek @Word32 ((p `plusPtr` 36 :: Ptr Word32))
    blockDimY <- peek @Word32 ((p `plusPtr` 40 :: Ptr Word32))
    blockDimZ <- peek @Word32 ((p `plusPtr` 44 :: Ptr Word32))
    sharedMemBytes <- peek @Word32 ((p `plusPtr` 48 :: Ptr Word32))
    paramCount <- peek @CSize ((p `plusPtr` 56 :: Ptr CSize))
    pParams <- peek @(Ptr (Ptr ())) ((p `plusPtr` 64 :: Ptr (Ptr (Ptr ()))))
    pParams' <- generateM (fromIntegral (coerce @CSize @Word64 paramCount)) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (Ptr ())
pParams Ptr (Ptr ()) -> Int -> Ptr (Ptr ())
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (Ptr ()))))
    extraCount <- peek @CSize ((p `plusPtr` 72 :: Ptr CSize))
    pExtras <- peek @(Ptr (Ptr ())) ((p `plusPtr` 80 :: Ptr (Ptr (Ptr ()))))
    pExtras' <- generateM (fromIntegral (coerce @CSize @Word64 extraCount)) (\Int
i -> forall a. Storable a => Ptr a -> IO a
peek @(Ptr ()) ((Ptr (Ptr ())
pExtras Ptr (Ptr ()) -> Int -> Ptr (Ptr ())
forall a. Ptr a -> Int -> Ptr a
`advancePtrBytes` (Int
8 Int -> Int -> Int
forall a. Num a => a -> a -> a
* (Int
i)) :: Ptr (Ptr ()))))
    pure $ CuLaunchInfoNVX
             function
             gridDimX
             gridDimY
             gridDimZ
             blockDimX
             blockDimY
             blockDimZ
             sharedMemBytes
             pParams'
             pExtras'

instance Zero CuLaunchInfoNVX where
  zero :: CuLaunchInfoNVX
zero = CuFunctionNVX
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Word32
-> Vector (Ptr ())
-> Vector (Ptr ())
-> CuLaunchInfoNVX
CuLaunchInfoNVX
           CuFunctionNVX
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Word32
forall a. Zero a => a
zero
           Vector (Ptr ())
forall a. Monoid a => a
mempty
           Vector (Ptr ())
forall a. Monoid a => a
mempty


type NVX_BINARY_IMPORT_SPEC_VERSION = 2

-- No documentation found for TopLevel "VK_NVX_BINARY_IMPORT_SPEC_VERSION"
pattern NVX_BINARY_IMPORT_SPEC_VERSION :: forall a . Integral a => a
pattern $mNVX_BINARY_IMPORT_SPEC_VERSION :: forall {r} {a}.
Integral a =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bNVX_BINARY_IMPORT_SPEC_VERSION :: forall a. Integral a => a
NVX_BINARY_IMPORT_SPEC_VERSION = 2


type NVX_BINARY_IMPORT_EXTENSION_NAME = "VK_NVX_binary_import"

-- No documentation found for TopLevel "VK_NVX_BINARY_IMPORT_EXTENSION_NAME"
pattern NVX_BINARY_IMPORT_EXTENSION_NAME :: forall a . (Eq a, IsString a) => a
pattern $mNVX_BINARY_IMPORT_EXTENSION_NAME :: forall {r} {a}.
(Eq a, IsString a) =>
a -> ((# #) -> r) -> ((# #) -> r) -> r
$bNVX_BINARY_IMPORT_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
NVX_BINARY_IMPORT_EXTENSION_NAME = "VK_NVX_binary_import"