mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 22:11:01 +01:00
a60fc025aab54fa88260c33d68251c24f39e8abe
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>
Languages
Rust
78.5%
WGSL
13%
GLSL
3.1%
Metal
2.8%
HLSL
2.3%
Other
0.2%