diff options
author | HampusM <hampus@hampusmat.com> | 2023-11-23 20:21:03 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-11-23 20:21:03 +0100 |
commit | 5b64c39b93b83a1b40e083ab448f4059bcbeea57 (patch) | |
tree | 076703bfe413fdd0812a3654b393103df4953745 | |
parent | fa46f545eb87ec8b5aba1f8bcddb4c90441e186b (diff) |
fix(engine): prevent removing newlines when deleting GLSL #version
-rw-r--r-- | engine/src/shader_preprocessor.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/engine/src/shader_preprocessor.rs b/engine/src/shader_preprocessor.rs index 479c5b1..70696ac 100644 --- a/engine/src/shader_preprocessor.rs +++ b/engine/src/shader_preprocessor.rs @@ -64,11 +64,12 @@ impl ShaderPreprocessor path: path.clone(), })?; - let mut included_lines = included.lines(); - - if let Some(first_line) = included_lines.next() { + if let Some(first_line) = included.lines().next() { if first_line.starts_with("#version") { - included = included_lines.collect(); + included = included + .chars() + .skip_while(|character| *character != '\n') + .collect(); } } |