Struct spirq_core::constant::Constant
source · pub struct Constant {
pub name: Option<String>,
pub ty: Type,
pub value: ConstantValue,
pub spec_id: Option<SpecId>,
}Expand description
Constant or specialization constant record.
Fields§
§name: Option<String>§ty: TypeType of constant.
value: ConstantValueDefined value of constant, or default value of specialization constant.
spec_id: Option<SpecId>Specialization constant ID, notice that this is NOT an instruction ID. It is used to identify specialization constants for graphics libraries.
Implementations§
source§impl Constant
impl Constant
sourcepub fn new(name: Option<String>, ty: Type, value: ConstantValue) -> Self
pub fn new(name: Option<String>, ty: Type, value: ConstantValue) -> Self
Create a constant record with name, type and value. ty must be a
ScalarType.
sourcepub fn new_itm(ty: Type, value: ConstantValue) -> Self
pub fn new_itm(ty: Type, value: ConstantValue) -> Self
Create an intermediate constant record with type and value. Intermediate constants don’t have names because they contribute to subexpressions in arithmetic.
Trait Implementations§
source§impl PartialEq for Constant
impl PartialEq for Constant
impl Eq for Constant
impl StructuralEq for Constant
impl StructuralPartialEq for Constant
Auto Trait Implementations§
impl RefUnwindSafe for Constant
impl Send for Constant
impl Sync for Constant
impl Unpin for Constant
impl UnwindSafe for Constant
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more