Skip to content

Commit

Permalink
Merge pull request #73975 from bitsawer/fix_preprocessor_include_check
Browse files Browse the repository at this point in the history
Fix shader preprocessor include resource check
  • Loading branch information
akien-mga committed Feb 26, 2023
2 parents 303430e + 35c970f commit ad32b22
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions servers/rendering/shader_preprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,11 @@ void ShaderPreprocessor::process_include(Tokenizer *p_tokenizer) {
path = state->current_filename.get_base_dir().path_join(path);
}

if (!ResourceLoader::exists(path)) {
set_error(RTR("Shader include file does not exist: ") + path, line);
return;
}

Ref<Resource> res = ResourceLoader::load(path);
if (res.is_null()) {
set_error(RTR("Shader include load failed. Does the shader include exist? Is there a cyclic dependency?"), line);
Expand Down

0 comments on commit ad32b22

Please sign in to comment.