Gfx GX Fn GXSetTevIndTile - wowjinxy/libPorpoise GitHub Wiki

GXSetTevIndTile

  • Category: Indirect Texturing
  • Matrix Status: Partial
  • Matrix Notes: Parity-checked helper semantics (tile-size wrap decode, matrix setup, and indirect stage configuration) are in place; final fidelity is bounded by GXSetTevIndirect backend approximation.
  • Matrix Link: Gfx-GX-API-Matrix

Official SDK (Reference)

  • Manual page: reference/man/gfx/gx/Indirect/GXSetTevIndTile.html
  • SDK source: reference/gx/GXBump.c (GXSetTevIndTile, around lines 421+)
  • Verified SDK behavior:
    • Maps tile sizes {16,32,64,128,256} to {GX_ITW_16,32,64,128,256}.
    • Invalid tile sizes assert in debug and fall back to GX_ITW_OFF.
    • Builds indirect matrix:
      • mtx[0][0] = tilespacing_s / 1024
      • mtx[1][1] = tilespacing_t / 1024
      • other terms are 0
    • Calls GXSetIndTexMtx(matrix_sel, mtx, 10).
    • Calls GXSetTevIndirect(..., format, bias_sel, matrix_sel, wrap_s, wrap_t, FALSE, TRUE, alpha_sel).

libPorpoise Implementation

  • Runtime implementation area: src/gx
  • Public API surface: include/dolphin/gx
  • Current implementation:
    • src/gx/pc_gx.c: GXSetTevIndTile performs the same tile-size wrap mapping (invalid -> GX_ITW_OFF), same matrix construction, calls GXSetIndTexMtx(..., 10), and forwards to GXSetTevIndirect with add_prev=GX_FALSE and utc_lod=GX_TRUE.

SDK vs Porpoise Diff

  • Signature parity:
    • SDK: void GXSetTevIndTile(...)
    • Porpoise: same
  • Behavioral parity:
    • Tile-size decode, matrix setup, and forwarding parameters match SDK.
  • Known divergence:
    • As with other indirect helpers, end-to-end accuracy is limited by remaining GXSetTevIndirect approximation points (notably bump-alpha side behavior).

Validation Checklist

  • GX demo coverage checked (indirect tiling setup path)
  • Pikmin usage path checked (indirect helper forwarding path)
  • Matrix status updated if needed
  • Notes updated with concrete file/function references

Working Notes

  • No runtime patch required for this function; implementation already matched SDK helper behavior.