Skip to main content

FunctionTracer

Struct FunctionTracer 

Source
pub struct FunctionTracer<'a> {
    pub function: &'a Function,
    pub constants: &'a Arena<Constant>,
    pub overrides: &'a Arena<Override>,
    pub functions_pending: &'a mut HandleSet<Function>,
    pub functions_used: &'a mut HandleSet<Function>,
    pub types_used: &'a mut HandleSet<Type>,
    pub global_variables_used: &'a mut HandleSet<GlobalVariable>,
    pub constants_used: &'a mut HandleSet<Constant>,
    pub overrides_used: &'a mut HandleSet<Override>,
    pub global_expressions_used: &'a mut HandleSet<Expression>,
    pub expressions_used: HandleSet<Expression>,
}

Fields§

§function: &'a Function§constants: &'a Arena<Constant>§overrides: &'a Arena<Override>§functions_pending: &'a mut HandleSet<Function>§functions_used: &'a mut HandleSet<Function>§types_used: &'a mut HandleSet<Type>§global_variables_used: &'a mut HandleSet<GlobalVariable>§constants_used: &'a mut HandleSet<Constant>§overrides_used: &'a mut HandleSet<Override>§global_expressions_used: &'a mut HandleSet<Expression>§expressions_used: HandleSet<Expression>

Function-local expressions used.

Implementations§

Source§

impl FunctionTracer<'_>

Source

pub fn trace_call(&mut self, function: Handle<Function>)

Source

pub fn trace(&mut self)

Source

pub const fn as_expression(&mut self) -> ExpressionTracer<'_>

Source§

impl FunctionTracer<'_>

Source

pub fn trace_block(&mut self, block: &[Statement])

Source

pub fn trace_block_including_emits(&mut self, block: &[Statement])

Like Self::trace_block, but also mark every Emitted expression as used, whether or not anything needs its value.

Compaction only keeps values something actually needs, so trace_block ignores Emit statements. A consumer that has to account for every expression the generated code mentions, rather than every expression it needs, wants this instead: the MSL backend does no dead code elimination, so it writes out a definition for each expression it bakes whether or not anything reads it, and that definition refers to the expression’s operands.

Source

fn trace_block_impl(&mut self, block: &[Statement], emits_are_used: bool)

Source

fn trace_atomic_function(&mut self, fun: &AtomicFunction)

Source

fn trace_ray_query_function(&mut self, fun: &RayQueryFunction)

Trait Implementations§

Source§

impl From<FunctionTracer<'_>> for FunctionMap

Source§

fn from(used: FunctionTracer<'_>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for FunctionTracer<'a>

§

impl<'a> RefUnwindSafe for FunctionTracer<'a>

§

impl<'a> Send for FunctionTracer<'a>

§

impl<'a> Sync for FunctionTracer<'a>

§

impl<'a> Unpin for FunctionTracer<'a>

§

impl<'a> UnsafeUnpin for FunctionTracer<'a>

§

impl<'a> !UnwindSafe for FunctionTracer<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,