Skip to content

Gfx GX Fn GXSetLineWidth

wowjinxy edited this page Apr 9, 2026 · 2 revisions

GXSetLineWidth

  • Category: Geometry and Vertex
  • Matrix Status: Partial
  • Matrix Notes: Width units corrected to GX 1/6-pixel semantics and state is tracked; textured line offset behavior is not rasterized.
  • 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/GXSetLineWidth.html:
    • Signature matches: void GXSetLineWidth(u8 width, GXTexOffset tex_offsets).
    • Width unit is 1/6 pixel (max effective width 42.5 px at width=255).
    • tex_offsets is intended for textured wide-line corner coordinates.
  • Runtime checked in src/gx/pc_gx.c:
    • Stores width and tex_offsets in GX state (g_gx.line_width, g_gx.line_tex_offset).
    • Applies raster width via OpenGL with unit conversion: glLineWidth(width / 6.0f).
    • Wide-line texture offset behavior is tracked in state but not rasterized in backend (matches matrix Partial).

Clone this wiki locally