Skip to content

WebGPU: downscaled images ignore their mip chain (sampler LodMaxClamp is 0) #25583

Closed

Description

@ramezgerges

Current behavior 🐛

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) 🔬

  1. 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).
  2. 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.

Workaround 🛠️

None.

Affected platforms 📱💻🖥️

WebAssembly, Desktop (Windows), Desktop (macOS), Desktop (X11), Android, iOS (the WebGPU backend).

Uno.Sdk version (and other relevant versions) 📦

Uno 7.0 dev builds (master).

IDE version 🧑‍💻

N/A

Anything else we need to know? 💬

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

  1. added
    kind/bug
    triage/untriaged
    on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugtriage/untriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions