Upgrade wgpu (#1692)

This commit is contained in:
Nathaniel Simard 2024-04-25 16:32:50 -04:00 committed by GitHub
parent a1bd14c5ae
commit 599a20d586
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 95 additions and 81 deletions

160
Cargo.lock generated
View File

@ -795,6 +795,12 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "cfg_aliases"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
[[package]]
name = "chrono"
version = "0.4.38"
@ -949,10 +955,35 @@ dependencies = [
]
[[package]]
name = "com-rs"
version = "0.2.1"
name = "com"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642"
checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6"
dependencies = [
"com_macros",
]
[[package]]
name = "com_macros"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5"
dependencies = [
"com_macros_support",
"proc-macro2",
"syn 1.0.109",
]
[[package]]
name = "com_macros_support"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]]
name = "console"
@ -1202,9 +1233,9 @@ dependencies = [
[[package]]
name = "d3d12"
version = "0.7.0"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e16e44ab292b1dddfdaf7be62cfd8877df52f2f3fde5858d95bab606be259f20"
checksum = "3e3d747f100290a1ca24b752186f61f6637e1deffe3bf6320de6fcb29510a307"
dependencies = [
"bitflags 2.5.0",
"libloading 0.8.3",
@ -1613,9 +1644,6 @@ version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181"
dependencies = [
"futures-core",
"futures-sink",
"nanorand",
"spin",
]
@ -2098,16 +2126,15 @@ dependencies = [
[[package]]
name = "gpu-allocator"
version = "0.23.0"
version = "0.25.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40fe17c8a05d60c38c0a4e5a3c802f2f1ceb66b76c67d96ffb34bef0475a7fad"
checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884"
dependencies = [
"backtrace",
"log",
"presser",
"thiserror",
"winapi",
"windows 0.51.1",
"windows",
]
[[package]]
@ -2210,14 +2237,14 @@ dependencies = [
[[package]]
name = "hassle-rs"
version = "0.10.0"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1397650ee315e8891a0df210707f0fc61771b0cc518c3023896064c5407cb3b0"
checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890"
dependencies = [
"bitflags 1.3.2",
"com-rs",
"bitflags 2.5.0",
"com",
"libc",
"libloading 0.7.4",
"libloading 0.8.3",
"thiserror",
"widestring",
"winapi",
@ -2385,7 +2412,7 @@ dependencies = [
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
"windows-core 0.52.0",
"windows-core",
]
[[package]]
@ -2554,6 +2581,12 @@ version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
[[package]]
name = "jni-sys"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130"
[[package]]
name = "jobserver"
version = "0.1.31"
@ -2856,9 +2889,9 @@ dependencies = [
[[package]]
name = "naga"
version = "0.14.2"
version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae585df4b6514cf8842ac0f1ab4992edc975892704835b549cf818dc0191249e"
checksum = "50e3524642f53d9af419ab5e8dd29d3ba155708267667c2f3f06c88c9e130843"
dependencies = [
"bit-set",
"bitflags 2.5.0",
@ -2882,15 +2915,6 @@ dependencies = [
"serde",
]
[[package]]
name = "nanorand"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3"
dependencies = [
"getrandom",
]
[[package]]
name = "native-tls"
version = "0.2.11"
@ -2925,6 +2949,15 @@ dependencies = [
"rayon",
]
[[package]]
name = "ndk-sys"
version = "0.5.0+25.2.9519653"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691"
dependencies = [
"jni-sys",
]
[[package]]
name = "netlib-src"
version = "0.8.0"
@ -3636,9 +3669,9 @@ dependencies = [
[[package]]
name = "raw-window-handle"
version = "0.5.2"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9"
checksum = "8cc3bcbdb1ddfc11e700e62968e6b4cc9c75bb466464ad28fb61c5b2c964418b"
[[package]]
name = "rawpointer"
@ -3712,14 +3745,6 @@ dependencies = [
"thiserror",
]
[[package]]
name = "refactor"
version = "0.14.0"
dependencies = [
"burn",
"serde",
]
[[package]]
name = "regex"
version = "1.10.4"
@ -4323,12 +4348,11 @@ dependencies = [
[[package]]
name = "spirv"
version = "0.2.0+1.5.4"
version = "0.3.0+sdk-1.3.268.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830"
checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844"
dependencies = [
"bitflags 1.3.2",
"num-traits",
"bitflags 2.5.0",
]
[[package]]
@ -4471,7 +4495,7 @@ dependencies = [
"once_cell",
"rayon",
"serde",
"windows 0.52.0",
"windows",
]
[[package]]
@ -5124,9 +5148,9 @@ dependencies = [
[[package]]
name = "web-sys"
version = "0.3.64"
version = "0.3.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b"
checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef"
dependencies = [
"js-sys",
"wasm-bindgen",
@ -5159,13 +5183,13 @@ checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082"
[[package]]
name = "wgpu"
version = "0.18.0"
version = "0.19.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30e7d227c9f961f2061c26f4cb0fbd4df0ef37e056edd0931783599d6c94ef24"
checksum = "cbd7311dbd2abcfebaabf1841a2824ed7c8be443a0f29166e5d3c6a53a762c01"
dependencies = [
"arrayvec",
"cfg-if",
"flume",
"cfg_aliases",
"js-sys",
"log",
"naga",
@ -5184,16 +5208,19 @@ dependencies = [
[[package]]
name = "wgpu-core"
version = "0.18.1"
version = "0.19.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef91c1d62d1e9e81c79e600131a258edf75c9531cbdbde09c44a011a47312726"
checksum = "28b94525fc99ba9e5c9a9e24764f2bc29bad0911a7446c12f446a8277369bf3a"
dependencies = [
"arrayvec",
"bit-vec",
"bitflags 2.5.0",
"cfg_aliases",
"codespan-reporting",
"indexmap 2.2.6",
"log",
"naga",
"once_cell",
"parking_lot 0.12.1",
"profiling",
"raw-window-handle",
@ -5207,9 +5234,9 @@ dependencies = [
[[package]]
name = "wgpu-hal"
version = "0.18.1"
version = "0.19.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b84ecc802da3eb67b4cf3dd9ea6fe45bbb47ef13e6c49c5c3240868a9cc6cdd9"
checksum = "fc1a4924366df7ab41a5d8546d6534f1f33231aa5b3f72b9930e300f254e39c3"
dependencies = [
"android_system_properties",
"arrayvec",
@ -5217,6 +5244,7 @@ dependencies = [
"bit-set",
"bitflags 2.5.0",
"block",
"cfg_aliases",
"core-graphics-types",
"d3d12",
"glow",
@ -5232,6 +5260,7 @@ dependencies = [
"log",
"metal",
"naga",
"ndk-sys",
"objc",
"once_cell",
"parking_lot 0.12.1",
@ -5250,9 +5279,9 @@ dependencies = [
[[package]]
name = "wgpu-types"
version = "0.18.0"
version = "0.19.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d5ed5f0edf0de351fe311c53304986315ce866f394a2e6df0c4b3c70774bcdd"
checksum = "b671ff9fb03f78b46ff176494ee1ebe7d603393f42664be55b64dc8d53969805"
dependencies = [
"bitflags 2.5.0",
"js-sys",
@ -5308,35 +5337,16 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows"
version = "0.51.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9"
dependencies = [
"windows-core 0.51.1",
"windows-targets 0.48.5",
]
[[package]]
name = "windows"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
dependencies = [
"windows-core 0.52.0",
"windows-core",
"windows-targets 0.52.5",
]
[[package]]
name = "windows-core"
version = "0.51.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64"
dependencies = [
"windows-targets 0.48.5",
]
[[package]]
name = "windows-core"
version = "0.52.0"

View File

@ -91,7 +91,7 @@ crossterm = "0.27"
futures-intrusive = "0.5"
text_placeholder = "0.5.0"
pollster = "0.3"
wgpu = "0.18.0"
wgpu = "0.19.4"
# Benchmarks and Burnbench
arboard = "3.3.2"

View File

@ -52,6 +52,7 @@ impl BenchmarkSystemInfo {
let instance = wgpu::Instance::default();
let adapters: Vec<wgpu::Adapter> = instance
.enumerate_adapters(burn_wgpu::AutoGraphicsApi::backend().into())
.into_iter()
.filter(|adapter| {
let info = adapter.get_info();
info.device_type == wgpu::DeviceType::DiscreteGpu

View File

@ -62,10 +62,12 @@ impl JitElement for i32 {
gpu::Elem::Int
}
fn maximum_value() -> Self {
i32::MAX
// Seems to cause problem for some GPU
i32::MAX - 1
}
fn minimum_value() -> Self {
i32::MIN
// Seems to cause problem for some GPU
i32::MIN + 1
}
}

View File

@ -87,7 +87,7 @@ impl Default for RuntimeOptions {
};
Self {
dealloc_strategy: DeallocStrategy::new_period_tick(1),
dealloc_strategy: DeallocStrategy::new_period_tick(tasks_max * 2),
slice_strategy: SliceStrategy::Ratio(0.8),
tasks_max,
}
@ -152,8 +152,8 @@ pub async fn select_device<G: GraphicsApi>(
.request_device(
&DeviceDescriptor {
label: None,
features: wgpu::Features::empty(),
limits,
required_features: wgpu::Features::empty(),
required_limits: limits,
},
None,
)
@ -194,6 +194,7 @@ fn select_adapter<G: GraphicsApi>(device: &WgpuDevice) -> wgpu::Adapter {
instance
.enumerate_adapters(G::backend().into())
.into_iter()
.for_each(|adapter| {
let device_type = adapter.get_info().device_type;