Enum naga::Expression [−][src]
pub enum Expression {}Show variants
Access { base: Handle<Expression>, index: Handle<Expression>, }, AccessIndex { base: Handle<Expression>, index: u32, }, Constant(Handle<Constant>), Splat { size: VectorSize, value: Handle<Expression>, }, Swizzle { size: VectorSize, vector: Handle<Expression>, pattern: [SwizzleComponent; 4], }, Compose { ty: Handle<Type>, components: Vec<Handle<Expression>>, }, FunctionArgument(u32), GlobalVariable(Handle<GlobalVariable>), LocalVariable(Handle<LocalVariable>), Load { pointer: Handle<Expression>, }, ImageSample { image: Handle<Expression>, sampler: Handle<Expression>, coordinate: Handle<Expression>, array_index: Option<Handle<Expression>>, offset: Option<Handle<Constant>>, level: SampleLevel, depth_ref: Option<Handle<Expression>>, }, ImageLoad { image: Handle<Expression>, coordinate: Handle<Expression>, array_index: Option<Handle<Expression>>, index: Option<Handle<Expression>>, }, ImageQuery { image: Handle<Expression>, query: ImageQuery, }, Unary { op: UnaryOperator, expr: Handle<Expression>, }, Binary { op: BinaryOperator, left: Handle<Expression>, right: Handle<Expression>, }, Select { condition: Handle<Expression>, accept: Handle<Expression>, reject: Handle<Expression>, }, Derivative { axis: DerivativeAxis, expr: Handle<Expression>, }, Relational { fun: RelationalFunction, argument: Handle<Expression>, }, Math { fun: MathFunction, arg: Handle<Expression>, arg1: Option<Handle<Expression>>, arg2: Option<Handle<Expression>>, }, As { expr: Handle<Expression>, kind: ScalarKind, convert: bool, }, Call(Handle<Function>), ArrayLength(Handle<Expression>),
Expand description
An expression that can be evaluated to obtain a value.
This is a Single Static Assignment (SSA) scheme similar to SPIR-V.
Variants
Array access with a computed index.
Show fields
Fields of Access
base: Handle<Expression>
index: Handle<Expression>
Array access with a known index.
Show fields
Fields of AccessIndex
base: Handle<Expression>
index: u32
Constant value.
Splat scalar into a vector.
Show fields
Fields of Splat
size: VectorSize
value: Handle<Expression>
Vector swizzle.
Show fields
Fields of Swizzle
Composite expression.
Show fields
Fields of Compose
ty: Handle<Type>
components: Vec<Handle<Expression>>
FunctionArgument(u32)
Reference a function parameter, by its index.
GlobalVariable(Handle<GlobalVariable>)
Reference a global variable.
LocalVariable(Handle<LocalVariable>)
Reference a local variable.
Load a value indirectly.
Show fields
Fields of Load
pointer: Handle<Expression>
Sample a point from a sampled or a depth image.
Show fields
Fields of ImageSample
image: Handle<Expression>
sampler: Handle<Expression>
coordinate: Handle<Expression>
array_index: Option<Handle<Expression>>
offset: Option<Handle<Constant>>
level: SampleLevel
depth_ref: Option<Handle<Expression>>
Load a texel from an image.
Show fields
Fields of ImageLoad
image: Handle<Expression>
coordinate: Handle<Expression>
array_index: Option<Handle<Expression>>
index: Option<Handle<Expression>>
For storage images, this is None. For sampled images, this is the Some(Level). For multisampled images, this is Some(Sample).
Query information from an image.
Show fields
Fields of ImageQuery
image: Handle<Expression>
query: ImageQuery
Apply an unary operator.
Show fields
Fields of Unary
op: UnaryOperator
expr: Handle<Expression>
Apply a binary operator.
Show fields
Fields of Binary
Select between two values based on a condition.
Show fields
Fields of Select
condition: Handle<Expression>
Boolean expression
accept: Handle<Expression>
reject: Handle<Expression>
Compute the derivative on an axis.
Show fields
Fields of Derivative
axis: DerivativeAxis
expr: Handle<Expression>
Call a relational function.
Show fields
Fields of Relational
fun: RelationalFunction
argument: Handle<Expression>
Call a math function
Show fields
Fields of Math
fun: MathFunction
arg: Handle<Expression>
arg1: Option<Handle<Expression>>
arg2: Option<Handle<Expression>>
Cast a simply type to another kind.
Show fields
Fields of As
expr: Handle<Expression>
Source expression, which can only be a scalar or a vector.
kind: ScalarKind
Target scalar kind.
convert: bool
True = conversion needs to take place; False = bitcast.
Result of calling another function.
ArrayLength(Handle<Expression>)
Get the length of an array. The expression must resolve to a pointer to an array with a dynamic size.
This doesn’t match the semantics of spirv’s OpArrayLength
, which must be passed
a pointer to a structure containing a runtime array in its’ last field.
Implementations
impl Expression
[src]
impl Expression
[src]pub fn needs_pre_emit(&self) -> bool
[src]
pub fn needs_pre_emit(&self) -> bool
[src]Returns true if the expression is considered emitted at the start of a function.
Trait Implementations
impl Clone for Expression
[src]
impl Clone for Expression
[src]fn clone(&self) -> Expression
[src]
fn clone(&self) -> Expression
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for Expression
[src]
impl Debug for Expression
[src]impl<'de> Deserialize<'de> for Expression
[src]
impl<'de> Deserialize<'de> for Expression
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl Serialize for Expression
[src]
impl Serialize for Expression
[src]Auto Trait Implementations
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,