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

Function process

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

Recursively resolve `#include "..."` directives in `entry_path`'s source, returning the fully-expanded WGSL. Each included file is emitted exactly once even if referenced multiple times.

(
    source: &dyn ShaderSource, entry_path: &str,
)

Source from the content-addressed store, hash-verified

63/// source, returning the fully-expanded WGSL. Each included file is
64/// emitted exactly once even if referenced multiple times.
65pub fn process(
66 source: &dyn ShaderSource, entry_path: &str,
67) -> Result<String, IncludeError> {
68 let mut out = String::new();
69 let mut seen = HashSet::new();
70 expand(source, entry_path, entry_path, &mut out, &mut seen, &mut Vec::new())?;
71 Ok(out)
72}
73
74fn expand(
75 source: &dyn ShaderSource,

Calls 1

expandFunction · 0.85