Update wgpu to latest version and improve error formating

This commit is contained in:
Imbris 2021-04-26 22:13:43 -04:00
parent 7da6b5e59d
commit 1647c9d607
4 changed files with 25 additions and 22 deletions

39
Cargo.lock generated
View File

@ -1875,7 +1875,7 @@ dependencies = [
[[package]]
name = "gfx-auxil"
version = "0.8.0"
source = "git+https://github.com/gfx-rs/gfx?rev=2a93d52661aafcbd6441ea83e739c8ced906cd21#2a93d52661aafcbd6441ea83e739c8ced906cd21"
source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e"
dependencies = [
"fxhash",
"gfx-hal",
@ -1885,7 +1885,7 @@ dependencies = [
[[package]]
name = "gfx-backend-dx11"
version = "0.7.0"
source = "git+https://github.com/gfx-rs/gfx?rev=2a93d52661aafcbd6441ea83e739c8ced906cd21#2a93d52661aafcbd6441ea83e739c8ced906cd21"
source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e"
dependencies = [
"arrayvec",
"bitflags",
@ -1906,7 +1906,7 @@ dependencies = [
[[package]]
name = "gfx-backend-dx12"
version = "0.7.0"
source = "git+https://github.com/gfx-rs/gfx?rev=2a93d52661aafcbd6441ea83e739c8ced906cd21#2a93d52661aafcbd6441ea83e739c8ced906cd21"
source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e"
dependencies = [
"arrayvec",
"bit-set",
@ -1927,7 +1927,7 @@ dependencies = [
[[package]]
name = "gfx-backend-empty"
version = "0.7.0"
source = "git+https://github.com/gfx-rs/gfx?rev=2a93d52661aafcbd6441ea83e739c8ced906cd21#2a93d52661aafcbd6441ea83e739c8ced906cd21"
source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e"
dependencies = [
"gfx-hal",
"log",
@ -1937,7 +1937,7 @@ dependencies = [
[[package]]
name = "gfx-backend-gl"
version = "0.7.0"
source = "git+https://github.com/gfx-rs/gfx?rev=2a93d52661aafcbd6441ea83e739c8ced906cd21#2a93d52661aafcbd6441ea83e739c8ced906cd21"
source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e"
dependencies = [
"arrayvec",
"bitflags",
@ -1958,7 +1958,7 @@ dependencies = [
[[package]]
name = "gfx-backend-metal"
version = "0.7.0"
source = "git+https://github.com/gfx-rs/gfx?rev=2a93d52661aafcbd6441ea83e739c8ced906cd21#2a93d52661aafcbd6441ea83e739c8ced906cd21"
source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e"
dependencies = [
"arrayvec",
"bitflags",
@ -1973,6 +1973,7 @@ dependencies = [
"naga",
"objc",
"parking_lot 0.11.1",
"profiling",
"range-alloc",
"raw-window-handle",
"storage-map",
@ -1981,7 +1982,7 @@ dependencies = [
[[package]]
name = "gfx-backend-vulkan"
version = "0.7.0"
source = "git+https://github.com/gfx-rs/gfx?rev=2a93d52661aafcbd6441ea83e739c8ced906cd21#2a93d52661aafcbd6441ea83e739c8ced906cd21"
source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e"
dependencies = [
"arrayvec",
"ash",
@ -2001,7 +2002,7 @@ dependencies = [
[[package]]
name = "gfx-hal"
version = "0.7.0"
source = "git+https://github.com/gfx-rs/gfx?rev=2a93d52661aafcbd6441ea83e739c8ced906cd21#2a93d52661aafcbd6441ea83e739c8ced906cd21"
source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e"
dependencies = [
"bitflags",
"naga",
@ -2141,8 +2142,8 @@ dependencies = [
[[package]]
name = "gpu-alloc"
version = "0.4.0"
source = "git+https://github.com/zakarumych/gpu-alloc.git?rev=560ad651aa8f7aefcee8f5bcf41e67a84561bcda#560ad651aa8f7aefcee8f5bcf41e67a84561bcda"
version = "0.4.2"
source = "git+https://github.com/zakarumych/gpu-alloc.git?rev=2cd1ad650cdd24d1647b6041f77ced0cbf1ff2a6#2cd1ad650cdd24d1647b6041f77ced0cbf1ff2a6"
dependencies = [
"bitflags",
"gpu-alloc-types",
@ -2151,7 +2152,7 @@ dependencies = [
[[package]]
name = "gpu-alloc-types"
version = "0.2.1"
source = "git+https://github.com/zakarumych/gpu-alloc.git?rev=560ad651aa8f7aefcee8f5bcf41e67a84561bcda#560ad651aa8f7aefcee8f5bcf41e67a84561bcda"
source = "git+https://github.com/zakarumych/gpu-alloc.git?rev=2cd1ad650cdd24d1647b6041f77ced0cbf1ff2a6#2cd1ad650cdd24d1647b6041f77ced0cbf1ff2a6"
dependencies = [
"bitflags",
]
@ -2918,7 +2919,7 @@ dependencies = [
[[package]]
name = "metal"
version = "0.21.0"
source = "git+https://github.com/gfx-rs/metal-rs?rev=439c986eb7a9b91e88b61def2daa66e4043fcbef#439c986eb7a9b91e88b61def2daa66e4043fcbef"
source = "git+https://github.com/gfx-rs/metal-rs?rev=78f632d194c7c16d18b71d7373c4080847d110b0#78f632d194c7c16d18b71d7373c4080847d110b0"
dependencies = [
"bitflags",
"block",
@ -3046,7 +3047,7 @@ checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238"
[[package]]
name = "naga"
version = "0.3.1"
source = "git+https://github.com/gfx-rs/naga?tag=gfx-20#0369ee181ed9cd315635fc0e3d99deecdbc72246"
source = "git+https://github.com/gfx-rs/naga?tag=gfx-23#4a5ff9a0538510ff3c3efa171941bfb44fc1be9c"
dependencies = [
"bit-set",
"bitflags",
@ -3933,9 +3934,9 @@ dependencies = [
[[package]]
name = "profiling"
version = "0.1.10"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0c71198452babfbba7419e716d29853c462d59da73c41485ab7dc8b4dc0c4be"
checksum = "c3a66d5e88679f2720126c11ee29da07a08f094eac52306b066edd7d393752d6"
[[package]]
name = "prometheus"
@ -4139,7 +4140,7 @@ dependencies = [
[[package]]
name = "range-alloc"
version = "0.1.2"
source = "git+https://github.com/gfx-rs/gfx?rev=2a93d52661aafcbd6441ea83e739c8ced906cd21#2a93d52661aafcbd6441ea83e739c8ced906cd21"
source = "git+https://github.com/gfx-rs/gfx?rev=46735bb079997257b4e5d8e813e6ed9c71aefd3e#46735bb079997257b4e5d8e813e6ed9c71aefd3e"
[[package]]
name = "raw-window-handle"
@ -6604,7 +6605,7 @@ dependencies = [
[[package]]
name = "wgpu"
version = "0.7.0"
source = "git+https://github.com/gfx-rs/wgpu-rs.git?rev=1de388afacee29fc2acb922f16081399839e57fa#1de388afacee29fc2acb922f16081399839e57fa"
source = "git+https://github.com/gfx-rs/wgpu-rs.git?rev=048551cba3419c50937192a85fb716c03c0ebf4b#048551cba3419c50937192a85fb716c03c0ebf4b"
dependencies = [
"arrayvec",
"js-sys",
@ -6624,7 +6625,7 @@ dependencies = [
[[package]]
name = "wgpu-core"
version = "0.7.0"
source = "git+https://github.com/gfx-rs/wgpu?rev=e430cf4bcc10aea447f637067fe81c75c80f0e46#e430cf4bcc10aea447f637067fe81c75c80f0e46"
source = "git+https://github.com/gfx-rs/wgpu?rev=13015c8621daade1decb7e1083b7e0f73eeab6c7#13015c8621daade1decb7e1083b7e0f73eeab6c7"
dependencies = [
"arrayvec",
"bitflags",
@ -6663,7 +6664,7 @@ dependencies = [
[[package]]
name = "wgpu-types"
version = "0.7.0"
source = "git+https://github.com/gfx-rs/wgpu?rev=e430cf4bcc10aea447f637067fe81c75c80f0e46#e430cf4bcc10aea447f637067fe81c75c80f0e46"
source = "git+https://github.com/gfx-rs/wgpu?rev=13015c8621daade1decb7e1083b7e0f73eeab6c7#13015c8621daade1decb7e1083b7e0f73eeab6c7"
dependencies = [
"bitflags",
]

View File

@ -114,7 +114,7 @@ nativeBuildInputs = ["pkg-config"]
winit = { git = "https://gitlab.com/veloren/winit.git", branch = "macos-test-spiffed" }
vek = { git = "https://gitlab.com/veloren/vek.git", branch = "fix_intrinsics2" }
# patch wgpu so we can use wgpu-profiler crate
wgpu = { git = "https://github.com/gfx-rs/wgpu-rs.git", rev = "1de388afacee29fc2acb922f16081399839e57fa" }
wgpu = { git = "https://github.com/gfx-rs/wgpu-rs.git", rev = "048551cba3419c50937192a85fb716c03c0ebf4b" }
# # Uncomment this to use a local fork of wgpu (for testing purposes)
# [patch.'https://github.com/gfx-rs/wgpu']

View File

@ -213,9 +213,10 @@ impl Renderer {
// This is better for use than their default because it includes the error in
// the panic message
device.on_uncaptured_error(|error| {
error!("{}", &error);
panic!(
"wgpu error (handling all wgpu errors as fatal): {:?}",
error
&error,
)
});

View File

@ -283,8 +283,9 @@ fn create_shader_module(
.compile_into_spirv(source, kind, file_name, "main", Some(options))
.map_err(|e| (file_name, e))?;
let label = [file_name, "\n\n", source].concat();
Ok(device.create_shader_module(&wgpu::ShaderModuleDescriptor {
label: Some(source),
label: Some(&label),
source: wgpu::ShaderSource::SpirV(Cow::Borrowed(spv.as_binary())),
flags: wgpu::ShaderFlags::empty(), // TODO: renable wgpu::ShaderFlags::VALIDATION,
}))