From 87e0405675072dbe20368e167871813a66d247eb Mon Sep 17 00:00:00 2001 From: chyyran Date: Tue, 17 Sep 2024 18:24:01 -0400 Subject: [PATCH] presets: properly trim shader name if given through pragma --- librashader-preprocess/src/lib.rs | 1 + librashader-preprocess/src/pragma.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/librashader-preprocess/src/lib.rs b/librashader-preprocess/src/lib.rs index dcb4df7..0f82d93 100644 --- a/librashader-preprocess/src/lib.rs +++ b/librashader-preprocess/src/lib.rs @@ -81,6 +81,7 @@ impl SourceOutput for String { pub(crate) fn load_shader_source(path: impl AsRef) -> Result { let source = read_source(path)?; let meta = pragma::parse_pragma_meta(&source)?; + let text = stage::process_stages(&source)?; let parameters = FastHashMap::from_iter(meta.parameters.into_iter().map(|p| (p.id.clone(), p))); diff --git a/librashader-preprocess/src/pragma.rs b/librashader-preprocess/src/pragma.rs index 2adf2cf..a95c0b3 100644 --- a/librashader-preprocess/src/pragma.rs +++ b/librashader-preprocess/src/pragma.rs @@ -110,12 +110,12 @@ pub(crate) fn parse_pragma_meta(source: impl AsRef) -> Result