pub fn quantize_snorm(v: f32, n: i32) -> i32
Expand description
Quantizes a float in [-1..1] range into an n-bit fixed point snorm value.
Assumes reconstruction function q / (2^(n-1)-1)
, which is the case for fixed-function normalized fixed point conversion (except early OpenGL versions).
Maximum reconstruction error: 1/2^n