pub struct OrderedCommandStream<D: CommandStreamDma = GpuDma> { /* private fields */ }Expand description
Forward, incremental GPU command list over caller-owned static storage.
Append complete packets with Self::push_packet, then Self::submit
to overlap CPU work with GPU drawing. Call Self::flush before
immediate GP0 drawing, VRAM uploads, or framebuffer presentation. Capacity
exhaustion performs that same synchronization before reusing storage.
Dropping the stream waits for in-flight DMA and discards unsent commands.
To present through psx-rt’s queued flip, arm the draw-done flag
(crate::Gpu::arm_draw_done on the transport Self::flush returns)
before the frame’s first packet (nodes can start walking as soon as they
close) and end the frame with push_packet([gp0::REQUEST_IRQ]) and
Self::submit; see crate::is_draw_done.
Implementations§
Source§impl<D: CommandStreamDma> OrderedCommandStream<D>
impl<D: CommandStreamDma> OrderedCommandStream<D>
Sourcepub fn with_dma(words: &'static mut [u32], dma: D) -> Self
pub fn with_dma(words: &'static mut [u32], dma: D) -> Self
A stream over words, at least 17 word-aligned RAM words, driven by
dma: the GpuDma token on the console, a test double on the host.
Sourcepub fn push_packet<const N: usize>(&mut self, words: [u32; N])
pub fn push_packet<const N: usize>(&mut self, words: [u32; N])
Append one complete GP0 packet in painter order.
N must be 1..=15. Packets are never split across DMA nodes.
Sourcepub fn push_upload(
&mut self,
x: u16,
y: u16,
width: u16,
height: u16,
pixels: &[u16],
)
pub fn push_upload( &mut self, x: u16, y: u16, width: u16, height: u16, pixels: &[u16], )
Append a small A0 upload between surrounding draw commands.
Coordinates and dimensions use VRAM halfwords. The rectangle must
match pixels and fit one node (at most 24 pixels). Odd pixel counts
have a zero-padded final halfword. Large asset uploads should use the
VRAM upload helpers after Self::flush.
Trait Implementations§
Source§impl<D: CommandStreamDma> Debug for OrderedCommandStream<D>
Shows the buffer’s fill state, not its words.
impl<D: CommandStreamDma> Debug for OrderedCommandStream<D>
Shows the buffer’s fill state, not its words.