Skip to content

Reduce the WebGPU backend's per-frame CPU work on native hosts #26564

Done

Description

@ramezgerges

What would you like to be added? 💡

Cut the per-frame CPU work the WebGPU backend does on native hosts (wgpu-native), so it renders as fast as the same scenes do on Google's Dawn.

Why is this needed? 🤔

Swapping Dawn in for wgpu-native showed Dawn faster on draw-heavy scenes: about 1.5× on Vulkan and up to 3.3× on D3D12 (RenderStress_ShapeSwarm 94.5 ms vs 28.5 ms per frame on D3D12). The gap is CPU, not GPU. Uno re-creates objects every frame (bind groups for clips, sites and passes; buffers; one mask texture and one pass pair per coverage mask) and issues one queue write per upload. wgpu-native pays much more than Dawn for each of these:

  • a staging buffer allocated per queue write;
  • an internal sampler-index buffer per bind group on D3D12;
  • a D3D12 command list per render pass.

Separately, the occlusion cull never culls anything on a partial repaint, so stacked full-window backgrounds are filled again inside every damage rect.

For which platforms 📱💻🖥️

All platforms 🌍

Anything else we need to know? 💬

Measured on an Intel UHD 620 laptop, 28 SamplesApp performance scenes, Vulkan and D3D12.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions