AGC: MXGP 26 (PPSA30839) renders opaque surfaces black in its 3D scenes; only the sky and reflections are lit #9510

Open
opened 2026-10-21 23:54:47 +00:00 by milescoviello · 5 comments
milescoviello commented 2026-10-21 23:54:47 +00:00 (Migrated from github.com)
Contributor

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: main a6dcea9279, 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):

  • 260 s: Cross on "PRESS X".
  • About 320 s: hold Square for 3 s. The MyNacon e-mail screen's Skip prompt is a square in a ring, a hold.
  • About 345 s: Cross accepts the Terms of Use.
  • 375, 405 and 435 s: Cross through the gamma screen to the rider profile.
  • About 460 s: Down 8 times, then Cross on Confirm.
  • About 640 s: Down 3 times, then Cross on Confirm (bike manufacturer).
  • Then Cross every 30 s, to the race at about 880 s.

Switches tried (rider profile screen at 465 s; mean brightness of a crop over the rider, 0.23 when it is black):

run result
main rider black (0.233)
APS5_NO_CLEARED_VIEW=1 no change (0.237)
APS5_NO_RESULT_MEMO=1 no change (0.225)
APS5_NO_TABLE_RESOLUTION_REUSE=1 + APS5_NO_TABLE_SNAPSHOT_REUSE=1 no change (0.255; the rider moves between runs)
APS5_CPU_DCC_KEYS=1 the sky goes black too; only the rider's rim light and some sparkles are left
APS5_NO_RESIDENT_TARGETS=1 aborts at 38 s: rendering into a 3D color target needs the resident image of its surface

The 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 (one WAIT_REG_MEM timeout 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 on main, profile screen with APS5_CPU_DCC_KEYS=1.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5970430003 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/9510). Originally posted by [milescoviello](https://github.com/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:** `main` a6dcea9279, 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): - 260 s: Cross on "PRESS X". - About 320 s: **hold Square for 3 s**. The MyNacon e-mail screen's Skip prompt is a square in a ring, a hold. - About 345 s: Cross accepts the Terms of Use. - 375, 405 and 435 s: Cross through the gamma screen to the rider profile. - About 460 s: Down 8 times, then Cross on Confirm. - About 640 s: Down 3 times, then Cross on Confirm (bike manufacturer). - Then Cross every 30 s, to the race at about 880 s. **Switches tried** (rider profile screen at 465 s; mean brightness of a crop over the rider, 0.23 when it is black): | run | result | |---|---| | `main` | rider black (0.233) | | `APS5_NO_CLEARED_VIEW=1` | no change (0.237) | | `APS5_NO_RESULT_MEMO=1` | no change (0.225) | | `APS5_NO_TABLE_RESOLUTION_REUSE=1` + `APS5_NO_TABLE_SNAPSHOT_REUSE=1` | no change (0.255; the rider moves between runs) | | `APS5_CPU_DCC_KEYS=1` | **the sky goes black too**; only the rider's rim light and some sparkles are left | | `APS5_NO_RESIDENT_TARGETS=1` | aborts at 38 s: `rendering into a 3D color target needs the resident image of its surface` | The 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 (one `WAIT_REG_MEM` timeout 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`](https://github.com/milescoviello/AnyPS5/releases/download/mxgp-lighting-2026-10-21/mxgp-profile-main.png), [race on `main`](https://github.com/milescoviello/AnyPS5/releases/download/mxgp-lighting-2026-10-21/mxgp-race-main.png), [profile screen with `APS5_CPU_DCC_KEYS=1`](https://github.com/milescoviello/AnyPS5/releases/download/mxgp-lighting-2026-10-21/mxgp-profile-cpu-dcc-keys.png). AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-22 00:39:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T00:39:32Z.


I checked where the mixed DCC keys warning is produced: the texture path treats DccKeys::Mixed as “texels are read as stored,” but the current log does not identify which draw consumes that texture. Since APS5_CPU_DCC_KEYS=1 changes 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6329816779 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/9510#issuecomment-6329816779). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T00:39:32Z. --- I checked where the `mixed DCC keys` warning is produced: the texture path treats `DccKeys::Mixed` as “texels are read as stored,” but the current log does not identify which draw consumes that texture. Since `APS5_CPU_DCC_KEYS=1` changes 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.
milescoviello commented 2026-10-22 03:20:42 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-22T03:20:42Z.


@MarcZX10 here's what a diagnostic build found, on main a6dcea9279 plus local prints. It reports every non-uncompressed DCC key read with:

  • its key histogram and a 32-slice layout;
  • whether the GPU lock was held;
  • the consumer (the draw's color targets, or the dispatch's program);
  • how that surface was last bound as a render target (with or without DCC).

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, readDccKeys answers its "unstable" Mixed there, and textureClearKeys reports 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). So record.keys is 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. DecodeColorBuffer drops DCC when MAX_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.

  • One run has 14 such targets: BGRA8 sRGB or UNORM, 2048x2048 with 12 mips or 4096x4096 with 13, all in slot 0.
  • Every one is later sampled, all mips, by a compute dispatch with every key byte 0x00. That reads as Clear0000, (0,0,0,0), so nothing rendered into them is ever seen.
  • Three of them appear as the profile screen loads, so I tested them. With a local switch that marks the whole key range uncompressed at each draw into them, those reports go away (the reads become "as stored"), but the rider stays black: crop mean 0.223, against 0.233 and 0.239 without the switch.

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)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6331858427 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/9510#issuecomment-6331858427). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-22T03:20:42Z. --- @MarcZX10 here's what a diagnostic build found, on `main` a6dcea9279 plus local prints. It reports every non-uncompressed DCC key read with: - its key histogram and a 32-slice layout; - whether the GPU lock was held; - the consumer (the draw's color targets, or the dispatch's program); - how that surface was last bound as a render target (with or without DCC). 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, `readDccKeys` answers its "unstable" `Mixed` there, and `textureClearKeys` reports 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`). So `record.keys` is 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.** `DecodeColorBuffer` drops DCC when `MAX_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. - One run has 14 such targets: BGRA8 sRGB or UNORM, 2048x2048 with 12 mips or 4096x4096 with 13, all in slot 0. - Every one is later sampled, all mips, by a compute dispatch with every key byte 0x00. That reads as `Clear0000`, (0,0,0,0), so nothing rendered into them is ever seen. - Three of them appear as the profile screen loads, so I tested them. With a local switch that marks the whole key range uncompressed at each draw into them, those reports go away (the reads become "as stored"), but **the rider stays black**: crop mean 0.223, against 0.233 and 0.239 without the switch. 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)
milescoviello commented 2026-10-22 03:57:34 +00:00 (Migrated from github.com)
Author
Contributor

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)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6332316690 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/9510#issuecomment-6332316690). Originally posted by [milescoviello](https://github.com/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)
milescoviello commented 2026-10-22 09:18:56 +00:00 (Migrated from github.com)
Author
Contributor

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 main with 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_UINT storage images by a 33x33-group compute dispatch and sampled as R8G8B8A8_SRGB by 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):

  • each cache gets 2-3 upload dispatches during boot (the last at 21 s), and 4 in total by the race;
  • the race's page tables are created and drawn at about 695 s;
  • nothing else is written into the caches.

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)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6337259910 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/9510#issuecomment-6337259910). Originally posted by [milescoviello](https://github.com/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 `main` with 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_UINT` storage images by a 33x33-group compute dispatch and sampled as `R8G8B8A8_SRGB` by 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): - each cache gets 2-3 upload dispatches during boot (the last at 21 s), and 4 in total by the race; - the race's page tables are created and drawn at about 695 s; - nothing else is written into the caches. 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)
milescoviello commented 2026-10-22 11:13:34 +00:00 (Migrated from github.com)
Author
Contributor

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 main notes 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.

  • Two compute shaders each ran 132 times. Every one of those dispatches had 0,1,1 as its arguments both before and after: 0 groups.
  • Eight more shaders ran 10-14 times each, again all with 0 groups.
  • Other indirect passes do get work: 64 to 376 groups.
  • The empty dispatches take their arguments from consecutive 32-byte entries of one 64 KiB buffer. The entries are reset to 0,1,1 and 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)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6339358948 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/9510#issuecomment-6339358948). Originally posted by [milescoviello](https://github.com/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](https://github.com/boykopovar/AnyPS5/discussions/6895)), another title from the same studio whose static scenery renders black. **How I measured it.** A local diagnostic build on `main` notes 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. - Two compute shaders each ran 132 times. Every one of those dispatches had `0,1,1` as its arguments both before and after: 0 groups. - Eight more shaders ran 10-14 times each, again all with 0 groups. - Other indirect passes do get work: 64 to 376 groups. - The empty dispatches take their arguments from consecutive 32-byte entries of one 64 KiB buffer. The entries are reset to `0,1,1` and 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)
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#9510
No description provided.