Skip to main content

LocalSlots

Struct LocalSlots 

Source
pub struct LocalSlots { /* private fields */ }
Expand description

Shared slot layout for all locals in one program.

Implementations§

Source§

impl LocalSlots

Source

pub fn for_program(program: &Program) -> Self

Build a slot layout from every binding site in a program.

Source

pub fn for_nodes(nodes: &[Node]) -> Self

Build a slot layout from a node slice.

Trait Implementations§

Source§

impl Debug for LocalSlots

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LocalSlots

Source§

fn default() -> LocalSlots

Returns the “default value” for a type. Read more
Source§

impl ExprVisitor for LocalSlots

Source§

type Break = Infallible

Break payload returned when traversal short-circuits.
Source§

fn visit_lit_u32( &mut self, _expr: &Expr, _value: u32, ) -> ControlFlow<Self::Break>

Integer literal (u32).
Source§

fn visit_lit_i32( &mut self, _expr: &Expr, _value: i32, ) -> ControlFlow<Self::Break>

Integer literal (i32).
Source§

fn visit_lit_f32( &mut self, _expr: &Expr, _value: f32, ) -> ControlFlow<Self::Break>

Float literal (f32).
Source§

fn visit_lit_bool( &mut self, _expr: &Expr, _value: bool, ) -> ControlFlow<Self::Break>

Bool literal.
Source§

fn visit_var(&mut self, _expr: &Expr, _name: &Ident) -> ControlFlow<Self::Break>

Variable reference.
Source§

fn visit_load( &mut self, _expr: &Expr, _buffer: &Ident, _index: &Expr, ) -> ControlFlow<Self::Break>

Buffer load (buffer[index]).
Source§

fn visit_buf_len( &mut self, _expr: &Expr, _buffer: &Ident, ) -> ControlFlow<Self::Break>

Buffer length.
Source§

fn visit_invocation_id( &mut self, _expr: &Expr, _axis: u32, ) -> ControlFlow<Self::Break>

Invocation id axis (gid.{x,y,z}).
Source§

fn visit_workgroup_id( &mut self, _expr: &Expr, _axis: u32, ) -> ControlFlow<Self::Break>

Workgroup id axis.
Source§

fn visit_local_id( &mut self, _expr: &Expr, _axis: u32, ) -> ControlFlow<Self::Break>

Local id axis within the workgroup.
Source§

fn visit_subgroup_local_id(&mut self, _expr: &Expr) -> ControlFlow<Self::Break>

Subgroup invocation id (lane index within subgroup).
Source§

fn visit_subgroup_size(&mut self, _expr: &Expr) -> ControlFlow<Self::Break>

Subgroup size.
Source§

fn visit_bin_op( &mut self, _expr: &Expr, _op: &BinOp, _left: &Expr, _right: &Expr, ) -> ControlFlow<Self::Break>

Binary operation.
Source§

fn visit_un_op( &mut self, _expr: &Expr, _op: &UnOp, _operand: &Expr, ) -> ControlFlow<Self::Break>

Unary operation.
Source§

fn visit_call( &mut self, _expr: &Expr, _op_id: &str, _args: &[Expr], ) -> ControlFlow<Self::Break>

Function call.
Source§

fn visit_sequence(&mut self, _parts: &[Expr]) -> ControlFlow<Self::Break>

Sequence-valued extension hook. Read more
Source§

fn visit_fma( &mut self, _expr: &Expr, _a: &Expr, _b: &Expr, _c: &Expr, ) -> ControlFlow<Self::Break>

Fused multiply-add (a * b + c).
Source§

fn visit_select( &mut self, _expr: &Expr, _cond: &Expr, _true_val: &Expr, _false_val: &Expr, ) -> ControlFlow<Self::Break>

Ternary select(cond, true_val, false_val).
Source§

fn visit_cast( &mut self, _expr: &Expr, _target: &DataType, _value: &Expr, ) -> ControlFlow<Self::Break>

Numeric cast.
Source§

fn visit_atomic( &mut self, _expr: &Expr, _op: &AtomicOp, _buffer: &Ident, _index: &Expr, _expected: Option<&Expr>, _value: &Expr, ) -> ControlFlow<Self::Break>

Atomic operation on a shared buffer.
Source§

fn visit_subgroup_ballot( &mut self, _expr: &Expr, _cond: &Expr, ) -> ControlFlow<Self::Break>

Subgroup ballot.
Source§

fn visit_subgroup_shuffle( &mut self, _expr: &Expr, _value: &Expr, _lane: &Expr, ) -> ControlFlow<Self::Break>

Subgroup shuffle.
Source§

fn visit_subgroup_add( &mut self, _expr: &Expr, _value: &Expr, ) -> ControlFlow<Self::Break>

Subgroup add.
Source§

fn visit_opaque_expr( &mut self, _expr: &Expr, _extension: &(dyn ExprNode + 'static), ) -> ControlFlow<Self::Break>

Downstream opaque expression extension.
Source§

fn walk_children_default( &mut self, expr: &Expr, order: VisitOrder, ) -> ControlFlow<Self::Break>
where Self: Sized,

Recursively walk this expression’s children using the requested order.
Source§

impl NodeVisitor for LocalSlots

Source§

type Break = Infallible

Break payload returned when traversal short-circuits.
Source§

fn visit_let( &mut self, _: &Node, name: &Ident, value: &Expr, ) -> ControlFlow<Self::Break>

Variable declaration.
Source§

fn visit_assign( &mut self, _: &Node, _: &Ident, value: &Expr, ) -> ControlFlow<Self::Break>

Variable assignment.
Source§

fn visit_store( &mut self, _: &Node, _: &Ident, index: &Expr, value: &Expr, ) -> ControlFlow<Self::Break>

Buffer store.
Source§

fn visit_if( &mut self, _: &Node, cond: &Expr, _: &[Node], _: &[Node], ) -> ControlFlow<Self::Break>

Conditional branch.
Source§

fn visit_loop( &mut self, _: &Node, var: &Ident, from: &Expr, to: &Expr, _: &[Node], ) -> ControlFlow<Self::Break>

Counted loop.
Source§

fn visit_indirect_dispatch( &mut self, _: &Node, _: &Ident, _: u64, ) -> ControlFlow<Self::Break>

Indirect dispatch source.
Source§

fn visit_async_load( &mut self, _: &Node, _: &Ident, _: &Ident, offset: &Expr, size: &Expr, _: &Ident, ) -> ControlFlow<Self::Break>

Async load node.
Source§

fn visit_async_store( &mut self, _: &Node, _: &Ident, _: &Ident, offset: &Expr, size: &Expr, _: &Ident, ) -> ControlFlow<Self::Break>

Async store node.
Source§

fn visit_async_wait(&mut self, _: &Node, _: &Ident) -> ControlFlow<Self::Break>

Async wait node.
Source§

fn visit_trap( &mut self, _: &Node, address: &Expr, _: &Ident, ) -> ControlFlow<Self::Break>

Trap node.
Source§

fn visit_resume(&mut self, _: &Node, _: &Ident) -> ControlFlow<Self::Break>

Resume node.
Source§

fn visit_return(&mut self, _: &Node) -> ControlFlow<Self::Break>

Return node.
Source§

fn visit_barrier(&mut self, _: &Node) -> ControlFlow<Self::Break>

Barrier node.
Source§

fn visit_block(&mut self, _: &Node, _: &[Node]) -> ControlFlow<Self::Break>

Block node.
Source§

fn visit_region( &mut self, _: &Node, _: &Ident, _: &Option<GeneratorRef>, _: &[Node], ) -> ControlFlow<Self::Break>

Region wrapper node.
Source§

fn visit_opaque_node( &mut self, _: &Node, _: &dyn NodeExtension, ) -> ControlFlow<Self::Break>

Downstream opaque node extension.
Source§

fn walk_children_default( &mut self, node: &Node, order: VisitOrder, ) -> ControlFlow<Self::Break>
where Self: Sized,

Recursively walk this node’s nested node children using the requested order.

Auto Trait Implementations§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more