feat: updated engine version to 4.4-rc1

This commit is contained in:
Sara 2025-02-23 14:38:14 +01:00
parent ee00efde1f
commit 21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions

View file

@ -30,8 +30,13 @@
#include "rendering_device_binds.h"
#include "shader_include_db.h"
Error RDShaderFile::parse_versions_from_text(const String &p_text, const String p_defines, OpenIncludeFunction p_include_func, void *p_include_func_userdata) {
ERR_FAIL_NULL_V(RenderingDevice::get_singleton(), ERR_UNAVAILABLE);
ERR_FAIL_NULL_V_MSG(
RenderingDevice::get_singleton(),
ERR_UNAVAILABLE,
"Cannot import custom .glsl shaders when running without a RenderingDevice. This can happen if you are using the headless more or the Compatibility renderer.");
Vector<String> lines = p_text.split("\n");
@ -101,18 +106,18 @@ Error RDShaderFile::parse_versions_from_text(const String &p_text, const String
if (reading_versions) {
String l = line.strip_edges();
if (!l.is_empty()) {
if (!l.contains("=")) {
if (!l.contains_char('=')) {
base_error = "Missing `=` in '" + l + "'. Version syntax is `version = \"<defines with C escaping>\";`.";
break;
}
if (!l.contains(";")) {
if (!l.contains_char(';')) {
// We don't require a semicolon per se, but it's needed for clang-format to handle things properly.
base_error = "Missing `;` in '" + l + "'. Version syntax is `version = \"<defines with C escaping>\";`.";
break;
}
Vector<String> slices = l.get_slice(";", 0).split("=");
String version = slices[0].strip_edges();
if (!version.is_valid_identifier()) {
if (!version.is_valid_ascii_identifier()) {
base_error = "Version names must be valid identifiers, found '" + version + "' instead.";
break;
}
@ -141,11 +146,17 @@ Error RDShaderFile::parse_versions_from_text(const String &p_text, const String
break;
}
include = include.substr(1, include.length() - 2).strip_edges();
String include_text = p_include_func(include, p_include_func_userdata);
if (!include_text.is_empty()) {
stage_code[stage] += "\n" + include_text + "\n";
String include_code = ShaderIncludeDB::get_built_in_include_file(include);
if (!include_code.is_empty()) {
stage_code[stage] += "\n" + include_code + "\n";
} else {
base_error = "#include failed for file '" + include + "'";
String include_text = p_include_func(include, p_include_func_userdata);
if (!include_text.is_empty()) {
stage_code[stage] += "\n" + include_text + "\n";
} else {
base_error = "#include failed for file '" + include + "'.";
}
}
} else {
base_error = "#include used, but no include function provided.";