diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-26 14:26:31 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-02-26 14:26:31 +0100 |
commit | ad32b22bdeb17b5a5a186d7e3835480b5ae34a0d (patch) | |
tree | 4b50b056f7a7408336850c70cf63dc6d9ac61249 | |
parent | 303430ef38933239250b53af1f53092a74d6afe5 (diff) | |
parent | 35c970f4f6f8d8c60b91cb86ad6cddea1c1f5753 (diff) |
Merge pull request #73975 from bitsawer/fix_preprocessor_include_check
Fix shader preprocessor include resource check
-rw-r--r-- | servers/rendering/shader_preprocessor.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/servers/rendering/shader_preprocessor.cpp b/servers/rendering/shader_preprocessor.cpp index b45a7c0db3..ff1d55f905 100644 --- a/servers/rendering/shader_preprocessor.cpp +++ b/servers/rendering/shader_preprocessor.cpp @@ -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); |