Git Product home page Git Product logo

wgpu's Introduction

wgpu

Matrix Matrix Build Status codecov.io

This is an implementation of WebGPU API in Rust, targeting both native and the Web. See the upstream WebGPU specification (work in progress).

The repository hosts the following parts:

  • Crates.io docs.rs - public Rust API for users
  • Crates.io docs.rs - internal Rust API for WebGPU implementations to use
  • Crates.io docs.rs - internal unsafe GPU abstraction API
  • Crates.io - Program that prints out information about all the adapters on the system or invokes a command for every adapter.
  • Crates.io docs.rs - Rust types shared between wgpu-core and wgpu-rs
  • player - standalone application for replaying the API traces, uses winit

Rust examples can be found at wgpu/examples. wgpu is a default member, so you can run the examples directly from the root, e.g. cargo run --example boids.

If you are looking for the native implementation or bindings to the API in other languages, you need wgpu-native.

Supported Platforms

API Windows 7/10 Linux & Android macOS & iOS
DX11 ๐Ÿšง
DX12 ๐Ÿšง
Vulkan โœ… โœ…
Metal โœ…
GLes3 ๐Ÿšง

โœ… = Primary support โ€” ๐Ÿ†— = Secondary support โ€” ๐Ÿšง = Unsupported, but support in progress

Testing Infrastructure

wgpu features a set of unit, integration, and example based tests. All framework based examples are automatically reftested against the screenshot in the example directory. The wgpu-info example contains the logic which can automatically run the tests multiple times for all the adapters present on the system. These tests are also run on CI on windows and linux over Vulkan/DX12/DX11/GL on software adapters.

To run the test suite, run the following command:

cargo run --bin wgpu-info -- cargo test --no-fail-fast

To run any individual test on a specific adapter, populate the following environment variables:

  • WGPU_ADAPTER_NAME with a substring of the name of the adapter you want to use (ex. "1080" will match "NVIDIA GeForce 1080ti").
  • WGPU_BACKEND with the name of the backend you want to use (vulkan, metal, dx12, dx11, or gl).

Then to run an example's reftests, run:

cargo test --example <example-name> --no-fail-fast

Or run a part of the integration test suite:

cargo test -p wgpu -- <name-of-test>

If you are a user and want a way to help contribute to wgpu, we always need more help writing test cases.

wgpu's People

Contributors

adamnemecek avatar aloucks avatar andful avatar bors[bot] avatar coder-256 avatar cwfitzgerald avatar daxpedda avatar electronicru avatar fintelia avatar gabrielmajeri avatar gordon-f avatar grovesnl avatar halfvoxel avatar imberflur avatar kimundi avatar korijn avatar kunalmohan avatar kvark avatar kyren avatar lachlansneff avatar napokue avatar parasyte avatar porky11 avatar psincf avatar rukai avatar scoopr avatar swiftcoder avatar wumpf avatar yanchith avatar yzsolt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.