Files
sp00nz 13c64d3172 pb_exec: four texture stages and the NV2A register combiners
Every pixel the NV2A writes goes through its register combiners; D3D's
fixed-function stages compile to them too. The executor stood in with
"stage 0 texel * diffuse", which is right for a menu quad and wrong for
any lit or multi-textured surface: Burnout 3's race came out unlit, with
a black sky, and its composite passes lost what their other stages carry.

- nv2a_combiner.c: up to eight general stages and the final combiner --
  input mappings, dot products, mux (LSB/MSB), output scale/bias, blue to
  alpha, per-stage or shared factors, V1+R0 sum and E*F product -- per
  xemu's psh.c. tests/nv2a_combiner checks MODULATE, a final-combiner
  lerp and an expand-normal dot product.
- Four texture stages, each with its own offset/format/size/address/
  palette; the 0x1B00-0x1BFF block is decoded per stage.
- Texture shader modes per SET_SHADER_STAGE_PROGRAM: 2D/3D projective,
  cube maps (face select, 128-byte-aligned face stride), pass-through,
  clip plane (per-component discard). Bump/dot-product modes read zero.
- The fog unit (linear/exp/exp2, abs variants, FOG_PARAMS) and fog colour
  feed the combiners' fog register; alpha test runs on the combiner
  output, before the depth write.
- Unwritten program texture coordinates default to (0,0,0,1).

The combiner path takes over once a title writes COMBINER_CONTROL;
RECOMP_NO_COMBINERS restores the old path for comparison. The frame
trace prints each batch's stage textures and combiner words.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 02:04:32 -07:00
..
2026-09-17 19:11:04 -05:00
2026-09-17 19:11:04 -05:00
2026-09-17 02:05:08 -05:00