Browse Source

Merge pull request #73975 from bitsawer/fix_preprocessor_include_check

Fix shader preprocessor include resource check
Rémi Verschelde 2 năm trước cách đây
mục cha
commit
ad32b22bde
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      servers/rendering/shader_preprocessor.cpp

+ 5 - 0
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);