úÎ#ì æëA      !"#$%&'()*+,-./012345 6 7 8 9 : ; < = > ? @ None,"#%&'-./145689;=>?FHIMPSUVX_`dghklmq$ˆ vulkan-utils‹Create an expression which checks the function pointers for all the Vulkan commands depended upon by the specified list of function names.YIt 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: M [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" .. ] ] A vulkan-utilsqGiven instance and device accessors and a function, find the function pointer accessor names which it depends onZcommandNames ['pVkCreateDevice, 'pVkDestroyDevice] ['pVkCreateFence] (mkName "withDevice")X[InstanceCmd Vulkan.Dynamic.pVkCreateDevice,InstanceCmd Vulkan.Dynamic.pVkDestroyDevice]B vulkan-utilsGet the C name of a function6commandString (DeviceCmd (mkName "pVkCreateInstance"))"vkCreateInstance"C vulkan-utilsgA list of potential sets of vulkan commands this name depends on, not all of them will be valid names.commandCandidates "withDevice"J["pVkAllocateDevice","pVkFreeDevice","pVkCreateDevice","pVkDestroyDevice"]&commandCandidates "waitSemaphoresSafe"["pVkWaitSemaphores"] commandCandidates "useCmdBuffer"'["pVkBeginCmdBuffer","pVkEndCmdBuffer"]!commandCandidates "withSemaphore"V["pVkAllocateSemaphore","pVkFreeSemaphore","pVkCreateSemaphore","pVkDestroySemaphore"]D vulkan-utils"Get the record accessors of a type.$(lift . fmap show =<< accessorNames ''Device)I["Vulkan.Core10.Handles.deviceHandle","Vulkan.Core10.Handles.deviceCmds"] vulkan-utils The names of functions from the vulkan' package. Unknown commands are ignoredNone("#%&'-./145689;=>?FHIMPSUVX_dghklmq+i vulkan-utilsA debug callback the same as  except it will call abort when -VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT is set. vulkan-utilsRA debug callback which prints the message prefixed with "Validation: " to stderr. vulkan-utils Assign a name to a handle using E, note that the VK_EXT_debug_utils extension must be enabled.None)"#%&'-./145689;=>?FHIMPSUVX_dghklmq.Ž vulkan-utils%Convert an OpenGL format enum into a FinternalFormat 0x8051Just FORMAT_R8G8B8_UNORMNone("#%&'-./145689;=>?FHIMPSUVX_dghklmqAÖ vulkan-utils]From a list of things, take all the required things and as many optional things as possible. vulkan-utilsLike .lWill throw an 'IOError in the case of missing things. Details on missing things will be reported in stderr.5This is useful in dealing with layers and extensions.  vulkan-utils/Show valies as a union of their individual bitsshowBits @Int 5 "1 .|. 4"showBits @Int 0 "zeroBits"(import Vulkan.Core10.Enums.QueueFlagBits3showBits (QUEUE_COMPUTE_BIT .|. QUEUE_GRAPHICS_BIT)*"QUEUE_GRAPHICS_BIT .|. QUEUE_COMPUTE_BIT"  vulkan-utils-Check if the intersection of bits is non-zero vulkan-utilsWhat do we have available vulkan-utilsOptional desired elements vulkan-utilsRequired desired elements vulkan-utils„(Missing optional elements, Either (missing required elements) or (all required elements and as many optional elements as possible) vulkan-utils.What are we sorting (Used for a debug message) vulkan-utilsWhat do we have available vulkan-utilsOptional desired elements vulkan-utilsRequired desired elements vulkan-utilsCAll the required elements and as many optional elements as possible  None) "#%&'-./145689;=>?FHIMPSUVX_dghklmqa0  vulkan-utilsLike  : except it will create a debug utils messenger (from the VK_EXT_debug_utils extension).If the VK_EXT_validation_features extension (from the VK_LAYER_KHRONOS_validationP layer) is available is it will be enabled and best practices messages enabled.  vulkan-utils Create an G[ with some layers and extensions, the layers and extensions will be added to the provided H.‰Will throw an 'IOError in the case of missing layers or extensions. Details on missing layers and extensions will be reported in stderr.  vulkan-utils Get a single I! deciding with a scoring functionÅPass a function which will extract any required values from a device in the spirit of parse-don't-validate. Also provide a function to compare these results for sorting multiple suitable devices.–As an example, the suitability function could return a tuple of device memory and the compute queue family index, and the scoring function could be JC to select devices based on their memory capacity. Consider using  : to find your desired queues in the suitability function.)If no devices are deemed suitable then a  NoSuchThing K is thrown. vulkan-utilsExtract the name of a I with L vulkan-utils Create a ME with some extensions, the extensions will be added to the provided N.gWill throw an 'IOError in the case of missing extensions. Missing extensions will be listed on stderr.  vulkan-utilsRequired layers vulkan-utilsOptional layers vulkan-utilsRequired extensions vulkan-utilsOptional extensions  vulkan-utilsRequired layers vulkan-utilsOptional layers vulkan-utilsRequired extensions vulkan-utilsOptional extensions  vulkan-utilsA suitability funcion for a I, O if it is not to be chosen. vulkan-utils$Scoring function to rate this result vulkan-utilsThe score and the device vulkan-utilsRequired extensions vulkan-utilsOptional extensions  None("#%&'-./145689;=>?FHIMPSUVX_dghklmq‡  vulkan-utilsRequirements for a P to be assigned a family by .+To assign to a specific queue family index f: )queueSpecFamilyPredicate = i _ -> i == f @To assign to any queue family which supports compute operations: wlet isComputeQueue q = QUEUE_COMPUTE_BIT .&&. queueFlags q in QueueSpec priority (_index q -> pure (isComputeQueue q))  vulkan-utilsGiven a I‹ and a set of requirements for queues, calculate an assignment of queues to queue families and return information with which to create a M. and also a function to extract the requested Ps from the device.,You may want to create a custom type with a Q% instance to store your queues like: ÿŠdata MyQueues q = MyQueues { computeQueue :: q , graphicsAndPresentQueue :: q , transferQueue :: q } myQueueSpecs :: MyQueues QueueSpec myQueueSpecs = MyQueues { computeQueue = QueueSpec 0.5 isComputeQueueFamily , graphicsAndPresentQueue = QueueSpec 1 isPresentQueueFamily , transferQueue = QueueSpec 1 isTransferOnlyQueueFamily } rNote, this doesn't permit differentiating queue family assignment based on whether or not the queue is protected. vulkan-utilsDoes this queue have R set and not S or T vulkan-utils<Can this queue family present to this surface on this deviceU vulkan-utils6Find all possible valid assignments for elements of a Q with some limited resources.assign @[] @_ @() [("a", 1)] [][[]]Iassign @[] [("hi", 1), ("foo", 3)] [Just, Just . reverse, Just . take 1 ]G[["hi","oof","f"],["foo","ih","f"],["foo","oof","h"],["foo","oof","f"]]žassign @[] [("a", 1), ("b", 2)] [\case {"a" -> Just 1; "b" -> Just 2; _ -> Nothing}, \case {"b" -> Just 3; _ -> Nothing}, \case {"a" -> Just 4; _ -> Nothing}] [[2,3,4]]V vulkan-utilsvSelect an element from the list according to some predicate, and return that element along with the decremented list. vulkan-utilsA set of requirements for Ps to be created vulkan-utils A set of W s to pass to X$A function to extract the requested P s from the M created with the WsO* if it wasn't possible to satisfy all the sU vulkan-utilsHow many of each Y are available vulkan-utilsWhich Ys can each element use vulkan-utilsYA list of assignments, each element in this list has the length of the requirements listNone+"#%&'-./145689;=>?FHIMPSUVX_dghklmqšé( vulkan-utils(< performs very simple interpolation of Haskell values into Zs.)Interpolated variables are prefixed with $3They can optionally be surrounded with braces like ${foo}5Interpolated variables are converted to strings with [ To escape a $ use \$+let foo = 123 in $(interpExp "hello, $foo") "hello, 123"1let foo = "world" in $(interpExp "hello, \\$foo") "hello, $foo"4let foo = "world" in $(interpExp "hello\r\n\rworld")"hello\r\n\rworld"\ vulkan-utils=Extract variables and literals from string to be interpolatedparse ""[]parse "hello $world"[Right "hello ",Left "world"]parse "$hello$world"eft "hello",Left "world"] parse "$" [Right "$"] parse "hi" [Right "hi"] parse "h$hi"[Right "h",Left "hi"] parse "$$hi"[Right "$",Left "hi"] parse "$1" [Right "$1"] parse "$$$" [Right "$$$"] parse "\\" [Right "\\"] parse "\\$" [Right "$"] parse "\\$hi" [Right "$hi"]parse "\\\\$hi"[Right "\\$hi"] parse "\\hi"[Right "\\hi"]parse "$hi\\$foo"[Left "hi",Right "$foo"]parse "hello, \\$foo"[Right "hello, $foo"]parse "${fo'o}bar"[Left "fo'o",Right "bar"] parse "\\" [Right "\\"] parse "\\\\$" [Right "\\$"] parse "$" [Right "$"]((None("#%&'-./145689;=>?FHIMPSUVX_dghklmqÀ² + vulkan-utils+7 is a QuasiQuoter which produces GLSL source code with #line” directives inserted so that error locations point to the correct location in the Haskell source file. It also permits basic string interpolation.)Interpolated variables are prefixed with $3They can optionally be surrounded with braces like ${foo}5Interpolated variables are converted to strings with [ To escape a $ use \$*It is intended to be used in concert with 2 like so ÉmyConstant = 3.141 -- Note that this will have to be in a different module myFragmentShader = $(compileShaderQ "frag" [glsl| #version 450 const float myConstant = ${myConstant}; main (){ } |]) An explicit example ( interactive is from doctest):5let version = 450 :: Int in [glsl|#version $version|]d"#version 450\n#extension GL_GOOGLE_cpp_style_line_directive : enable\n#line 46 \"<interactive>\"\n"`Note that line number will be thrown off if any of the interpolated variables contain newlines., vulkan-utils*QuasiQuoter for creating a compute shader.Equivalent to calling $$(compileShaderQ "comp" [glsl|...|]) without interpolation support.- vulkan-utils+QuasiQuoter for creating a fragment shader.Equivalent to calling $$(compileShaderQ "frag" [glsl|...|]) without interpolation support.. vulkan-utils+QuasiQuoter for creating a geometry shader.Equivalent to calling $$(compileShaderQ "geom" [glsl|...|]) without interpolation support./ vulkan-utils7QuasiQuoter for creating a tessellation control shader.Equivalent to calling $$(compileShaderQ "tesc" [glsl|...|]) without interpolation support.0 vulkan-utils:QuasiQuoter for creating a tessellation evaluation shader.Equivalent to calling $$(compileShaderQ "tese" [glsl|...|]) without interpolation support.1 vulkan-utils)QuasiQuoter for creating a vertex shader.Equivalent to calling $$(compileShaderQ "vert" [glsl|...|]) without interpolation support.2 vulkan-utils7Compile a glsl shader to spir-v using glslangValidator.RMessages are converted to GHC warnings or errors depending on compilation success.3 vulkan-utils6Compile a glsl shader to spir-v using glslangValidator2 vulkan-utilsstage vulkan-utils glsl code vulkan-utilsSpir-V bytecode3 vulkan-utilsSource location vulkan-utilsstage vulkan-utils glsl code vulkan-utils'Spir-V bytecode with warnings or errors )*+,-./01234 +,-./01*)234 None("#%&'-./145689;=>?FHIMPSUVX_dghklmqæ‡ 7 vulkan-utils79 is a QuasiQuoter which produces HLSL source code with a #line“ directive inserted so that error locations point to the correct location in the Haskell source file. It also permits basic string interpolation.)Interpolated variables are prefixed with $3They can optionally be surrounded with braces like ${foo}5Interpolated variables are converted to strings with [ To escape a $ use \$*It is intended to be used in concert with > like so ÞmyConstant = 3.141 -- Note that this will have to be in a different module myFragmentShader = $(compileShaderQ "frag" [hlsl| static const float myConstant = ${myConstant}; float main (){ return myConstant; } |]) An explicit example ( interactive is from doctest):6let foo = 450 :: Int in [hlsl|const float foo = $foo|]3"#line 31 \"<interactive>\"\nconst float foo = 450"`Note that line number will be thrown off if any of the interpolated variables contain newlines.8 vulkan-utils*QuasiQuoter for creating a compute shader.Equivalent to calling $$(compileShaderQ "comp" [hlsl|...|]) without interpolation support.9 vulkan-utils+QuasiQuoter for creating a fragment shader.Equivalent to calling $$(compileShaderQ "frag" [hlsl|...|]) without interpolation support.: vulkan-utils+QuasiQuoter for creating a geometry shader.Equivalent to calling $$(compileShaderQ "geom" [hlsl|...|]) without interpolation support.; vulkan-utils7QuasiQuoter for creating a tessellation control shader.Equivalent to calling $$(compileShaderQ "tesc" [hlsl|...|]) without interpolation support.< vulkan-utils:QuasiQuoter for creating a tessellation evaluation shader.Equivalent to calling $$(compileShaderQ "tese" [hlsl|...|]) without interpolation support.= vulkan-utils)QuasiQuoter for creating a vertex shader.Equivalent to calling $$(compileShaderQ "vert" [hlsl|...|]) without interpolation support.> vulkan-utilsFCompile a HLSL shader to SPIR-V using glslc (from the shaderc project)RMessages are converted to GHC warnings or errors depending on compilation success.? vulkan-utils+Compile a HLSL shader to spir-v using glslc> vulkan-utilsstage vulkan-utils glsl or code vulkan-utilsSpir-V bytecode? vulkan-utilsSource location vulkan-utilsstage vulkan-utils HLSL code vulkan-utils'Spir-V bytecode with warnings or errors 56789:;<=>?@ 789:;<=65>?@]    ! "#$%&'()*+,-./0123456789:; < = > 3 4 5 6 7 8 9 : ?@ABCDEFDGHDIJDKLDIMNOPNQRDKSDITDUVNWXDIYNZ[D\]D\^D\_`aDUbDUcDdeNfgNhijk'vulkan-utils-0.3-2eekXwEaDKsL3iKqn96Y2qVulkan.Utils.CommandCheckVulkan.Utils.DebugVulkan.Utils.FromGLVulkan.Utils.MiscVulkan.Utils.InitializationVulkan.Utils.QueueAssignment!Vulkan.Utils.ShaderQQ.InterpolateVulkan.Utils.ShaderQQVulkan.Utils.ShaderQQ.Shaderc assignQueuescheckCommandsExp$fEqDeviceOrInstanceCommand$fShowDeviceOrInstanceCommanddebugCallbackFatalPtrdebugCallbackPtr nameObjectinternalFormatpartitionOptReqpartitionOptReqIOshowBits.&&.!createDebugInstanceWithExtensionscreateInstanceWithExtensionspickPhysicalDevicephysicalDeviceNamecreateDeviceWithExtensions QueueIndex$sel:unQueueIndex:QueueIndexQueueFamilyIndex($sel:unQueueFamilyIndex:QueueFamilyIndex QueueSpec%$sel:queueSpecQueuePriority:QueueSpec'$sel:queueSpecFamilyPredicate:QueueSpecisComputeQueueFamilyisGraphicsQueueFamilyisTransferQueueFamilyisTransferOnlyQueueFamilyisPresentQueueFamily$fEqQueueFamilyIndex$fOrdQueueFamilyIndex$fEnumQueueFamilyIndex$fShowQueueFamilyIndex$fEqQueueIndex$fOrdQueueIndex$fEnumQueueIndex$fShowQueueIndex interpExp GLSLWarning GLSLErrorglslcompfraggeomtesctesevertcompileShaderQ compileShaderprocessValidatorMessagesShadercWarning ShadercErrorhlslprocessShadercMessages commandNames commandStringcommandCandidates accessorNames vulkan-3.7-DAqNOOYteJlMG7ZlYO52Y$Vulkan.Extensions.VK_EXT_debug_utilssetDebugUtilsObjectNameEXTVulkan.Core10.Enums.FormatFormatVulkan.Core10.HandlesInstance"Vulkan.Core10.DeviceInitializationInstanceCreateInfoPhysicalDevicebase Data.TuplefstGHC.IO.ExceptionIOErrorgetPhysicalDevicePropertiesDeviceVulkan.Core10.DeviceDeviceCreateInfo GHC.MaybeNothingQueueData.Traversable Traversable!Vulkan.Core10.Enums.QueueFlagBitsQUEUE_TRANSFER_BITQUEUE_COMPUTE_BITQUEUE_GRAPHICS_BITassignselectDeviceQueueCreateInfo createDeviceVulkan.Core10.ImageView$sel:a:ComponentMappingGHC.BaseStringGHC.Showshowparse