# gpui_wgpu: Fix WGPU panic from unsupported atlas texture formats \(\#53808\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/dc3b25a4f4dd246f9a594da1cba7debefe34b00d)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: dc3b25a4f4dd246f9a594da1cba7debefe34b00d

Requested commit: dc3b25a4f4dd246f9a594da1cba7debefe34b00d

Commit: dc3b25a4f4dd246f9a594da1cba7debefe34b00d

Tree: b121df3a0e267580f01a22bb684764d9f376baac

Author: Oleksiy Syvokon

Committer: GitHub

## Message

```
gpui_wgpu: Fix WGPU panic from unsupported atlas texture formats (#53808)

We were assuming that `Bgra8Unorm` always works, which was causing the
panic on configurations that don't support it ("wgpu-hal invariant was
violated: Requested feature is not available on this device")

This change makes a proper fallback to `Rgba8Unorm`. In the worst case,
if a device doesn't support that as well (highly unlikely), we return a
proper error instead of a panic.


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes ZED-69S

Release Notes:

- Fixed panic on devices that don't support BGRA8
```

## Parents

- [2ab33bbb0f58ed525f96a2382865dc953dd52ac4](https://git.cafe/gitcafe/zed/commit/2ab33bbb0f58ed525f96a2382865dc953dd52ac4?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/dc3b25a4f4dd246f9a594da1cba7debefe34b00d?format=markdown)
