mischief-render
Safe HaskellNone
LanguageGHC2024

Mischief.WGPU

Synopsis

What is WGPU?

WGPU is a low-level Rust rendering API. It is compatible with many rendering backends including Vulkan, Metal, D3D12, OpenGL, WebGL2 and WebGPU.

This module provides bindings for wgpu-native, a C-based wrapper around WGPU.

Installing WGPU

Download the correct binary build from here for your Operating System.

Put the path to it in the extra-lib-dirs of your haskell project:

extra-lib-dirs: /path/to/wgpu/lib

This is usually done in cabal.project.local (since it will be different on each developer's machine) but can be put in your normal .cabal file too.

Possible Issues

On linux you may also need to add this path to the LD_LIBRARY_PATH env variable, like so:

export LD_LIBRARY_PATH="path/to/wgpu/lib:$LD_LIBRARY_PATH"

On mac, you might encounter a problem where the OS refuses to include the wgpu headers into hsc2hs. In that case, you'll need to add this into your cabal.project.local:

package mischief-render
  hsc2hs-options: --lflag=-Wl,-rpath,path/to/wgpu/lib

And run this on the CLI:

xattr -dr com.apple.quarantine path/to/wgpu