HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Modulevulkan-utils-0.5.11.0Haskell2010

Vulkan.Utils.CommandCheck

  • 1 value
valuecheckCommandsExp
  1. :: [Name]

    The names of functions from the vulkan package. Unknown commands are ignored

  2. -> Q Exp
#

Create an expression which checks the function pointers for all the Vulkan commands depended upon by the specified list of function names.

It returns a list of function names corresponding to those functions with null pointers.

Your program can use this function to fail early if a command couldn't be loaded for some reason (missing extension or layer for example).

One can create a function called checkCommands with the following: [d| checkCommands = $(checkCommandsExp ['withInstance, 'cmdDraw, ...]) |]

It has the type IsString a => Instance -> Device -> [a]

It looks basically like

inst dev ->
  [ name
  | True <- [ nullFunPtr == pVkCreateDevice inst
            , nullFunPtr == pVkCreateFence dev
              ..
            ]
  | name <- [ "vkCreateDevice"
            , "vkCreateFence"
              ..
            ]
  ]