Gfx GX Fn GXTexCoord family - wowjinxy/libPorpoise GitHub Wiki

GXTexCoord[n][t]

  • Category: Geometry and Vertex
  • Matrix Status: Implemented
  • Matrix Notes: Verified descriptor-ordered TEX0..TEX7 routing for immediate direct/indexed family, with per-attribute fixed-point scaling and per-vertex phase reset.
  • Matrix Link: Gfx-GX-API-Matrix

Official SDK (Reference)

  • Manual root: reference/rvlsdk/man/en_US/gx
  • Primary SDK source area: demos/PikminDemo/src/gx (GC-style Dolphin GX source)
  • Notes:
    • Confirm official signature/prototype
    • Confirm documented side effects (register/state updates)
    • Confirm special behavior and edge cases from manual

libPorpoise Implementation

  • Runtime implementation area: src/gx
  • Public API surface: include/dolphin/gx
  • Notes:
    • Confirm API signature matches SDK
    • Confirm state writes match SDK semantics
    • Confirm backend behavior in PC renderer path

SDK vs Porpoise Diff

  • Signature parity:
    • SDK:
    • Porpoise:
  • Behavioral parity:
    • SDK:
    • Porpoise:
  • Known divergence:

Validation Checklist

  • GX demo coverage checked
  • Pikmin usage path checked
  • Matrix status updated if needed
  • Notes updated with concrete file/function references

Working Notes

  • Confirmed runtime behavior in src/gx/pc_gx.c:
    • Added descriptor-order texcoord selection (pc_gx_current_texcoord_attr) for immediate API calls.
    • Added texcoord phase advance/reset (pc_gx_advance_texcoord_phase, reset on GXBegin and each new vertex in GXPosition3f32).
    • Updated GXTexCoord2* fixed-point variants to use selected attribute frac, not hardcoded GX_VA_TEX0.
    • Updated GXTexCoord1x16/1x8 to read from selected texcoord array/format (GX_VA_TEX0..GX_VA_TEX7) instead of TEX0-only.