using #[texture(n)] with a 3D texture in a custom shader causes a crash
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
For example:
```rust
#[derive(AsBindGroup, TypeUuid, Debug, Clone, Default, Reflect)]
#[uuid = "f690fdae-d598-45ab-8225-97e2a3f056e0"]
pub struct MyMaterial {
#[uniform(0)]
pub color: Color,
#[texture(1)]
#[sampler(2)]
pub texture: Option>,
}
```
And the error message:
thread 'Compute Task Pool (0)' panicked at 'wgpu error: Validation Error
Caused by:
In Device::create_bind_group
texture binding 1 expects dimension = D2, but given a view with dimension = D3
Contributor guide
Research direction
Start from the Rust AsBindGroup handling for the #[texture(n)] and #[sampler(n)] bindings, then reproduce the example with a 3D texture and inspect the resulting create_bind_group validation error. Done means using a 3D texture no longer causes the reported dimension mismatch crash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100