# gpui_web: Flatten webgl texel loading \(\#64337\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 6c9d10cb83084cfdbb9d4cf3919b57b7dc707758

Requested commit: 6c9d10cb83084cfdbb9d4cf3919b57b7dc707758

Commit: 6c9d10cb83084cfdbb9d4cf3919b57b7dc707758

Tree: 35ed805bfde4a514d2d2012872e02d3780f9de99

Author: Cameron Mcloughlin

Committer: GitHub

## Message

```
gpui_web: Flatten webgl texel loading (#64337)

The webGL backend uses textures to upload quads to the GPU, since it
doesn't have storage buffers. Each quad is stored in 10 texels, and we
previously fetched each texel 4 times. Although texel fetches are
cached, the extra bookkeeping optimized badly, and lead to bad
performance.

This change replaces the `read_word` calls with `fetch_texel_instance`,
and manually unrolls this loop. This gave the following frame time
improvements scrolling through delta web:

- desktop, 9950x3d iGPU, 1440p, firefox:  ~3.3x faster
- mobile, Pixel 10 Pro, firefox: ~23x faster

---

Release Notes:

- [GPUI] Improved performance of webGL quad upload, around a ~3x frame
time reduction in typical cases
```

## Parents

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

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