[package]
name = "wgpu_bindings"
version = "0.1.0"
authors = [
  "Dzmitry Malyshau <kvark@mozilla.com>",
  "Joshua Groves <josh@joshgroves.com>",
]
edition = "2021"
license = "MPL-2.0"
publish = false

[lib]

[features]
default = []

[dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "93e00976015c937fc86f02bd9efcf343c6ce5e5d"
features = ["serde", "trace", "strict_asserts", "wgsl", "api_log_info"]

# We want the wgpu-core Metal backend on macOS and iOS.
# (We should consider also enabling "vulkan" for Vulkan Portability.)
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "93e00976015c937fc86f02bd9efcf343c6ce5e5d"
features = ["metal"]

# We want the wgpu-core Direct3D backends on Windows.
[target.'cfg(windows)'.dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "93e00976015c937fc86f02bd9efcf343c6ce5e5d"
features = ["dx12"]

# We want the wgpu-core Vulkan backend on Linux and Windows.
[target.'cfg(any(windows, all(unix, not(any(target_os = "macos", target_os = "ios")))))'.dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "93e00976015c937fc86f02bd9efcf343c6ce5e5d"
features = ["vulkan"]

[dependencies.wgt]
package = "wgpu-types"
git = "https://github.com/gfx-rs/wgpu"
rev = "93e00976015c937fc86f02bd9efcf343c6ce5e5d"

[dependencies.wgh]
package = "wgpu-hal"
git = "https://github.com/gfx-rs/wgpu"
rev = "93e00976015c937fc86f02bd9efcf343c6ce5e5d"

[target.'cfg(windows)'.dependencies]
windows = { version = "0.62", default-features = false, features = [
  "Win32_Graphics_Dxgi_Common",
  "Win32_Graphics_Direct3D12",
] }

[target.'cfg(target_os = "macos")'.dependencies]
objc2 = "0.6.3"
objc2-foundation = { version = "0.3.2", default-features = false, features = [
  "NSProcessInfo",
] }
objc2-io-surface = { version = "0.3", default-features = false, features = [
  "IOSurfaceTypes",
  "objc2-core-foundation",
] }
objc2-metal = { version = "0.3", default-features = false, features = [
  "MTLAllocation",
  "MTLResource",
  "MTLTexture",
  "objc2-io-surface",
] }

[dependencies]
bincode = "1"
log = "0.4"
parking_lot = "0.12"
serde = "1"
serde_json = "1"
nsstring = { path = "../../xpcom/rust/nsstring" }
static_prefs = { path = "../../modules/libpref/init/static_prefs" }
arrayvec = "0.7"
ash = "0.38"
glean = { workspace = true }
firefox-on-glean = { path = "../../toolkit/components/glean/api" }
moz_task = { path = "../../xpcom/rust/moz_task" }
futures-channel = "0.3"
