Gfx GX Fn GXSetTevDirect - wowjinxy/libPorpoise GitHub Wiki

GXSetTevDirect

  • Category: Indirect Texturing
  • Matrix Status: Implemented
  • Matrix Notes: Parity-checked wrapper that disables indirect effects for a TEV stage via canonical GXSetTevIndirect(...) direct settings.
  • Matrix Link: Gfx-GX-API-Matrix

Official SDK (Reference)

  • Manual page: reference/man/gfx/gx/Indirect/GXSetTevDirect.html
  • SDK source: reference/gx/GXBump.c (GXSetTevDirect, around lines 371+)
  • Verified SDK behavior:
    • GXSetTevDirect(tev_stage) is a convenience call that forwards to:
      • ind_stage = GX_INDTEXSTAGE0
      • format = GX_ITF_8
      • bias_sel = GX_ITB_NONE
      • matrix_sel = GX_ITM_OFF
      • wrap_s/t = GX_ITW_OFF
      • add_prev = FALSE
      • utc_lod = FALSE
      • alpha_sel = GX_ITBA_OFF
    • Uses CHECK_IN_BGN semantics (inherited by forwarded call path).

libPorpoise Implementation

  • Runtime implementation area: src/gx
  • Public API surface: include/dolphin/gx
  • Current implementation:
    • src/gx/pc_gx.c: GXSetTevDirect forwards to GXSetTevIndirect with the same canonical constants as SDK.
    • Begin-safe behavior is inherited through GXSetTevIndirect (which now flushes pending begin state before update).

SDK vs Porpoise Diff

  • Signature parity:
    • SDK: void GXSetTevDirect(GXTevStageID tev_stage)
    • Porpoise: same
  • Behavioral parity:
    • SDK and Porpoise both implement this as the canonical direct-mode wrapper over GXSetTevIndirect.
  • Known divergence:
    • None in wrapper semantics.

Validation Checklist

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

Working Notes

  • Build sanity target after update: pikmin_demo (Win32 Debug).