pub struct TextureRead {
pub word: usize,
pub opcode: u16,
pub texture: u32,
pub texture_indexed: bool,
pub texture_space: Option<u32>,
pub sampler: Option<u32>,
pub sampler_indexed: bool,
pub sampler_space: Option<u32>,
pub comparison: bool,
pub sampler_mode: Option<u32>,
}Expand description
One instruction of a program that reads a texture (a shader resource view, t<n>).
Fields§
§word: usizeThe instruction’s first word in the token stream.
opcode: u16The instruction’s opcode (see crate::opcode_name).
texture: u32The number of the t register, or the constant part of its index where TextureRead::texture_indexed. In
Shader Model 5.1 the register of the declared range the instruction reads, as fxc’s disassembly gives it.
texture_indexed: boolThe texture register is indexed by a register (t[r1.x + 3]).
texture_space: Option<u32>The texture’s register space: 0 before Shader Model 5.1; in 5.1 its declaration’s, None where the program
declares no texture of the id the instruction names.
sampler: Option<u32>The number of the s register the instruction samples with; none for a load, which uses no sampler.
sampler_indexed: boolThe sampler register is indexed by a register.
sampler_space: Option<u32>The sampler’s register space, as TextureRead::texture_space gives the texture’s; none without a sampler.
comparison: boolThe instruction compares the sampled value with a reference (sample_c, sample_c_lz, gather4_c,
gather4_po_c and the feedback forms of them).
sampler_mode: Option<u32>How the program declares the sampler (dcl_sampler): 0 default, 1 comparison, 2 mono; none where the program
declares no sampler of that number (or the instruction has no sampler).