Enum naga::back::spv::LookupType
source · enum LookupType {
Handle(Handle<Type>),
Local(LocalType),
}
Expand description
A type encountered during SPIR-V generation.
In the process of writing SPIR-V, we need to synthesize various types for intermediate results and such: pointer types, vector/matrix component types, or even booleans, which usually appear in SPIR-V code even when they’re not used by the module source.
However, we can’t use crate::Type
or crate::TypeInner
for these, as the
type arena may not contain what we need (it only contains types used
directly by other parts of the IR), and the IR module is immutable, so we
can’t add anything to it.
So for local use in the SPIR-V writer, we use this type, which holds either
a handle into the arena, or a LocalType
containing something synthesized
locally.
This is very similar to the proc::TypeResolution
enum, with LocalType
playing the role of TypeInner
. However, LocalType
also has other
properties needed for SPIR-V generation; see the description of
LocalType
for details.
Variants§
Trait Implementations§
source§impl Clone for LookupType
impl Clone for LookupType
source§fn clone(&self) -> LookupType
fn clone(&self) -> LookupType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for LookupType
impl Debug for LookupType
source§impl From<LocalType> for LookupType
impl From<LocalType> for LookupType
source§impl Hash for LookupType
impl Hash for LookupType
source§impl PartialEq for LookupType
impl PartialEq for LookupType
source§fn eq(&self, other: &LookupType) -> bool
fn eq(&self, other: &LookupType) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for LookupType
impl Eq for LookupType
impl StructuralPartialEq for LookupType
Auto Trait Implementations§
impl Freeze for LookupType
impl RefUnwindSafe for LookupType
impl Send for LookupType
impl Sync for LookupType
impl Unpin for LookupType
impl UnwindSafe for LookupType
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.