tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 757847de0fcf5cd1299e81a70ac5412c4162484e
parent ea9adc9b7ef394d78846ad7db756a5b94034495a
Author: Andy Leiserson <aleiserson@mozilla.com>
Date:   Fri, 14 Nov 2025 23:20:38 +0000

Bug 2000099: Update wgpu to upstream a4413823 r=webgpu-reviewers,supply-chain-reviewers,jimb

Differential Revision: https://phabricator.services.mozilla.com/D272685

Diffstat:
M.cargo/config.toml.in | 4++--
MCargo.lock | 12++++++------
Mgfx/wgpu_bindings/Cargo.toml | 12++++++------
Mgfx/wgpu_bindings/moz.yaml | 4++--
Msupply-chain/audits.toml | 12++++++------
Mthird_party/rust/wgpu-core/.cargo-checksum.json | 4++--
Mthird_party/rust/wgpu-core/src/command/bind.rs | 2+-
Mthird_party/rust/wgpu-core/src/command/compute.rs | 83+++++++++++++++++++++++++++++++++++++++++++++++++------------------------------
Mthird_party/rust/wgpu-core/src/command/pass.rs | 52+++++++++++++++++++++++++---------------------------
Mthird_party/rust/wgpu-core/src/command/render.rs | 2+-
Mthird_party/rust/wgpu-core/src/device/queue.rs | 4++++
Mthird_party/rust/wgpu-core/src/track/buffer.rs | 27+++++++++++++++++++++++----
Mthird_party/rust/wgpu-core/src/track/metadata.rs | 8++++++++
Mthird_party/rust/wgpu-core/src/track/mod.rs | 19+++++++++++++------
Mthird_party/rust/wgpu-core/src/track/texture.rs | 11++++++-----
15 files changed, 157 insertions(+), 99 deletions(-)

diff --git a/.cargo/config.toml.in b/.cargo/config.toml.in @@ -40,9 +40,9 @@ git = "https://github.com/franziskuskiefer/cose-rust" rev = "43c22248d136c8b38fe42ea709d08da6355cf04b" replace-with = "vendored-sources" -[source."git+https://github.com/gfx-rs/wgpu?rev=d8f97261d23e436be75884f792b5931b383c4041"] +[source."git+https://github.com/gfx-rs/wgpu?rev=a441382328c5163466fae06802737ef1df8d1f13"] git = "https://github.com/gfx-rs/wgpu" -rev = "d8f97261d23e436be75884f792b5931b383c4041" +rev = "a441382328c5163466fae06802737ef1df8d1f13" replace-with = "vendored-sources" [source."git+https://github.com/glandium/allocator-api2?rev=ad5f3d56a5a4519eff52af4ff85293431466ef5c"] diff --git a/Cargo.lock b/Cargo.lock @@ -4758,7 +4758,7 @@ checksum = "a2983372caf4480544083767bf2d27defafe32af49ab4df3a0b7fc90793a3664" [[package]] name = "naga" version = "27.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=d8f97261d23e436be75884f792b5931b383c4041#d8f97261d23e436be75884f792b5931b383c4041" +source = "git+https://github.com/gfx-rs/wgpu?rev=a441382328c5163466fae06802737ef1df8d1f13#a441382328c5163466fae06802737ef1df8d1f13" dependencies = [ "arrayvec", "bit-set", @@ -7940,7 +7940,7 @@ dependencies = [ [[package]] name = "wgpu-core" version = "27.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=d8f97261d23e436be75884f792b5931b383c4041#d8f97261d23e436be75884f792b5931b383c4041" +source = "git+https://github.com/gfx-rs/wgpu?rev=a441382328c5163466fae06802737ef1df8d1f13#a441382328c5163466fae06802737ef1df8d1f13" dependencies = [ "arrayvec", "bit-set", @@ -7970,7 +7970,7 @@ dependencies = [ [[package]] name = "wgpu-core-deps-apple" version = "27.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=d8f97261d23e436be75884f792b5931b383c4041#d8f97261d23e436be75884f792b5931b383c4041" +source = "git+https://github.com/gfx-rs/wgpu?rev=a441382328c5163466fae06802737ef1df8d1f13#a441382328c5163466fae06802737ef1df8d1f13" dependencies = [ "wgpu-hal", ] @@ -7978,7 +7978,7 @@ dependencies = [ [[package]] name = "wgpu-core-deps-windows-linux-android" version = "27.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=d8f97261d23e436be75884f792b5931b383c4041#d8f97261d23e436be75884f792b5931b383c4041" +source = "git+https://github.com/gfx-rs/wgpu?rev=a441382328c5163466fae06802737ef1df8d1f13#a441382328c5163466fae06802737ef1df8d1f13" dependencies = [ "wgpu-hal", ] @@ -7986,7 +7986,7 @@ dependencies = [ [[package]] name = "wgpu-hal" version = "27.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=d8f97261d23e436be75884f792b5931b383c4041#d8f97261d23e436be75884f792b5931b383c4041" +source = "git+https://github.com/gfx-rs/wgpu?rev=a441382328c5163466fae06802737ef1df8d1f13#a441382328c5163466fae06802737ef1df8d1f13" dependencies = [ "android_system_properties", "arrayvec", @@ -8024,7 +8024,7 @@ dependencies = [ [[package]] name = "wgpu-types" version = "27.0.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=d8f97261d23e436be75884f792b5931b383c4041#d8f97261d23e436be75884f792b5931b383c4041" +source = "git+https://github.com/gfx-rs/wgpu?rev=a441382328c5163466fae06802737ef1df8d1f13#a441382328c5163466fae06802737ef1df8d1f13" dependencies = [ "bitflags 2.9.0", "bytemuck", diff --git a/gfx/wgpu_bindings/Cargo.toml b/gfx/wgpu_bindings/Cargo.toml @@ -17,7 +17,7 @@ default = [] [dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "d8f97261d23e436be75884f792b5931b383c4041" +rev = "a441382328c5163466fae06802737ef1df8d1f13" features = ["serde", "trace", "strict_asserts", "wgsl", "api_log_info"] # We want the wgpu-core Metal backend on macOS and iOS. @@ -25,32 +25,32 @@ features = ["serde", "trace", "strict_asserts", "wgsl", "api_log_info"] [target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies.wgc] package = "wgpu-core" git = "https://github.com/gfx-rs/wgpu" -rev = "d8f97261d23e436be75884f792b5931b383c4041" +rev = "a441382328c5163466fae06802737ef1df8d1f13" 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 = "d8f97261d23e436be75884f792b5931b383c4041" +rev = "a441382328c5163466fae06802737ef1df8d1f13" 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 = "d8f97261d23e436be75884f792b5931b383c4041" +rev = "a441382328c5163466fae06802737ef1df8d1f13" features = ["vulkan"] [dependencies.wgt] package = "wgpu-types" git = "https://github.com/gfx-rs/wgpu" -rev = "d8f97261d23e436be75884f792b5931b383c4041" +rev = "a441382328c5163466fae06802737ef1df8d1f13" [dependencies.wgh] package = "wgpu-hal" git = "https://github.com/gfx-rs/wgpu" -rev = "d8f97261d23e436be75884f792b5931b383c4041" +rev = "a441382328c5163466fae06802737ef1df8d1f13" features = ["device_lost_panic", "internal_error_panic"] [target.'cfg(windows)'.dependencies] diff --git a/gfx/wgpu_bindings/moz.yaml b/gfx/wgpu_bindings/moz.yaml @@ -8,8 +8,8 @@ origin: name: wgpu description: A cross-platform pure-Rust graphics API, modeled on the WebGPU standard url: https://github.com/gfx-rs/wgpu - release: d8f97261d23e436be75884f792b5931b383c4041 (2025-10-27T10:59:42Z). - revision: d8f97261d23e436be75884f792b5931b383c4041 + release: a441382328c5163466fae06802737ef1df8d1f13 (2025-11-13T20:50:18Z). + revision: a441382328c5163466fae06802737ef1df8d1f13 license: ['MIT', 'Apache-2.0'] updatebot: diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml @@ -4350,7 +4350,7 @@ who = [ "Erich Gubler <erichdongubler@gmail.com>", ] criteria = "safe-to-deploy" -delta = "27.0.0 -> 27.0.0@git:d8f97261d23e436be75884f792b5931b383c4041" +delta = "27.0.0 -> 27.0.0@git:a441382328c5163466fae06802737ef1df8d1f13" importable = false [[audits.net2]] @@ -6917,7 +6917,7 @@ who = [ "Erich Gubler <erichdongubler@gmail.com>", ] criteria = "safe-to-deploy" -delta = "27.0.0 -> 27.0.0@git:d8f97261d23e436be75884f792b5931b383c4041" +delta = "27.0.0 -> 27.0.0@git:a441382328c5163466fae06802737ef1df8d1f13" importable = false [[audits.wgpu-core-deps-apple]] @@ -6948,7 +6948,7 @@ who = [ "Erich Gubler <erichdongubler@gmail.com>", ] criteria = "safe-to-deploy" -delta = "27.0.0 -> 27.0.0@git:d8f97261d23e436be75884f792b5931b383c4041" +delta = "27.0.0 -> 27.0.0@git:a441382328c5163466fae06802737ef1df8d1f13" importable = false [[audits.wgpu-core-deps-windows-linux-android]] @@ -6979,7 +6979,7 @@ who = [ "Erich Gubler <erichdongubler@gmail.com>", ] criteria = "safe-to-deploy" -delta = "27.0.0 -> 27.0.0@git:d8f97261d23e436be75884f792b5931b383c4041" +delta = "27.0.0 -> 27.0.0@git:a441382328c5163466fae06802737ef1df8d1f13" importable = false [[audits.wgpu-hal]] @@ -7088,7 +7088,7 @@ who = [ "Erich Gubler <erichdongubler@gmail.com>", ] criteria = "safe-to-deploy" -delta = "27.0.0 -> 27.0.0@git:d8f97261d23e436be75884f792b5931b383c4041" +delta = "27.0.0 -> 27.0.0@git:a441382328c5163466fae06802737ef1df8d1f13" importable = false [[audits.wgpu-types]] @@ -7192,7 +7192,7 @@ who = [ "Erich Gubler <erichdongubler@gmail.com>", ] criteria = "safe-to-deploy" -delta = "27.0.0 -> 27.0.0@git:d8f97261d23e436be75884f792b5931b383c4041" +delta = "27.0.0 -> 27.0.0@git:a441382328c5163466fae06802737ef1df8d1f13" importable = false [[audits.whatsys]] diff --git a/third_party/rust/wgpu-core/.cargo-checksum.json b/third_party/rust/wgpu-core/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"14fc314e094524575e12773badac343c650bfd0c983d828539a4ac887a64bbf6","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"dc0d97139e8205818c703741c7be7cb3b96888bd5917b8d6fc6133731e403c21","build.rs":"5e3619e28faeac243cbae1a5f739ad15035dc9e1254957b64fd1deed6f393c8a","src/as_hal.rs":"5d08d8e49b016abb662957d8e42ab748d580a2f3e449caeeb7311f222b8818f6","src/binding_model.rs":"9943f0814b697f446ee374343a980e49ca2f8fae1bb1955ba889eb0bee4b1f3b","src/command/allocator.rs":"386cb6e60bd332a881dbbe57ff66a0fa83f35e3ee924559f1689418ac6c7273a","src/command/bind.rs":"060bca4de8e8f2ed3157e702e77eecedd9c5f6eab68c3c07b59b23191308346e","src/command/bundle.rs":"d078bb708cbdea42ebebc5c5a510bff3cad982b67be3682ed5956bfb212114f1","src/command/clear.rs":"932afc6e1858f8c93d3ecf721215a0bc584a8e613444641a98f5cb98e3061b4b","src/command/compute.rs":"2316e2e0409cffdc9b28fc28491e78e8fbaf4ea317ea2a92b27b5a22be38292d","src/command/compute_command.rs":"18aa0b8e389a5d345243b876b1abbacfc998a19d23069e092183fa7be10fa0ab","src/command/draw.rs":"e7bf195d33683a19b077e64d181cb27b8acde724732ac9af3c94d83c3f21559e","src/command/encoder.rs":"7655f8c248120f39e37f3ad0f84bd9816df78a75657790ab12d5aba144fef65f","src/command/encoder_command.rs":"4e1d28040d9330a803644e377bd7675ec503cd0396c31394658dc67d71a4b50f","src/command/ffi.rs":"1fb626579a7726a32d571a17a14f2656def0c170f4f6297e7e51772a6fc5a566","src/command/memory_init.rs":"f68a796c4262d261620cf85e5762e267dee013f4ef5d61f67fcb173b59048983","src/command/mod.rs":"0c650f854bbf48b25c00ff4b3423b0e33abc7199a4a423d39ae155cc694deb47","src/command/pass.rs":"ece99f1a023d03e8f293c9533e90f1762945988819bfb35d6f182bdb1997faf8","src/command/query.rs":"fa7cb51fbbaa50febe0e61c473891d4131125c290180a05d49b60f5138931fb4","src/command/ray_tracing.rs":"bcb785a0845ecccc87411037fac234474429beba9cd67ba33d55476716e25dca","src/command/render.rs":"5cf2e50dfa16426624a3d6b4a6207025c8fbe6a76bb96671ef19fe8337dc95ee","src/command/render_command.rs":"3f1bc2fec688fa3f33052867eeb2e194020a643f7d16f6111b8b128594c38570","src/command/timestamp_writes.rs":"da06fb07b8d0917be3e7fb9212d0ffc6b16526e1c1df617213ef354c3e1fb446","src/command/transfer.rs":"28fdca903934d7e2e5d12d28f952ad3e9ef804c8452f9d020831b5e6aca7e19d","src/command/transition_resources.rs":"753cb02adfee4758404c403d19fd76e6c8de77de01435a2cbe2f60bdbe44bde1","src/conv.rs":"4e4115429df502099f7230d47a050d307f6237c7c11c9c90cba9e34dc909ebdd","src/device/bgl.rs":"b081fe1393f1dd917151efc3a10ee0269fecd3920eac3b45411c1197a98c5a06","src/device/global.rs":"e6ca310ed5f0ed4bd369d25b0f6ee6711624484f35c9fd533111f603aae25618","src/device/life.rs":"44bd34cf5ab1c1a21729f2188df6d2ca0238f11c5f723380c8a4a16fbbd90b88","src/device/mod.rs":"dc8271ae7b62e1096f1a9068f671e6ed8cf7a11b5f9987066d5c173c6e4c4ad8","src/device/queue.rs":"0a883c00acef68fe05d309ec68a5df0c920965074c9c5fa4753b7861d279c4fe","src/device/ray_tracing.rs":"cb13bc0caf54113ca12ce5db147af339474ec4b2423f2556600b5ea936b408cc","src/device/resource.rs":"039e2b45debf9396038482ae67cdea7bed0bb5fc8ba694941ee61638df11ff1f","src/device/trace.rs":"39e52ee5b220eb6a13d949582f1f87756189648bf2f05ea7148b0a67b73c226f","src/error.rs":"4f07a0b09b30b2d6cbc855d0091d724000f492018af3b41e80befbeccf2a6f4e","src/global.rs":"bd76f9552496996f9eba6502e5caf1bcd6ca33bf3d5008795b5335f74e56fd55","src/hash_utils.rs":"9f57a627fe3f00659391670141df62f68d67922c7b186f2a9a5958ab16fb576f","src/hub.rs":"308c53e05134e5a48294c61511e43077adfdb5c334237de2016ed4537d562382","src/id.rs":"134974aa304d1d0eb7349438b9660519886c513f01d5868cd4331d2bc78f2cb8","src/identity.rs":"712ccda267eb602655c53672a94346aa4c9f88c0044ae6edcd658a814c9a50cf","src/indirect_validation/dispatch.rs":"b15d926e0de732c3c39c965f168f99598fa508ca4b0883061993d99dd644b31a","src/indirect_validation/draw.rs":"6d8338f37f406c6e2cf89713e8493f167e1d8e999737f2976de298810c2ada76","src/indirect_validation/mod.rs":"79466e4f9a59386e833958b3537beed6ffb6a7ee62aaabcf35382c2683998e43","src/indirect_validation/utils.rs":"e6a3b636dd71ff6b01d5abd5a589a0136fb30aa1d517a43f45cf2e5ad54da245","src/indirect_validation/validate_draw.wgsl":"fa7bba5f28c6c181f2d55ecfe386a5e5cd276bcb3c36aa7f963f43c535a9bf9a","src/init_tracker/buffer.rs":"6167a400ab271ba857f1c507e60a46fbd318c185aff87eecf7eb05f7f09b6963","src/init_tracker/mod.rs":"aa87df3428e3b23507377c71eae92dc1dd9f5d5374aa0b03906fb81507fc6ce6","src/init_tracker/texture.rs":"ffdc67d4be23bcd48b22945de94ac0ea8ee571f91eb6d00323b9afe6fa91eef3","src/instance.rs":"e7b9a20e070cc401f75dfe07aceb8f2950a4d99ed8a7d4413ef9f0813f5a8ca1","src/lib.rs":"57d2562e33b04113cc6c2ca3bc9a215ec779a291be82b680ff037fac7d7a8a15","src/lock/mod.rs":"8d3ae3f8d004d7f7d8a3aefe9f30b35669cb8e2409f5fba27b1fcb116b2429c4","src/lock/observing.rs":"5bf62cef9f3ae67e99af640442fadd4e1f762480d990ee69ed9924c9e94a8dce","src/lock/rank.rs":"238e6a97c58ee1a804863c8011bb257864301170344d18596bdaab09f3f74b54","src/lock/ranked.rs":"a95d6bf7f2ef510047a4c33687076beccf38a0148aac3261bd29fa7555e3f488","src/lock/vanilla.rs":"ca8156d4c981473d437db1056487a44c714760d685819eaff8cf82fb0098a608","src/pipeline.rs":"b7aae46522bc6843b0f47dac7e73e33197c76e9724cfb4be3b949bfa27a99fb1","src/pipeline_cache.rs":"f6a82de6cf362be50335d26e8eed983b53812a8444dff9c8c988a075f3325f8f","src/pool.rs":"e11bfdc73a66321d26715465fa74657dcd26a9b856b80b8369b4aac2132a4295","src/present.rs":"bf0c6c47e58496199955013170f41cbf10755c1572583d5af4b88686c28ffb66","src/ray_tracing.rs":"a4261ccd978e8fab1fef48a168d2d33f8a9f2dae89f285ecd9ec8a6d0894fa3b","src/registry.rs":"ecd457e8956e065050bb9c63ca404505e56ffed6d540b3f14f745d7c4010b205","src/resource.rs":"942a362cc4ef05876870d3bcb0f0db8d2a513be5acacf257c202ee2c0c83a908","src/scratch.rs":"ea5c40e4d18a12f09cc1038f2dcdddb69b13e99275ac987d826658229a39b326","src/snatch.rs":"bf422810afd952894e365cd397763d42d6365ce3c5a5b4c1170566432f462939","src/storage.rs":"29427dea035d03abc8b8abdebecc5591378f1366088d1468ab2beb8536e7d675","src/timestamp_normalization/common.wgsl":"9f65aef0526ff9dde945fae70cef064ad961b0aee4291759ae82974cd2ead0a7","src/timestamp_normalization/mod.rs":"89444ad79900c12c2dc44780f1525cd0554d6ed1d9038938dd0075e8173ae59d","src/timestamp_normalization/timestamp_normalization.wgsl":"4b2202b965e4c67482d03a546ac38c72a602d79ed9a60e6f7217393c49afad49","src/track/blas.rs":"18c7b5b89a60ab49bbc0f4f8b85a24502c1d968714ef4c586095e119848d902a","src/track/buffer.rs":"c64e14aba25291064b1a095c875f94cd053b1d7d3744691c041285328e99f7ac","src/track/metadata.rs":"00b754c2c23b6fbfc11a03aecf0528a38fbfec0ff54f4d9eeaed4043e54884a5","src/track/mod.rs":"67e6fd7c6538c7e3cdd1655e85400320adac559f6c257477985081994edbf5d3","src/track/range.rs":"2688b05a0c6e8510ff6ba3a9623e8b83f433a05ba743129928c56c93d9a9c233","src/track/stateless.rs":"3db699f5f48a319fa07fb16cdf51e1623d6ecac7a476467ee366e014ea665b89","src/track/texture.rs":"3f3295bbc1b41415fceac700e6b494b26c3c673ebc5aa1fe31803197e53b68ea","src/validation.rs":"a4f661cd65a621e1aebf2d5c5aa3d726373647d6cbab36ed8ebdcb42bbecf416","src/weak_vec.rs":"a4193add5912b91226a3155cc613365b7fafdf2e7929d21d68bc19d149696e85"},"package":null} -\ No newline at end of file +{"files":{"Cargo.toml":"14fc314e094524575e12773badac343c650bfd0c983d828539a4ac887a64bbf6","LICENSE.APACHE":"a6cba85bc92e0cff7a450b1d873c0eaa2e9fc96bf472df0247a26bec77bf3ff9","LICENSE.MIT":"dc0d97139e8205818c703741c7be7cb3b96888bd5917b8d6fc6133731e403c21","build.rs":"5e3619e28faeac243cbae1a5f739ad15035dc9e1254957b64fd1deed6f393c8a","src/as_hal.rs":"5d08d8e49b016abb662957d8e42ab748d580a2f3e449caeeb7311f222b8818f6","src/binding_model.rs":"9943f0814b697f446ee374343a980e49ca2f8fae1bb1955ba889eb0bee4b1f3b","src/command/allocator.rs":"386cb6e60bd332a881dbbe57ff66a0fa83f35e3ee924559f1689418ac6c7273a","src/command/bind.rs":"198c23d5d5a0012a0aac58d4a42e7fd5c69776e7b19309720fbb85e699347d0d","src/command/bundle.rs":"d078bb708cbdea42ebebc5c5a510bff3cad982b67be3682ed5956bfb212114f1","src/command/clear.rs":"932afc6e1858f8c93d3ecf721215a0bc584a8e613444641a98f5cb98e3061b4b","src/command/compute.rs":"bd7f8df05c7172781bed6d181b75360e3b66d0cf0c56f655ad76ab8e73b59b76","src/command/compute_command.rs":"18aa0b8e389a5d345243b876b1abbacfc998a19d23069e092183fa7be10fa0ab","src/command/draw.rs":"e7bf195d33683a19b077e64d181cb27b8acde724732ac9af3c94d83c3f21559e","src/command/encoder.rs":"7655f8c248120f39e37f3ad0f84bd9816df78a75657790ab12d5aba144fef65f","src/command/encoder_command.rs":"4e1d28040d9330a803644e377bd7675ec503cd0396c31394658dc67d71a4b50f","src/command/ffi.rs":"1fb626579a7726a32d571a17a14f2656def0c170f4f6297e7e51772a6fc5a566","src/command/memory_init.rs":"f68a796c4262d261620cf85e5762e267dee013f4ef5d61f67fcb173b59048983","src/command/mod.rs":"0c650f854bbf48b25c00ff4b3423b0e33abc7199a4a423d39ae155cc694deb47","src/command/pass.rs":"e92efb6eef955cc329e5c5d2aa49e5be78e42dc82ed62e6878b005f4450e9e80","src/command/query.rs":"fa7cb51fbbaa50febe0e61c473891d4131125c290180a05d49b60f5138931fb4","src/command/ray_tracing.rs":"bcb785a0845ecccc87411037fac234474429beba9cd67ba33d55476716e25dca","src/command/render.rs":"f0dda975fa2f1c6f74e6150db7b26d1f3c8a9cf9523892e4e2f3a3f81009b839","src/command/render_command.rs":"3f1bc2fec688fa3f33052867eeb2e194020a643f7d16f6111b8b128594c38570","src/command/timestamp_writes.rs":"da06fb07b8d0917be3e7fb9212d0ffc6b16526e1c1df617213ef354c3e1fb446","src/command/transfer.rs":"28fdca903934d7e2e5d12d28f952ad3e9ef804c8452f9d020831b5e6aca7e19d","src/command/transition_resources.rs":"753cb02adfee4758404c403d19fd76e6c8de77de01435a2cbe2f60bdbe44bde1","src/conv.rs":"4e4115429df502099f7230d47a050d307f6237c7c11c9c90cba9e34dc909ebdd","src/device/bgl.rs":"b081fe1393f1dd917151efc3a10ee0269fecd3920eac3b45411c1197a98c5a06","src/device/global.rs":"e6ca310ed5f0ed4bd369d25b0f6ee6711624484f35c9fd533111f603aae25618","src/device/life.rs":"44bd34cf5ab1c1a21729f2188df6d2ca0238f11c5f723380c8a4a16fbbd90b88","src/device/mod.rs":"dc8271ae7b62e1096f1a9068f671e6ed8cf7a11b5f9987066d5c173c6e4c4ad8","src/device/queue.rs":"efe56b3905bac2540d67a469aa01c6579034b541ee7e898234809d0071f08abf","src/device/ray_tracing.rs":"cb13bc0caf54113ca12ce5db147af339474ec4b2423f2556600b5ea936b408cc","src/device/resource.rs":"039e2b45debf9396038482ae67cdea7bed0bb5fc8ba694941ee61638df11ff1f","src/device/trace.rs":"39e52ee5b220eb6a13d949582f1f87756189648bf2f05ea7148b0a67b73c226f","src/error.rs":"4f07a0b09b30b2d6cbc855d0091d724000f492018af3b41e80befbeccf2a6f4e","src/global.rs":"bd76f9552496996f9eba6502e5caf1bcd6ca33bf3d5008795b5335f74e56fd55","src/hash_utils.rs":"9f57a627fe3f00659391670141df62f68d67922c7b186f2a9a5958ab16fb576f","src/hub.rs":"308c53e05134e5a48294c61511e43077adfdb5c334237de2016ed4537d562382","src/id.rs":"134974aa304d1d0eb7349438b9660519886c513f01d5868cd4331d2bc78f2cb8","src/identity.rs":"712ccda267eb602655c53672a94346aa4c9f88c0044ae6edcd658a814c9a50cf","src/indirect_validation/dispatch.rs":"b15d926e0de732c3c39c965f168f99598fa508ca4b0883061993d99dd644b31a","src/indirect_validation/draw.rs":"6d8338f37f406c6e2cf89713e8493f167e1d8e999737f2976de298810c2ada76","src/indirect_validation/mod.rs":"79466e4f9a59386e833958b3537beed6ffb6a7ee62aaabcf35382c2683998e43","src/indirect_validation/utils.rs":"e6a3b636dd71ff6b01d5abd5a589a0136fb30aa1d517a43f45cf2e5ad54da245","src/indirect_validation/validate_draw.wgsl":"fa7bba5f28c6c181f2d55ecfe386a5e5cd276bcb3c36aa7f963f43c535a9bf9a","src/init_tracker/buffer.rs":"6167a400ab271ba857f1c507e60a46fbd318c185aff87eecf7eb05f7f09b6963","src/init_tracker/mod.rs":"aa87df3428e3b23507377c71eae92dc1dd9f5d5374aa0b03906fb81507fc6ce6","src/init_tracker/texture.rs":"ffdc67d4be23bcd48b22945de94ac0ea8ee571f91eb6d00323b9afe6fa91eef3","src/instance.rs":"e7b9a20e070cc401f75dfe07aceb8f2950a4d99ed8a7d4413ef9f0813f5a8ca1","src/lib.rs":"57d2562e33b04113cc6c2ca3bc9a215ec779a291be82b680ff037fac7d7a8a15","src/lock/mod.rs":"8d3ae3f8d004d7f7d8a3aefe9f30b35669cb8e2409f5fba27b1fcb116b2429c4","src/lock/observing.rs":"5bf62cef9f3ae67e99af640442fadd4e1f762480d990ee69ed9924c9e94a8dce","src/lock/rank.rs":"238e6a97c58ee1a804863c8011bb257864301170344d18596bdaab09f3f74b54","src/lock/ranked.rs":"a95d6bf7f2ef510047a4c33687076beccf38a0148aac3261bd29fa7555e3f488","src/lock/vanilla.rs":"ca8156d4c981473d437db1056487a44c714760d685819eaff8cf82fb0098a608","src/pipeline.rs":"b7aae46522bc6843b0f47dac7e73e33197c76e9724cfb4be3b949bfa27a99fb1","src/pipeline_cache.rs":"f6a82de6cf362be50335d26e8eed983b53812a8444dff9c8c988a075f3325f8f","src/pool.rs":"e11bfdc73a66321d26715465fa74657dcd26a9b856b80b8369b4aac2132a4295","src/present.rs":"bf0c6c47e58496199955013170f41cbf10755c1572583d5af4b88686c28ffb66","src/ray_tracing.rs":"a4261ccd978e8fab1fef48a168d2d33f8a9f2dae89f285ecd9ec8a6d0894fa3b","src/registry.rs":"ecd457e8956e065050bb9c63ca404505e56ffed6d540b3f14f745d7c4010b205","src/resource.rs":"942a362cc4ef05876870d3bcb0f0db8d2a513be5acacf257c202ee2c0c83a908","src/scratch.rs":"ea5c40e4d18a12f09cc1038f2dcdddb69b13e99275ac987d826658229a39b326","src/snatch.rs":"bf422810afd952894e365cd397763d42d6365ce3c5a5b4c1170566432f462939","src/storage.rs":"29427dea035d03abc8b8abdebecc5591378f1366088d1468ab2beb8536e7d675","src/timestamp_normalization/common.wgsl":"9f65aef0526ff9dde945fae70cef064ad961b0aee4291759ae82974cd2ead0a7","src/timestamp_normalization/mod.rs":"89444ad79900c12c2dc44780f1525cd0554d6ed1d9038938dd0075e8173ae59d","src/timestamp_normalization/timestamp_normalization.wgsl":"4b2202b965e4c67482d03a546ac38c72a602d79ed9a60e6f7217393c49afad49","src/track/blas.rs":"18c7b5b89a60ab49bbc0f4f8b85a24502c1d968714ef4c586095e119848d902a","src/track/buffer.rs":"7f2393d16d0e8f624327c7a3a1de7176f945f3d33bfd3e12640faddc5c2c9f83","src/track/metadata.rs":"04b8bcf8ded7c7c805d9336cfc874da9d8de7d12d99f7525f0540780a1dffc45","src/track/mod.rs":"c28de55e31cdde3feb067945a04446dc5343a39418c4b9c2c76148172e7ba855","src/track/range.rs":"2688b05a0c6e8510ff6ba3a9623e8b83f433a05ba743129928c56c93d9a9c233","src/track/stateless.rs":"3db699f5f48a319fa07fb16cdf51e1623d6ecac7a476467ee366e014ea665b89","src/track/texture.rs":"34e72a20364d3ce642c21b29a089811503aa2fb4e7dab1a1e20d8ddd598742d7","src/validation.rs":"a4f661cd65a621e1aebf2d5c5aa3d726373647d6cbab36ed8ebdcb42bbecf416","src/weak_vec.rs":"a4193add5912b91226a3155cc613365b7fafdf2e7929d21d68bc19d149696e85"},"package":null} +\ No newline at end of file diff --git a/third_party/rust/wgpu-core/src/command/bind.rs b/third_party/rust/wgpu-core/src/command/bind.rs @@ -418,7 +418,7 @@ impl Binder { pub(super) fn entries( &self, range: Range<usize>, - ) -> impl ExactSizeIterator<Item = (usize, &'_ EntryPayload)> + '_ { + ) -> impl ExactSizeIterator<Item = (usize, &'_ EntryPayload)> + Clone + '_ { let payloads = &self.payloads[range.clone()]; zip(range, payloads) } diff --git a/third_party/rust/wgpu-core/src/command/compute.rs b/third_party/rust/wgpu-core/src/command/compute.rs @@ -8,8 +8,10 @@ use alloc::{borrow::Cow, boxed::Box, sync::Arc, vec::Vec}; use core::{convert::Infallible, fmt, str}; use crate::{ - api_log, binding_model::BindError, command::pass::flush_bindings_helper, - resource::RawResourceAccess, + api_log, + binding_model::BindError, + command::pass::flush_bindings_helper, + resource::{RawResourceAccess, Trackable}, }; use crate::{ binding_model::{LateMinBufferBindingSizeMismatch, PushConstantUploadError}, @@ -30,7 +32,7 @@ use crate::{ resource::{ self, Buffer, InvalidResourceError, Labeled, MissingBufferUsageError, ParentDevice, }, - track::{ResourceUsageCompatibilityError, Tracker, TrackerIndex}, + track::{ResourceUsageCompatibilityError, Tracker}, Label, }; use crate::{command::InnerCommandEncoder, resource::DestroyedResourceError}; @@ -306,45 +308,65 @@ impl<'scope, 'snatch_guard, 'cmd_enc> State<'scope, 'snatch_guard, 'cmd_enc> { /// /// # Indirect buffer handling /// - /// For indirect dispatches without validation, pass both `indirect_buffer` - /// and `indirect_buffer_index_if_not_validating`. The indirect buffer will - /// be added to the usage scope and the tracker. + /// The `indirect_buffer` argument should be passed for any indirect + /// dispatch (with or without validation). It will be checked for + /// conflicting usages according to WebGPU rules. For the purpose of + /// these rules, the fact that we have actually processed the buffer in + /// the validation pass is an implementation detail. /// - /// For indirect dispatches with validation, pass only `indirect_buffer`. - /// The indirect buffer will be added to the usage scope to detect usage - /// conflicts. The indirect buffer does not need to be added to the tracker; - /// the indirect validation code handles transitions manually. + /// The `track_indirect_buffer` argument should be set when doing indirect + /// dispatch *without* validation. In this case, the indirect buffer will + /// be added to the tracker in order to generate any necessary transitions + /// for that usage. + /// + /// When doing indirect dispatch *with* validation, the indirect buffer is + /// processed by the validation pass and is not used by the actual dispatch. + /// The indirect validation code handles transitions for the validation + /// pass. fn flush_bindings( &mut self, indirect_buffer: Option<&Arc<Buffer>>, - indirect_buffer_index_if_not_validating: Option<TrackerIndex>, + track_indirect_buffer: bool, ) -> Result<(), ComputePassErrorInner> { - let mut scope = self.pass.base.device.new_usage_scope(); - for bind_group in self.pass.binder.list_active() { - unsafe { scope.merge_bind_group(&bind_group.used)? }; + unsafe { self.pass.scope.merge_bind_group(&bind_group.used)? }; } - // When indirect validation is turned on, our actual use of the buffer - // is `STORAGE_READ_ONLY`, but for usage scope validation, we still want - // to treat it as indirect so we can detect the conflicts prescribed by - // WebGPU. The usage scope we construct here never leaves this function - // (and is not used to populate a tracker), so it's fine to do this. + // Add the indirect buffer. Because usage scopes are per-dispatch, this + // is the only place where INDIRECT usage could be added, and it is safe + // for us to remove it below. if let Some(buffer) = indirect_buffer { - scope + self.pass + .scope .buffers .merge_single(buffer, wgt::BufferUses::INDIRECT)?; } - // Add the state of the indirect buffer, if needed (see above). - self.intermediate_trackers - .buffers - .set_multiple(&mut scope.buffers, indirect_buffer_index_if_not_validating); + // For compute, usage scopes are associated with each dispatch and not + // with the pass as a whole. However, because the cost of creating and + // dropping `UsageScope`s is significant (even with the pool), we + // add and then remove usage from a single usage scope. - flush_bindings_helper(&mut self.pass, |bind_group| { + for bind_group in self.pass.binder.list_active() { self.intermediate_trackers - .set_from_bind_group(&mut scope, &bind_group.used) - })?; + .set_and_remove_from_usage_scope_sparse(&mut self.pass.scope, &bind_group.used); + } + + if track_indirect_buffer { + self.intermediate_trackers + .buffers + .set_and_remove_from_usage_scope_sparse( + &mut self.pass.scope.buffers, + indirect_buffer.map(|buf| buf.tracker_index()), + ); + } else if let Some(buffer) = indirect_buffer { + self.pass + .scope + .buffers + .remove_usage(buffer, wgt::BufferUses::INDIRECT); + } + + flush_bindings_helper(&mut self.pass)?; CommandEncoder::drain_barriers( self.pass.base.raw_encoder, @@ -894,7 +916,7 @@ fn dispatch(state: &mut State, groups: [u32; 3]) -> Result<(), ComputePassErrorI state.is_ready()?; - state.flush_bindings(None, None)?; + state.flush_bindings(None, false)?; let groups_size_limit = state .pass @@ -1095,7 +1117,7 @@ fn dispatch_indirect( }]); } - state.flush_bindings(Some(&buffer), None)?; + state.flush_bindings(Some(&buffer), false)?; unsafe { state .pass @@ -1104,8 +1126,7 @@ fn dispatch_indirect( .dispatch_indirect(params.dst_buffer, 0); } } else { - use crate::resource::Trackable; - state.flush_bindings(Some(&buffer), Some(buffer.tracker_index()))?; + state.flush_bindings(Some(&buffer), true)?; let buf_raw = buffer.try_raw(state.pass.base.snatch_guard)?; unsafe { diff --git a/third_party/rust/wgpu-core/src/command/pass.rs b/third_party/rust/wgpu-core/src/command/pass.rs @@ -132,17 +132,20 @@ where Ok(()) } -/// Helper for `flush_bindings` implementing the portions that are the same for -/// compute and render passes. -pub(super) fn flush_bindings_helper<F>( - state: &mut PassState, - mut f: F, -) -> Result<(), DestroyedResourceError> -where - F: FnMut(&Arc<BindGroup>), -{ - for bind_group in state.binder.list_active() { - f(bind_group); +/// Implementation of `flush_bindings` for both compute and render passes. +/// +/// See the compute pass version of `State::flush_bindings` for an explanation +/// of some differences in handling the two types of passes. +pub(super) fn flush_bindings_helper(state: &mut PassState) -> Result<(), DestroyedResourceError> { + let range = state.binder.take_rebind_range(); + if range.is_empty() { + return Ok(()); + } + + let entries = state.binder.entries(range); + + for (_, entry) in entries.clone() { + let bind_group = entry.group.as_ref().unwrap(); state.base.buffer_memory_init_actions.extend( bind_group.used_buffer_ranges.iter().filter_map(|action| { @@ -171,25 +174,20 @@ where state.base.as_actions.extend(used_resource); } - let range = state.binder.take_rebind_range(); - let entries = state.binder.entries(range); - match state.binder.pipeline_layout.as_ref() { - Some(pipeline_layout) if entries.len() != 0 => { - for (i, e) in entries { - if let Some(group) = e.group.as_ref() { - let raw_bg = group.try_raw(state.base.snatch_guard)?; - unsafe { - state.base.raw_encoder.set_bind_group( - pipeline_layout.raw(), - i as u32, - Some(raw_bg), - &e.dynamic_offsets, - ); - } + if let Some(pipeline_layout) = state.binder.pipeline_layout.as_ref() { + for (i, e) in entries { + if let Some(group) = e.group.as_ref() { + let raw_bg = group.try_raw(state.base.snatch_guard)?; + unsafe { + state.base.raw_encoder.set_bind_group( + pipeline_layout.raw(), + i as u32, + Some(raw_bg), + &e.dynamic_offsets, + ); } } } - _ => {} } Ok(()) diff --git a/third_party/rust/wgpu-core/src/command/render.rs b/third_party/rust/wgpu-core/src/command/render.rs @@ -578,7 +578,7 @@ impl<'scope, 'snatch_guard, 'cmd_enc> State<'scope, 'snatch_guard, 'cmd_enc> { /// See the compute pass version for an explanation of some ways that /// `flush_bindings` differs between the two types of passes. fn flush_bindings(&mut self) -> Result<(), RenderPassErrorInner> { - flush_bindings_helper(&mut self.pass, |_| {})?; + flush_bindings_helper(&mut self.pass)?; Ok(()) } diff --git a/third_party/rust/wgpu-core/src/device/queue.rs b/third_party/rust/wgpu-core/src/device/queue.rs @@ -1799,9 +1799,13 @@ fn validate_command_buffer( } } } + // WebGPU requires that we check every bind group referenced during + // encoding, even ones that may have been replaced before being used. + // TODO(<https://github.com/gfx-rs/wgpu/issues/8510>): Optimize this. { profiling::scope!("bind groups"); for bind_group in &cmd_buf_data.trackers.bind_groups { + // This checks the bind group and all resources it references. bind_group.try_raw(snatch_guard)?; } } diff --git a/third_party/rust/wgpu-core/src/track/buffer.rs b/third_party/rust/wgpu-core/src/track/buffer.rs @@ -261,6 +261,22 @@ impl BufferUsageScope { ) } } + + /// Removes the indicated usage from the scope. + /// + /// Note that multiple uses of the same type get merged. It is only + /// safe to remove a usage if you are certain you aren't going to + /// erase another usage you don't know about. + pub fn remove_usage(&mut self, buffer: &Buffer, usage: BufferUses) { + let index = buffer.tracker_index().as_usize(); + if self.metadata.contains(index) { + // SAFETY: If the buffer is part of this usage scope, then the index + // is in range. + unsafe { + *self.state.get_unchecked_mut(index) &= !usage; + } + } + } } /// Stores all buffer state within a command buffer. @@ -303,7 +319,7 @@ impl BufferTracker { } /// Extend the vectors to let the given index be valid. - pub fn allow_index(&mut self, index: usize) { + fn allow_index(&mut self, index: usize) { if index >= self.start.len() { self.set_size(index + 1); } @@ -447,7 +463,7 @@ impl BufferTracker { /// /// If a resource identified by `index_source` is not found in the usage /// scope. - pub fn set_multiple( + pub fn set_and_remove_from_usage_scope_sparse( &mut self, scope: &mut BufferUsageScope, index_source: impl IntoIterator<Item = TrackerIndex>, @@ -461,8 +477,9 @@ impl BufferTracker { let index = index.as_usize(); scope.tracker_assert_in_bounds(index); - unsafe { - assert!(scope.metadata.contains_unchecked(index)); + + if unsafe { !scope.metadata.contains_unchecked(index) } { + continue; } // SAFETY: we checked that the index is in bounds for the scope, and @@ -479,6 +496,8 @@ impl BufferTracker { }, ) }; + + unsafe { scope.metadata.remove(index) }; } } diff --git a/third_party/rust/wgpu-core/src/track/metadata.rs b/third_party/rust/wgpu-core/src/track/metadata.rs @@ -130,6 +130,14 @@ impl<T: Clone> ResourceMetadata<T> { }; iterate_bitvec_indices(&self.owned) } + + /// Remove the resource with the given index from the set. + pub(super) unsafe fn remove(&mut self, index: usize) { + unsafe { + *self.resources.get_unchecked_mut(index) = None; + } + self.owned.set(index, false); + } } /// A source of resource metadata. diff --git a/third_party/rust/wgpu-core/src/track/mod.rs b/third_party/rust/wgpu-core/src/track/mod.rs @@ -661,7 +661,8 @@ impl Tracker { } /// Iterates through all resources in the given bind group and adopts - /// the state given for those resources in the UsageScope. + /// the state given for those resources in the UsageScope. It also + /// removes all touched resources from the usage scope. /// /// If a transition is needed to get the resources into the needed /// state, those transitions are stored within the tracker. A @@ -669,8 +670,10 @@ impl Tracker { /// [`TextureTracker::drain_transitions`] is needed to get those transitions. /// /// This is a really funky method used by Compute Passes to generate - /// barriers for each dispatch. We use the bind group as a source of which - /// IDs to look at. + /// barriers after a call to dispatch without needing to iterate + /// over all elements in the usage scope. We use each the + /// bind group as a source of which IDs to look at. The bind groups + /// must have first been added to the usage scope. /// /// Only stateful things are merged in here, all other resources are owned /// indirectly by the bind group. @@ -678,12 +681,16 @@ impl Tracker { /// # Panics /// /// If a resource in the `bind_group` is not found in the usage scope. - pub fn set_from_bind_group(&mut self, scope: &mut UsageScope, bind_group: &BindGroupStates) { - self.buffers.set_multiple( + pub fn set_and_remove_from_usage_scope_sparse( + &mut self, + scope: &mut UsageScope, + bind_group: &BindGroupStates, + ) { + self.buffers.set_and_remove_from_usage_scope_sparse( &mut scope.buffers, bind_group.buffers.used_tracker_indices(), ); self.textures - .set_multiple(&mut scope.textures, &bind_group.views); + .set_and_remove_from_usage_scope_sparse(&mut scope.textures, &bind_group.views); } } diff --git a/third_party/rust/wgpu-core/src/track/texture.rs b/third_party/rust/wgpu-core/src/track/texture.rs @@ -615,7 +615,7 @@ impl TextureTracker { /// # Panics /// /// If a resource in `bind_group_state` is not found in the usage scope. - pub fn set_multiple( + pub fn set_and_remove_from_usage_scope_sparse( &mut self, scope: &mut TextureUsageScope, bind_group_state: &TextureViewBindGroupState, @@ -627,12 +627,11 @@ impl TextureTracker { for (view, _) in bind_group_state.views.iter() { let index = view.parent.tracker_index().as_usize(); - scope.tracker_assert_in_bounds(index); - unsafe { - assert!(scope.metadata.contains_unchecked(index)); - } + if unsafe { !scope.metadata.contains_unchecked(index) } { + continue; + } let texture_selector = &view.parent.full_range; // SAFETY: we checked that the index is in bounds for the scope, and // called `set_size` to ensure it is valid for `self`. @@ -651,6 +650,8 @@ impl TextureTracker { &mut self.temp, ) }; + + unsafe { scope.metadata.remove(index) }; } } }