pub struct Constant {
pub word: usize,
pub name: String,
pub register_set: u16,
pub register: u16,
pub count: u16,
pub reserved: u16,
pub ty: Type,
pub default: Option<Vec<u8>>,
}Expand description
A named allocation, including the original type even when optimization shortened its register range.
Fields§
§word: usizeThe word of the program that the constant’s record (D3DXSHADER_CONSTANTINFO) starts in.
name: StringThe constant’s name, from the NUL-terminated UTF-8 string its record points at.
register_set: u16D3DXREGISTER_SET: BOOL=0, INT4=1, FLOAT4=2, SAMPLER=3.
register: u16First register of the allocation (u16 at offset 6 of the constant record), in the bank register_set names.
count: u16Registers allocated (u16 at offset 8). Reading refuses 0; how many registers a bank has is the device’s and the version’s, which reading does not check.
reserved: u16Compiler-reserved word of D3DXSHADER_CONSTANTINFO. Compilers write nonzero values; it is retained verbatim and does not change the explicit register allocation.
ty: TypeThe declared type; it can be larger than count registers when the compiler shortened the allocation.
default: Option<Vec<u8>>Raw register defaults (BOOL rows are 4 bytes, other numeric rows 16); no defaults on samplers.