AGC: MXGP 26 (PPSA30839) renders opaque surfaces black in its 3D scenes; only the sky and reflections are lit #9510
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 milescoviello on 2026-10-21T23:54:47Z.
MXGP 26 (PPSA30839) now reaches a race on
main, but its 3D scenes render opaque surfaces black. On the rider-profile screen the rider and bike are flat black shapes against a lit sky. In the race, the track, the bike, the crowd and the fences are black, and patches of the track show as flat white. Only the sky, the far hills, and what looks like the sky's reflection in puddles are lit. The game itself runs: menus, the gamma screen, the profile and bike screens, then lap 1 with the HUD at about 4.5 FPS.Setup:
maina6dcea9279, release libraries, Ubuntu 26.04.1, RTX 4070 Ti, NVIDIA 615.71.09, 12 GB cap. Not tried on another vendor.Route (pad input through
APS5_PAD_INPUT_FILE, times from launch, warm shader cache):Switches tried (rider profile screen at 465 s; mean brightness of a crop over the rider, 0.23 when it is black):
mainAPS5_NO_CLEARED_VIEW=1APS5_NO_RESULT_MEMO=1APS5_NO_TABLE_RESOLUTION_REUSE=1+APS5_NO_TABLE_SNAPSHOT_REUSE=1APS5_CPU_DCC_KEYS=1APS5_NO_RESIDENT_TARGETS=1rendering into a 3D color target needs the resident image of its surfaceThe DCC-key switch changes the image, so DCC metadata matters to this scene. In the same runs the log reports textures read with mixed keys:
texture 0x... (format 56 / 71 / 130 / 36) has mixed DCC keys at 0x...; its texels are read as stored. That's about 30 reports, in two bursts: at boot, and again once the race loads. I haven't tied one of them to the black surfaces.Not the cause: ray tracing (none of the 355 dumped MXGP shaders uses
image_bvh_intersect_ray), and GPU waits (oneWAIT_REG_MEMtimeout in a 900 s run). Borderlands 4, another UE5 title, lights its 3D intro logo correctly on the same build.Screenshots: profile screen on
main, race onmain, profile screen withAPS5_CPU_DCC_KEYS=1.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T00:39:32Z.
I checked where the
mixed DCC keyswarning is produced: the texture path treatsDccKeys::Mixedas “texels are read as stored,” but the current log does not identify which draw consumes that texture. SinceAPS5_CPU_DCC_KEYS=1changes the frame substantially, the most useful next datum would be one black surface traced to its draw and sampled descriptor: target/texture base and format, DCC address and extent, plus whether the relevant key bytes are uniform, mixed, pending, or unknown at that lookup. That would tell us whether one of the mixed-key warnings explains the black result or is only incidental. I did not find an open PR that clearly implements this scene-specific behavior, so I’m not linking an unrelated change as a fix.Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-22T03:20:42Z.
@MarcZX10 here's what a diagnostic build found, on
maina6dcea9279plus local prints. It reports every non-uncompressed DCC key read with:Three 900 s runs on the same route. I haven't yet tied one black surface to its pass, but three things are settled:
1. Most "mixed DCC keys; texels are read as stored" warnings at boot are false alarms. The image-record pass in stage A (
ShaderResources.cpp,record.keys = TextureClearKeys(...)) runs unlocked. For a key range under a unit shadow,readDccKeysanswers its "unstable"Mixedthere, andtextureClearKeysreports that as mixed. The bytes were in fact uniform: 0x40 for both 2560x1440 RGBA16F textures at boot, and 0x00 for the race-time RGBA8 ones. Stage B reads the keys again under the lock (fastTexture→ProvedClearKeys). Sorecord.keysis never used when the surface has DCC, but the false reports fill most of the 32-report cap.2. The real mixed keys are 1280x720 RGBA16F surfaces with garbage in their key range. The key bytes hold 198 to 256 distinct values, mostly not key codes. Each is sampled by a draw that renders into the same surface with DCC off in
CB_COLOR_INFO(dcc 0x0), while the texture descriptor names DCC at surface + 0x780000. Reading them as stored matches what the CB wrote.3. Mipmapped DCC color targets sample as cleared after they're rendered.
DecodeColorBufferdrops DCC whenMAX_MIP> 0 (the one-time "DCC keys of mipmapped color targets are ignored"). Uniform clear keys aren't reported by the existing warning, which is why this didn't show up before.Clear0000, (0,0,0,0), so nothing rendered into them is ever seen.So point 3 is a real gap, but not this symptom.
Locked-stage reads of uniform 0000 keys: 206 in one run. 114 of those surfaces are never a render target, 41 are rendered only with DCC, 36 both ways, and 15 only without DCC (8 of the 15 are the mipmapped ones). Much of this memory is aliased. For example, 0x121b390000 is an A2B10G10R10 color target in some passes and a sampled R16G16B16A16_UNORM texture in others, and their DCC offsets differ (+0xF00000 and +0x1CC0000). So a cleared read isn't wrong by itself.
Next, I'll dump the inputs of the full-screen compute passes (320x180 and 160x90 groups) that read the GBuffer at the profile screen. If you'd like point 3 handled anyway (expand the clear, then keep the keys uncompressed while AnyPS5 renders them uncompressed), I can make that its own PR with a test.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-22T03:57:34Z.
@MarcZX10 point 3 above is now #9597 (mipmapped DCC chains keep their keys on the resident image, with tests). It doesn't change the black surfaces here: in an MXGP run with it, all 14 chains keep their keys, but the race looks the same.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-22T09:18:56Z.
Progress on the black surfaces: the lead is now UE5's virtual texture streaming, which looks stuck after its first few pages. Linux, RTX 4070 Ti, release libs on
mainwith local diagnostic prints only. No fix yet.The physical caches hold almost nothing. Two 6760x6760 textures (26x26 tiles of 260 px) are written as
R8G8B8A8_UINTstorage images by a 33x33-group compute dispatch and sampled asR8G8B8A8_SRGBby the scene's draws. Their results are still on the GPU when they're sampled. When I flush them to guest memory and count every nonzero word, each cache holds exactly 67,600 nonzero words after 470 s: one 260x260 page. One of the 1024x1024 R16 page tables is zero in every mip. The 256x256 and 512x512 page tables do hold entries.Writes into the caches stop early. Counting GPU writes per surface over a run that reaches the race (about 1000 s):
A track at race start should stream far more than 4 pages per cache.
Feedback is written, then copied into a buffer that reads as zero. In a 1 s window during the race, every one of the 2,222 draws binds the same writable 64 KiB buffer, about 2% nonzero, which looks like the feedback buffer. A 1x1x1 compute dispatch reads it and writes another 64 KiB buffer. That second buffer is all zero when the next such dispatch runs. If it's the buffer the CPU reads its page requests from, the requests never arrive and only the pages UE always keeps resident get uploaded.
Next I'll check whether that dispatch's output ever reaches guest memory. Then I'll check whether the black materials are the ones sampling these caches.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-22T11:13:34Z.
A step back from the virtual-texture lead: in the race, MXGP's indirect compute dispatches run with 0 groups. This is the same thing @mrfelek captured in Hot Wheels Infinite Rush (PPSA22408, #6895), another title from the same studio whose static scenery renders black.
How I measured it. A local diagnostic build on
mainnotes the argument words of every indirect dispatch in a 1 s window of the race (930-931 s). It reads them again a second after the window, once the GPU is done.Result. 1,653 dispatches ran in that window, 1,197 of them indirect.
0,1,1as its arguments both before and after: 0 groups.0,1,1and never incremented. Some 14 different compute passes write that buffer, and on the CPU side it is 1-2 % nonzero.So, as in mrfelek's capture, the binned passes after culling get no work. That fits the rest of what I see in MXGP. If the opaque geometry goes through a compute rasterizer that gets nothing to draw, its G-buffer colour stays empty and the materials never write virtual texture feedback. That would explain why the virtual texture caches hold one page after hundreds of seconds. Lighting from the sky and the reflections doesn't depend on that geometry.
Turning off written-buffer staging (
APS5_NO_WRITTEN_SHADOW=1 APS5_NO_ATOMIC_STAGING=1) changes nothing here. Next I want to find the pass that should increment those entries, and what it reads that leaves every bin empty: the previous frame's depth pyramid for occlusion culling, the instance data, or the culling work queue itself.AI-assisted: yes (Claude Code)