feat: updated engine

This commit is contained in:
Sara Gerretsen 2026-07-10 17:04:34 +02:00
parent cbe99774ff
commit f4cf6b3999
6607 changed files with 910135 additions and 430025 deletions

View file

@ -35,13 +35,13 @@
#include "modules/glslang/shader_compile.h"
#endif
#include "shader_include_db.h"
#include "servers/rendering/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) {
Vector<String> lines = p_text.split("\n");
bool reading_versions = false;
bool stage_found[RD::SHADER_STAGE_MAX] = { false, false, false, false, false };
bool stage_found[RD::SHADER_STAGE_MAX] = {};
RD::ShaderStage stage = RD::SHADER_STAGE_MAX;
static const char *stage_str[RD::SHADER_STAGE_MAX] = {
"vertex",
@ -49,6 +49,11 @@ Error RDShaderFile::parse_versions_from_text(const String &p_text, const String
"tesselation_control",
"tesselation_evaluation",
"compute",
"raygen",
"any_hit",
"closest_hit",
"miss",
"intersection",
};
String stage_code[RD::SHADER_STAGE_MAX];
int stages_found = 0;
@ -193,7 +198,7 @@ Error RDShaderFile::parse_versions_from_text(const String &p_text, const String
code = code.replace("VERSION_DEFINES", E.value);
String error;
#ifdef MODULE_GLSLANG_ENABLED
Vector<uint8_t> spirv = compile_glslang_shader(RD::ShaderStage(i), ShaderIncludeDB::parse_include_files(code), RD::SHADER_LANGUAGE_VULKAN_VERSION_1_1, RD::SHADER_SPIRV_VERSION_1_3, &error);
Vector<uint8_t> spirv = compile_glslang_shader(RD::ShaderStage(i), ShaderIncludeDB::parse_include_files(code), RD::SHADER_LANGUAGE_VULKAN_VERSION_1_1, RD::SHADER_SPIRV_VERSION_1_4, &error);
bytecode->set_stage_bytecode(RD::ShaderStage(i), spirv);
#else
error = "Shader compilation is not supported because glslang was not enabled.";