diff options
author | bitsawer <sawerduster@gmail.com> | 2023-01-27 14:35:20 +0200 |
---|---|---|
committer | bitsawer <sawerduster@gmail.com> | 2023-01-27 14:37:55 +0200 |
commit | 0acaccebaf3b1dc6445f8a100a1011b89faa4216 (patch) | |
tree | 726a356904ea8162907819411a8467bad177319b /servers | |
parent | 518b9e5801a19229805fe837d7d0cf92920ad413 (diff) |
Fix several shader preprocessor include issues
Diffstat (limited to 'servers')
-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 816d937e9f..b45a7c0db3 100644 --- a/servers/rendering/shader_preprocessor.cpp +++ b/servers/rendering/shader_preprocessor.cpp @@ -674,6 +674,11 @@ void ShaderPreprocessor::process_include(Tokenizer *p_tokenizer) { return; } + path = path.simplify_path(); + if (path.is_relative_path()) { + path = state->current_filename.get_base_dir().path_join(path); + } + 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); |