gecko-dev/third_party/rust/metal
Jim Blandy 8c4605cfa4 Bug 1762730: Update wgpu-core, wgpu-hal, and wgpu-types to 75e82afd. r=jgilbert
New versions of several crates are introduced to third_party/rust, by
changing the versions requested in `gfx/wgpu_bindings/Cargo.toml` and
running `mach vendor rust`:

- `wgpu-core`, `wgpu-hal`, and `wgpu-types`, as used by `wgpu_bindings`
- `naga`, `ash`, and `metal`, as used by the above

These are all exact copies of the upstream sources, at the git
revisions listed in `.cargo/config.in`.

This brings in fixes for some upstream `wgpu` bugs that were fuzzblockers:

- Compute pipelines never freed at runtime, leaking memory #2564
  https://github.com/gfx-rs/wgpu/issues/2564

- Device::drop doesn't actually free the device when using backend::direct::Context #2563
  https://github.com/gfx-rs/wgpu/issues/2563

The Firefox sources also needed some adjustments to catch up with
upstream changes:

- The C type `mozilla::webgpu::ffi::WGPUTextureFormat` is now a struct
  containing a tag enum and a union, not just an enum. This is needed
  for [gfx-rs/wgpu#2477](https://github.com/gfx-rs/wgpu/pull/2477).

  (Note that Firefox's `WebGPU.webidl` is behind the current spec,
  so even though the newest ASTC texture formats are supported in `wgpu`,
  they're not available in Firefox yet.)

- `wgpu` got a new feature, `id32`, which cbindgen needed to be told
  about so that it would generate preprocessor-protected code like
  this:

      #if defined(WGPU_FEATURE_ID32)
      typedef uint32_t WGPUNonZeroId;
      #endif

      #if !defined(WGPU_FEATURE_ID32)
      typedef uint64_t WGPUNonZeroId;
      #endif

  instead of just spitting out two conflicting definitions of
  `WGPUNonZeroId`.

- The `wgpu_core::hub::IdentityHandlerFactory` trait's `spawn` method
  no longer takes a `min_index` argument. (Our implementations of that
  trait never used that argument anyway, so this was easy to
  accommodate.)

Differential Revision: https://phabricator.services.mozilla.com/D142779
2022-04-07 00:33:59 +00:00
..
.github/workflows WIP: Bug 1747750 - Return null WebGPU adapter r=jimb 2022-01-12 15:34:55 +00:00
examples Bug 1762730: Update wgpu-core, wgpu-hal, and wgpu-types to 75e82afd. r=jgilbert 2022-04-07 00:33:59 +00:00
src Bug 1762730: Update wgpu-core, wgpu-hal, and wgpu-types to 75e82afd. r=jgilbert 2022-04-07 00:33:59 +00:00
.cargo-checksum.json Bug 1762730: Update wgpu-core, wgpu-hal, and wgpu-types to 75e82afd. r=jgilbert 2022-04-07 00:33:59 +00:00
Cargo.toml Bug 1762730: Update wgpu-core, wgpu-hal, and wgpu-types to 75e82afd. r=jgilbert 2022-04-07 00:33:59 +00:00
LICENSE-APACHE
LICENSE-MIT
Makefile
README.md
bors.toml Bug 1622846 - Update WebGPU API with wgpu r=jgilbert,webidl,smaug 2021-03-04 21:25:46 +00:00

README.md

metal-rs

Actions Status Crates.io

Unsafe Rust bindings for the Metal 3D Graphics API.

Examples

The examples directory highlights different ways of using the Metal graphics API for rendering and computation.

Examples can be run using commands such as:

# Replace `window` with the name of the example that you would like to run
cargo run --example window

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.