pub enum InputSource {
Color0,
TexCoord(u8),
Other(u8),
}Expand description
The interpolant an input operand reads, from its 4-bit input index (SourceKind::Input).
On the programs of Tony Hawk’s SHRED (3,267 distinct fragment programs) the indices read are 1 (9 programs), 4 to 11
and 13. Index 4 + k is texture coordinate set k: the program header’s tex_coords_input_mask has bit k set
exactly when index 4 + k is read, in all 3,267 programs for k 0 to 7 and 9 (k 8 is never read and its bit is
never set). Index 1 is the first colour: the header’s attribute_input_mask has bits 0 and 2 set in the nine
programs that read it. Indices 0, 2, 3, 12 and 14 are never read there: InputSource::TexCoord names 12 by the
same rule, the other four are left as InputSource::Other.
Variants§
Color0
Input index 1, the first colour.
TexCoord(u8)
Input index 4 + k, texture coordinate set k (0 to 9).
Other(u8)
An index that is neither (0, 2, 3, 14, 15 and the 4-bit values nothing names).
Implementations§
Source§impl InputSource
impl InputSource
Sourcepub fn from_index(index: u8) -> Self
pub fn from_index(index: u8) -> Self
The interpolant input index index (the 4-bit field of the instruction) reads.
Sourcepub fn index(self) -> u8
pub fn index(self) -> u8
The input index of this interpolant: the inverse of InputSource::from_index.