pub struct TextureWindow { /* private fields */ }Expand description
GP0(E2) texture-window state.
Mask and offset values are stored in the hardware’s 8-texel units.
TextureWindow::NONE is a no-op window. Non-zero masks let a
primitive repeat a sub-rectangle of the active tpage without
physically duplicating texels in VRAM.
Implementations§
Source§impl TextureWindow
impl TextureWindow
Sourcepub const fn new(mask_x: u8, mask_y: u8, offset_x: u8, offset_y: u8) -> Self
pub const fn new(mask_x: u8, mask_y: u8, offset_x: u8, offset_y: u8) -> Self
Build from raw GP0(E2) fields. Each value must fit in 5 bits.
Sourcepub const fn power_of_two_tile(
origin_x: u8,
origin_y: u8,
size_x: u8,
size_y: u8,
) -> Self
pub const fn power_of_two_tile( origin_x: u8, origin_y: u8, size_x: u8, size_y: u8, ) -> Self
Build a window for a power-of-two tile.
origin_* and size_* are in texels. Each origin must align to its
tile size because GP0(E2) replaces the coordinate bits selected by the
mask. The complete tile must fit in the active 256x256 texture page.
Sourcepub const fn origin_texels(self) -> [u8; 2]
pub const fn origin_texels(self) -> [u8; 2]
Texture-page origin selected by this window, in texels.
Power-of-two atlas placements use the raw offset fields as their aligned page-local origin. Exposing it lets a cooker-proven surface address the same texels directly and omit GP0(E2) from its packets.
Trait Implementations§
Source§impl Clone for TextureWindow
impl Clone for TextureWindow
Source§fn clone(&self) -> TextureWindow
fn clone(&self) -> TextureWindow
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TextureWindow
impl Debug for TextureWindow
Source§impl PartialEq for TextureWindow
impl PartialEq for TextureWindow
impl Copy for TextureWindow
impl Eq for TextureWindow
impl StructuralPartialEq for TextureWindow
Auto Trait Implementations§
impl Freeze for TextureWindow
impl RefUnwindSafe for TextureWindow
impl Send for TextureWindow
impl Sync for TextureWindow
impl Unpin for TextureWindow
impl UnsafeUnpin for TextureWindow
impl UnwindSafe for TextureWindow
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)