Gfx GX Fn GXSetViewport - wowjinxy/libPorpoise GitHub Wiki
GXSetViewport
- Category:
Transformation and Matrix
- Matrix Status:
Implemented
- Matrix Notes: Verified viewport/depth-range storage and GL viewport application in GX top-left coordinate convention.
- 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:
libPorpoise Implementation
- Runtime implementation area:
src/gx
- Public API surface:
include/dolphin/gx
- Notes:
SDK vs Porpoise Diff
- Signature parity:
- Behavioral parity:
-
Known divergence:
Validation Checklist
Working Notes
- Docs checked against
reference/man/gfx/gx/Transform/GXSetViewport.html and SDK source in reference/gx/GXTransform.c.
- Runtime checked in
src/gx/pc_gx.c:
- Stores viewport parameters (
left/top/wd/ht/nearz/farz) in GX state.
- Applies viewport using GX top-left convention with Y-flip for GL backend.
- Applies depth range via
glDepthRange(nearz, farz).
GXSetViewportv and GXGetViewportv use matching 6-float layout.
- Notes:
- SDK internally routes
GXSetViewport through GXSetViewportJitter(..., VI_FIELD_ABOVE).
- Current backend’s
GXSetViewport path is equivalent for non-jittered (field-above) behavior.
- Result: function-level parity is correct for viewport/depth-range state semantics; no runtime code changes needed.