Gfx GX Fn GXSetVtxDesc - wowjinxy/libPorpoise GitHub Wiki

GXSetVtxDesc

  • Category: Geometry and Vertex
  • Matrix Status: Implemented
  • Matrix Notes: Parity-adjusted: NRM/NBT mutual exclusion now matches SDK behavior.
  • Matrix Link: Gfx-GX-API-Matrix

Official SDK (Reference)

  • Manual page: E:/GPT5/Porpoise_SDK/libPorpoise/reference/man/gfx/gx/Geometry/GXSetVtxDesc.html
  • Related pages:
    • E:/GPT5/Porpoise_SDK/libPorpoise/reference/man/gfx/gx/Geometry/GXSetVtxDescv.html
    • E:/GPT5/Porpoise_SDK/libPorpoise/reference/man/gfx/gx/Geometry/GXClearVtxDesc.html
  • SDK source parity check area: E:/GPT5/ACGC-PC-Port-Debug-Stuff/src/static/dolphin/gx/GXAttr.c
  • Notes:
    • Signature/prototype is void GXSetVtxDesc(GXAttr attr, GXAttrType type).
    • Manual explicitly calls out that GX_VA_POS is required for each vertex.
    • SDK semantics: GX_VA_NRM and GX_VA_NBT share one CP descriptor slot; enabling one disables the other.
    • SDK validates attr/type and updates CP/XF dirty state (dirtyState |= 8).

libPorpoise Implementation

  • Runtime implementation area: E:/GPT5/Porpoise_SDK/libPorpoise/src/gx/pc_gx.c
  • Legacy implementation area: E:/GPT5/Porpoise_SDK/libPorpoise/src/gx/GXGeometry.cpp
  • Public API surface: E:/GPT5/Porpoise_SDK/libPorpoise/include/dolphin/gx/GXGeometry.h
  • Notes:
    • ACPC/GX backend now uses SDK-typed signature (GXAttr, GXAttrType) for GXSetVtxDesc/GXSetVtxDescv.
    • ACPC/GX and legacy backends now enforce NRM/NBT mutual exclusion on set.
    • GXSetVtxDescv now iterates GXVtxDescList entries until GX_VA_NULL with null guard.

SDK vs Porpoise Diff

  • Signature parity:
    • SDK: void GXSetVtxDesc(GXAttr, GXAttrType)
    • Porpoise: matches in both backends after parity patch
  • Behavioral parity:
    • SDK: NRM/NBT are mutually exclusive and share one descriptor slot
    • Porpoise: now mirrors this behavior in both backends
  • Known divergence:
    • ACPC/GX backend does not model hardware dirtyState bits; it updates software state directly.
    • SDK has assert-style guards (CHECK_GXBEGIN/ASSERTMSGLINE); PC backend currently fails soft on invalid input.

Validation Checklist

  • GX demo coverage checked
  • Pikmin usage path checked
  • Matrix notes updated for GXSetVtxDesc family
  • Notes updated with concrete file/function references

Working Notes

  • Related SDK parity detail in same family: GXClearVtxDesc defaults position descriptor to GX_DIRECT after clear.