wgpu validation error when using 16bits precision PNGs
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## Bevy version
0.7.0
## Operating system & version
Pop_OS! 21.10
## What you did
I tried to use a normal texture which has a precision of "16-bit gamma integer".
## What you expected to happen
I've expected to have the texture loaded normally and used with a `PbrBundle`.
## What actually happened
Crash at runtime.
```
2022-04-19T09:57:07.813153Z INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1
2022-04-19T09:57:07.885682Z INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce GTX 1660", vendor: 4318, device: 8580, device_type: DiscreteGpu, backend: Vulkan }
2022-04-19T09:57:08.200302Z ERROR wgpu::backend::direct: Handling wgpu errors as fatal by default
thread 'TaskPool (7)' panicked at 'wgpu error: Validation Error
Caused by:
In Device::create_bind_group
note: label = `pbr_standard_material_bind_group`
texture binding 9 expects sample type = Float { filterable: true }, but given a view with format = Rgba16Uint
', /home/pancake/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.12.0/src/backend/direct.rs:2273:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at 'task has failed', /home/pancake/.cargo/registry/src/github.com-1ecc6299db9ec823/async-task-4.2.0/src/task.rs:425:45
```
## Additional information
I've compared my texture with other textures which work correctly :

Left is the image used by https://github.com/bevyengine/bevy/blob/main/examples/3d/texture.rs and right is the normal texture generating the wgpu validation error. The only difference I found was the precision.
After re-exporting the image to use 8-bit precision, the error is gone.
Contributor guide
Assessment
This issue has not been assessed yet.