Struct HzbPyramidView
pub struct HzbPyramidView<'a> {
pub base_width: u32,
pub base_height: u32,
pub mip_texels: &'a [f32],
pub mip_slices: [(usize, u32, u32); 8],
pub mip_count: usize,
}Expand description
Lightweight zero-heap view over a 2-phase Hierarchical Z-Buffer (HZB) mip chain.
Each mip stores conservative farthest depth values in [0.0, 1.0] (max reduction
for standard [0, 1] depth where 0.0 is near and 1.0 is far).
Fields§
§base_width: u32Base mip 0 dimensions (width, height).
base_height: u32§mip_texels: &'a [f32]Packed mip texels in row-major order starting from mip 0.
mip_slices: [(usize, u32, u32); 8](offset, width, height) for up to 8 mip levels.
mip_count: usizeImplementations§
§impl<'a> HzbPyramidView<'a>
impl<'a> HzbPyramidView<'a>
pub fn sample_farthest_depth(&self, uv: [f32; 2], mip_level: usize) -> f32
pub fn sample_farthest_depth(&self, uv: [f32; 2], mip_level: usize) -> f32
Samples the conservative farthest depth at (uv_x, uv_y) in [0, 1]^2 at mip_level.
Trait Implementations§
§impl<'a> Clone for HzbPyramidView<'a>
impl<'a> Clone for HzbPyramidView<'a>
§fn clone(&self) -> HzbPyramidView<'a>
fn clone(&self) -> HzbPyramidView<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for HzbPyramidView<'a>
Auto Trait Implementations§
impl<'a> Freeze for HzbPyramidView<'a>
impl<'a> RefUnwindSafe for HzbPyramidView<'a>
impl<'a> Send for HzbPyramidView<'a>
impl<'a> Sync for HzbPyramidView<'a>
impl<'a> Unpin for HzbPyramidView<'a>
impl<'a> UnsafeUnpin for HzbPyramidView<'a>
impl<'a> UnwindSafe for HzbPyramidView<'a>
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more