Skip to content

Commit

Permalink
Request NDC_Y_FLIP feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Mar 26, 2020
1 parent 938aec9 commit 543bee1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This is an active GitHub mirror of the WebGPU implementation in Rust, which now
[![Crates.io](https://img.shields.io/crates/v/wgpu-core.svg?label=wgpu-core)](https://crates.io/crates/wgpu-core)
[![Crates.io](https://img.shields.io/crates/v/wgpu-native.svg?label=wgpu-native)](https://crates.io/crates/wgpu-native)

This is an experimental [WebGPU](https://www.w3.org/community/gpu/) implementation, exposing both Rust and C interfaces as a native static library. It's written in Rust and is based on [gfx-hal](https://github.com/gfx-rs/gfx) and a few [Rendy](https://github.com/amethyst/rendy) bits. See the upstream [WebGPU specification](https://gpuweb.github.io/gpuweb/) (work in progress).
This is an experimental [WebGPU](https://www.w3.org/community/gpu/) implementation, exposing both Rust and C interfaces as a native static library. It's written in Rust and is based on [gfx-hal](https://github.com/gfx-rs/gfx) with help of [gfx-extras](https://github.com/gfx-rs/gfx-extras). See the upstream [WebGPU specification](https://gpuweb.github.io/gpuweb/) (work in progress).

The implementation consists of the following parts:

Expand Down
12 changes: 7 additions & 5 deletions wgpu-core/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,12 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
let adapter = &adapter_guard[adapter_id].raw;
let wishful_features =
hal::Features::VERTEX_STORES_AND_ATOMICS |
hal::Features::FRAGMENT_STORES_AND_ATOMICS;
hal::Features::FRAGMENT_STORES_AND_ATOMICS |
hal::Features::NDC_Y_UP;
let enabled_features = adapter.physical_device.features() & wishful_features;
if enabled_features != wishful_features {
log::warn!("Missing features: {:?}", wishful_features - enabled_features);
}

let family = adapter
.queue_families
Expand All @@ -456,10 +461,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
let mut gpu = unsafe {
adapter
.physical_device
.open(
&[(family, &[1.0])],
adapter.physical_device.features() & wishful_features,
)
.open(&[(family, &[1.0])], enabled_features)
.unwrap()
};

Expand Down

0 comments on commit 543bee1

Please sign in to comment.