Skip to main content

SpirVOp

Enum SpirVOp 

Source
pub enum SpirVOp {
Show 101 variants Variable(StorageClass), Load, Store, AccessChain, CopyObject, IAdd, ISub, IMul, SDiv, UDiv, SMod, UMod, SNegate, FAdd, FSub, FMul, FDiv, FMod, FNegate, FRem, IEqual, INotEqual, SLessThan, SLessThanEqual, SGreaterThan, ULessThan, FOrdEqual, FOrdLessThan, FOrdGreaterThan, LogicalAnd, LogicalOr, LogicalNot, LogicalEqual, BitwiseAnd, BitwiseOr, BitwiseXor, Not, ShiftLeftLogical, ShiftRightLogical, ShiftRightArithmetic, ConvertFToS, ConvertFToU, ConvertSToF, ConvertUToF, FConvert, SConvert, UConvert, Bitcast, CompositeConstruct, CompositeExtract, CompositeInsert, VectorShuffle, VectorExtractDynamic, VectorInsertDynamic, MatrixTimesVector, VectorTimesMatrix, MatrixTimesMatrix, MatrixTimesScalar, Dot, OuterProduct, Transpose, Label, Branch, BranchConditional, Switch, Return, ReturnValue, Unreachable, Phi, LoopMerge, SelectionMerge, Function, FunctionParameter, FunctionEnd, FunctionCall, ImageSampleImplicitLod, ImageSampleExplicitLod, ImageLoad, ImageStore, AtomicLoad, AtomicStore, AtomicIAdd, AtomicISub, AtomicCompareExchange, ExtInstGlsl(GlslStd450Op), Capability(SpirVCapability), Extension(String), ExtInstImport(String), MemoryModel(AddressingModel, MemoryModel), EntryPoint(ExecutionModel, String), ExecutionMode(ExecutionMode), Decorate(Decoration), MemberDecorate(u32, Decoration), Name(String), Constant(u64), ConstantComposite, ConstantTrue, ConstantFalse, TypeForwardPointer(StorageClass), ControlBarrier, MemoryBarrier,
}
Expand description

SPIR-V opcodes (a representative subset).

Each variant corresponds to a SPIR-V instruction from the specification. Numeric opcode values follow the SPIR-V 1.6 spec (Table 1).

Variants§

§

Variable(StorageClass)

OpVariable: declare a variable with storage class

§

Load

OpLoad: load from a pointer

§

Store

OpStore: store to a pointer

§

AccessChain

OpAccessChain: compute a pointer into a composite

§

CopyObject

OpCopyObject: copy a value

§

IAdd

OpIAdd: integer addition

§

ISub

OpISub: integer subtraction

§

IMul

OpIMul: integer multiplication

§

SDiv

OpSDiv: signed integer division

§

UDiv

OpUDiv: unsigned integer division

§

SMod

OpSMod: signed modulo

§

UMod

OpUMod: unsigned modulo

§

SNegate

OpSNegate: signed negation

§

FAdd

OpFAdd: float addition

§

FSub

OpFSub: float subtraction

§

FMul

OpFMul: float multiplication

§

FDiv

OpFDiv: float division

§

FMod

OpFMod: float modulo

§

FNegate

OpFNegate: float negation

§

FRem

OpFRem: float remainder

§

IEqual

OpIEqual: integer equality

§

INotEqual

OpINotEqual: integer inequality

§

SLessThan

OpSLessThan: signed less-than

§

SLessThanEqual

OpSLessThanEqual: signed less-than-or-equal

§

SGreaterThan

OpSGreaterThan: signed greater-than

§

ULessThan

OpULessThan: unsigned less-than

§

FOrdEqual

OpFOrdEqual: float ordered equal

§

FOrdLessThan

OpFOrdLessThan: float ordered less-than

§

FOrdGreaterThan

OpFOrdGreaterThan: float ordered greater-than

§

LogicalAnd

OpLogicalAnd: logical and

§

LogicalOr

OpLogicalOr: logical or

§

LogicalNot

OpLogicalNot: logical not

§

LogicalEqual

OpLogicalEqual: logical equality

§

BitwiseAnd

OpBitwiseAnd: bitwise and

§

BitwiseOr

OpBitwiseOr: bitwise or

§

BitwiseXor

OpBitwiseXor: bitwise xor

§

Not

OpNot: bitwise not

§

ShiftLeftLogical

OpShiftLeftLogical: logical shift left

§

ShiftRightLogical

OpShiftRightLogical: logical shift right

§

ShiftRightArithmetic

OpShiftRightArithmetic: arithmetic shift right

§

ConvertFToS

OpConvertFToS: float-to-signed-int

§

ConvertFToU

OpConvertFToU: float-to-unsigned-int

§

ConvertSToF

OpConvertSToF: signed-int-to-float

§

ConvertUToF

OpConvertUToF: unsigned-int-to-float

§

FConvert

OpFConvert: float-to-float conversion

§

SConvert

OpSConvert: signed integer bit-width conversion

§

UConvert

OpUConvert: unsigned integer bit-width conversion

§

Bitcast

OpBitcast: reinterpret bits as another type

§

CompositeConstruct

OpCompositeConstruct: build a vector/matrix/struct/array

§

CompositeExtract

OpCompositeExtract: extract a component from a composite

§

CompositeInsert

OpCompositeInsert: insert a value into a composite

§

VectorShuffle

OpVectorShuffle: permute vector components

§

VectorExtractDynamic

OpVectorExtractDynamic: extract at runtime index

§

VectorInsertDynamic

OpVectorInsertDynamic: insert at runtime index

§

MatrixTimesVector

OpMatrixTimesVector: mat * vec

§

VectorTimesMatrix

OpVectorTimesMatrix: vec * mat

§

MatrixTimesMatrix

OpMatrixTimesMatrix: mat * mat

§

MatrixTimesScalar

OpMatrixTimesScalar: mat * scalar

§

Dot

OpDot: dot product of two vectors

§

OuterProduct

OpOuterProduct: outer product of two vectors

§

Transpose

OpTranspose: matrix transpose

§

Label

OpLabel: basic block label

§

Branch

OpBranch: unconditional branch

§

BranchConditional

OpBranchConditional: conditional branch

§

Switch

OpSwitch: switch on integer

§

Return

OpReturn: return from function with void

§

ReturnValue

OpReturnValue: return a value

§

Unreachable

OpUnreachable: mark unreachable code

§

Phi

OpPhi: SSA phi node

§

LoopMerge

OpLoopMerge: loop structure hint

§

SelectionMerge

OpSelectionMerge: selection structure hint

§

Function

OpFunction: begin a function definition

§

FunctionParameter

OpFunctionParameter: declare a parameter

§

FunctionEnd

OpFunctionEnd: end a function definition

§

FunctionCall

OpFunctionCall: call a function

§

ImageSampleImplicitLod

OpImageSampleImplicitLod: sample image with implicit LOD

§

ImageSampleExplicitLod

OpImageSampleExplicitLod: sample image with explicit LOD

§

ImageLoad

OpImageLoad: load from a storage image

§

ImageStore

OpImageStore: store to a storage image

§

AtomicLoad

OpAtomicLoad: atomic load

§

AtomicStore

OpAtomicStore: atomic store

§

AtomicIAdd

OpAtomicIAdd: atomic integer add

§

AtomicISub

OpAtomicISub: atomic integer subtract

§

AtomicCompareExchange

OpAtomicCompareExchange: compare and swap

§

ExtInstGlsl(GlslStd450Op)

OpExtInst (GLSLstd450) — standard math functions

§

Capability(SpirVCapability)

OpCapability: declare a SPIR-V capability

§

Extension(String)

OpExtension: import a SPIR-V extension

§

ExtInstImport(String)

OpExtInstImport: import extended instruction set

§

MemoryModel(AddressingModel, MemoryModel)

OpMemoryModel: set addressing + memory model

§

EntryPoint(ExecutionModel, String)

OpEntryPoint: declare a shader entry point

§

ExecutionMode(ExecutionMode)

OpExecutionMode: declare execution mode for entry point

§

Decorate(Decoration)

OpDecorate: decorate an ID with metadata

§

MemberDecorate(u32, Decoration)

OpMemberDecorate: decorate a struct member

§

Name(String)

OpName: assign debug name to an ID

§

Constant(u64)

OpConstant: scalar constant value

§

ConstantComposite

OpConstantComposite: composite constant

§

ConstantTrue

OpConstantTrue: boolean true

§

ConstantFalse

OpConstantFalse: boolean false

§

TypeForwardPointer(StorageClass)

OpTypeForwardPointer: forward declaration of pointer type

§

ControlBarrier

OpControlBarrier: synchronization barrier

§

MemoryBarrier

OpMemoryBarrier: memory barrier

Trait Implementations§

Source§

impl Clone for SpirVOp

Source§

fn clone(&self) -> SpirVOp

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SpirVOp

Source§

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

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

impl Display for SpirVOp

Source§

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

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

impl PartialEq for SpirVOp

Source§

fn eq(&self, other: &SpirVOp) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for SpirVOp

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.