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

Function abi_version_of

native/shared/src/renderer/shader_include.rs:50–60  ·  view source on GitHub ↗

Parse the optional ABI version from a `// ABI-VERSION: N` comment at the top of a shader source. Returns 0 if absent. Used to fail pipeline creation early when a stale shader predates a header bump.

(source: &str)

Source from the content-addressed store, hash-verified

48/// at the top of a shader source. Returns 0 if absent. Used to fail
49/// pipeline creation early when a stale shader predates a header bump.
50pub fn abi_version_of(source: &str) -> u32 {
51 for line in source.lines().take(20) {
52 let trimmed = line.trim_start();
53 if let Some(rest) = trimmed.strip_prefix("// ABI-VERSION:") {
54 if let Ok(v) = rest.trim().parse::<u32>() {
55 return v;
56 }
57 }
58 }
59 0
60}
61
62/// Recursively resolve `#include "..."` directives in `entry_path`'s
63/// source, returning the fully-expanded WGSL. Each included file is

Callers 1

verify_abi_versionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected