Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

Module prim

Module prim 

Source
Expand description

Primitive packet types for DMA-based GPU submission.

Each struct is #[repr(C)] with the tag word first – that’s the shape the DMA linked-list walker expects. The field names match the on-wire GP0 word order so a reader can cross-reference PSX-SPX without redundant decoding.

Builders (new constructors) zero the tag; crate::frame::OtFrame::add fills it in during insertion with (words_after_tag << 24) | next.

Structs§

ClassicQuadTexturedGouraud
Classic textured Gouraud quad without inline texture-window state. This is the compact GP0(3Ch) packet paired with ClassicTriTexturedGouraud. 13 words (tag + 12 data).
ClassicTriTextured
Classic flat-tinted textured triangle without an inline GP0(E2) texture-window command. Renderers that keep one texture-window state for the whole pass can use this compact GP0(24h) packet. 8 words (tag + 7 data).
ClassicTriTexturedGouraud
Classic textured Gouraud triangle without an inline GP0(E2) texture-window command. This is the compact GP0(34h) packet used by renderers that keep a single texture-window state for the whole pass. 10 words (tag + 9 data).
FillRect
VRAM fill (GP0 02h). 4 words (tag + 3 data).
LineGouraud
Gouraud-shaded single line (GP0 50h). 5 words (tag + 4 data).
LineMono
Monochrome single line. 4 words (tag + 3 data). GP0 0x40 – the real diagonal-capable line rasteriser (unlike RectFlat, which the GPU snaps to 16-pixel X boundaries in its GP0 0x02 fill).
QuadFlat
Flat-shaded quad. 6 words (tag + 5 data).
QuadGouraud
Gouraud-shaded quad. 9 words (tag + 8 data).
QuadGouraudBlended
Semi-transparent Gouraud quad with its GP0(E1) blend state embedded in the same DMA packet.
QuadTextured
Textured quad with a single flat tint. 10 words (tag + 9 data).
QuadTexturedGouraud
Textured Gouraud quad with inline texture-window state. Mirrors TriTexturedGouraud extended to four vertices: GP0(E2) texture-window state immediately followed by the GP0(3Ch) Gouraud-textured-quad command. Per-vertex RGB modulates the sampled texel exactly like the triangle. 14 words (tag + 13 data).
QuadTexturedMaterial
Textured quad with inline texture-window state. 11 words (tag + 10 data).
RectFlat
Untextured variable-size rectangle. 4 words (tag + 3 data). Ignores draw-area clip on some GPU revisions; prefer QuadFlat when you need clipping.
Sprite
Textured sprite (variable size). 5 words (tag + 4 data).
TriFlat
Flat-shaded triangle. 5 words (tag + 4 data).
TriGouraud
Gouraud-shaded triangle. 7 words (tag + 6 data).
TriTextured
Textured triangle with a single flat tint. 9 words (tag + 8 data).
TriTexturedGouraud
Textured Gouraud-shaded triangle. 11 words (tag + 10 data).

Traits§

GpuPacket
A GPU packet that can be linked into an ordering table as one DMA node.