bors[bot] a60fc025aa [rs] Merge #281
281: The Context trait r=grovesNL a=kvark

The main motivation here is to avoid blocking the wgpu-core updates by `wgpu-native`. Instead, `wgpu-native` becomes a branch, and the dependency of `wgpu-rs` -> `wgpu-native` starts adhering to the contract/API of the standard webgpu-native headers.

The biggest change is the introduction of the Context trait. I recall us discussing 2 downsides to having this trait:
  1. inconvenient for the users to include. This is a non-issue here, since it's private.
  2. more code to maintain. This is less of an issue if we aim to have 3 backends.

What this gives in return is a well established contract with the backends. Unlike gfx-rs, the backend code is right here, a part of the crate, so the contract is only for internal use.

Fixes #156 : the "direct" implementation of it goes straight to wgpu-core. What this gives us is less overhead for command recording, since there is no longer an extra indirection on every command, and no heap allocation at the end of a render pass.

The downside of this PR is one extra `Arc` (with addref) per object.

This commit also has small improvements:
- consuming command buffers on submit (Fixes #267)
- Instance type
- proper call to destructors
- fallible `request_device`

Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
2020-04-27 04:12:38 +00:00
2020-04-26 18:59:48 -02:30
Description
No description provided
137 MiB
Languages
Rust 79.9%
WGSL 16.2%
HLSL 2%
GLSL 1.7%
JavaScript 0.2%