Gfx GX Fn GXGetVtxAttrFmt - wowjinxy/libPorpoise GitHub Wiki

GXGetVtxAttrFmt

  • Category: Geometry and Vertex
  • Matrix Status: Implemented
  • Matrix Notes: Returns VAT (cnt/type/frac) for attribute in selected vertex format.
  • 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

  • Docs checked against reference/man/gfx/gx/Geometry/GXGetVtxAttrFmt.html and SDK source in reference/gx/GXAttr.c.
  • Runtime parity updates in src/gx/pc_gx.c:
    • NRM/NBT now return implied normal fixed-point fraction based on type (GX_S8 -> 6, GX_S16 -> 14, else 0).
    • Default branch now matches SDK style fallback for non-VAT attrs (cnt=1, type=GX_U8, frac=0).
    • Supported VAT attrs remain GX_VA_POS, GX_VA_NRM/GX_VA_NBT, GX_VA_CLR0/1, GX_VA_TEX0..7.