MCPcopy Create free account
hub / github.com/Rust-GPU/rust-gpu / spv_module_for_entry_point

Method spv_module_for_entry_point

examples/runners/wgpu/src/lib.rs:96–118  ·  view source on GitHub ↗
(
        &'a self,
        wanted_entry: &str,
    )

Source from the content-addressed store, hash-verified

94
95impl CompiledShaderModules {
96 fn spv_module_for_entry_point<'a>(
97 &'a self,
98 wanted_entry: &str,
99 ) -> wgpu::ShaderModuleDescriptorSpirV<'a> {
100 for (name, spv_module) in &self.named_spv_modules {
101 match name {
102 Some(name) if name != wanted_entry => continue,
103 _ => {
104 return wgpu::ShaderModuleDescriptorSpirV {
105 label: name.as_deref(),
106 source: Cow::Borrowed(&spv_module.source),
107 };
108 }
109 }
110 }
111 unreachable!(
112 "{wanted_entry:?} not found in modules {:?}",
113 self.named_spv_modules
114 .iter()
115 .map(|(name, _)| name)
116 .collect::<Vec<_>>()
117 );
118 }
119}
120
121fn maybe_watch(

Callers 2

create_pipelineFunction · 0.80
start_internalFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected