Repository navigation
Gfx GX Fn GXSetArray
wowjinxy edited this page Apr 9, 2026
·
2 revisions
- Category:
Geometry and Vertex - Matrix Status:
Implemented - Matrix Notes: SDK parity pass done: valid attr range + NBT aliasing now match Dolphin
GXAttr.c. - Matrix Link: Gfx-GX-API-Matrix
- Manual page:
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/GXAttr.c - Notes:
- Signature:
void GXSetArray(GXAttr attr, const void* base_ptr, u8 stride). - Accepted attrs for this API are
GX_VA_POS .. GX_LIGHT_ARRAY(matrix/light arrays plus POS/NRM/CLR/TEX arrays). - SDK maps
GX_VA_NBTtoGX_VA_NRMbefore programming the CP attribute array register. - SDK stores per-attr base and byte stride used for indexed fetch.
- Signature:
- Runtime implementation area:
E:/GPT5/Porpoise_SDK/libPorpoise/src/gx/pc_gx.c - Public API surface:
E:/GPT5/Porpoise_SDK/libPorpoise/include/dolphin/gx/GXGeometry.h - Notes:
- Signature now matches SDK typed form (
GXAttr). -
GX_VA_NBTis now explicitly aliased toGX_VA_NRM. - Attr validation now mirrors SDK API domain (
GX_VA_POS .. GX_LIGHT_ARRAY). - Base/stride state is stored and consumed by indexed paths (
GXPosition1x*,GXNormal1x*,GXColor1x*,GXTexCoord1x*) and matrix/light indexed loaders.
- Signature now matches SDK typed form (
- Signature parity:
- SDK:
void GXSetArray(GXAttr attr, const void* base_ptr, u8 stride) - Porpoise: now matches.
- SDK:
- Behavioral parity:
- SDK: aliases
GX_VA_NBTtoGX_VA_NRM, validates attr domain, then stores array base/stride. - Porpoise: now mirrors this behavior.
- SDK: aliases
- Known divergence:
- SDK writes masked physical addresses into CP registers; PC backend stores host pointers directly for software/indexed decode.
- SDK debug path asserts on invalid args; PC backend uses fail-soft early return.
- GX demo coverage checked
- Pikmin usage path checked
- Matrix status/notes updated for this function
- Notes updated with concrete file/function references
- This API is central for matrix/light indexed loads too, not just vertex attribute arrays.