diff options
author | Yuri Sizov <11782833+YuriSizov@users.noreply.github.com> | 2023-05-30 15:32:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-30 15:32:04 +0200 |
commit | faa73c9fcbe3d55fc738962effc9dc40fb83b687 (patch) | |
tree | 1d5eeb703c3893af62d2d4340a4bdd70e9bff793 /servers/rendering/shader_preprocessor.cpp | |
parent | 3a895eafc0839c44f12843edf8fed60a01433968 (diff) | |
parent | 67038471ffdaf91d8385c9324698e99443c72056 (diff) | |
download | redot-engine-faa73c9fcbe3d55fc738962effc9dc40fb83b687.tar.gz |
Merge pull request #77608 from bitsawer/fix_cyclic_includes
Fix shader preprocessor cyclic include handling
Diffstat (limited to 'servers/rendering/shader_preprocessor.cpp')
-rw-r--r-- | servers/rendering/shader_preprocessor.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/servers/rendering/shader_preprocessor.cpp b/servers/rendering/shader_preprocessor.cpp index 0644f5918c..f8081cda44 100644 --- a/servers/rendering/shader_preprocessor.cpp +++ b/servers/rendering/shader_preprocessor.cpp @@ -700,7 +700,7 @@ void ShaderPreprocessor::process_include(Tokenizer *p_tokenizer) { if (!included.is_empty()) { uint64_t code_hash = included.hash64(); if (state->cyclic_include_hashes.find(code_hash)) { - set_error(RTR("Cyclic include found."), line); + set_error(RTR("Cyclic include found") + ": " + path, line); return; } } @@ -733,7 +733,7 @@ void ShaderPreprocessor::process_include(Tokenizer *p_tokenizer) { FilePosition fp; fp.file = state->current_filename; - fp.line = line; + fp.line = line + 1; state->include_positions.push_back(fp); String result; @@ -1157,6 +1157,7 @@ void ShaderPreprocessor::set_error(const String &p_error, int p_line) { if (state->error.is_empty()) { state->error = p_error; FilePosition fp; + fp.file = state->current_filename; fp.line = p_line + 1; state->include_positions.push_back(fp); } |