bors[bot] 662f9567d7 Merge #242
242: Add logic to pick highest performance GPU on DirectX 12 r=kvark a=AndrewGaspar

I was having an issue on my Surface Book where my Intel's integrated GPU is always selected instead of my Nvidia discrete GPU when querying for `HighPerformance`. It turns out the Intel GPU is reported as a `DistcreteGPU` by `gfx` (in fact `gfx` has no logic for reporting `IntegratedGPU`s for DX12). However, it also turns out that `dx12::Instance::enumerate_adapters` returns adapters in descending order of performance, at least on Windows 10 > 1803. Therefore, we should use the _first_ GPU in each category, at least for `HighPerformance`. With this fix, `LowPower` selects my Intel GPU and `HighPerformance` and `Default` select my Nvidia GPU.

I'm not so sure `LowPower` = `IntegratedGPU` and `HighPerformance` = `DiscreteGPU` is the quite correct mapping, so I filed an issue on gfx to improve the ability for querying for power/performance preference: https://github.com/gfx-rs/gfx/issues/2879

Anyway, let me know if you have a different fix you'd prefer.

Co-authored-by: Andrew Gaspar <andrew.gaspar@outlook.com>
2019-07-02 17:16:19 +00:00
2019-06-05 01:55:24 +00:00
2019-07-01 21:13:26 -06:00
2019-06-13 11:08:53 -04:00
2018-09-14 11:39:24 -04:00
2019-06-23 22:17:42 +10:00
2019-05-10 20:40:42 -04:00
2019-05-24 14:46:37 +07:00
2018-09-13 15:18:51 -04:00
2019-06-04 22:09:58 -02:30
2019-05-24 14:46:37 +07:00

This is an active GitHub mirror of the WebGPU native implementation in Rust, which now lives in Mozilla-central. Issues and pull requests are accepted, but we merge them in m-c manually and then sync to GitHub instead of landing directly here.


WebGPU

Build Status Crates.io Gitter

This is an experimental WebGPU implementation as a native static library. It's written in Rust and is based on gfx-hal and Rendy libraries. The corresponding WebIDL specification can be found at gpuweb project.

The implementation consists of the following parts:

  1. wgpu-native - the native implementation of WebGPU as a C API library
  2. wgpu-remote - remoting layer to work with WebGPU across the process boundary
  3. ffi - the C headers generated by cbindgen for both of the libraries

Supported platforms:

  • Vulkan on Windows and Linux
  • D3D12 and D3D11 on Windows
  • Metal on macOS and iOS

Usage

This repository contains C-language examples that link to the native library targets and perform basic rendering and computation. To run the C triangle example, install a C compiler + glfw 3, then run these commands at the root of the repo:

rustup toolchain install nightly
cargo install cbindgen
make examples-native
cd examples/hello_triangle_c/build
./hello_triangle

The idiomatic Rust wrapper lives in https://github.com/gfx-rs/wgpu-rs and provides a number of more complex examples to get a feel of the API.

Description
No description provided
Readme 137 MiB
Languages
Rust 79.9%
WGSL 16.2%
HLSL 2%
GLSL 1.7%
JavaScript 0.2%