Skip to content

BurningWitness/vulkan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Third iteration of Haskell bindings to the Vulkan API, the previous two being vulkan and and vulkan-api (in that order).

These bindings are as low-level as it can get, meaning:

  • Naming is 1:1 to Vulkan, just like in vulkan-api;

  • Enumerators are expressed as polymorphic patterns, just like in gl;

  • All functions provided by this library are direct FFI calls linked during compilation. All extension functions have to be extracted manually.

  • All memory allocation is manual.

This repository is split into the following packages:

Notes on building

Two different ways of setting up quickly:

  • Get a version from the local repository (if available). This will work as long as all of the extensions used are compatible with that version.

  • Download SDK from the official website. The version should ideally match the vulkan-raw XML version specified here. There may not be a version for more obscure setups (e.g. linux-arm64).

vulkan-raw is not considered a valid package under Cabal 3.8 due to overly strict other-modules checks.

Linux

Works out of the box, everything is installed into system paths.

MacOS

Two options:

  • Use install_vulkan.py to install everything into system paths;

  • Configure vulkan-raw to use $VULKAN_SDK/macOS/include in extra-include-dirs, $VULKAN_SDK/macOS/lib in extra-lib-dirs and make sure libvulkan.dylib is visible in PATH.

Windows

VulkanRT-...-Installer.exe can be used to install vulkan-1.dll in system path.

vulkan-raw requires %VULKAN_SDK%\Include provided in extra-include-dirs and %VULKAN_SDK%\Lib in extra-lib-dirs.

NOTE: if using GHC 9.2 or lower,vk-mem-alloc requires C++ libraries which will be linked dynamically if provided via extra-libraries: stdc++. To link statically, supply ld-options: -Wl,-Bstatic -lstdc++ -Bdynamic to both vk-mem-alloc and executables depending on it.

NOTE: vulkan-raw fails to build under GHC 9.4.4 due to symbol linking failures. This will hopefully be resolved in a later GHC version.

About

Raw Haskell bindings to Vulkan API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published