• Stars
    star
    383
  • Rank 111,995 (Top 3 %)
  • Language
    C
  • License
    Mozilla Public Li...
  • Created about 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Vulkan Portability Implementation

gfx-portability

Build Status Matrix

This is a prototype library implementing Vulkan Portability Initiative using gfx-hal. See gfx-rs meta issue for backend limitations and further details.

Platform support:

  • macOS/Metal (lib, icd)
  • iOS/Metal (lib, icd)
  • Windows/DX12 (lib, icd)
  • UWP/DX12 (lib)

For those interested in performance, we did a comprehensive benchmarks of Dota2 and Dolphin Emulator on macOS. Results were published to gfx-rs blog here and there.

For the extension support, see INSTANCE_EXTENSIONS and DEVICE_EXTENSIONS in the code.

Showcase

Dota2:

Dota2

Quake

VkQuake VkQuake3

RPCS3:

RPCS3-cube RPCS3-scogger

Dolphin:

Dolphin-sb Dolphin-pm Dolphin-mk Dolphin-md

Instructions

Despite the fact it's written in Rust, the produced binaries have standard linking interface compatible with any program (written in the language of your choice). There are multiple ways to link to gfx-portability.

Dynamic linking

Typically, you'd need to create a symbolic link with a name that a target application expects, e.g. libvulkan.dylib -> libportability.dylib.

Check out and build:

git clone --recursive https://github.com/gfx-rs/portability && cd portability
cargo build --manifest-path libportability/Cargo.toml --features <vulkan|dx12|metal>

ICD provider

gfx-portability can be used with Vulkan loader like any other Vulkan driver. In order to use it this way, you need to build libportability-icd and point to it from an ICD json file:

VK_ICD_FILENAMES=portability/libportability-icd/portability-macos-debug.json <some_vulkan_app>

Static linking

For C, you'd need to add crate-type = ["cdylib"] to libportability-gfx/Cargo.toml and build it with the backend of your choice. Note: features of this library are fully-qualified crate names, e.g. features gfx-backend-metal. For rust, just point the cargo dependency to libportability-gfx.

Running Samples

LunarG (API-Samples)

After building portability as shown above, grab a copy from https://github.com/LunarG/VulkanSamples. Manually override the VULKAN_LOADER variable and set it to the portability library.

set (VULKAN_LOADER "path/to/portability/library")

Then proceed with the normal build instructions.

Vulkan CTS coverage

Please visit our wiki for CTS hookup instructions. Once everything is set, you can generate the new results by calling make cts on Unix systems. When investigating a particular failure, it's handy to do make cts debug=<test_name>, which runs a single test under system debugger (gdb/lldb). For simply inspecting the log output, one can also do make cts pick=<test_name>.

More Repositories

1

wgpu

A cross-platform, safe, pure-Rust graphics API.
Rust
12,115
star
2

gfx

[maintenance mode] A low-overhead Vulkan-like GPU API for Rust.
Rust
5,350
star
3

wgpu-rs

Rust bindings to wgpu native library
Rust
1,690
star
4

naga

Universal shader translation in Rust
Rust
1,530
star
5

wgpu-native

Native WebGPU implementation based on wgpu-core
Rust
836
star
6

metal-rs

Rust bindings for Metal
Rust
567
star
7

rspirv

Rust implementation of SPIR-V module processing functionalities
Rust
442
star
8

genmesh

A library of mesh generation utilities.
Rust
122
star
9

gfx-ocean

Compute based ocean simulation with gfx_hal 🌊
Rust
116
star
10

meetup

Rust Graphics meetups
68
star
11

d3d12-rs

Rust wrapper for D3D12
Rust
36
star
12

gfx-memory

[DEPRECATED] Memory management library of gfx_hal
Rust
26
star
13

gfx-extras

DEPRECATED: Extra libraries to help working with gfx-hal
Rust
21
star
14

nv-flip-rs

Bindings to Nvidia Labs's ꟻLIP image comparison and error visualization library
Rust
19
star
15

wgpu-rs.github.io

Hosting for wgpu.rs website
HTML
17
star
16

gfx-render

Rust
16
star
17

gfx-rs.github.io

Blog for the gfx-rs project
HTML
15
star
18

gfx_scene

deprecated
Rust
15
star
19

gfx_gl

An OpenGL loader tailored to gfx-rs's needs.
Rust
14
star
20

wanari

Khronos ANARI implementation in Rust based on wgpu-rs
Rust
9
star
21

range-alloc

Rust
6
star
22

draw_state

deprecated
Rust
6
star
23

subscriber

Tracing subscribers to help with wgpu
Rust
5
star
24

gfx_macros

deprecated
Rust
4
star
25

stories

wgpu stories blog
Ruby
4
star
26

cherry

Fork of Android Cherry tool for Vulkan CTS tracking
Go
2
star
27

ci-build

Automated action for building/hosting components we need in CI
2
star