Skip to main content

tex_width_bits

Function tex_width_bits 

Source
pub fn tex_width_bits(width: u32) -> u32
Expand description

log2 of a resource texture’s width in texels.

width must be a power of two — every resource texture is sized from frust_gpu::TierCaps::resource_texture_dim, which is. A width that is not makes the shader’s 1 << bits reconstruction disagree with the real texture, so the precondition is checked in debug builds; release builds take the trailing-zero count as-is rather than panicking on a frame path.