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

Method build

crates/spirv-builder/src/lib.rs:437–453  ·  view source on GitHub ↗

Builds the module. If `print_metadata` is [`MetadataPrintout::Full`], you usually don't have to inspect the path in the result, as the environment variable for the path to the module will already be set.

(mut self)

Source from the content-addressed store, hash-verified

435 /// Builds the module. If `print_metadata` is [`MetadataPrintout::Full`], you usually don't have to inspect the path
436 /// in the result, as the environment variable for the path to the module will already be set.
437 pub fn build(mut self) -> Result<CompileResult, SpirvBuilderError> {
438 self.validate_running_conditions()?;
439 let metadata_file = invoke_rustc(&self)?;
440 match self.print_metadata {
441 MetadataPrintout::Full | MetadataPrintout::DependencyOnly => {
442 leaf_deps(&metadata_file, |artifact| {
443 println!("cargo:rerun-if-changed={artifact}");
444 })
445 // Close enough
446 .map_err(SpirvBuilderError::MetadataFileMissing)?;
447 }
448 MetadataPrintout::None => (),
449 }
450 let metadata = self.parse_metadata_file(&metadata_file)?;
451
452 Ok(metadata)
453 }
454
455 pub(crate) fn validate_running_conditions(&mut self) -> Result<(), SpirvBuilderError> {
456 if (self.print_metadata == MetadataPrintout::Full) && self.multimodule {

Callers 12

mainFunction · 0.45
compile_shadersFunction · 0.45
newMethod · 0.45
create_render_passMethod · 0.45
rebuild_pipelinesMethod · 0.45
drawMethod · 0.45
maybe_watchFunction · 0.45
startFunction · 0.45
build_shaderFunction · 0.45
mainFunction · 0.45

Calls 4

invoke_rustcFunction · 0.85
leaf_depsFunction · 0.85
parse_metadata_fileMethod · 0.80

Tested by

no test coverage detected