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,
)
| 63 | /// source, returning the fully-expanded WGSL. Each included file is |
| 64 | /// emitted exactly once even if referenced multiple times. |
| 65 | pub 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 | |
| 74 | fn expand( |
| 75 | source: &dyn ShaderSource, |