Gfx GX Fn GXClearVtxDesc - wowjinxy/libPorpoise GitHub Wiki

GXClearVtxDesc

  • Category: Geometry and Vertex
  • Matrix Status: Implemented
  • Matrix Notes: SDK parity pass done: clear resets descriptor state and restores default GX_VA_POS = GX_DIRECT.
  • Matrix Link: Gfx-GX-API-Matrix

Official SDK (Reference)

  • Manual page: E:/GPT5/Porpoise_SDK/libPorpoise/reference/man/gfx/gx/Geometry/GXClearVtxDesc.html
  • Related pages:
    • E:/GPT5/Porpoise_SDK/libPorpoise/reference/man/gfx/gx/Geometry/GXSetVtxDesc.html
    • E:/GPT5/Porpoise_SDK/libPorpoise/reference/man/gfx/gx/Geometry/GXSetVtxDescv.html
  • SDK source parity check area: E:/GPT5/ACGC-PC-Port-Debug-Stuff/src/static/dolphin/gx/GXAttr.c
  • Notes:
    • Manual signature: void GXClearVtxDesc(void).
    • Manual text says all attributes are set to GX_NONE.
    • Dolphin GX source implementation then explicitly sets position descriptor field to direct (GX_VA_POS = GX_DIRECT) and marks descriptor dirty.

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:
    • Signature matches SDK.
    • ACPC/GX backend clears descriptor table and restores GX_VA_POS = GX_DIRECT.
    • Legacy backend mirrors the same default restore.

SDK vs Porpoise Diff

  • Signature parity:
    • SDK: void GXClearVtxDesc(void)
    • Porpoise: same
  • Behavioral parity:
    • SDK source: clears descriptor state and leaves GX_VA_POS direct-enabled.
    • Porpoise: same in both backends.
  • Known divergence:
    • Manual prose says "all attributes to GX_NONE", but Dolphin source keeps position direct as post-clear default. Porpoise follows source/runtime behavior for compatibility.

Validation Checklist

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

Working Notes

  • SDK source reference lines: GXAttr.c around GXClearVtxDesc show vcdLo reset plus POS field set.