MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / verify_abi_version

Function verify_abi_version

native/shared/src/renderer/shader_library.rs:36–48  ·  view source on GitHub ↗

Self-check: the ABI header parses to a known version. Called from Renderer::new so a bad merge is caught at startup, not at the first draw call.

(expected: u32)

Source from the content-addressed store, hash-verified

34/// Renderer::new so a bad merge is caught at startup, not at the first
35/// draw call.
36pub fn verify_abi_version(expected: u32) -> Result<(), String> {
37 let src = library();
38 let body = src.fetch("material_abi.wgsl")
39 .ok_or_else(|| "material_abi.wgsl missing from shader library".to_string())?;
40 let actual = super::shader_include::abi_version_of(body);
41 if actual != expected {
42 return Err(format!(
43 "shader ABI version mismatch: header declares {}, engine expects {}",
44 actual, expected
45 ));
46 }
47 Ok(())
48}
49
50/// The version the engine was built against. EN-012 bumped this to 2
51/// when MaterialFactors gained `shading_model` + `foliage_params`

Callers 1

Calls 3

libraryFunction · 0.85
abi_version_ofFunction · 0.85
fetchMethod · 0.80

Tested by 1