naga::back::msl::writer

Struct ExpressionContext

source
struct ExpressionContext<'a> {
    function: &'a Function,
    origin: FunctionOrigin,
    info: &'a FunctionInfo,
    module: &'a Module,
    mod_info: &'a ModuleInfo,
    pipeline_options: &'a PipelineOptions,
    lang_version: (u8, u8),
    policies: BoundsCheckPolicies,
    guarded_indices: HandleSet<Expression>,
    force_loop_bounding: bool,
}

Fields§

§function: &'a Function§origin: FunctionOrigin§info: &'a FunctionInfo§module: &'a Module§mod_info: &'a ModuleInfo§pipeline_options: &'a PipelineOptions§lang_version: (u8, u8)§policies: BoundsCheckPolicies§guarded_indices: HandleSet<Expression>

The set of expressions used as indices in ReadZeroSkipWrite-policy accesses. These may need to be cached in temporary variables. See index::find_checked_indexes for details.

§force_loop_bounding: bool

Implementations§

source§

impl<'a> ExpressionContext<'a>

source

fn resolve_type(&self, handle: Handle<Expression>) -> &'a TypeInner

source

fn image_needs_lod(&self, image: Handle<Expression>) -> bool

Return true if calls to image’s read and write methods should supply a level of detail.

Only mipmapped images need to specify a level of detail. Since 1D textures cannot have mipmaps, MSL requires that the level argument to texture1d queries and accesses must be a constexpr 0. It’s easiest just to omit the level entirely for 1D textures.

source

fn choose_bounds_check_policy( &self, pointer: Handle<Expression>, ) -> BoundsCheckPolicy

source

fn access_needs_check( &self, base: Handle<Expression>, index: GuardedIndex, ) -> Option<IndexableLength>

source

fn get_packed_vec_kind(&self, expr_handle: Handle<Expression>) -> Option<Scalar>

Auto Trait Implementations§

§

impl<'a> Freeze for ExpressionContext<'a>

§

impl<'a> RefUnwindSafe for ExpressionContext<'a>

§

impl<'a> Send for ExpressionContext<'a>

§

impl<'a> Sync for ExpressionContext<'a>

§

impl<'a> Unpin for ExpressionContext<'a>

§

impl<'a> UnwindSafe for ExpressionContext<'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.