Repository navigation
Viewer: cap the frame rate on software renderers - #1220
Merged
Merged
Conversation
On a CPU rasterizer (a software adapter, SwiftShader, llvmpipe) the usual 50 fps cadence is out of reach and chasing it starves the app of the cores it renders on. The daylight look's heavier frames made that bite: editor E2E specs ran ~1.6× slower on CI's GPU-less browser and timed out. Detected with the device tier, software renderers now cap at 20 fps (SwiftShader undo/redo spec: 64 s → 47 s; monochrome 41 s). GPUs are unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
wass08
force-pushed
the
wawa/software-renderer-fps
branch
from
November 6, 2026 00:48
16476ae to
0712548
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Caps the viewer's frame rate at 20 fps when the device renders on the CPU (a software WebGPU adapter, SwiftShader, llvmpipe), detected with the existing device tier. GPUs are unaffected.
On a software rasterizer the usual 50 fps cadence is out of reach, and chasing it starves the app of the cores it renders on. The daylight look from #1217 has heavier frames, which made this bite: editor E2E specs ran about 1.6× slower on CI's GPU-less browser and timed out.
Measured locally on SwiftShader (undo/redo E2E spec): 64 s before, 47 s with the cap (41 s in monochrome). The paint spec passes in 21 s.
How to test
--use-angle=swiftshader), open a project: the device is detected as a software renderer, and frames are capped at 20 fps.Checklist
bun devbun checkto verify)mainbranch🤖 Generated with Claude Code
Note
Low Risk
Render-loop cadence change only when a software rasterizer is detected; GPU users and persisted preferences are unaffected.
Overview
When WebGPU init completes, the viewer now records whether rendering is CPU/software (fallback adapter, SwiftShader, llvmpipe, etc.) via new
isSoftwareRendererindevice-tier, stored as transientsoftwareRendererin the viewer store alongside detected quality tier.<FrameLimiter>then usesmin(maxFps, 20)instead of the default 50 fps cap on those devices, so the loop does not burn CPU chasing an unreachable cadence. Hardware GPU paths are unchanged.Unit tests cover software vs GPU detection strings.
Reviewed by Cursor Bugbot for commit 0712548. Bugbot is set up for automated code reviews on this repo. Configure here.