You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WebGPU: downscaled images ignore their mip chain (sampler LodMaxClamp is 0) #25583
On the WebGPU backend, an image drawn smaller than its pixel size is always sampled from its full-resolution level, even though a full mip chain is uploaded. Downscaled photos alias (and shimmer when they move), and each pixel of such an image strides across the whole texture, so the draw's GPU cost tracks the texture size rather than the area it covers.
The cause is the image sampler in WebGpuDevice: it is created from a zero-initialised WGPUSamplerDescriptor that never sets LodMaxClamp, so the clamp is 0 instead of WebGPU's default of 32.
Expected behavior 🎯
Downscaled images are filtered through their mip chain: no aliasing, and a cost proportional to the pixels drawn.
How to reproduce it (as minimally and precisely as possible) 🔬
Run any page that shows large images at a fraction of their size with the WebGPU backend (UNO_WEBGPU=1), e.g. Uno Chefs' home page (1050 px photos in ~330 px cards).
Images look aliased compared with Skia, and a GPU capture (RenderDoc) shows image draws costing several times more per pixel than other draws, independent of their on-screen size.
A deterministic check: a 256×256 image of alternating 1 px black/white columns shown at 30×30 should render flat mid-grey. Today the row reads anywhere from near-black to near-white.
Measured on the Chefs home page (Intel UHD 620, Chrome, fixed CPU clock, 120 Hz): image draws' GPU time drops by about half with the fix, and the page goes from 104.5 to 115.5 fps on WebAssembly.
The Skia backend shows the same aliasing on that check (it samples images with SKFilterMode.Linear and no mipmap mode); that is not covered by this issue.
Activity