Platform Support
Nightshade targets the platforms wgpu targets. Native Windows, Linux, and macOS, plus the web through WebGPU.
Supported Platforms
| Platform | Status | Backend | Notes |
|---|---|---|---|
| Windows 10/11 | Full Support | Vulkan, DX12 | Primary development platform |
| Linux | Full Support | Vulkan | X11 and Wayland |
| macOS | Full Support | Metal | Requires macOS 10.13+ |
| Web (WASM) | Full Support | WebGPU | Modern browsers only |
Windows
Requirements
- Windows 10 version 1903 or later for DX12
- Windows 10 version 1607 or later for Vulkan
- A GPU with Vulkan 1.1 or DirectX 12 support
Graphics Backends
Windows picks a backend in this order:
- Vulkan for the broadest feature coverage
- DirectX 12 as the native Windows path
- DirectX 11 as the fallback for older hardware
Building
cargo build --release
Distribution
The executable is self-contained. Ship the assets folder next to it:
game/
├── game.exe
└── assets/
├── models/
├── textures/
└── audio/
Linux
Requirements
- X11 or Wayland
- A GPU and driver supporting Vulkan 1.1
- Ubuntu 20.04+, Fedora 33+, or Arch Linux are common starting points
Dependencies
Install the Vulkan development packages.
Ubuntu/Debian:
sudo apt install libvulkan1 vulkan-tools libvulkan-dev
sudo apt install libasound2-dev # For audio feature
Fedora:
sudo dnf install vulkan-loader vulkan-tools vulkan-headers
sudo dnf install alsa-lib-devel # For audio feature
Arch Linux:
sudo pacman -S vulkan-icd-loader vulkan-tools vulkan-headers
sudo pacman -S alsa-lib # For audio feature
Building
cargo build --release
Wayland Support
winit picks between X11 and Wayland based on the environment. You can force one:
# Force X11
WINIT_UNIX_BACKEND=x11 ./game
# Force Wayland
WINIT_UNIX_BACKEND=wayland ./game
Distribution
Bundle as an AppImage or wrap the binary in a launcher script:
#!/bin/bash
cd "$(dirname "$0")"
./game
macOS
Requirements
- macOS 10.13 (High Sierra) or later
- A Metal-capable GPU. Most Macs from 2012 onwards qualify.
Building
cargo build --release
Code Signing
Sign the binary before distribution:
codesign --deep --force --sign "Developer ID Application: Your Name" target/release/game
App Bundle
The expected layout for a macOS app:
Game.app/
└── Contents/
├── Info.plist
├── MacOS/
│ └── game
└── Resources/
└── assets/
Info.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>game</string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.game</string>
<key>CFBundleName</key>
<string>Game</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
</dict>
</plist>
Web (WebAssembly)
Requirements
- A browser with WebGPU
- Chrome 113+, Edge 113+, or Firefox 141+
Building
Install wasm-pack:
cargo install wasm-pack
Build the web bundle:
wasm-pack build --target web
HTML Template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Game</title>
<style>
body { margin: 0; overflow: hidden; }
canvas { width: 100vw; height: 100vh; display: block; }
</style>
</head>
<body>
<canvas id="canvas"></canvas>
<script type="module">
import init from './pkg/game.js';
init();
</script>
</body>
</html>
Limitations
The web build is constrained by what browsers expose.
| Feature | Status |
|---|---|
| Rendering | Supported |
| Input | Supported |
| Audio | Supported (Web Audio) |
| Gamepad | Supported (Gamepad API) |
| Physics | Supported |
| File System | Limited, no direct disk access |
| Threads | Limited, requires SharedArrayBuffer |
Asset Loading
Assets have to be served over HTTP and fetched at runtime:
#![allow(unused)] fn main() { #[cfg(target_arch = "wasm32")] async fn load_assets() { // Assets loaded via HTTP fetch } }
Cross-Compilation
Windows from Linux
Install the MinGW toolchain and target:
sudo apt install mingw-w64
rustup target add x86_64-pc-windows-gnu
cargo build --release --target x86_64-pc-windows-gnu
Linux from Windows
Use WSL2 or a Docker image:
# In WSL2
cargo build --release --target x86_64-unknown-linux-gnu
macOS Cross-Compilation
Cross-compiling to macOS needs the Apple SDK, which is awkward to source legally outside a Mac. The practical path is GitHub Actions macOS runners.
GPU Requirements
Minimum Requirements
| Feature | Requirement |
|---|---|
| API | Vulkan 1.1 / DX12 / Metal |
| VRAM | 2 GB |
| Shader Model | 5.0 |
Recommended Requirements
| Feature | Requirement |
|---|---|
| API | Vulkan 1.2+ |
| VRAM | 4+ GB |
| Shader Model | 6.0 |
Feature Support by GPU Generation
| GPU | Basic Rendering | Tessellation | Compute Culling |
|---|---|---|---|
| Intel HD 4000+ | Yes | Yes | Yes |
| NVIDIA GTX 600+ | Yes | Yes | Yes |
| AMD GCN 1.0+ | Yes | Yes | Yes |
| Apple M1+ | Yes | Yes | Yes |
Performance by Platform
Rough relative performance, higher is better.
| Platform | Performance | Notes |
|---|---|---|
| Windows (Vulkan) | 100% | Best overall |
| Windows (DX12) | 95% | A little more driver overhead |
| Linux (Vulkan) | 98% | Matches Windows with good drivers |
| macOS (Metal) | 90% | Different cost profile than Vulkan |
| Web (WebGPU) | 70% | Browser and JS bridge overhead |
Troubleshooting
Windows: "No suitable adapter found"
- Update GPU drivers
- Install the Vulkan Runtime
- Force the DX12 backend with
WGPU_BACKEND=dx12 ./game.exe
Linux: "Failed to create Vulkan instance"
- Install Vulkan drivers for your GPU
- Check that
vulkaninforuns - Verify the ICD loader sees them:
ls /usr/share/vulkan/icd.d/
macOS: "Metal not available"
- Update macOS to 10.13 or later
- Check Apple Menu > About This Mac > System Report > Graphics for Metal support
Web: "WebGPU not supported"
- Use Chrome 113+ or Edge 113+
- Enable the WebGPU flag in browser settings if needed
- Verify
navigator.gpuexists in the browser console