Skip to main content

Instruction

Struct Instruction 

Source
pub struct Instruction {
Show 23 fields pub offset: usize, pub size: usize, pub opcode: Opcode, pub words: [u32; 4], pub end: bool, pub destination: Register, pub write_mask: u8, pub no_destination: bool, pub update_condition: bool, pub condition_destination: u8, pub predicate: Predicate, pub saturate: bool, pub precision: u8, pub expand_texture: bool, pub texture_unit: Option<u8>, pub sources: Vec<Source>, pub constant: Option<[u32; 4]>, pub source_precision: [u8; 3], pub scale: u8, pub indexed_input: bool, pub input_address: u16, pub interpolant_flag: bool, pub control: Option<Control>,
}
Expand description

A decoded instruction.

Fields§

§offset: usize

The byte offset of the instruction’s first slot.

§size: usize

Its size in bytes: 16, or 32 with an inline constant.

§opcode: Opcode

The opcode.

§words: [u32; 4]

Rotated words, including fields not interpreted here.

§end: bool

The instruction is the last of the program.

§destination: Register

The destination register.

§write_mask: u8

The components written, bit 0 x to bit 3 w.

§no_destination: bool

The result goes to the condition code only.

§update_condition: bool

The instruction updates a condition-code register.

§condition_destination: u8

Which condition-code register it updates.

§predicate: Predicate

The condition under which it executes.

§saturate: bool

The result is clamped to 0 to 1.

§precision: u8

The result precision code, as stored.

§expand_texture: bool

The texture lookup expands its result (the signed-range flag), as stored.

§texture_unit: Option<u8>

The texture unit a sampling instruction reads.

§sources: Vec<Source>

The sources, as many as the opcode reads.

§constant: Option<[u32; 4]>

The inline constant of the slot after the instruction, as IEEE bits.

§source_precision: [u8; 3]

Encoded modifiers for each source, and the result scale, retained without floating-point evaluation.

§scale: u8

The result scale code, as stored.

§indexed_input: bool

The inputs are addressed indirectly (bit 30 of the last operand word). Clear in every instruction of the fragment programs on the disc.

§input_address: u16

Bits 19 to 29 of the last operand word, as stored. Bits 21 to 29 are all ones on every instruction of the disc’s programs that reads an interpolant and zero on every other; bits 19 and 20 are always zero. It is not an address in any of them.

§interpolant_flag: bool

Bit 31 of the last operand word, as stored: a flag of the interpolant the instruction reads (always clear where it reads none). Within one program every read of one interpolant has the same value in 17,689 of the disc’s 17,691 (program, interpolant) pairs; it is clear on all 10,409 texture lookups’ coordinates (texture coordinates 0 and 1) and set on most of the reads of texture coordinates 4 to 7. What it selects is not established: a program’s parameter table names no varying, so the sense (perspective-corrected or not) is not tied to any data, and it is read as the bit it is.

§control: Option<Control>

What a flow-control instruction does.

Trait Implementations§

Source§

impl Clone for Instruction

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Instruction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Instruction

Source§

impl PartialEq for Instruction

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Instruction

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.