[codex] optimize PSP stats text rendering#19
Merged
Merged
Conversation
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.
Summary
Optimizes the stats demo text path on PSP by moving native glyph rendering from per-frame coverage-run rect generation to cached PSM_4444 font atlas textures, then drawing each glyph as a textured sprite.
Also reduces avoidable layout churn for changing text:
scripts/bench-ppsspp.tsplusscripts/psp.ts --benchfor repeatable PPSSPP timing runs.Root Cause
The stats demo updates large numeric text every frame. On PSP this forced expensive text/layout work and the GE backend rebuilt anti-aliased glyphs by scanning coverage cells into many horizontal rect sprites each frame.
Benchmark
PPSSPP stats window, same input/window as PR #6 style benchmark:
avg_work_us=38449,avg_render_us=10138,avg_tick_us=15337avg_work_us=16385,avg_render_us=1028,avg_tick_us=2666Final 5-sample report:
dist/bench/ppsspp-bench-2026-07-05T00-27-50-289Z.jsonlocally.Validation
git diff --checkbunx tsc --noEmitbun run testcargo test --manifest-path core/Cargo.tomlPSP_SDK=/Users/evan/code/dreamcart/mipsel-sony-psp E2E_PPSSPP_TIMEOUT=60 UPDATE=1 bun test/e2e-ppsspp.tsPSP_SDK=/Users/evan/code/dreamcart/mipsel-sony-psp E2E_PPSSPP_TIMEOUT=60 bun test/e2e-ppsspp.tsPSP_SDK=/Users/evan/code/dreamcart/mipsel-sony-psp BENCH_PPSSPP_TIMEOUT=60 bun scripts/bench-ppsspp.ts --apps=stats --samples=5 --timeout=60Post-rebase smoke:
git diff --checkbunx tsc --noEmit && bun run testPSP_SDK=/Users/evan/code/dreamcart/mipsel-sony-psp BENCH_PPSSPP_TIMEOUT=60 bun scripts/bench-ppsspp.ts --apps=stats --samples=1 --timeout=60