Skip to content

[Blocker 2/6] Scene triangles not reaching pixel shader #3

@mgrz18

Description

@mgrz18

Symptom

When game advances frames (DONEs > 100), the rainbow-test pixel shader (which colors each fragment by screen position) produces ZERO visible output. But FORCE_MAGENTA early-return DOES work in earlier-stage runs.

Hypothesis

Stall-recovered frames render only fillrects (boot transitions), not scene triangles. The actual game's bondviewMain → bgLevelRender → model_render chain hasn't been reached — game is still in some prelevel state.

Evidence

  • FORCE_MAGENTA shader produces lower-half-magenta in PPM (= rasterizer works for tris)
  • Rainbow shader: ZERO output in 4/4 runs even when DONEs=152
  • Boot fillrects DO render (uniform colors)
  • Diff: rect path bypasses xyz *= w in vertex shader; tri path multiplies. If w is bad, tris collapse.

Try next

  1. Force game to skip boot — check /tmp/ge_decomp/src/main.c for fast-path arguments
  2. Add per-tri counter of renderFlagRect(rp.flags) in pixel shader to count rect vs tri invocations
  3. Verify screenPos.w in compute shader (RSPProcessCS.hlsl:125) is reasonable (1.0, not 0 or NaN)

Files

  • lib/rt64/src/shaders/RasterPS.hlsl (rainbow test commented at line ~125)
  • lib/rt64/src/shaders/RasterVS.hlsl:21 (`ndcPos.xyz *= ndcPos.w`)
  • lib/rt64/src/shaders/RSPProcessCS.hlsl:118-126 (where `screenPos.w` is set)

Acceptance criteria

Rainbow shader produces gradient output covering at least 25% of frame.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions