Skip to content

Commit

Permalink
Bug 1868672 - Update wgpu to revision ff7b2c399301cca9bcbc5b19a869f…
Browse files Browse the repository at this point in the history
…eb3c29ef785. r=webgpu-reviewers,supply-chain-reviewers,jimb

# Changelog

 * #4807 Bump wasm-bindgen-test from 0.3.38 to 0.3.39
   By dependabot[bot] in gfx-rs/wgpu#4807
 * #4830 Use Display instead of Debug to log errors.
   By nical in gfx-rs/wgpu#4830
 * #4755 [naga wgsl-in] Automatic conversions for `var` initializers.
   By jimblandy in gfx-rs/wgpu#4755
 * #4755 [naga wgsl-in] Automatic conversions for `var` initializers.
   By jimblandy in gfx-rs/wgpu#4755
 * #4755 [naga wgsl-in] Automatic conversions for `var` initializers.
   By jimblandy in gfx-rs/wgpu#4755
 * #4832 vulkan: fix multi-planar texture creation
   By xiaopengli89 in gfx-rs/wgpu#4832
 * #4758 [vk] remove (old) unused blocklist for dual source blending
   By teoxoy in gfx-rs/wgpu#4758
 * #4828 Remove DX11 backend
   By valaphee in gfx-rs/wgpu#4828
 * #4836 [gl] add support for line and point polygon modes
   By valaphee in gfx-rs/wgpu#4836
 * #4820 Bump futures-lite from 2.0.1 to 2.1.0
   By dependabot[bot] in gfx-rs/wgpu#4820
 * #4811 Expose shader validation
   By daxpedda in gfx-rs/wgpu#4811
 * #3507 [wgpu-hal] Inline RayQuery Support
   By daniel-keitel in gfx-rs/wgpu#3507
 * #4726 Fix Javascript exception on repeated `BufferSlice::get_mapped_range` calls
   By DouglasDwyer in gfx-rs/wgpu#4726
 * #4841 Remove `expose-ids` Feature
   By cwfitzgerald in gfx-rs/wgpu#4841
 * #4843 Some Minor `wgpu-core` Cleanups
   By cwfitzgerald in gfx-rs/wgpu#4843
 * #4844 Work around cbindgen issue
   By nical in gfx-rs/wgpu#4844

Differential Revision: https://phabricator.services.mozilla.com/D195735
  • Loading branch information
nical committed Dec 8, 2023
1 parent 81781df commit b58a1a6
Show file tree
Hide file tree
Showing 59 changed files with 2,518 additions and 1,437 deletions.
4 changes: 2 additions & 2 deletions .cargo/config.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 25,9 @@ git = "https://github.com/franziskuskiefer/cose-rust"
rev = "43c22248d136c8b38fe42ea709d08da6355cf04b"
replace-with = "vendored-sources"

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

[source."git https://github.com/hsivonen/chardetng?rev=3484d3e3ebdc8931493aa5df4d7ee9360a90e76b"]
Expand Down
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions dom/webgpu/Adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 77,6 @@ void AdapterInfo::GetWgpuBackend(nsString& s) const {
case ffi::WGPUBackend_Dx12:
s.AssignLiteral("Dx12");
return;
case ffi::WGPUBackend_Dx11:
s.AssignLiteral("Dx11");
return;
case ffi::WGPUBackend_Gl:
s.AssignLiteral("Gl");
return;
Expand Down
14 changes: 7 additions & 7 deletions gfx/wgpu_bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 17,7 @@ default = []
[dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "767ac03245ee937d3dc552edc13fe7ab0a860eec"
rev = "ff7b2c399301cca9bcbc5b19a869feb3c29ef785"
#Note: "replay" shouldn't ideally be needed,
# but it allows us to serialize everything across IPC.
features = ["replay", "trace", "serial-pass", "strict_asserts", "wgsl", "api_log_info"]
Expand All @@ -27,36 27,36 @@ features = ["replay", "trace", "serial-pass", "strict_asserts", "wgsl", "api_log
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "767ac03245ee937d3dc552edc13fe7ab0a860eec"
rev = "ff7b2c399301cca9bcbc5b19a869feb3c29ef785"
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 = "767ac03245ee937d3dc552edc13fe7ab0a860eec"
rev = "ff7b2c399301cca9bcbc5b19a869feb3c29ef785"
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 = "767ac03245ee937d3dc552edc13fe7ab0a860eec"
rev = "ff7b2c399301cca9bcbc5b19a869feb3c29ef785"
features = ["vulkan"]

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

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

[target.'cfg(windows)'.dependencies.d3d12]
git = "https://github.com/gfx-rs/wgpu"
rev = "767ac03245ee937d3dc552edc13fe7ab0a860eec"
rev = "ff7b2c399301cca9bcbc5b19a869feb3c29ef785"

[target.'cfg(windows)'.dependencies]
winapi = "0.3"
Expand Down
4 changes: 2 additions & 2 deletions gfx/wgpu_bindings/moz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 20,11 @@ origin:

# Human-readable identifier for this version/release
# Generally "version NNN", "tag SSS", "bookmark SSS"
release: commit 767ac03245ee937d3dc552edc13fe7ab0a860eec
release: commit ff7b2c399301cca9bcbc5b19a869feb3c29ef785

# Revision to pull in
# Must be a long or short commit SHA (long preferred)
revision: 767ac03245ee937d3dc552edc13fe7ab0a860eec
revision: ff7b2c399301cca9bcbc5b19a869feb3c29ef785

license: ['MIT', 'Apache-2.0']

Expand Down
25 changes: 25 additions & 0 deletions supply-chain/audits.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 1201,11 @@ who = "Erich Gubler <[email protected]>"
criteria = "safe-to-deploy"
delta = "0.7.0@git:6e21f7a9291db4395192d6b510d906978ae2d251 -> 0.7.0@git:a820a3ffba468cbb87c2a7e7bbe37065ed5207ee"

[[audits.d3d12]]
who = "Nicolas Silva <[email protected]>"
criteria = "safe-to-deploy"
delta = "0.7.0@git:767ac03245ee937d3dc552edc13fe7ab0a860eec -> 0.7.0@git:ff7b2c399301cca9bcbc5b19a869feb3c29ef785"

[[audits.d3d12]]
who = "Nicolas Silva <[email protected]>"
criteria = "safe-to-deploy"
Expand Down Expand Up @@ -2497,6 2502,11 @@ who = "Erich Gubler <[email protected]>"
criteria = "safe-to-deploy"
delta = "0.14.0@git:6e21f7a9291db4395192d6b510d906978ae2d251 -> 0.14.0@git:a820a3ffba468cbb87c2a7e7bbe37065ed5207ee"

[[audits.naga]]
who = "Nicolas Silva <[email protected]>"
criteria = "safe-to-deploy"
delta = "0.14.0@git:767ac03245ee937d3dc552edc13fe7ab0a860eec -> 0.14.0@git:ff7b2c399301cca9bcbc5b19a869feb3c29ef785"

[[audits.naga]]
who = "Nicolas Silva <[email protected]>"
criteria = "safe-to-deploy"
Expand Down Expand Up @@ -4270,6 4280,11 @@ who = "Erich Gubler <[email protected]>"
criteria = "safe-to-deploy"
delta = "0.18.0@git:6e21f7a9291db4395192d6b510d906978ae2d251 -> 0.18.0@git:a820a3ffba468cbb87c2a7e7bbe37065ed5207ee"

[[audits.wgpu-core]]
who = "Nicolas Silva <[email protected]>"
criteria = "safe-to-deploy"
delta = "0.18.0@git:767ac03245ee937d3dc552edc13fe7ab0a860eec -> 0.18.0@git:ff7b2c399301cca9bcbc5b19a869feb3c29ef785"

[[audits.wgpu-core]]
who = "Nicolas Silva <[email protected]>"
criteria = "safe-to-deploy"
Expand Down Expand Up @@ -4343,6 4358,11 @@ who = "Erich Gubler <[email protected]>"
criteria = "safe-to-deploy"
delta = "0.18.0@git:6e21f7a9291db4395192d6b510d906978ae2d251 -> 0.18.0@git:a820a3ffba468cbb87c2a7e7bbe37065ed5207ee"

[[audits.wgpu-hal]]
who = "Nicolas Silva <[email protected]>"
criteria = "safe-to-deploy"
delta = "0.18.0@git:767ac03245ee937d3dc552edc13fe7ab0a860eec -> 0.18.0@git:ff7b2c399301cca9bcbc5b19a869feb3c29ef785"

[[audits.wgpu-hal]]
who = "Nicolas Silva <[email protected]>"
criteria = "safe-to-deploy"
Expand Down Expand Up @@ -4416,6 4436,11 @@ who = "Erich Gubler <[email protected]>"
criteria = "safe-to-deploy"
delta = "0.18.0@git:6e21f7a9291db4395192d6b510d906978ae2d251 -> 0.18.0@git:a820a3ffba468cbb87c2a7e7bbe37065ed5207ee"

[[audits.wgpu-types]]
who = "Nicolas Silva <[email protected]>"
criteria = "safe-to-deploy"
delta = "0.18.0@git:767ac03245ee937d3dc552edc13fe7ab0a860eec -> 0.18.0@git:ff7b2c399301cca9bcbc5b19a869feb3c29ef785"

[[audits.wgpu-types]]
who = "Nicolas Silva <[email protected]>"
criteria = "safe-to-deploy"
Expand Down
2 changes: 1 addition & 1 deletion third_party/rust/naga/.cargo-checksum.json

Large diffs are not rendered by default.

98 changes: 61 additions & 37 deletions third_party/rust/naga/src/front/wgsl/lower/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -875,10 875,30 @@ impl<'source, 'temp> Lowerer<'source, 'temp> {
ast::GlobalDeclKind::Var(ref v) => {
let ty = self.resolve_ast_type(v.ty, &mut ctx)?;

let init = v
.init
.map(|init| self.expression(init, &mut ctx.as_const()))
.transpose()?;
let init;
if let Some(init_ast) = v.init {
let mut ectx = ctx.as_const();
let lowered = self.expression_for_abstract(init_ast, &mut ectx)?;
let ty_res = crate::proc::TypeResolution::Handle(ty);
let converted = ectx
.try_automatic_conversions(lowered, &ty_res, v.name.span)
.map_err(|error| match error {
Error::AutoConversion {
dest_span: _,
dest_type,
source_span: _,
source_type,
} => Error::InitializationTypeMismatch {
name: v.name.span,
expected: dest_type,
got: source_type,
},
other => other,
})?;
init = Some(converted);
} else {
init = None;
}

let binding = if let Some(ref binding) = v.binding {
Some(crate::ResourceBinding {
Expand Down Expand Up @@ -1142,45 1162,49 @@ impl<'source, 'temp> Lowerer<'source, 'temp> {
return Ok(());
}
ast::LocalDecl::Var(ref v) => {
let mut emitter = Emitter::default();
emitter.start(&ctx.function.expressions);

let initializer = match v.init {
Some(init) => Some(
self.expression(init, &mut ctx.as_expression(block, &mut emitter))?,
),
None => None,
};

let explicit_ty =
v.ty.map(|ty| self.resolve_ast_type(ty, &mut ctx.as_global()))
v.ty.map(|ast| self.resolve_ast_type(ast, &mut ctx.as_global()))
.transpose()?;

let ty = match (explicit_ty, initializer) {
(Some(explicit), Some(initializer)) => {
let mut ctx = ctx.as_expression(block, &mut emitter);
let initializer_ty = resolve_inner!(ctx, initializer);
if !ctx.module.types[explicit]
.inner
.equivalent(initializer_ty, &ctx.module.types)
{
let gctx = &ctx.module.to_ctx();
return Err(Error::InitializationTypeMismatch {
let mut emitter = Emitter::default();
emitter.start(&ctx.function.expressions);
let mut ectx = ctx.as_expression(block, &mut emitter);

let ty;
let initializer;
match (v.init, explicit_ty) {
(Some(init), Some(explicit_ty)) => {
let init = self.expression_for_abstract(init, &mut ectx)?;
let ty_res = crate::proc::TypeResolution::Handle(explicit_ty);
let init = ectx
.try_automatic_conversions(init, &ty_res, v.name.span)
.map_err(|error| match error {
Error::AutoConversion {
dest_span: _,
dest_type,
source_span: _,
source_type,
} => Error::InitializationTypeMismatch {
name: v.name.span,
expected: explicit.to_wgsl(gctx),
got: initializer_ty.to_wgsl(gctx),
});
}
explicit
expected: dest_type,
got: source_type,
},
other => other,
})?;
ty = explicit_ty;
initializer = Some(init);
}
(Some(explicit), None) => explicit,
(None, Some(initializer)) => ctx
.as_expression(block, &mut emitter)
.register_type(initializer)?,
(None, None) => {
return Err(Error::MissingType(v.name.span));
(Some(init), None) => {
let concretized = self.expression(init, &mut ectx)?;
ty = ectx.register_type(concretized)?;
initializer = Some(concretized);
}
};
(None, Some(explicit_ty)) => {
ty = explicit_ty;
initializer = None;
}
(None, None) => return Err(Error::MissingType(v.name.span)),
}

let (const_initializer, initializer) = {
match initializer {
Expand Down
Loading

0 comments on commit b58a1a6

Please sign in to comment.