From ad3d08b917bd5df972ed1721f6c8543f733531db Mon Sep 17 00:00:00 2001 From: Benjamin Hansen Date: Fri, 13 Sep 2024 20:48:54 -0600 Subject: [PATCH] fixed tobj not building due to ahash --- .gitignore | 1 + Cargo.lock | 18 ++---------------- code/beginner/tutorial9-models/Cargo.toml | 2 +- .../tutorial10-lighting/Cargo.toml | 2 +- .../intermediate/tutorial11-normals/Cargo.toml | 2 +- code/intermediate/tutorial12-camera/Cargo.toml | 2 +- code/intermediate/tutorial13-hdr/Cargo.toml | 2 +- code/intermediate/wip-terrain/Cargo.toml | 2 +- code/showcase/gifs/Cargo.toml | 2 +- code/showcase/mouse-picking/Cargo.toml | 2 +- code/showcase/threading/Cargo.toml | 2 +- docs/beginner/tutorial4-buffer/README.md | 1 + docs/beginner/tutorial9-models/README.md | 4 +--- 13 files changed, 14 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 711138bd8..8a5a7baf5 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ target/ /image.png /output*.* output/ +debug-target.json /trace *trace.zip diff --git a/Cargo.lock b/Cargo.lock index 4fc1ca77b..fa5b5d434 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -24,17 +24,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.7" @@ -1304,7 +1293,7 @@ version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" dependencies = [ - "ahash 0.8.7", + "ahash", "allocator-api2", ] @@ -3032,9 +3021,6 @@ name = "tobj" version = "3.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "deacee3abcc4fd8ff3f0f7c08d4583ab51753ed1d5a3acacd6d5773f640c27d6" -dependencies = [ - "ahash 0.7.6", -] [[package]] name = "tokio" @@ -4383,7 +4369,7 @@ version = "0.29.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c824f11941eeae66ec71111cc2674373c772f482b58939bb4066b642aa2ffcf" dependencies = [ - "ahash 0.8.7", + "ahash", "android-activity", "atomic-waker", "bitflags 2.6.0", diff --git a/code/beginner/tutorial9-models/Cargo.toml b/code/beginner/tutorial9-models/Cargo.toml index 5067c46f1..a2d7a56a8 100644 --- a/code/beginner/tutorial9-models/Cargo.toml +++ b/code/beginner/tutorial9-models/Cargo.toml @@ -15,7 +15,7 @@ cgmath = "0.18" env_logger = "0.10" pollster = "0.3" log = "0.4" -tobj = { version = "3.2", features = ["async"]} +tobj = { version = "3.2", default-features = false, features = ["async"]} wgpu = "22.0" winit = { version = "0.29", features = ["rwh_05"] } diff --git a/code/intermediate/tutorial10-lighting/Cargo.toml b/code/intermediate/tutorial10-lighting/Cargo.toml index 3dcf40df8..4215c2b90 100644 --- a/code/intermediate/tutorial10-lighting/Cargo.toml +++ b/code/intermediate/tutorial10-lighting/Cargo.toml @@ -15,7 +15,7 @@ cgmath = "0.18" env_logger = "0.10" pollster = "0.3" log = "0.4" -tobj = { version = "3.2", features = ["async"]} +tobj = { version = "3.2", default-features = false, features = ["async"]} wgpu = { version = "22.0"} winit = { version = "0.29", features = ["rwh_05"] } diff --git a/code/intermediate/tutorial11-normals/Cargo.toml b/code/intermediate/tutorial11-normals/Cargo.toml index 5f93e5ffd..bff68a4c0 100644 --- a/code/intermediate/tutorial11-normals/Cargo.toml +++ b/code/intermediate/tutorial11-normals/Cargo.toml @@ -15,7 +15,7 @@ cgmath = "0.18" env_logger = "0.10" pollster = "0.3" log = "0.4" -tobj = { version = "3.2", features = ["async"]} +tobj = { version = "3.2", default-features = false, features = ["async"]} wgpu = { version = "22.0"} winit = { version = "0.29", features = ["rwh_05"] } diff --git a/code/intermediate/tutorial12-camera/Cargo.toml b/code/intermediate/tutorial12-camera/Cargo.toml index 209d2787a..5d323dc3b 100644 --- a/code/intermediate/tutorial12-camera/Cargo.toml +++ b/code/intermediate/tutorial12-camera/Cargo.toml @@ -15,7 +15,7 @@ cgmath = "0.18" env_logger = "0.10" pollster = "0.3" log = "0.4" -tobj = { version = "3.2", features = ["async"]} +tobj = { version = "3.2", default-features = false, features = ["async"]} wgpu = { version = "22.0"} winit = { version = "0.29", features = ["rwh_05"] } instant = "0.1" diff --git a/code/intermediate/tutorial13-hdr/Cargo.toml b/code/intermediate/tutorial13-hdr/Cargo.toml index cd979f4c8..7ff275956 100644 --- a/code/intermediate/tutorial13-hdr/Cargo.toml +++ b/code/intermediate/tutorial13-hdr/Cargo.toml @@ -15,7 +15,7 @@ cgmath = "0.18" env_logger = "0.10" pollster = "0.3" log = "0.4" -tobj = { version = "3.2", features = ["async"]} +tobj = { version = "3.2", default-features = false, features = ["async"]} wgpu = { version = "22.0"} winit = { version = "0.29", features = ["rwh_05"] } instant = "0.1" diff --git a/code/intermediate/wip-terrain/Cargo.toml b/code/intermediate/wip-terrain/Cargo.toml index 6bbb35cd4..af4fd2d93 100644 --- a/code/intermediate/wip-terrain/Cargo.toml +++ b/code/intermediate/wip-terrain/Cargo.toml @@ -15,7 +15,7 @@ cgmath = { version = "0.18", features = [ "swizzle" ] } env_logger = "0.10" pollster = "0.3" log = "0.4" -tobj = { version = "3.2", features = ["async"]} +tobj = { version = "3.2", default-features = false, features = ["async"]} wgpu = { version = "22.0"} winit = { version = "0.29", features = ["rwh_05"] } instant = "0.1" diff --git a/code/showcase/gifs/Cargo.toml b/code/showcase/gifs/Cargo.toml index 6d2fef174..1c0f356a7 100644 --- a/code/showcase/gifs/Cargo.toml +++ b/code/showcase/gifs/Cargo.toml @@ -13,7 +13,7 @@ env_logger = "0.10" pollster = "0.3" image = "0.24.2" log = "0.4" -tobj = "3.1" +tobj = { version = "3.2", default-features = false, features = ["async"]} wgpu = "22.0" winit = { version = "0.29", features = ["rwh_05"] } gif = "0.11.4" diff --git a/code/showcase/mouse-picking/Cargo.toml b/code/showcase/mouse-picking/Cargo.toml index 989f434d8..70a147cc0 100644 --- a/code/showcase/mouse-picking/Cargo.toml +++ b/code/showcase/mouse-picking/Cargo.toml @@ -15,7 +15,7 @@ cgmath = "0.18" env_logger = "0.10" pollster = "0.3" log = "0.4" -tobj = { version = "3.2", features = ["async"]} +tobj = { version = "3.2", default-features = false, features = ["async"]} wgpu = { version = "22.0"} winit = { version = "0.29", features = ["rwh_05"] } instant = "0.1" diff --git a/code/showcase/threading/Cargo.toml b/code/showcase/threading/Cargo.toml index 54117e1b1..e743f3c84 100644 --- a/code/showcase/threading/Cargo.toml +++ b/code/showcase/threading/Cargo.toml @@ -16,7 +16,7 @@ env_logger = "0.10" pollster = "0.3" log = "0.4" rayon = "1.4" # NEW! -tobj = { version = "3.2", features = ["async"]} +tobj = { version = "3.2", default-features = false, features = ["async"]} wgpu = { version = "22.0"} winit = { version = "0.29", features = ["rwh_05"] } instant = "0.1" diff --git a/docs/beginner/tutorial4-buffer/README.md b/docs/beginner/tutorial4-buffer/README.md index 8cb6d14f4..7ddbe01c5 100644 --- a/docs/beginner/tutorial4-buffer/README.md +++ b/docs/beginner/tutorial4-buffer/README.md @@ -425,6 +425,7 @@ render_pass.draw_indexed(0..self.num_indices, 0, 0..1); // 2. ``` A couple of things to note: + 1. The method name is `set_index_buffer`, not `set_index_buffers`. You can only have one index buffer set at a time. 2. When using an index buffer, you need to use `draw_indexed`. The `draw` method ignores the index buffer. Also, make sure you use the number of indices (`num_indices`), not vertices, as your model will either draw wrong or the method will `panic` because there are not enough indices. diff --git a/docs/beginner/tutorial9-models/README.md b/docs/beginner/tutorial9-models/README.md index ebc7b2793..d99ac25de 100644 --- a/docs/beginner/tutorial9-models/README.md +++ b/docs/beginner/tutorial9-models/README.md @@ -233,9 +233,7 @@ We're going to use the [tobj](https://docs.rs/tobj/3.0/tobj/) library to load ou ```toml [dependencies] # other dependencies... -tobj = { version = "3.2.1", features = [ - "async", -]} +tobj = { version = "3.2", default-features = false, features = ["async"]} ``` Before we can load our model, though, we need somewhere to put it.