feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -78,8 +78,8 @@ Config::Config() {
#endif
bptc_supported = extensions.has("GL_ARB_texture_compression_bptc") || extensions.has("EXT_texture_compression_bptc");
astc_supported = extensions.has("GL_KHR_texture_compression_astc") || extensions.has("GL_OES_texture_compression_astc") || extensions.has("GL_KHR_texture_compression_astc_ldr") || extensions.has("GL_KHR_texture_compression_astc_hdr");
astc_hdr_supported = extensions.has("GL_KHR_texture_compression_astc_hdr");
astc_supported = astc_hdr_supported || extensions.has("GL_KHR_texture_compression_astc") || extensions.has("GL_OES_texture_compression_astc") || extensions.has("GL_KHR_texture_compression_astc_ldr") || extensions.has("WEBGL_compressed_texture_astc");
astc_layered_supported = extensions.has("GL_KHR_texture_compression_astc_sliced_3d");
if (RasterizerGLES3::is_gles_over_gl()) {
@ -226,7 +226,7 @@ Config::Config() {
// OpenGL ES 3.0 V@331.0 (GIT@35e467f, Ice9844a736) (Date:04/15/19)
// OpenGL ES 3.0 V@415.0 (GIT@d39f783, I79de86aa2c, 1591296226) (Date:06/04/20)
// OpenGL ES 3.0 V@0502.0 (GIT@09fef447e8, I1fe547a144, 1661493934) (Date:08/25/22)
String driver_version = gl_version.get_slice("V@", 1).get_slice(" ", 0);
String driver_version = gl_version.get_slice("V@", 1).get_slicec(' ', 0);
if (driver_version.is_valid_float() && driver_version.to_float() >= 331.0) {
flip_xy_workaround = false;

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef CONFIG_GLES3_H
#define CONFIG_GLES3_H
#pragma once
#ifdef GLES3_ENABLED
@ -123,5 +122,3 @@ public:
} // namespace GLES3
#endif // GLES3_ENABLED
#endif // CONFIG_GLES3_H

View file

@ -1181,7 +1181,7 @@ void LightStorage::lightmap_tap_sh_light(RID p_lightmap, const Vector3 &p_point,
return; // Nothing could be done.
}
node = ABS(node) - 1;
node = Math::abs(node) - 1;
uint32_t *tetrahedron = (uint32_t *)&lm->tetrahedra[node * 4];
Vector3 points[4] = { lm->points[tetrahedron[0]], lm->points[tetrahedron[1]], lm->points[tetrahedron[2]], lm->points[tetrahedron[3]] };

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef LIGHT_STORAGE_GLES3_H
#define LIGHT_STORAGE_GLES3_H
#pragma once
#ifdef GLES3_ENABLED
@ -909,5 +908,3 @@ public:
} // namespace GLES3
#endif // GLES3_ENABLED
#endif // LIGHT_STORAGE_GLES3_H

View file

@ -1143,9 +1143,9 @@ MaterialStorage::MaterialStorage() {
actions.renames["CANVAS_MATRIX"] = "canvas_transform";
actions.renames["SCREEN_MATRIX"] = "screen_transform";
actions.renames["TIME"] = "time";
actions.renames["PI"] = _MKSTR(Math_PI);
actions.renames["TAU"] = _MKSTR(Math_TAU);
actions.renames["E"] = _MKSTR(Math_E);
actions.renames["PI"] = String::num(Math::PI);
actions.renames["TAU"] = String::num(Math::TAU);
actions.renames["E"] = String::num(Math::E);
actions.renames["AT_LIGHT_PASS"] = "false";
actions.renames["INSTANCE_CUSTOM"] = "instance_custom";
@ -1238,9 +1238,9 @@ MaterialStorage::MaterialStorage() {
actions.renames["TIME"] = "scene_data.time";
actions.renames["EXPOSURE"] = "(1.0 / scene_data.emissive_exposure_normalization)";
actions.renames["PI"] = _MKSTR(Math_PI);
actions.renames["TAU"] = _MKSTR(Math_TAU);
actions.renames["E"] = _MKSTR(Math_E);
actions.renames["PI"] = String::num(Math::PI);
actions.renames["TAU"] = String::num(Math::TAU);
actions.renames["E"] = String::num(Math::E);
actions.renames["OUTPUT_IS_SRGB"] = "SHADER_IS_SRGB";
actions.renames["CLIP_SPACE_FAR"] = "SHADER_SPACE_FAR";
actions.renames["VIEWPORT_SIZE"] = "scene_data.viewport_size";
@ -1406,9 +1406,9 @@ MaterialStorage::MaterialStorage() {
}
actions.renames["TRANSFORM"] = "xform";
actions.renames["TIME"] = "time";
actions.renames["PI"] = _MKSTR(Math_PI);
actions.renames["TAU"] = _MKSTR(Math_TAU);
actions.renames["E"] = _MKSTR(Math_E);
actions.renames["PI"] = String::num(Math::PI);
actions.renames["TAU"] = String::num(Math::TAU);
actions.renames["E"] = String::num(Math::E);
actions.renames["LIFETIME"] = "lifetime";
actions.renames["DELTA"] = "local_delta";
actions.renames["NUMBER"] = "particle_number";
@ -1463,9 +1463,9 @@ MaterialStorage::MaterialStorage() {
actions.renames["SCREEN_UV"] = "uv";
actions.renames["TIME"] = "time";
actions.renames["FRAGCOORD"] = "gl_FragCoord";
actions.renames["PI"] = _MKSTR(Math_PI);
actions.renames["TAU"] = _MKSTR(Math_TAU);
actions.renames["E"] = _MKSTR(Math_E);
actions.renames["PI"] = String::num(Math::PI);
actions.renames["TAU"] = String::num(Math::TAU);
actions.renames["E"] = String::num(Math::E);
actions.renames["HALF_RES_COLOR"] = "half_res_color";
actions.renames["QUARTER_RES_COLOR"] = "quarter_res_color";
actions.renames["RADIANCE"] = "radiance";
@ -1925,7 +1925,7 @@ void MaterialStorage::global_shader_parameters_load_settings(bool p_load_texture
for (const PropertyInfo &E : settings) {
if (E.name.begins_with("shader_globals/")) {
StringName name = E.name.get_slice("/", 1);
StringName name = E.name.get_slicec('/', 1);
Dictionary d = GLOBAL_GET(E.name);
ERR_CONTINUE(!d.has("type"));

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef MATERIAL_STORAGE_GLES3_H
#define MATERIAL_STORAGE_GLES3_H
#pragma once
#ifdef GLES3_ENABLED
@ -634,5 +633,3 @@ public:
} // namespace GLES3
#endif // GLES3_ENABLED
#endif // MATERIAL_STORAGE_GLES3_H

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef MESH_STORAGE_GLES3_H
#define MESH_STORAGE_GLES3_H
#pragma once
#ifdef GLES3_ENABLED
@ -604,5 +603,3 @@ public:
} // namespace GLES3
#endif // GLES3_ENABLED
#endif // MESH_STORAGE_GLES3_H

View file

@ -513,7 +513,7 @@ void ParticlesStorage::_particles_process(Particles *p_particles, double p_delta
GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton();
GLES3::MaterialStorage *material_storage = GLES3::MaterialStorage::get_singleton();
double new_phase = Math::fmod(p_particles->phase + (p_delta / p_particles->lifetime) * p_particles->speed_scale, 1.0);
double new_phase = Math::fmod(p_particles->phase + (p_delta / p_particles->lifetime), 1.0);
//update current frame
ParticlesFrameParams frame_params;
@ -534,7 +534,7 @@ void ParticlesStorage::_particles_process(Particles *p_particles, double p_delta
p_particles->phase = new_phase;
frame_params.time = RSG::rasterizer->get_total_time();
frame_params.delta = p_delta * p_particles->speed_scale;
frame_params.delta = p_delta;
frame_params.random_seed = p_particles->random_seed;
frame_params.explosiveness = p_particles->explosiveness;
frame_params.randomness = p_particles->randomness;
@ -1097,8 +1097,6 @@ void ParticlesStorage::update_particles() {
fixed_fps = particles->fixed_fps;
}
bool zero_time_scale = Engine::get_singleton()->get_time_scale() <= 0.0;
if (particles->clear && particles->pre_process_time > 0.0) {
double frame_time;
if (fixed_fps > 0) {
@ -1115,37 +1113,27 @@ void ParticlesStorage::update_particles() {
}
}
double time_scale = MAX(particles->speed_scale, 0.0);
if (fixed_fps > 0) {
double frame_time;
double decr;
if (zero_time_scale) {
frame_time = 0.0;
decr = 1.0 / fixed_fps;
} else {
frame_time = 1.0 / fixed_fps;
decr = frame_time;
}
double frame_time = 1.0 / fixed_fps;
double delta = RSG::rasterizer->get_frame_delta_time();
if (delta > 0.1) { //avoid recursive stalls if fps goes below 10
delta = 0.1;
} else if (delta <= 0.0) { //unlikely but..
delta = 0.001;
}
double todo = particles->frame_remainder + delta;
double todo = particles->frame_remainder + delta * time_scale;
while (todo >= frame_time) {
_particles_process(particles, frame_time);
todo -= decr;
todo -= frame_time;
}
particles->frame_remainder = todo;
} else {
if (zero_time_scale) {
_particles_process(particles, 0.0);
} else {
_particles_process(particles, RSG::rasterizer->get_frame_delta_time());
}
_particles_process(particles, RSG::rasterizer->get_frame_delta_time() * time_scale);
}
if (particles->request_process_time > 0.0) {

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef PARTICLES_STORAGE_GLES3_H
#define PARTICLES_STORAGE_GLES3_H
#pragma once
#ifdef GLES3_ENABLED
@ -460,5 +459,3 @@ public:
} // namespace GLES3
#endif // GLES3_ENABLED
#endif // PARTICLES_STORAGE_GLES3_H

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef RENDER_SCENE_BUFFERS_GLES3_H
#define RENDER_SCENE_BUFFERS_GLES3_H
#pragma once
#ifdef GLES3_ENABLED
@ -164,5 +163,3 @@ public:
};
#endif // GLES3_ENABLED
#endif // RENDER_SCENE_BUFFERS_GLES3_H

View file

@ -1468,8 +1468,8 @@ void TextureStorage::texture_debug_usage(List<RS::TextureInfo> *r_info) {
List<RID> textures;
texture_owner.get_owned_list(&textures);
for (List<RID>::Element *E = textures.front(); E; E = E->next()) {
Texture *t = texture_owner.get_or_null(E->get());
for (const RID &rid : textures) {
Texture *t = texture_owner.get_or_null(rid);
if (!t) {
continue;
}

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef TEXTURE_STORAGE_GLES3_H
#define TEXTURE_STORAGE_GLES3_H
#pragma once
#ifdef GLES3_ENABLED
@ -730,5 +729,3 @@ inline String TextureStorage::get_framebuffer_error(GLenum p_status) {
} // namespace GLES3
#endif // GLES3_ENABLED
#endif // TEXTURE_STORAGE_GLES3_H

View file

@ -421,6 +421,9 @@ bool Utilities::has_os_feature(const String &p_feature) const {
if (p_feature == "etc2") {
return config->etc2_supported;
}
if (p_feature == "astc_hdr") {
return config->astc_hdr_supported;
}
return false;
}

View file

@ -28,8 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/
#ifndef UTILITIES_GLES3_H
#define UTILITIES_GLES3_H
#pragma once
#ifdef GLES3_ENABLED
@ -233,5 +232,3 @@ public:
} // namespace GLES3
#endif // GLES3_ENABLED
#endif // UTILITIES_GLES3_H