Commit 5695f517 authored by Dzmitry Malyshau's avatar Dzmitry Malyshau
Browse files

Bug 1726626 - Move gfx/wgpu into a 3rd party dependency r=jgilbert,bholley

This update makes wgpu a vendored dependency instead of having it in gfx/wgpu.

## Notes


It relies on https://phabricator.services.mozilla.com/D123157

It has a quirk related to OpenGL ES backend. Previousy, we manually had to disable GL backend
in order to avoid vendoring WASM dependencies in. This time, manual editing is more complicated,
so instead this change adds a few cargo patch lines to point WASM dependencies to dummy projects.

The update also totally removes SPIRV-Cross, since the latest `wgpu` doesn't depend on it any more.
The compiled binary size for Gecko should improve with this.

Differential Revision: https://phabricator.services.mozilla.com/D123153
parent edabfc69
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -47,9 +47,8 @@ git = "https://github.com/mozilla-spidermonkey/jsparagus"
replace-with = "vendored-sources"
rev = "2e56bb9bae5d8211137980a717ee991cc4a5eb98"

[source."https://github.com/kvark/spirv_cross"]
branch = "wgpu5"
git = "https://github.com/kvark/spirv_cross"
[source."https://github.com/kvark/dummy-web"]
git = "https://github.com/kvark/dummy-web"
replace-with = "vendored-sources"

[source."https://github.com/kinetiknz/mio-named-pipes"]
@@ -82,6 +81,16 @@ git = "https://github.com/hsivonen/chardetng"
replace-with = "vendored-sources"
rev = "302c995f91f44cf26e77dc4758ad56c3ff0153ad"

[source."https://github.com/gfx-rs/wgpu"]
git = "https://github.com/gfx-rs/wgpu"
replace-with = "vendored-sources"
rev = "d23288e"

[source."https://github.com/gfx-rs/naga"]
git = "https://github.com/gfx-rs/naga"
replace-with = "vendored-sources"
rev = "93db57c"

[source."https://github.com/bytecodealliance/wasmtime"]
git = "https://github.com/bytecodealliance/wasmtime"
replace-with = "vendored-sources"
+0 −1
Original line number Diff line number Diff line
@@ -119,7 +119,6 @@ gfx/vr/service/openvr/src/strtools_public.cpp
gfx/vr/service/openvr/src/strtools_public.h
gfx/vr/service/openvr/src/vrpathregistry_public.cpp
gfx/vr/service/openvr/src/vrpathregistry_public.h
gfx/wgpu/.*
gfx/ycbcr/.*
intl/hyphenation/hyphen/.*
intl/icu/.*
+111 −254
Original line number Diff line number Diff line
@@ -87,15 +87,21 @@ name = "arrayvec"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"

[[package]]
name = "arrayvec"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcd"
dependencies = [
 "serde",
]

[[package]]
name = "ash"
version = "0.32.1"
version = "0.33.0+1.2.186"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06063a002a77d2734631db74e8f4ce7148b77fe522e6bca46f2ae7774fd48112"
checksum = "a2142f1fa77cc4d24ffd2f24dc84f88ce5b1e588d524f10fb473a04b93aef14f"
dependencies = [
 "libloading 0.7.0",
]
@@ -393,7 +399,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b83b7baab1e671718d78204225800d6b170e648188ac7dc992e9d6bddf87d0c0"
dependencies = [
 "arrayref",
 "arrayvec",
 "arrayvec 0.5.2",
 "constant_time_eq",
]

@@ -510,9 +516,6 @@ name = "cc"
version = "1.0.68"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787"
dependencies = [
 "jobserver",
]

[[package]]
name = "cert_storage"
@@ -638,21 +641,6 @@ dependencies = [
 "cc",
]

[[package]]
name = "cocoa-foundation"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318"
dependencies = [
 "bitflags",
 "block",
 "core-foundation",
 "core-graphics-types",
 "foreign-types",
 "libc",
 "objc",
]

[[package]]
name = "codespan-reporting"
version = "0.11.1"
@@ -1052,9 +1040,9 @@ dependencies = [

[[package]]
name = "d3d12"
version = "0.4.0"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "091ed1b25fe47c7ff129fc440c23650b6114f36aa00bc7212cc8041879294428"
checksum = "2daefd788d1e96e0a9d66dee4b828b883509bc3ea9ce30665f04c3246372690c"
dependencies = [
 "bitflags",
 "libloading 0.7.0",
@@ -1219,15 +1207,6 @@ dependencies = [
 "smallbitvec",
]

[[package]]
name = "drm-fourcc"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ebbf3a5ed4671aabffefce172ff43d69c1f27dd2c6aea28e5212a70f32ada0cf"
dependencies = [
 "serde",
]

[[package]]
name = "dtoa"
version = "0.4.8"
@@ -1349,16 +1328,6 @@ dependencies = [
 "serde",
]

[[package]]
name = "external-memory"
version = "0.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e4dfe8d292b014422776a8c516862d2bff8a81b223a4461dfdc45f3862dc9d39"
dependencies = [
 "bitflags",
 "drm-fourcc",
]

[[package]]
name = "fake-simd"
version = "0.1.2"
@@ -1844,148 +1813,6 @@ dependencies = [
 "wasi",
]

[[package]]
name = "gfx-auxil"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1694991b11d642680e82075a75c7c2bd75556b805efa7660b705689f05b1ab1c"
dependencies = [
 "fxhash",
 "gfx-hal",
 "spirv_cross",
]

[[package]]
name = "gfx-backend-dx11"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f9e453baf3aaef2b0c354ce0b3d63d76402e406a59b64b7182d123cfa6635ae"
dependencies = [
 "arrayvec",
 "bitflags",
 "gfx-auxil",
 "gfx-hal",
 "gfx-renderdoc",
 "libloading 0.7.0",
 "log",
 "parking_lot",
 "range-alloc",
 "raw-window-handle",
 "smallvec",
 "spirv_cross",
 "thunderdome",
 "winapi",
 "wio",
]

[[package]]
name = "gfx-backend-dx12"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21506399f64a3c4d389182a89a30073856ae33eb712315456b4fd8f39ee7682a"
dependencies = [
 "arrayvec",
 "bit-set",
 "bitflags",
 "d3d12",
 "gfx-auxil",
 "gfx-hal",
 "gfx-renderdoc",
 "log",
 "parking_lot",
 "range-alloc",
 "raw-window-handle",
 "smallvec",
 "spirv_cross",
 "thunderdome",
 "winapi",
]

[[package]]
name = "gfx-backend-empty"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29c8f813c47791918aa00dc9c9ddf961d23fa8c2a5d869e6cb8ea84f944820f4"
dependencies = [
 "gfx-hal",
 "log",
 "raw-window-handle",
]

[[package]]
name = "gfx-backend-metal"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0de85808e2a98994c6af925253f8a9593bc57180ef1ea137deab6d35cc949517"
dependencies = [
 "arrayvec",
 "bitflags",
 "block",
 "cocoa-foundation",
 "copyless",
 "core-graphics-types",
 "foreign-types",
 "fxhash",
 "gfx-auxil",
 "gfx-hal",
 "log",
 "metal",
 "naga",
 "objc",
 "parking_lot",
 "profiling",
 "range-alloc",
 "raw-window-handle",
 "spirv_cross",
 "storage-map",
]

[[package]]
name = "gfx-backend-vulkan"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9861ec855acbbc65c0e4f966d761224886e811dc2c6d413a4776e9293d0e5c0"
dependencies = [
 "arrayvec",
 "ash",
 "byteorder",
 "core-graphics-types",
 "gfx-hal",
 "gfx-renderdoc",
 "inplace_it",
 "log",
 "naga",
 "objc",
 "parking_lot",
 "raw-window-handle",
 "smallvec",
 "winapi",
]

[[package]]
name = "gfx-hal"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fbb575ea793dd0507b3082f4f2cde62dc9f3cebd98f5cd49ba2a4da97a976fd"
dependencies = [
 "bitflags",
 "external-memory",
 "naga",
 "raw-window-handle",
 "thiserror",
]

[[package]]
name = "gfx-renderdoc"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8027995e247e2426d3a00d13f5191dd56c314bff02dc4b54cbf727f1ba9c40a"
dependencies = [
 "libloading 0.7.0",
 "log",
 "renderdoc-sys",
]

[[package]]
name = "gkrust"
version = "0.1.0"
@@ -2172,6 +1999,18 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"

[[package]]
name = "glow"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f04649123493bc2483cbef4daddb45d40bbdae5adb221a63a23efdb0cc99520"
dependencies = [
 "js-sys",
 "slotmap",
 "wasm-bindgen",
 "web-sys",
]

[[package]]
name = "glsl"
version = "4.0.3"
@@ -2228,9 +2067,9 @@ dependencies = [

[[package]]
name = "gpu-alloc"
version = "0.4.7"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbc1b6ca374e81862526786d9cb42357ce03706ed1b8761730caafd02ab91f3a"
checksum = "c481459c44304a1dfed23bd650bb3912e12c9f77d7871f86d7ed7c9730a52e79"
dependencies = [
 "bitflags",
 "gpu-alloc-types",
@@ -2247,9 +2086,9 @@ dependencies = [

[[package]]
name = "gpu-descriptor"
version = "0.1.1"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8a70f1e87a3840ed6a3e99e02c2b861e4dbdf26f0d07e38f42ea5aff46cfce2"
checksum = "d7a237f0419ab10d17006d55c62ac4f689a6bf52c75d3f38b8361d249e8d4b0b"
dependencies = [
 "bitflags",
 "gpu-descriptor-types",
@@ -2569,6 +2408,11 @@ dependencies = [
 "libc",
]

[[package]]
name = "js-sys"
version = "0.3.100"
source = "git+https://github.com/kvark/dummy-web#5731e569d865a1ebaf116f48dad781f355a99243"

[[package]]
name = "jsparagus"
version = "0.1.0"
@@ -2625,7 +2469,7 @@ name = "jsparagus-parser"
version = "0.1.0"
source = "git+https://github.com/mozilla-spidermonkey/jsparagus?rev=2e56bb9bae5d8211137980a717ee991cc4a5eb98#2e56bb9bae5d8211137980a717ee991cc4a5eb98"
dependencies = [
 "arrayvec",
 "arrayvec 0.5.2",
 "bumpalo",
 "jsparagus-ast",
 "jsparagus-generated-parser",
@@ -2672,6 +2516,16 @@ dependencies = [
 "smoosh",
]

[[package]]
name = "khronos-egl"
version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3"
dependencies = [
 "libc",
 "libloading 0.7.0",
]

[[package]]
name = "khronos_api"
version = "3.1.0"
@@ -3035,9 +2889,9 @@ dependencies = [

[[package]]
name = "metal"
version = "0.23.0"
version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79d7d769f1c104b8388294d6594d491d2e21240636f5f94d37f8a0f3d7904450"
checksum = "e0514f491f4cc03632ab399ee01e2c1c1b12d3e1cf2d667c1ff5f87d6dcd2084"
dependencies = [
 "bitflags",
 "block",
@@ -3191,7 +3045,7 @@ dependencies = [
name = "mozglue-static"
version = "0.1.0"
dependencies = [
 "arrayvec",
 "arrayvec 0.5.2",
 "cc",
 "rustc_version",
]
@@ -3309,9 +3163,8 @@ checksum = "a2983372caf4480544083767bf2d27defafe32af49ab4df3a0b7fc90793a3664"

[[package]]
name = "naga"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef670817eef03d356d5a509ea275e7dd3a78ea9e24261ea3cb2dfed1abb08f64"
version = "0.6.0"
source = "git+https://github.com/gfx-rs/naga?rev=93db57c#93db57c12b4a5eff48bdd00c494efa5ec89567ad"
dependencies = [
 "bit-set",
 "bitflags",
@@ -3320,8 +3173,8 @@ dependencies = [
 "log",
 "num-traits",
 "petgraph",
 "rose_tree",
 "spirv_headers",
 "serde",
 "spirv",
 "thiserror",
]

@@ -4281,15 +4134,6 @@ dependencies = [
 "serde",
]

[[package]]
name = "rose_tree"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "284de9dae38774e2813aaabd7e947b4a6fe9b8c58c2309f754a487cdd50de1c2"
dependencies = [
 "petgraph",
]

[[package]]
name = "rsclientcerts"
version = "0.1.0"
@@ -4365,7 +4209,7 @@ version = "1.14.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9787e62372fc0c5a0f3af64c392652db72d3ec1cc0cff1becc175d2c11e6fbcc"
dependencies = [
 "arrayvec",
 "arrayvec 0.5.2",
 "num-traits",
 "serde",
]
@@ -4649,6 +4493,11 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527"

[[package]]
name = "slotmap"
version = "1.100.0"
source = "git+https://github.com/kvark/dummy-web#5731e569d865a1ebaf116f48dad781f355a99243"

[[package]]
name = "smallbitvec"
version = "2.5.0"
@@ -4686,26 +4535,10 @@ dependencies = [
]

[[package]]
name = "spirv-cross-internal"
version = "0.1.0"
source = "git+https://github.com/kvark/spirv_cross?branch=wgpu5#a5a90d38ab1f82ad8327b48e161dbfe556ef6c6e"
dependencies = [
 "cc",
]

[[package]]
name = "spirv_cross"
version = "0.23.0"
source = "git+https://github.com/kvark/spirv_cross?branch=wgpu5#a5a90d38ab1f82ad8327b48e161dbfe556ef6c6e"
dependencies = [
 "spirv-cross-internal",
]

[[package]]
name = "spirv_headers"
version = "1.5.0"
name = "spirv"
version = "0.2.0+1.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f5b132530b1ac069df335577e3581765995cba5a13995cdbbdbc8fb057c532c"
checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830"
dependencies = [
 "bitflags",
 "num-traits",
@@ -4750,15 +4583,6 @@ dependencies = [
 "xpcom",
]

[[package]]
name = "storage-map"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "418bb14643aa55a7841d5303f72cf512cfb323b8cc221d51580500a1ca75206c"
dependencies = [
 "lock_api",
]

[[package]]
name = "storage_variant"
version = "0.1.0"
@@ -4780,7 +4604,7 @@ name = "style"
version = "0.0.1"
dependencies = [
 "app_units",
 "arrayvec",
 "arrayvec 0.5.2",
 "atomic_refcell",
 "bindgen",
 "bitflags",
@@ -5040,12 +4864,6 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b5b2bd897775cb425729882f0710639eb69f3d784db834ee85941ae9c35bb83"

[[package]]
name = "thunderdome"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87b4947742c93ece24a0032141d9caa3d853752e694a57e35029dd2bd08673e0"

[[package]]
name = "time"
version = "0.1.43"
@@ -5338,7 +5156,7 @@ version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6ee6f45294ecb6e220e76b8afddb50a8b69d433f31ad9eb2d16fb44029ef5db"
dependencies = [
 "arrayvec",
 "arrayvec 0.5.2",
]

[[package]]
@@ -5540,6 +5358,11 @@ version = "0.9.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"

[[package]]
name = "wasm-bindgen"
version = "0.2.100"
source = "git+https://github.com/kvark/dummy-web#5731e569d865a1ebaf116f48dad781f355a99243"

[[package]]
name = "wasmparser"
version = "0.78.2"
@@ -5564,6 +5387,11 @@ dependencies = [
 "wast",
]

[[package]]
name = "web-sys"
version = "0.3.100"
source = "git+https://github.com/kvark/dummy-web#5731e569d865a1ebaf116f48dad781f355a99243"

[[package]]
name = "webdriver"
version = "0.43.1"
@@ -5738,21 +5566,14 @@ dependencies = [

[[package]]
name = "wgpu-core"
version = "0.9.2"
version = "0.10.0"
source = "git+https://github.com/gfx-rs/wgpu?rev=d23288e#d23288e455eec657c5632d7c24410d0d2ef2057e"
dependencies = [
 "arrayvec",
 "arrayvec 0.7.1",
 "bitflags",
 "cfg_aliases",
 "copyless",
 "fxhash",
 "gfx-backend-dx11",
 "gfx-backend-dx12",
 "gfx-backend-empty",
 "gfx-backend-metal",
 "gfx-backend-vulkan",
 "gfx-hal",
 "gpu-alloc",
 "gpu-descriptor",
 "log",
 "naga",
 "parking_lot",
@@ -5761,12 +5582,47 @@ dependencies = [
 "serde",
 "smallvec",
 "thiserror",
 "wgpu-hal",
 "wgpu-types",
]

[[package]]
name = "wgpu-hal"
version = "0.10.1"
source = "git+https://github.com/gfx-rs/wgpu?rev=d23288e#d23288e455eec657c5632d7c24410d0d2ef2057e"
dependencies = [
 "arrayvec 0.7.1",
 "ash",
 "bit-set",
 "bitflags",
 "block",
 "core-graphics-types",
 "d3d12",
 "foreign-types",
 "fxhash",
 "glow",
 "gpu-alloc",
 "gpu-descriptor",
 "inplace_it",
 "khronos-egl",
 "libloading 0.7.0",
 "log",
 "metal",
 "naga",
 "objc",
 "parking_lot",
 "range-alloc",
 "raw-window-handle",
 "renderdoc-sys",
 "thiserror",
 "wgpu-types",
 "winapi",
]

[[package]]
name = "wgpu-types"
version = "0.9.0"
version = "0.10.0"
source = "git+https://github.com/gfx-rs/wgpu?rev=d23288e#d23288e455eec657c5632d7c24410d0d2ef2057e"
dependencies = [
 "bitflags",
 "serde",
@@ -5781,6 +5637,7 @@ dependencies = [
 "parking_lot",
 "serde",
 "wgpu-core",
 "wgpu-hal",
 "wgpu-types",
]

+7 −2
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ exclude = [

  # Excluded because these crates have their own Cargo workspaces so they can't
  # be included in the top-level one.
  "gfx/wgpu",
  "gfx/wr",

  # Excluded because they are used only as dependencies, not top-level targets,
@@ -44,6 +43,7 @@ exclude = [
]

# Use the new dependency resolver to reduce some of the platform-specific dependencies.
# This is required for 'third_party/rust/wgpu-hal'
resolver = "2"

# Explicitly specify what our profiles use.  The opt-level setting here is
@@ -82,8 +82,13 @@ chardetng = { git = "https://github.com/hsivonen/chardetng", rev="302c995f91f44c
chardetng_c = { git = "https://github.com/hsivonen/chardetng_c", rev="ed8a4c6f900a90d4dbc1d64b856e61490a1c3570" }
libudev-sys = { path = "dom/webauthn/libudev-sys" }
packed_simd = { git = "https://github.com/hsivonen/packed_simd", rev="6a16f954950401b92b4e220fbf2dfaf6f00e1fb2" }
spirv_cross = { git = "https://github.com/kvark/spirv_cross", branch = "wgpu5" }
minidump_writer_linux = { git = "https://github.com/msirringhaus/minidump_writer_linux.git", rev = "029ac0d54b237f27dc7d8d4e51bc0fb076e5e852" }
# The following overrides point to dummy projects, as a temporary measure until this is resolved:
# https://github.com/rust-lang/cargo/issues/6179
js-sys = { git = "https://github.com/kvark/dummy-web" }
slotmap = { git = "https://github.com/kvark/dummy-web" }
wasm-bindgen = { git = "https://github.com/kvark/dummy-web" }
web-sys = { git = "https://github.com/kvark/dummy-web" }

[patch.crates-io.cranelift-codegen]
git = "https://github.com/bytecodealliance/wasmtime"
+0 −1
Original line number Diff line number Diff line
@@ -115,7 +115,6 @@ gfx/tests/
gfx/thebes/
gfx/vr/
gfx/webrender_bindings/
gfx/wgpu/
gfx/wgpu_bindings/
gfx/wr/
gfx/ycbcr/
Loading