summaryrefslogtreecommitdiff
path: root/engine/src/shader_preprocessor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/shader_preprocessor.rs')
-rw-r--r--engine/src/shader_preprocessor.rs9
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();
}
}