mirror of
https://github.com/sotrh/learn-wgpu.git
synced 2024-11-13 13:10:41 +00:00
fixed tobj not building due to ahash
This commit is contained in:
parent
b31249b660
commit
ad3d08b917
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,6 +6,7 @@ target/
|
||||
/image.png
|
||||
/output*.*
|
||||
output/
|
||||
debug-target.json
|
||||
|
||||
/trace
|
||||
*trace.zip
|
||||
|
18
Cargo.lock
generated
18
Cargo.lock
generated
@ -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",
|
||||
|
@ -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"] }
|
||||
|
||||
|
@ -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"] }
|
||||
|
||||
|
@ -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"] }
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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.
|
||||
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user