pub struct Context { /* private fields */ }
Expand description
Context object with global resources for SPIR-T.
Those resources currently are:
- interners, for anything without an identity, and which can be deduplicated
- “entity” allocators, for everything else - i.e. anything with an identity
that needs to remain unique across an entire
Context
- the definition of an entity isn’t kept in the
Context
, but rather in someEntityDefs
collection somewhere in aModule
(or further nested), with only the entity indices being allocated by theContext
- the definition of an entity isn’t kept in the
- custom SPIR-V “extended instruction set” descriptions, which can be
dynamically registered, to account for any such “extended instruction set”
not covered by
spv::spec::Spec
’s built-in list (e.g. non-standard tool-specific sets), and only used for pretty-printing
Implementations§
source§impl Context
impl Context
sourcepub fn register_custom_ext_inst_set(
&self,
ext_inst_set_name: &str,
ext_inst_set_desc: ExtInstSetDesc
)
pub fn register_custom_ext_inst_set( &self, ext_inst_set_name: &str, ext_inst_set_desc: ExtInstSetDesc )
Register a custom ExtInstSetDesc
with name ext_inst_set_name
,
to be used by pretty-printing when using this Context
.
sourcepub fn get_custom_ext_inst_set_by_lowercase_name(
&self,
lowercase_ext_inst_set_name: &str
) -> Option<&ExtInstSetDesc>
pub fn get_custom_ext_inst_set_by_lowercase_name( &self, lowercase_ext_inst_set_name: &str ) -> Option<&ExtInstSetDesc>
Return a custom ExtInstSetDesc
, if one was registered on this Context
,
for this OpExtInstImport
name (required to be lowercase, due to Khronos’
choice of case insensitivity, but not checked by this function).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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