Gfx GX Fn GXPosition family - wowjinxy/libPorpoise GitHub Wiki

GXPosition[n][t]

  • Category: Geometry and Vertex
  • Matrix Status: Implemented
  • Matrix Notes: SDK/manual parity reviewed for all position entry points; direct and indexed paths match expected data forms, including VAT frac scaling for integer position types.
  • Matrix Link: Gfx-GX-API-Matrix

Official SDK (Reference)

  • Manual page: E:/GPT5/Porpoise_SDK/libPorpoise/reference/man/gfx/gx/Geometry/GXPosition.html
  • Related pages:
    • E:/GPT5/Porpoise_SDK/libPorpoise/reference/man/gfx/gx/Geometry/GXBegin.html
    • E:/GPT5/Porpoise_SDK/libPorpoise/reference/man/gfx/gx/Geometry/GXSetVtxDesc.html
    • E:/GPT5/Porpoise_SDK/libPorpoise/reference/man/gfx/gx/Geometry/GXSetVtxAttrFmt.html
    • E:/GPT5/Porpoise_SDK/libPorpoise/reference/man/gfx/gx/Geometry/GXSetArray.html
  • SDK source parity check area: E:/GPT5/ACGC-PC-Port-Debug-Stuff/src/static/dolphin/gx/GXVert.c
  • Notes:
    • Signature family matches manual (3*, 2*, and indexed 1x8/1x16 variants).
    • Manual requirements confirmed: valid between GXBegin/GXEnd, must match descriptor+format.
    • Indexed behavior confirmed: index references array configured through GXSetArray.

libPorpoise Implementation

  • Runtime implementation area: E:/GPT5/Porpoise_SDK/libPorpoise/src/gx/pc_gx.c
  • Public API surface: E:/GPT5/Porpoise_SDK/libPorpoise/include/dolphin/gx/GXVert.h
  • Notes:
    • Direct paths (GXPosition3*, GXPosition2*) map to per-vertex position writes.
    • Integer direct paths apply inverse quantization via current VAT POS frac.
    • Indexed paths (GXPosition1x8/1x16) read from GX_VA_POS array using current VAT POS cnt/type/frac.
    • GXPosition2* routes to Z=0 behavior in PC backend.

SDK vs Porpoise Diff

  • Signature parity:
    • SDK: full GXPosition[n][t] family listed in manual.
    • Porpoise: matching function family exposed/implemented.
  • Behavioral parity:
    • SDK: direct and indexed position submission per descriptor/format.
    • Porpoise: mirrors direct/indexed submission and fixed-point dequantization behavior for integer formats.
  • Known divergence:
    • SDK debug library validates strict call order and begin/end usage; PC backend currently fails soft rather than asserting.
    • PC backend treats 2* variants as explicit z=0 write in software path.

Validation Checklist

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

Working Notes

  • Runtime function cluster is in pc_gx.c around GXPosition3f32 through GXPosition1x8.