#[repr(C, align(4))]pub struct QuadTexturedGouraud {Show 14 fields
pub tag: u32,
pub tex_window: u32,
pub color0_cmd: u32,
pub v0: u32,
pub uv0_clut: u32,
pub color1: u32,
pub v1: u32,
pub uv1_tpage: u32,
pub color2: u32,
pub v2: u32,
pub uv2: u32,
pub color3: u32,
pub v3: u32,
pub uv3: u32,
}Expand description
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).
The PS1 GPU rasterizes this quad as the two triangles (v0,v1,v2)
and (v1,v2,v3) – the 1-2 diagonal. A caller whose engine
splits quads on the 0-2 diagonal as tri(a,b,c)+tri(a,c,d) must
reorder its perimeter [a,b,c,d] to [b,a,c,d] before building the
packet so the hardware split lands on the same edge; that yields
pixel-identical output (proved by
textured_gouraud_quad_matches_two_triangle_split_bitexact in the
emulator GPU tests).
Fields§
§tag: u32OT linkage.
tex_window: u32GP0(E2) texture-window command.
color0_cmd: u320x3C000000 | color0 header – v0’s RGB shares the opcode word.
v0: u32Vertex 0 position.
uv0_clut: u32(u0, v0, clut) packed.
color1: u32Vertex 1 colour.
v1: u32Vertex 1 position.
uv1_tpage: u32(u1, v1, tpage) packed.
color2: u32Vertex 2 colour.
v2: u32Vertex 2 position.
uv2: u32(u2, v2, 0) packed.
color3: u32Vertex 3 colour.
v3: u32Vertex 3 position.
uv3: u32(u3, v3, 0) packed.
Implementations§
Source§impl QuadTexturedGouraud
impl QuadTexturedGouraud
Sourcepub const EMPTY: Self
pub const EMPTY: Self
Zeroed packet for static prebuilt-pool initialisation. Real content is written by the first draw of each surface before the packet ever links into an ordering table (per-surface validity bytes guarantee it).
Sourcepub const fn with_material(
verts: [(i16, i16); 4],
uvs: [(u8, u8); 4],
colors: [(u8, u8, u8); 4],
material: TextureMaterial,
) -> Self
pub const fn with_material( verts: [(i16, i16); 4], uvs: [(u8, u8); 4], colors: [(u8, u8, u8); 4], material: TextureMaterial, ) -> Self
Build a textured Gouraud quad from per-vertex UVs and a
TextureMaterial. Vertex order is TL, TR, BL, BR; each colour
tints its vertex ((128, 128, 128) leaves texels unmodulated).
Sourcepub const fn with_packet_material_packed_uv_words(
verts: [(i16, i16); 4],
uv_words: [u16; 4],
colors: [(u8, u8, u8); 4],
material: TexturedGouraudPacketMaterial,
) -> Self
pub const fn with_packet_material_packed_uv_words( verts: [(i16, i16); 4], uv_words: [u16; 4], colors: [(u8, u8, u8); 4], material: TexturedGouraudPacketMaterial, ) -> Self
Build a textured Gouraud quad from UV words and a packet material
precomputed for a hot material, mirroring
TriTexturedGouraud::with_packet_material_packed_uv_words.
Sourcepub const fn with_staged_slot_prepacked_colors(
verts: [(i16, i16); 4],
uv_words: [u16; 4],
colors: [u32; 4],
clut_high_word: u32,
tpage_high_word: u32,
texture_window_word: u32,
ot_slot: u16,
) -> Self
pub const fn with_staged_slot_prepacked_colors( verts: [(i16, i16); 4], uv_words: [u16; 4], colors: [u32; 4], clut_high_word: u32, tpage_high_word: u32, texture_window_word: u32, ot_slot: u16, ) -> Self
Build a self-contained texture-window packet whose tag temporarily
carries ot_slot for a later tagged-stream OT linking pass.
Every color word must have its high byte clear, and clut_high_word
and tpage_high_word must hold only their high halfwords; debug builds
assert both. A word that breaks this changes what the GPU draws, not
memory, so the constructor is safe.
Sourcepub const unsafe fn with_staged_slot_prepacked_unchecked(
verts: [(i16, i16); 4],
uv_words: [u16; 4],
colors: [u32; 4],
clut_high_word: u32,
tpage_high_word: u32,
texture_window_word: u32,
ot_slot: u16,
) -> Self
👎Deprecated: renamed to with_staged_slot_prepacked_colors, which is safe
pub const unsafe fn with_staged_slot_prepacked_unchecked( verts: [(i16, i16); 4], uv_words: [u16; 4], colors: [u32; 4], clut_high_word: u32, tpage_high_word: u32, texture_window_word: u32, ot_slot: u16, ) -> Self
renamed to with_staged_slot_prepacked_colors, which is safe
Renamed to Self::with_staged_slot_prepacked_colors, which is safe.
§Safety
Nothing beyond that function’s preconditions; it stays unsafe so
existing unsafe blocks keep compiling without a warning.
Sourcepub fn set_positions(&mut self, verts: [(i16, i16); 4])
pub fn set_positions(&mut self, verts: [(i16, i16); 4])
Rewrite the four vertex words of a prebuilt packet, leaving every material/UV/colour word untouched. This is the per-frame patch for precompiled static world geometry.
Sourcepub fn copy_payload_from(&mut self, source: &Self)
pub fn copy_payload_from(&mut self, source: &Self)
Copy every packet word except the OT tag from a prebuilt skeleton. The destination can then patch positions and link into an ordering table without inheriting a stale DMA link.
Sourcepub fn set_colors(&mut self, colors: [(u8, u8, u8); 4])
pub fn set_colors(&mut self, colors: [(u8, u8, u8); 4])
Rewrite the four colour words of a prebuilt packet, preserving the opcode byte that shares v0’s colour word.
Trait Implementations§
Source§impl Clone for QuadTexturedGouraud
impl Clone for QuadTexturedGouraud
Source§fn clone(&self) -> QuadTexturedGouraud
fn clone(&self) -> QuadTexturedGouraud
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QuadTexturedGouraud
impl Debug for QuadTexturedGouraud
Source§impl GpuPacket for QuadTexturedGouraud
impl GpuPacket for QuadTexturedGouraud
Source§impl Hash for QuadTexturedGouraud
impl Hash for QuadTexturedGouraud
Source§impl PartialEq for QuadTexturedGouraud
impl PartialEq for QuadTexturedGouraud
impl Copy for QuadTexturedGouraud
impl Eq for QuadTexturedGouraud
impl StructuralPartialEq for QuadTexturedGouraud
Auto Trait Implementations§
impl Freeze for QuadTexturedGouraud
impl RefUnwindSafe for QuadTexturedGouraud
impl Send for QuadTexturedGouraud
impl Sync for QuadTexturedGouraud
impl Unpin for QuadTexturedGouraud
impl UnsafeUnpin for QuadTexturedGouraud
impl UnwindSafe for QuadTexturedGouraud
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)