bevyengine / bevyengine/bevy

using #[texture(n)] with a 3D texture in a custom shader causes a crash

Open
#8,241 1 comment 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug I-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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.