Purple foliage, blinds and skin: only the translucent material classes of the tiled lighting pass #3279

Open
opened 2026-11-26 15:42:13 +00:00 by github-bot · 2 comments
Owner

@⁠Ym1r1710 on GitHub · 2026-11-26 15:39 UTC · original

Foliage, blinds/curtains and skin come out purple in the world. I spent a few runs narrowing it down; posting what I have so nobody repeats it.

Setup: RTX 5080, driver 621.24, Windows 11. Build is upstream main at ffe310eb plus the CGBJ patch set (it is the only base I have that lights the world properly), diag profile, --console series-s. Spot: Jason's house balcony right after the first mission, deterministic camera, so frame world+672 is the same shot every run.

What it looks like: vertical blinds behind the glass door and the house wall around them are pink/purple, island trees and potted plants are purple, faces in cutscenes go purple on and off.

Where it comes from

  • G-buffer is fine. Albedo of the blinds dumps as (202,202,196), skin as (164,114,87). Nothing purple before lighting.
  • It appears in the tiled lighting pass (VS_TiledLighting_fdbb4ddc, vertex 25ebc92075b62822), which draws one pixel shader per material class into the 1280x720 RGBA16F light target. PS_PBR_MATERIAL_STANDARD (1cd9bc634417a981) surfaces look right in the same frame.
  • Skipping PS_PBR_MATERIAL_TRANSLUCENCY_42ad1e50 (a9a0b814cd938ec0) and its NoDir twin (1702071f810bed34) with VICTORY_SKIP_PIPELINES makes the trees disappear together with the purple. So foliage is that class.
  • Blinds, the wall and skin stay purple with those two skipped, so they are other classes. BLURTRANSMISSION (0e44bcc54eaebe5f) and SKIN (01999631eaafe981) are the ones that read the extra G-buffer target at table offset 0x13c0; STANDARD and TRANSLUCENCY do not.
  • TRANSLUCENCY binds exactly the same resources as STANDARD. The only input difference I see is that it loads the 0xfa0 target with dmask 0xe (G,B,A) where STANDARD loads dmask 0xc. No unusual opcodes in the diff, just more math (extra v_exp/v_log/v_rsq/v_rcp, 16 v_readfirstlane vs 28).

Ruled out

  • The CGBJ ambient stand-in: with VICTORY_AMBIENT and VICTORY_AMBIENT_AIR unset it gets more purple (the stand-in was hiding part of it), and the island trees turn purple too.
  • BC7 rotation fix (#3111) and the SDWA sign-extend fix (#3124) both applied, no change.
  • All five refused compute shaders running (VICTORY_SCC_LOCAL_ANY=1), no change.
  • The stencil "inside a room" bit: it lines up with the house, but foliage outside has the same problem.
  • Stand-in formats: the only stand-ins in that frame are a 1280x720 B5G5R5A1 mask and the 1920x1080 R9G9B9E5 target, which already contains the purple.

My guess is something these "light through thin surfaces" shaders share and STANDARD doesn't, rather than data. Happy to run a build or a switch on this spot if someone has an idea. A diag build with VICTORY_DUMP_TARGETS reproduces it in about 90 seconds.

**@⁠Ym1r1710** on GitHub · 2026-11-26 15:39 UTC · [original](https://github.com/Marvisak/VIctory/issues/3279) Foliage, blinds/curtains and skin come out purple in the world. I spent a few runs narrowing it down; posting what I have so nobody repeats it. **Setup:** RTX 5080, driver 621.24, Windows 11. Build is upstream main at ffe310eb plus the CGBJ patch set (it is the only base I have that lights the world properly), diag profile, `--console series-s`. Spot: Jason's house balcony right after the first mission, deterministic camera, so frame world+672 is the same shot every run. **What it looks like:** vertical blinds behind the glass door and the house wall around them are pink/purple, island trees and potted plants are purple, faces in cutscenes go purple on and off. **Where it comes from** - G-buffer is fine. Albedo of the blinds dumps as (202,202,196), skin as (164,114,87). Nothing purple before lighting. - It appears in the tiled lighting pass (`VS_TiledLighting_fdbb4ddc`, vertex 25ebc92075b62822), which draws one pixel shader per material class into the 1280x720 RGBA16F light target. `PS_PBR_MATERIAL_STANDARD` (1cd9bc634417a981) surfaces look right in the same frame. - Skipping `PS_PBR_MATERIAL_TRANSLUCENCY_42ad1e50` (a9a0b814cd938ec0) and its NoDir twin (1702071f810bed34) with VICTORY_SKIP_PIPELINES makes the trees disappear together with the purple. So foliage is that class. - Blinds, the wall and skin stay purple with those two skipped, so they are other classes. `BLURTRANSMISSION` (0e44bcc54eaebe5f) and `SKIN` (01999631eaafe981) are the ones that read the extra G-buffer target at table offset 0x13c0; STANDARD and TRANSLUCENCY do not. - TRANSLUCENCY binds exactly the same resources as STANDARD. The only input difference I see is that it loads the 0xfa0 target with dmask 0xe (G,B,A) where STANDARD loads dmask 0xc. No unusual opcodes in the diff, just more math (extra v_exp/v_log/v_rsq/v_rcp, 16 v_readfirstlane vs 28). **Ruled out** - The CGBJ ambient stand-in: with VICTORY_AMBIENT and VICTORY_AMBIENT_AIR unset it gets *more* purple (the stand-in was hiding part of it), and the island trees turn purple too. - BC7 rotation fix (#3111) and the SDWA sign-extend fix (#3124) both applied, no change. - All five refused compute shaders running (VICTORY_SCC_LOCAL_ANY=1), no change. - The stencil "inside a room" bit: it lines up with the house, but foliage outside has the same problem. - Stand-in formats: the only stand-ins in that frame are a 1280x720 B5G5R5A1 mask and the 1920x1080 R9G9B9E5 target, which already contains the purple. My guess is something these "light through thin surfaces" shaders share and STANDARD doesn't, rather than data. Happy to run a build or a switch on this spot if someone has an idea. A diag build with VICTORY_DUMP_TARGETS reproduces it in about 90 seconds.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 15:42:13 +00:00
Author
Owner

@⁠Ingenioeren on GitHub · 2026-11-26 15:44 UTC · original

I checked the 0xc versus 0xe difference in isolation on public main 63bcca4. A synthetic compute shader loaded an RGBA32F texel (1.5, -2.0, 3.0, 0.5) through a descriptor table and copied the destination registers to a readback buffer. On both an RX 6750 XT and Windows WARP, all 32 lanes returned:

Mask 32-bit results Packed d16 result words
0xc B, A 0x38004200
0xe G, B, A 0x4200c000, 0x00003800

The guard values in the unwritten registers survived in every case. The basic channel selection and packing agreed with the expected order. This fixture covers a plain image_load and does not reproduce the full pixel-shader pass or its resource bindings. If you have the instruction details for the two 0xfa0 reads, the load mnemonic, d16 flag, view format and channel swizzle would help make the synthetic fixture closer to those reads. No shader dump needed. Channel selection and packing in the emitter

AI-assisted synthetic verification with OpenAI Codex.

**@⁠Ingenioeren** on GitHub · 2026-11-26 15:44 UTC · [original](https://github.com/Marvisak/VIctory/issues/3279#issuecomment-7196697037) I checked the `0xc` versus `0xe` difference in isolation on public main `63bcca4`. A synthetic compute shader loaded an RGBA32F texel `(1.5, -2.0, 3.0, 0.5)` through a descriptor table and copied the destination registers to a readback buffer. On both an RX 6750 XT and Windows WARP, all 32 lanes returned: | Mask | 32-bit results | Packed `d16` result words | | --- | --- | --- | | `0xc` | B, A | `0x38004200` | | `0xe` | G, B, A | `0x4200c000`, `0x00003800` | The guard values in the unwritten registers survived in every case. The basic channel selection and packing agreed with the expected order. This fixture covers a plain `image_load` and does not reproduce the full pixel-shader pass or its resource bindings. If you have the instruction details for the two `0xfa0` reads, the load mnemonic, `d16` flag, view format and channel swizzle would help make the synthetic fixture closer to those reads. No shader dump needed. [Channel selection and packing in the emitter](https://github.com/Marvisak/VIctory/blob/63bcca43c6a00a758510398fa43096ce7e4f7df0/crates/victory-shader/src/emit/lower.rs#L9016-L9051) AI-assisted synthetic verification with OpenAI Codex.
Author
Owner

@⁠Ym1r1710 on GitHub · 2026-11-26 17:13 UTC · original

Thanks for checking that. Here are the two loads as they are in the containers (both pixel shaders are wave32, the host reports 32 lanes min/max on this card):

STANDARD (1cd9bc634417a981):

s_load_dwordx8 s[48:55], s[8:9], 0x000fa0
image_load v[17:18], [v51,v52], s[48:55] dmask:0xc dim:SQ_RSRC_IMG_2D unorm

TRANSLUCENCY (a9a0b814cd938ec0):

s_load_dwordx8 s[40:47], s[8:9], 0x000fa0
image_load v[25:27], [v53,v54], s[40:47] dmask:0xe dim:SQ_RSRC_IMG_2D unorm
  • Both are the NSA form (separate x/y registers), no d16, no a16, no lod.
  • The texture behind 0xfa0 is a 1280x720 render target, title format R8G8B8A8_UNORM (28) and the same on the host, so no stand-in format. Component mapping is the default one.
  • In my dump that target is mostly G = 0 (only ~7% of texels have a non-zero G), e.g. blinds/wall (128, 0, 181), a potted plant (127, 0, 185).

So your result matches what I'd expect, and I don't think the 0xe read itself is the problem anymore. More likely the extra math that consumes it. I'll try to narrow it down further on my side and post if I find the instruction.

**@⁠Ym1r1710** on GitHub · 2026-11-26 17:13 UTC · [original](https://github.com/Marvisak/VIctory/issues/3279#issuecomment-7198675593) Thanks for checking that. Here are the two loads as they are in the containers (both pixel shaders are wave32, the host reports 32 lanes min/max on this card): STANDARD (1cd9bc634417a981): ``` s_load_dwordx8 s[48:55], s[8:9], 0x000fa0 image_load v[17:18], [v51,v52], s[48:55] dmask:0xc dim:SQ_RSRC_IMG_2D unorm ``` TRANSLUCENCY (a9a0b814cd938ec0): ``` s_load_dwordx8 s[40:47], s[8:9], 0x000fa0 image_load v[25:27], [v53,v54], s[40:47] dmask:0xe dim:SQ_RSRC_IMG_2D unorm ``` - Both are the NSA form (separate x/y registers), no d16, no a16, no lod. - The texture behind 0xfa0 is a 1280x720 render target, title format R8G8B8A8_UNORM (28) and the same on the host, so no stand-in format. Component mapping is the default one. - In my dump that target is mostly G = 0 (only ~7% of texels have a non-zero G), e.g. blinds/wall (128, 0, 181), a potted plant (127, 0, 185). So your result matches what I'd expect, and I don't think the 0xe read itself is the problem anymore. More likely the extra math that consumes it. I'll try to narrow it down further on my side and post if I find the instruction.
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory#3279
No description provided.