mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix several shader preprocessor include issues
This commit is contained in:
parent
518b9e5801
commit
0acaccebaf
6 changed files with 36 additions and 4 deletions
|
|
@ -383,11 +383,12 @@ void ShaderTextEditor::_code_complete_script(const String &p_code, List<ScriptLa
|
|||
List<ScriptLanguage::CodeCompletionOption> pp_defines;
|
||||
ShaderPreprocessor preprocessor;
|
||||
String code;
|
||||
complete_from_path = (shader.is_valid() ? shader->get_path() : shader_inc->get_path()).get_base_dir();
|
||||
String resource_path = (shader.is_valid() ? shader->get_path() : shader_inc->get_path());
|
||||
complete_from_path = resource_path.get_base_dir();
|
||||
if (!complete_from_path.ends_with("/")) {
|
||||
complete_from_path += "/";
|
||||
}
|
||||
preprocessor.preprocess(p_code, "", code, nullptr, nullptr, nullptr, nullptr, &pp_options, &pp_defines, _complete_include_paths);
|
||||
preprocessor.preprocess(p_code, resource_path, code, nullptr, nullptr, nullptr, nullptr, &pp_options, &pp_defines, _complete_include_paths);
|
||||
complete_from_path = String();
|
||||
if (pp_options.size()) {
|
||||
for (const ScriptLanguage::CodeCompletionOption &E : pp_options) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue