Skip to content

fix(ps4): Gnm packet types, submission pacing and color array slices for Gang Beasts (CUSA04865) - #3

Open
ntamas94 wants to merge 3 commits into
Get-fix:ps4/limbo-gpufrom
ntamas94:fix/ps4-gnm-packets-color-slices
Open

ntamas94 wants to merge 3 commits into
Get-fix:ps4/limbo-gpufrom
ntamas94:fix/ps4-gnm-packets-color-slices

Conversation

@ntamas94

@ntamas94 ntamas94 commented Oct 20, 2026 •

Copy link
Copy Markdown

What

Three changes to this PR's PS4 path, found while bringing up Gang Beasts (CUSA04865, Unity, my own dump) on top of boykopovar#6977. Each commit stands alone so you can take any of them. #1 already covers the other gaps this title hit (the non-resident display buffer, the 38-bit T# base, MTBUF and the image dimension from the T#), so they are not repeated here. Progress notes are in boykopovar#7941.

  1. Type-0 and type-2 packets in a command buffer. The Gnm lowering threw on any packet that was not type 3. A type-2 dword is filler, and a type-0 packet carries its own length, so both are now stepped over; type 1 still throws, now with its header and position. Gang Beasts produces a type-0 header itself: it binds a 16-byte V# over an 8-byte allocateFromCommandBuffer block, and its compute dispatch stores 1 at offset 8, which is the next packet's header. With the queue several milliseconds behind, that store lands after the title has rebuilt the buffer for the next frame (traced with a watch on that dword and timestamps on submits and dispatches).

  2. APS5_GNM_SUBMIT_WAIT_IDLE=1. Each sceGnmSubmitCommandBuffers and sceGnmSubmitAndFlipCommandBuffers after the first waits for the work already queued, so the GPU trails the title by at most one submission. Without it, Gang Beasts' rebuilds of command buffers and descriptor tables race with work that has not run yet. Besides (1), this shows up as draws whose S# slot holds T# words, a V# slot holding an S#, and a sampler descriptor that reads as unnormalized with clamp mode 7. With the knob, runs of up to ten minutes through the menus, character select, loading and a full match had none of these, with no change in the menu frame rate (vsync-bound, 59.94 FPS). It is off by default, because a submission whose packets wait on a label the title writes only after a later submission would never finish. APS5_SYNC_FLIP=1, which savvaniss uses for Risk, also removed the packet clobber in three menu runs.

  3. One array slice of a color target. A GCN CB_COLOR_VIEW that selects an array slice threw "GCN color array slices are not implemented". A view of one slice now addresses that slice: the surface base plus the slice index times the slice size. A view of several slices still throws. A new case in agc_driver_graphics covers slices 0 and 2 and the rejected two-slice view.

Not in this PR: Gang Beasts' level load waited forever because sceNetSetsockopt returned EBADF on a socket created with socket(). main handles that since boykopovar#6142, so rebasing this branch brings it.

Tested

Windows 11 Pro (26200), WinLibs GCC 15.2.0 r7, NVIDIA RTX 2080, on this branch at 93eeee0: agc_driver_graphics passes, with the new slice case. On my local branch, which has these three commits besides stand-ins for the title's other imports and the changes listed in boykopovar#7941, Gang Beasts plays a full round with APS5_GNM_SUBMIT_WAIT_IDLE=1: the menu, character select, a level (Wheel) with correct lighting and physics, the end of the match and the return to character select. Linux was not run locally.

Checklist

🤖 Generated with Claude Code

ntamas94 and others added 3 commits October 20, 2026 03:47
…d buffer

The lowering threw on any packet that was not type 3. A type-2 dword is filler and a type-0 packet carries its own length, so both are stepped over as the console's command processor reads past them; a type-1 packet still throws, now with its header and position.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…GNM_SUBMIT_WAIT_IDLE)

A submission is queued without waiting, so the GPU can trail the title by several milliseconds. With APS5_GNM_SUBMIT_WAIT_IDLE=1 each submission after the first waits for the work already queued, bounding that lag to one submission. Off by default: a submission that waits on a label the title writes after a later submission would never finish.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A GCN color target whose CB_COLOR_VIEW selects an array slice threw. A view of one slice now addresses that slice, the surface base plus the slice index times the slice size; a view of several slices still throws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Get-fix

Get-fix commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Thanks @ntamas94. boykopovar#6977 is now a draft integration branch, and its own work is split into boykopovar#9429 to boykopovar#9433 (details). The maintainers asked that the branch not land anything without its own review, so could you open this upstream against main, with the array-slice commit on boykopovar#9431 and the GnmDriver commits on boykopovar#9432, with Depends on? Once it's open, I'll merge it into ps4/limbo-gpu, list it as a member and run Limbo with it. ps4/limbo-gpu now moves to the split branches, so this pull request may show conflicts here.

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

@ntamas94

Copy link
Copy Markdown
Author

Opened upstream as two pull requests against main: the array-slice commit as boykopovar#9675 on top of boykopovar#9431, and the two GnmDriver commits as boykopovar#9676 on top of boykopovar#9432, each with Depends on. APS5_GNM_SUBMIT_WAIT_IDLE now has its row in docs/dev/ENVIRONMENT.md.

The packet-stepping commit in boykopovar#9676 also answers MarcZX10's type-2 point on boykopovar#9432. If you would rather take it into boykopovar#9432, I will drop it from boykopovar#9676.

AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants