perf: Killzone: Liberation (PPSA11142) gameplay at ~6 FPS on Intel Meteor Lake: the PSP vertex mesh program routes 1,730 direct VGPR accesses through a 152-register relative-addressing window #27373
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Mouad-Scriptz-0 on 2026-11-26T00:23:41Z.
Title and scene
PPSA11142 (Killzone: Liberation, Sony's PSP emulator), first mission after the first checkpoint, gameplay with the camera moving
What is slow or what changed
Gameplay runs at ~6 FPS (frame p50 156 ms) and the GPU is the limit: the trace shows the GPU busy 154.5 ms per present (97 %), while the queue worker is busy 27 % and the presenter waits 151.6 ms per frame on the render fence. Menus run at ~20 FPS.
In separate runs with
APS5_PROFILE_GPU=1 APS5_PROFILE_GPU_DRAWS=1 APS5_PROFILE_GPU_DRAW_STAGES=1(not the traced run), draws took 9.86 s of GPU time per 10 s. Two drawsets took 85 % of it, and both use the mesh program0xae0900with fragment0xada700:This is the PSP vertex program (2 linked programs merged into a mesh stage, wave64, 256 threads, 3,176 code words). Its request is attached (
shader_555f81514900.req, dumped withAPS5_DUMP_SHADERSon an earlier build; it replays on63b2e14). On63b2e14it recompiles to 267,438 SPIR-V words, and ANV compiles that to:That is a 4.66 MB binary. It takes 166 s to compile.
Where the size comes from (
APS5_DUMP_IR=all agc_shader_replay shader_555f81514900.req):u32[152]arrays. These are the relative-addressing vector windows (v0..v151), one per linked program. At SIMD32 one array needs 152 GRFs, more than the 128 available, so ANV most likely lowers it to scratch. I did not confirm this in the assembly.resources, the window accesses are 1,730 with a constant index (1,090LoadVectorWindow, 640StoreVectorWindow) and 114 with a dynamic index (104 loads, 10 stores). The constant-index accesses are ordinary VGPR reads and writes that land in the window range.UMin32(IAdd32(0x39 | 0x3a | 0, ReadFirstLane(<window register>)), 0x97), so the indexed range is data-dependent and the window has to cover v0..v151.StoreVectorWindow), so it doesn't qualify. #15520 already limits the window to the blocks between relative accesses.OpAccessChain, 5,691OpSelect, 5,538OpBitwiseAnd.Possible direction (not tried): keep direct VGPR accesses in SSA even when the window has relative writes. Copy the live window range into the array just before each relative access and read it back after, so the 1,730 constant-index accesses stop going through Function storage.
I could not test a narrower dispatch.
INTEL_SIMD_DEBUG=ms16/ms8still produce SIMD32, even with the module compiled withoutrequiredSubgroupSizeand withALLOW_VARYING_SUBGROUP_SIZE.Setup notes:
anv_device_import_bo_from_host_ptr(Mesa #17014), because the title imports a 4 GiB host range.AI-assisted: yes (Claude Code).
Summary lines
Traces
aps5-trace-63b2e14408f9-268019.json.gz, plusshader_555f81514900.req(the PSP vertex program's request) andmesh-stats.txt(ANV compile statistics), attached in the first comment below.Digest
seconds 120:20 from present 1206: 126 presents, frame p50 156.0 / p90 165.1 / p99 311.8 / max 450.3 ms, GPU busy 154.5 ms per present
Intel(R) Graphics (MTL), Intel open-source Mesa driver Mesa 27.0.0-devel (git-35ba262983), Linux 7.3.4-300.fc45.x86_64, 1920x1080, commit
63b2e14408, dropped: noSlowest frames (largest slices inside each, inclusive)
Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): Driver.Present 156.6, VideoOut.Flip 155.7, VideoOut.Flip.present 155.5, batch 153.5, Driver.Present.render_fence_wait 151.6, Vulkan.Retire 151.6, Vulkan.Retire.wait 151.6, Recorder.WaitSerial 140.1, Driver.WorkerWait 111.4, Driver.WorkerWait.idle_and_completion_poll 111.4
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
Worker stacks
No response
Capture
aps5-trace-63b2e14408f9-268019.json.gz
shader_555f81514900.req.txt
mesh-stats.txt