pub struct SamplerUse {
pub address: [Address; 2],
pub border: Option<[f32; 4]>,
pub mip_lod_bias: Option<f32>,
pub lod: Option<[f32; 2]>,
}Expand description
What a binding’s sampler gives a texture’s sampling: the addressing along u and v, the colour a border reads, and the level-of-detail bias and level range it states.
Fields§
§address: [Address; 2]The addressing along u and v.
border: Option<[f32; 4]>The colour a coordinate outside the texture reads along an Address::Border axis; finite, and stated where an
axis is a border.
mip_lod_bias: Option<f32>Added to a computed level of detail (Filtering::Trilinear); finite.
lod: Option<[f32; 2]>The least and greatest level of detail the sampler reads: the level, its bias added, is clamped to them; finite and ordered.
Implementations§
Source§impl SamplerUse
impl SamplerUse
Sourcepub fn addressed(address: [Address; 2]) -> SamplerUse
pub fn addressed(address: [Address; 2]) -> SamplerUse
The addressing address, no border colour, no bias and no level range.
Sourcepub fn of(
state: &SamplerState,
unstated: Unstated,
) -> Result<SamplerUse, String>
pub fn of( state: &SamplerState, unstated: Unstated, ) -> Result<SamplerUse, String>
From a binding’s sampler state: its u and v addressing (an unstated axis as unstated says), its border colour,
its bias and its level range. Border addressing with no border colour is refused, as is a state that does not
verify (SamplerState::verify: a colour, bias or range that isn’t finite, a reversed range). Whether an axis
was assumed is SamplerUse::assumed.
Sourcepub fn assumed(state: &SamplerState) -> bool
pub fn assumed(state: &SamplerState) -> bool
Whether state leaves the u or v addressing unstated: what SamplerUse::of took from Unstated.