Crates.io | blade-graphics |
lib.rs | blade-graphics |
version | 0.5.0 |
source | src |
created_at | 2023-01-26 06:22:03.990615 |
updated_at | 2024-08-28 05:57:31.904434 |
description | Graphics abstraction for Blade |
homepage | |
repository | https://github.com/kvark/blade |
max_upload_size | |
id | 768230 |
size | 2,907,051 |
Blade-graphics is a lean and mean GPU abstraction aimed at ergonomics and fun. See motivation, FAQ, and performance for details.
The backend is selected automatically based on the host platform:
Feature | Vulkan | Metal | GLES |
---|---|---|---|
compute | :white_check_mark: | :white_check_mark: | |
ray tracing | :white_check_mark: |
Required instance extensions:
Required device extensions:
Conceptually, Blade requires the baseline Vulkan hardware with a relatively fresh driver. All of these required extensions are supported in software by the driver on any underlying architecture.
GLES is also supported at a basic level. It's enabled for wasm32-unknown-unknown
target, and can also be force-enabled on native:
RUSTFLAGS="--cfg gles" CARGO_TARGET_DIR=./target-gl cargo test
This path can be activated on all platforms via Angle library.
For example, on macOS it's sufficient to place libEGL.dylib
and libGLESv2.dylib
in the working directory.
Following command will start a web server offering the bunnymark
example:
cargo run-wasm --example bunnymark
First, ensure to load the environment from the Vulkan SDK:
cd /opt/VulkanSDK && source setup-env.sh
Vulkan backend can be forced on using "vulkan" config flag. Example invocation that produces a vulkan (portability) build into another target folder:
RUSTFLAGS="--cfg vulkan" CARGO_TARGET_DIR=./target-vk cargo test