Repository navigation
Renderer: decode cache + resident vertex buffers for big draws - #78
Merged
Merged
Conversation
Characters are skinned on the GPU, so the vertex data of a model's
draws is the same every frame, but every draw was decoded again
(GeGpuVertex, 68 bytes a vertex), staged and copied into the frame's
ring VBO. On the RP6 (Adreno 740, Turnip) that copy and upload was the
render thread's largest item ("GPU submit"), and a 40k-triangle mod
body cost ~8 fps on its own.
- psp_ge_vertex.cpp: draws of 512+ vertices are cached by vertex /
index address, count, vertex type, material ambient/alpha and a hash
of the source indices + vertices (any change decodes afresh); 64 MB
budget, cleared when over (generation counter).
ge_decode_vertices_gpu_cached() hands out the cached copy + its id.
- psp_ge_draw.cpp: such a draw gets its own batch and is drawn from a
static VBO + VAOs made once per cache entry (dropped with the cache
generation): no staging, no ring copy, no upload.
- PSPRECOMP_DECODE_CACHE=0 / PSPRECOMP_GPU_VCACHE=0 turn them off.
RP6, 40 s AI Quick Battle, phone's own settings (60 fps, render scale
2, Vulkan + Turnip), SurfaceFlinger present times, 3 samples each:
retail 56.4 -> 57.1 fps
NT Lightning mod (39.6k tris) 49.5 -> 57.6 fps (same as retail)
Desktop (Vulkan, RADV): no change (not limited there); cache hit rate
in a fight 99.98 % (14 entries, 3.1 MB). Visual check: banter and
battle draw the same.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Characters are skinned on the GPU, so the vertex data of a model's draws is the same every frame, but every draw was decoded again (68 bytes a vertex), staged and copied into the frame's ring VBO. On the RP6 that copy/upload was the render thread's largest item ("GPU submit"). Draws of 512+ vertices are now decoded once (cache keyed by addresses, count, vertex type, material colour and a hash of the source bytes: any change decodes afresh) and drawn from a resident VBO made once per entry.
PSPRECOMP_DECODE_CACHE=0/PSPRECOMP_GPU_VCACHE=0turn them off.RP6, 40 s AI Quick Battle, phone settings (60 fps, render scale 2, Vulkan + Turnip), SurfaceFlinger present times:
Desktop: no change (not limited there); hit rate 99.98 %; banter and battle draw the same. Built and run together with #77 on the current main.
Release notes
🤖 Generated with Claude Code