pub struct RdefType {
pub word: usize,
pub class: u16,
pub scalar: u16,
pub rows: u16,
pub columns: u16,
pub elements: u16,
pub members: Vec<RdefMember>,
pub name: Option<String>,
}Expand description
A variable’s type record (D3D11_SHADER_TYPE_DESC) as stored, and its members’ types.
Fields§
§word: usizeWhere the record starts, in words of the part.
class: u16D3D_SHADER_VARIABLE_CLASS: 0 scalar, 1 vector, 2 row-major matrix, 3 column-major matrix, 4 object, 5 struct.
scalar: u16D3D_SHADER_VARIABLE_TYPE.
rows: u16The matrix’s rows (1 for a scalar or vector).
columns: u16The vector’s or matrix’s columns.
elements: u16The array length; 0 where it isn’t an array.
members: Vec<RdefMember>The struct’s members, in order.
name: Option<String>The type’s name (float4, float3x4, a struct’s own name), where the layout stores one (Shader Model 5).
Implementations§
Source§impl RdefType
impl RdefType
Sourcepub fn scalar_name(&self) -> String
pub fn scalar_name(&self) -> String
D3D_SHADER_VARIABLE_TYPE as HLSL names it (float, uint, Texture2D; type and the number for one it
has no name for).
Sourcepub fn type_name(&self) -> String
pub fn type_name(&self) -> String
The type’s name as Microsoft’s disassembler writes it before a variable’s name: float4, row_major float3x4,
interface ILight. Built from the class and scalar type, as the disassembler does (the stored name of a uint
is dword); an interface’s from its stored name. A struct is struct (the disassembler opens a block of its
members instead).