mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Fix shader preprocessor cyclic include handling
This commit is contained in:
parent
1ae0bb0e8f
commit
67038471ff
3 changed files with 19 additions and 17 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue