mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-04-06 20:11:49 +02:00
Reworked the new GLOBAL_GET_CACHED macro.
This commit is contained in:
parent
f3b8330182
commit
35b072e1df
@ -224,23 +224,19 @@ Variant _GLOBAL_DEF_ALIAS(const String &p_var, const String &p_old_name, const V
|
|||||||
#define GLOBAL_DEF_ALIAS_RST(m_var, m_old_name, m_value) _GLOBAL_DEF(m_var, m_old_name, m_value, true)
|
#define GLOBAL_DEF_ALIAS_RST(m_var, m_old_name, m_value) _GLOBAL_DEF(m_var, m_old_name, m_value, true)
|
||||||
#define GLOBAL_GET(m_var) ProjectSettings::get_singleton()->get(m_var)
|
#define GLOBAL_GET(m_var) ProjectSettings::get_singleton()->get(m_var)
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////
|
#define GLOBAL_CACHED(m_name, m_type, m_setting_name) \
|
||||||
// Cached versions of GLOBAL_GET.
|
static m_type m_name; \
|
||||||
// Cached but uses a typed variable for storage, this can be more efficient.
|
{ \
|
||||||
#define GLOBAL_GET_CACHED(m_type, m_setting_name) ([](const char *p_name) -> m_type {\
|
static_assert(HAS_TRIVIAL_DESTRUCTOR(m_type), "GLOBAL_CACHED must use a trivial type that allows static lifetime."); \
|
||||||
static_assert(HAS_TRIVIAL_DESTRUCTOR(m_type), "GLOBAL_GET_CACHED must use a trivial type that allows static lifetime.");\
|
static uint32_t local_version = 0; \
|
||||||
static m_type local_var;\
|
static Mutex local_mutex; \
|
||||||
static uint32_t local_version = 0;\
|
uint32_t new_version = ProjectSettings::get_singleton()->get_version(); \
|
||||||
static Mutex local_mutex;\
|
if (local_version != new_version) { \
|
||||||
uint32_t new_version = ProjectSettings::get_singleton()->get_version();\
|
local_mutex.lock(); \
|
||||||
if (local_version != new_version) {\
|
local_version = new_version; \
|
||||||
MutexLock lock(local_mutex);\
|
m_name = ProjectSettings::get_singleton()->get(m_setting_name); \
|
||||||
local_version = new_version;\
|
local_mutex.unlock(); \
|
||||||
local_var = ProjectSettings::get_singleton()->get(p_name);\
|
} \
|
||||||
return local_var;\
|
}
|
||||||
}\
|
|
||||||
MutexLock lock(local_mutex);\
|
|
||||||
return local_var; })(m_setting_name)
|
|
||||||
|
|
||||||
#endif // PROJECT_SETTINGS_H
|
#endif // PROJECT_SETTINGS_H
|
||||||
|
|
||||||
|
@ -147,7 +147,9 @@ void _physics_interpolation_warning(const char *p_function, const char *p_file,
|
|||||||
warn_count = warn_max;
|
warn_count = warn_max;
|
||||||
warn_timeout = time_now + warn_timeout_seconds;
|
warn_timeout = time_now + warn_timeout_seconds;
|
||||||
|
|
||||||
if (GLOBAL_GET_CACHED(bool, "debug/settings/physics_interpolation/enable_warnings")) {
|
GLOBAL_CACHED(debug_setting_enable_warnings, bool, "debug/settings/physics_interpolation/enable_warnings");
|
||||||
|
|
||||||
|
if (debug_setting_enable_warnings) {
|
||||||
// UINT64_MAX means unused.
|
// UINT64_MAX means unused.
|
||||||
if (p_id == UINT64_MAX) {
|
if (p_id == UINT64_MAX) {
|
||||||
_err_print_error(p_function, p_file, p_line, "[Physics interpolation] " + String(p_warn_string) + " (possibly benign).", ERR_HANDLER_WARNING);
|
_err_print_error(p_function, p_file, p_line, "[Physics interpolation] " + String(p_warn_string) + " (possibly benign).", ERR_HANDLER_WARNING);
|
||||||
|
@ -276,7 +276,7 @@ void RasterizerGLES2::begin_frame(double frame_step) {
|
|||||||
frame_step = 0.001;
|
frame_step = 0.001;
|
||||||
}
|
}
|
||||||
|
|
||||||
double time_roll_over = GLOBAL_GET_CACHED(double, "rendering/limits/time/time_rollover_secs");
|
GLOBAL_CACHED(time_roll_over, double, "rendering/limits/time/time_rollover_secs");
|
||||||
time_total = Math::fmod(time_total, time_roll_over);
|
time_total = Math::fmod(time_total, time_roll_over);
|
||||||
|
|
||||||
storage->frame.time[0] = time_total;
|
storage->frame.time[0] = time_total;
|
||||||
|
@ -4059,9 +4059,12 @@ void RasterizerSceneGLES2::initialize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerSceneGLES2::iteration() {
|
void RasterizerSceneGLES2::iteration() {
|
||||||
shadow_filter_mode = ShadowFilterMode(int(GLOBAL_GET_CACHED(int32_t, "rendering/quality/shadows/filter_mode")));
|
GLOBAL_CACHED(rendering_quality_shadows_filter_mode, int32_t, "rendering/quality/shadows/filter_mode");
|
||||||
|
GLOBAL_CACHED(rendering_quality_directional_shadow_size, int32_t, "rendering/quality/directional_shadow/size");
|
||||||
|
|
||||||
const int directional_shadow_size_new = next_power_of_2(GLOBAL_GET_CACHED(int32_t, "rendering/quality/directional_shadow/size"));
|
shadow_filter_mode = ShadowFilterMode(int(rendering_quality_shadows_filter_mode));
|
||||||
|
|
||||||
|
const int directional_shadow_size_new = next_power_of_2(rendering_quality_directional_shadow_size);
|
||||||
if (directional_shadow_size != directional_shadow_size_new) {
|
if (directional_shadow_size != directional_shadow_size_new) {
|
||||||
directional_shadow_size = directional_shadow_size_new;
|
directional_shadow_size = directional_shadow_size_new;
|
||||||
directional_shadow_create();
|
directional_shadow_create();
|
||||||
|
@ -2296,7 +2296,8 @@ void RasterizerStorageGLES2::mesh_add_surface(RID p_mesh, uint32_t p_format, RS:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//bool has_morph = p_blend_shapes.size();
|
//bool has_morph = p_blend_shapes.size();
|
||||||
bool use_split_stream = GLOBAL_GET_CACHED(bool, "rendering/misc/mesh_storage/split_stream") && !(p_format & RS::ARRAY_FLAG_USE_DYNAMIC_UPDATE);
|
GLOBAL_CACHED(storage_split_stream, bool, "rendering/misc/mesh_storage/split_stream");
|
||||||
|
bool use_split_stream = storage_split_stream && !(p_format & RS::ARRAY_FLAG_USE_DYNAMIC_UPDATE);
|
||||||
|
|
||||||
Surface::Attrib attribs[RS::ARRAY_MAX];
|
Surface::Attrib attribs[RS::ARRAY_MAX];
|
||||||
|
|
||||||
|
@ -1226,9 +1226,9 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() {
|
|||||||
//actions[RS::SHADER_SPATIAL].render_mode_defines["cull_front"] = "#define DO_SIDE_CHECK\n";
|
//actions[RS::SHADER_SPATIAL].render_mode_defines["cull_front"] = "#define DO_SIDE_CHECK\n";
|
||||||
//actions[RS::SHADER_SPATIAL].render_mode_defines["cull_disabled"] = "#define DO_SIDE_CHECK\n";
|
//actions[RS::SHADER_SPATIAL].render_mode_defines["cull_disabled"] = "#define DO_SIDE_CHECK\n";
|
||||||
|
|
||||||
bool force_lambert = GLOBAL_GET_CACHED(bool, "rendering/quality/shading/force_lambert_over_burley");
|
GLOBAL_CACHED(render_force_lambert_over_burley, bool, "rendering/quality/shading/force_lambert_over_burley");
|
||||||
|
|
||||||
if (!force_lambert) {
|
if (!render_force_lambert_over_burley) {
|
||||||
actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_burley"] = "#define DIFFUSE_BURLEY\n";
|
actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_burley"] = "#define DIFFUSE_BURLEY\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1236,9 +1236,9 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() {
|
|||||||
actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_lambert_wrap"] = "#define DIFFUSE_LAMBERT_WRAP\n";
|
actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_lambert_wrap"] = "#define DIFFUSE_LAMBERT_WRAP\n";
|
||||||
actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_toon"] = "#define DIFFUSE_TOON\n";
|
actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_toon"] = "#define DIFFUSE_TOON\n";
|
||||||
|
|
||||||
bool force_blinn = GLOBAL_GET_CACHED(bool, "rendering/quality/shading/force_blinn_over_ggx");
|
GLOBAL_CACHED(render_force_blinn_over_ggx, bool, "rendering/quality/shading/force_blinn_over_ggx");
|
||||||
|
|
||||||
if (!force_blinn) {
|
if (!render_force_blinn_over_ggx) {
|
||||||
actions[RS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_SCHLICK_GGX\n";
|
actions[RS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_SCHLICK_GGX\n";
|
||||||
} else {
|
} else {
|
||||||
actions[RS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_BLINN\n";
|
actions[RS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_BLINN\n";
|
||||||
|
@ -178,7 +178,9 @@ ShaderGLES2::Version *ShaderGLES2::get_current_version() {
|
|||||||
strings.push_back("#define USE_HIGHP_PRECISION\n");
|
strings.push_back("#define USE_HIGHP_PRECISION\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (GLOBAL_GET_CACHED(bool, "rendering/gles2/compatibility/enable_high_float.Android")) {
|
GLOBAL_CACHED(gles2_compat_enable_high_float_android, bool, "rendering/gles2/compatibility/enable_high_float.Android");
|
||||||
|
|
||||||
|
if (gles2_compat_enable_high_float_android) {
|
||||||
// enable USE_HIGHP_PRECISION but safeguarded by an availability check as highp support is optional in GLES2
|
// enable USE_HIGHP_PRECISION but safeguarded by an availability check as highp support is optional in GLES2
|
||||||
// see Section 4.5.4 of the GLSL_ES_Specification_1.00
|
// see Section 4.5.4 of the GLSL_ES_Specification_1.00
|
||||||
strings.push_back("#ifdef GL_FRAGMENT_PRECISION_HIGH\n #define USE_HIGHP_PRECISION\n#endif\n");
|
strings.push_back("#ifdef GL_FRAGMENT_PRECISION_HIGH\n #define USE_HIGHP_PRECISION\n#endif\n");
|
||||||
|
@ -200,7 +200,7 @@ void RasterizerGLES3::begin_frame(double frame_step) {
|
|||||||
frame_step = 0.001;
|
frame_step = 0.001;
|
||||||
}
|
}
|
||||||
|
|
||||||
double time_roll_over = GLOBAL_GET_CACHED(double, "rendering/limits/time/time_rollover_secs");
|
GLOBAL_CACHED(time_roll_over, double, "rendering/limits/time/time_rollover_secs");
|
||||||
time_total = Math::fmod(time_total, time_roll_over);
|
time_total = Math::fmod(time_total, time_roll_over);
|
||||||
|
|
||||||
storage->frame.time[0] = time_total;
|
storage->frame.time[0] = time_total;
|
||||||
|
@ -5315,22 +5315,31 @@ void RasterizerSceneGLES3::initialize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerSceneGLES3::iteration() {
|
void RasterizerSceneGLES3::iteration() {
|
||||||
shadow_filter_mode = ShadowFilterMode(GLOBAL_GET_CACHED(int32_t, "rendering/quality/shadows/filter_mode"));
|
GLOBAL_CACHED(rendering_global_filter_mode, int32_t, "rendering/quality/shadows/filter_mode");
|
||||||
|
GLOBAL_CACHED(rendering_global_directional_shadow_size, int32_t, "rendering/quality/directional_shadow/size");
|
||||||
|
GLOBAL_CACHED(rendering_global_subsurface_scattering_follow_surface, bool, "rendering/quality/subsurface_scattering/follow_surface");
|
||||||
|
GLOBAL_CACHED(rendering_global_subsurface_scattering_weight_samples, bool, "rendering/quality/subsurface_scattering/weight_samples");
|
||||||
|
GLOBAL_CACHED(rendering_global_subsurface_scattering_quality, int32_t, "rendering/quality/subsurface_scattering/quality");
|
||||||
|
GLOBAL_CACHED(rendering_global_subsurface_scattering_scale, float, "rendering/quality/subsurface_scattering/scale");
|
||||||
|
GLOBAL_CACHED(rendering_global_lightmapping_use_bicubic_sampling, bool, "rendering/quality/lightmapping/use_bicubic_sampling");
|
||||||
|
GLOBAL_CACHED(rendering_global_voxel_cone_tracinghigh_quality, bool, "rendering/quality/voxel_cone_tracing/high_quality");
|
||||||
|
|
||||||
const int directional_shadow_size_new = next_power_of_2(GLOBAL_GET_CACHED(int32_t, "rendering/quality/directional_shadow/size"));
|
shadow_filter_mode = ShadowFilterMode(rendering_global_filter_mode);
|
||||||
|
|
||||||
|
const int directional_shadow_size_new = next_power_of_2(rendering_global_directional_shadow_size);
|
||||||
if (directional_shadow_size != directional_shadow_size_new) {
|
if (directional_shadow_size != directional_shadow_size_new) {
|
||||||
directional_shadow_size = directional_shadow_size_new;
|
directional_shadow_size = directional_shadow_size_new;
|
||||||
directional_shadow_create();
|
directional_shadow_create();
|
||||||
}
|
}
|
||||||
|
|
||||||
subsurface_scatter_follow_surface = GLOBAL_GET_CACHED(bool, "rendering/quality/subsurface_scattering/follow_surface");
|
subsurface_scatter_follow_surface = rendering_global_subsurface_scattering_follow_surface;
|
||||||
subsurface_scatter_weight_samples = GLOBAL_GET_CACHED(bool, "rendering/quality/subsurface_scattering/weight_samples");
|
subsurface_scatter_weight_samples = rendering_global_subsurface_scattering_weight_samples;
|
||||||
subsurface_scatter_quality = SubSurfaceScatterQuality(int(GLOBAL_GET_CACHED(int32_t, "rendering/quality/subsurface_scattering/quality")));
|
subsurface_scatter_quality = SubSurfaceScatterQuality(int(rendering_global_subsurface_scattering_quality));
|
||||||
subsurface_scatter_size = GLOBAL_GET_CACHED(float, "rendering/quality/subsurface_scattering/scale");
|
subsurface_scatter_size = rendering_global_subsurface_scattering_scale;
|
||||||
|
|
||||||
storage->config.use_lightmap_filter_bicubic = GLOBAL_GET_CACHED(bool, "rendering/quality/lightmapping/use_bicubic_sampling");
|
storage->config.use_lightmap_filter_bicubic = rendering_global_lightmapping_use_bicubic_sampling;
|
||||||
state.scene_shader.set_conditional(SceneShaderGLES3::USE_LIGHTMAP_FILTER_BICUBIC, storage->config.use_lightmap_filter_bicubic);
|
state.scene_shader.set_conditional(SceneShaderGLES3::USE_LIGHTMAP_FILTER_BICUBIC, storage->config.use_lightmap_filter_bicubic);
|
||||||
state.scene_shader.set_conditional(SceneShaderGLES3::VCT_QUALITY_HIGH, GLOBAL_GET_CACHED(bool, "rendering/quality/voxel_cone_tracing/high_quality"));
|
state.scene_shader.set_conditional(SceneShaderGLES3::VCT_QUALITY_HIGH, rendering_global_voxel_cone_tracinghigh_quality);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerSceneGLES3::finalize() {
|
void RasterizerSceneGLES3::finalize() {
|
||||||
|
@ -3390,7 +3390,8 @@ void RasterizerStorageGLES3::mesh_add_surface(RID p_mesh, uint32_t p_format, RS:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//bool has_morph = p_blend_shapes.size();
|
//bool has_morph = p_blend_shapes.size();
|
||||||
bool use_split_stream = GLOBAL_GET_CACHED(bool, "rendering/misc/mesh_storage/split_stream") && !(p_format & RS::ARRAY_FLAG_USE_DYNAMIC_UPDATE);
|
GLOBAL_CACHED(global_storage_split_stream, bool, "rendering/misc/mesh_storage/split_stream")
|
||||||
|
bool use_split_stream = global_storage_split_stream && !(p_format & RS::ARRAY_FLAG_USE_DYNAMIC_UPDATE);
|
||||||
|
|
||||||
Surface::Attrib attribs[RS::ARRAY_MAX];
|
Surface::Attrib attribs[RS::ARRAY_MAX];
|
||||||
|
|
||||||
|
@ -1268,9 +1268,9 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
|
|||||||
actions[RS::SHADER_SPATIAL].render_mode_defines["cull_front"] = "#define DO_SIDE_CHECK\n";
|
actions[RS::SHADER_SPATIAL].render_mode_defines["cull_front"] = "#define DO_SIDE_CHECK\n";
|
||||||
actions[RS::SHADER_SPATIAL].render_mode_defines["cull_disabled"] = "#define DO_SIDE_CHECK\n";
|
actions[RS::SHADER_SPATIAL].render_mode_defines["cull_disabled"] = "#define DO_SIDE_CHECK\n";
|
||||||
|
|
||||||
bool force_lambert = GLOBAL_GET_CACHED(bool, "rendering/quality/shading/force_lambert_over_burley");
|
GLOBAL_CACHED(render_force_lambert_over_burley, bool, "rendering/quality/shading/force_lambert_over_burley");
|
||||||
|
|
||||||
if (!force_lambert) {
|
if (!render_force_lambert_over_burley) {
|
||||||
actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_burley"] = "#define DIFFUSE_BURLEY\n";
|
actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_burley"] = "#define DIFFUSE_BURLEY\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1278,9 +1278,9 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
|
|||||||
actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_lambert_wrap"] = "#define DIFFUSE_LAMBERT_WRAP\n";
|
actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_lambert_wrap"] = "#define DIFFUSE_LAMBERT_WRAP\n";
|
||||||
actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_toon"] = "#define DIFFUSE_TOON\n";
|
actions[RS::SHADER_SPATIAL].render_mode_defines["diffuse_toon"] = "#define DIFFUSE_TOON\n";
|
||||||
|
|
||||||
bool force_blinn = GLOBAL_GET_CACHED(bool, "rendering/quality/shading/force_blinn_over_ggx");
|
GLOBAL_CACHED(render_force_blinn_over_ggx, bool, "rendering/quality/shading/force_blinn_over_ggx");
|
||||||
|
|
||||||
if (!force_blinn) {
|
if (!render_force_blinn_over_ggx) {
|
||||||
actions[RS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_SCHLICK_GGX\n";
|
actions[RS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_SCHLICK_GGX\n";
|
||||||
} else {
|
} else {
|
||||||
actions[RS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_BLINN\n";
|
actions[RS::SHADER_SPATIAL].render_mode_defines["specular_schlick_ggx"] = "#define SPECULAR_BLINN\n";
|
||||||
|
@ -418,13 +418,14 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
|
|||||||
if (repeat > 0) {
|
if (repeat > 0) {
|
||||||
tex_flags |= Texture::FLAG_REPEAT;
|
tex_flags |= Texture::FLAG_REPEAT;
|
||||||
|
|
||||||
const bool min_gles3 = GLOBAL_GET("rendering/quality/driver/driver_name") == "GLES3" &&
|
GLOBAL_CACHED(global_fallback_to_gles2, bool, "rendering/quality/driver/fallback_to_gles2");
|
||||||
!GLOBAL_GET_CACHED(bool, "rendering/quality/driver/fallback_to_gles2");
|
|
||||||
|
const bool min_gles3 = GLOBAL_GET("rendering/quality/driver/driver_name") == "GLES3" && !global_fallback_to_gles2;
|
||||||
if (!min_gles3 && !image->is_size_po2()) {
|
if (!min_gles3 && !image->is_size_po2()) {
|
||||||
// The project can be run using GLES2. GLES2 does not guarantee that
|
// The project can be run using GLES2. GLES2 does not guarantee that
|
||||||
// repeating textures with a non-power-of-two size will be displayed
|
// repeating textures with a non-power-of-two size will be displayed
|
||||||
// without artifacts (due to upscaling to the nearest power of 2).
|
// without artifacts (due to upscaling to the nearest power of 2).
|
||||||
if (GLOBAL_GET_CACHED(bool, "rendering/quality/driver/fallback_to_gles2")) {
|
if (global_fallback_to_gles2) {
|
||||||
WARN_PRINT(vformat("%s: Imported a repeating texture with a size of %dx%d, but the project is configured to allow falling back to GLES2.\nNon-power-of-2 repeating textures may not display correctly on some platforms such as HTML5. This is because GLES2 does not mandate support for non-power-of-2 repeating textures.",
|
WARN_PRINT(vformat("%s: Imported a repeating texture with a size of %dx%d, but the project is configured to allow falling back to GLES2.\nNon-power-of-2 repeating textures may not display correctly on some platforms such as HTML5. This is because GLES2 does not mandate support for non-power-of-2 repeating textures.",
|
||||||
p_source_file, image->get_width(), image->get_height()));
|
p_source_file, image->get_width(), image->get_height()));
|
||||||
} else {
|
} else {
|
||||||
|
@ -1475,7 +1475,10 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
|
|||||||
// Render every past/future step with the capture shader.
|
// Render every past/future step with the capture shader.
|
||||||
|
|
||||||
RS::get_singleton()->canvas_item_set_material(onion.capture.canvas_item, onion.capture.material->get_rid());
|
RS::get_singleton()->canvas_item_set_material(onion.capture.canvas_item, onion.capture.material->get_rid());
|
||||||
onion.capture.material->set_shader_param("bkg_color", GLOBAL_GET_CACHED(Color, "rendering/environment/default_clear_color"));
|
|
||||||
|
GLOBAL_CACHED(global_environment_default_clear_color, Color, "rendering/environment/default_clear_color");
|
||||||
|
|
||||||
|
onion.capture.material->set_shader_param("bkg_color", global_environment_default_clear_color);
|
||||||
onion.capture.material->set_shader_param("differences_only", onion.differences_only);
|
onion.capture.material->set_shader_param("differences_only", onion.differences_only);
|
||||||
onion.capture.material->set_shader_param("present", onion.differences_only ? RS::get_singleton()->viewport_get_texture(present_rid) : RID());
|
onion.capture.material->set_shader_param("present", onion.differences_only ? RS::get_singleton()->viewport_get_texture(present_rid) : RID());
|
||||||
|
|
||||||
|
@ -3677,7 +3677,9 @@ void CanvasItemEditor::set_current_tool(Tool p_tool) {
|
|||||||
|
|
||||||
void CanvasItemEditor::_notification(int p_what) {
|
void CanvasItemEditor::_notification(int p_what) {
|
||||||
if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
|
if (p_what == NOTIFICATION_PHYSICS_PROCESS) {
|
||||||
EditorNode::get_singleton()->get_scene_root()->set_snap_controls_to_pixels(GLOBAL_GET_CACHED(bool, "gui/common/snap_controls_to_pixels"));
|
GLOBAL_CACHED(global_gui_common_snap_controls_to_pixels, bool, "gui/common/snap_controls_to_pixels")
|
||||||
|
|
||||||
|
EditorNode::get_singleton()->get_scene_root()->set_snap_controls_to_pixels(global_gui_common_snap_controls_to_pixels);
|
||||||
|
|
||||||
bool has_container_parents = false;
|
bool has_container_parents = false;
|
||||||
int nb_control = 0;
|
int nb_control = 0;
|
||||||
|
@ -894,7 +894,8 @@ Ref<Texture> EditorFontPreviewPlugin::generate_from_path(const String &p_path, c
|
|||||||
|
|
||||||
Ref<Font> font = sampled_font;
|
Ref<Font> font = sampled_font;
|
||||||
|
|
||||||
const Color c = GLOBAL_GET_CACHED(Color, "rendering/environment/default_clear_color");
|
GLOBAL_CACHED(global_default_clear_color, Color, "rendering/environment/default_clear_color");
|
||||||
|
const Color c = global_default_clear_color;
|
||||||
const float fg = c.get_luminance() < 0.5 ? 1.0 : 0.0;
|
const float fg = c.get_luminance() < 0.5 ? 1.0 : 0.0;
|
||||||
font->draw(canvas_item, pos, sampled_text, Color(fg, fg, fg));
|
font->draw(canvas_item, pos, sampled_text, Color(fg, fg, fg));
|
||||||
|
|
||||||
|
@ -96,7 +96,9 @@ void ThemeEditorPreview::_propagate_redraw(Control *p_at) {
|
|||||||
|
|
||||||
void ThemeEditorPreview::_refresh_interval() {
|
void ThemeEditorPreview::_refresh_interval() {
|
||||||
// In case the project settings have changed.
|
// In case the project settings have changed.
|
||||||
preview_bg->set_frame_color(GLOBAL_GET_CACHED(Color, "rendering/environment/default_clear_color"));
|
GLOBAL_CACHED(rendering_default_clear_color, Color, "rendering/environment/default_clear_color");
|
||||||
|
|
||||||
|
preview_bg->set_frame_color(rendering_default_clear_color);
|
||||||
|
|
||||||
_propagate_redraw(preview_bg);
|
_propagate_redraw(preview_bg);
|
||||||
_propagate_redraw(preview_content);
|
_propagate_redraw(preview_content);
|
||||||
|
@ -446,7 +446,9 @@ void EditorScriptTextEditor::_validate_script() {
|
|||||||
warnings_panel->clear();
|
warnings_panel->clear();
|
||||||
|
|
||||||
// Add missing connections.
|
// Add missing connections.
|
||||||
if (GLOBAL_GET_CACHED(bool, "debug/gdscript/warnings/enable")) {
|
GLOBAL_CACHED(global_debug_warning_enable, bool, "debug/gdscript/warnings/enable")
|
||||||
|
|
||||||
|
if (global_debug_warning_enable) {
|
||||||
Node *base = get_tree()->get_edited_scene_root();
|
Node *base = get_tree()->get_edited_scene_root();
|
||||||
if (base && missing_connections.size() > 0) {
|
if (base && missing_connections.size() > 0) {
|
||||||
warnings_panel->push_table(1);
|
warnings_panel->push_table(1);
|
||||||
|
@ -2538,6 +2538,8 @@ bool Main::iteration() {
|
|||||||
frames++;
|
frames++;
|
||||||
Engine::get_singleton()->_idle_frames++;
|
Engine::get_singleton()->_idle_frames++;
|
||||||
|
|
||||||
|
GLOBAL_CACHED(debug_settings_stdout_print_pfs, bool, "debug/settings/stdout/print_fps");
|
||||||
|
|
||||||
if (frame > 1000000) {
|
if (frame > 1000000) {
|
||||||
// Wait a few seconds before printing FPS, as FPS reporting just after the engine has started is inaccurate.
|
// Wait a few seconds before printing FPS, as FPS reporting just after the engine has started is inaccurate.
|
||||||
if (hide_print_fps_attempts == 0) {
|
if (hide_print_fps_attempts == 0) {
|
||||||
@ -2545,7 +2547,7 @@ bool Main::iteration() {
|
|||||||
if (print_fps) {
|
if (print_fps) {
|
||||||
print_line(vformat("Editor FPS: %d (%s mspf)", frames, rtos(1000.0 / frames).pad_decimals(2)));
|
print_line(vformat("Editor FPS: %d (%s mspf)", frames, rtos(1000.0 / frames).pad_decimals(2)));
|
||||||
}
|
}
|
||||||
} else if (print_fps || GLOBAL_GET_CACHED(bool, "debug/settings/stdout/print_fps")) {
|
} else if (print_fps || debug_settings_stdout_print_pfs) {
|
||||||
print_line(vformat("Project FPS: %d (%s mspf)", frames, rtos(1000.0 / frames).pad_decimals(2)));
|
print_line(vformat("Project FPS: %d (%s mspf)", frames, rtos(1000.0 / frames).pad_decimals(2)));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -2091,7 +2091,7 @@ static void _find_identifiers_in_base(const GDScriptCompletionContext &p_context
|
|||||||
|
|
||||||
if (!_static) {
|
if (!_static) {
|
||||||
List<MethodInfo> methods;
|
List<MethodInfo> methods;
|
||||||
bool is_autocompleting_getters = GLOBAL_GET_CACHED(bool, "debug/gdscript/completion/autocomplete_setters_and_getters");
|
GLOBAL_CACHED(is_autocompleting_getters, bool, "debug/gdscript/completion/autocomplete_setters_and_getters");
|
||||||
ClassDB::get_method_list(type, &methods, false, !is_autocompleting_getters);
|
ClassDB::get_method_list(type, &methods, false, !is_autocompleting_getters);
|
||||||
for (List<MethodInfo>::Element *E = methods.front(); E; E = E->next()) {
|
for (List<MethodInfo>::Element *E = methods.front(); E; E = E->next()) {
|
||||||
if (E->get().name.begins_with("_")) {
|
if (E->get().name.begins_with("_")) {
|
||||||
|
@ -8703,13 +8703,20 @@ void GDScriptParser::_add_warning(int p_code, int p_line, const String &p_symbol
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GDScriptParser::_add_warning(int p_code, int p_line, const Vector<String> &p_symbols) {
|
void GDScriptParser::_add_warning(int p_code, int p_line, const Vector<String> &p_symbols) {
|
||||||
if (GLOBAL_GET_CACHED(bool, "debug/gdscript/warnings/exclude_addons") && base_path.begins_with("res://addons/")) {
|
GLOBAL_CACHED(global_warnings_exclude_addons, bool, "debug/gdscript/warnings/exclude_addons")
|
||||||
|
|
||||||
|
if (global_warnings_exclude_addons && base_path.begins_with("res://addons/")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tokenizer->is_ignoring_warnings() || !GLOBAL_GET_CACHED(bool, "debug/gdscript/warnings/enable")) {
|
|
||||||
|
GLOBAL_CACHED(global_warnings_enable, bool, "debug/gdscript/warnings/enable");
|
||||||
|
|
||||||
|
if (tokenizer->is_ignoring_warnings() || !global_warnings_enable) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String warn_name = GDScriptWarning::get_name_from_code((GDScriptWarning::Code)p_code).to_lower();
|
String warn_name = GDScriptWarning::get_name_from_code((GDScriptWarning::Code)p_code).to_lower();
|
||||||
|
|
||||||
if (tokenizer->get_warning_global_skips().has(warn_name)) {
|
if (tokenizer->get_warning_global_skips().has(warn_name)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -8820,7 +8827,9 @@ Error GDScriptParser::_parse(const String &p_base_path) {
|
|||||||
|
|
||||||
// Resolve warning ignores
|
// Resolve warning ignores
|
||||||
Vector<Pair<int, String>> warning_skips = tokenizer->get_warning_skips();
|
Vector<Pair<int, String>> warning_skips = tokenizer->get_warning_skips();
|
||||||
bool warning_is_error = GLOBAL_GET_CACHED(bool, "debug/gdscript/warnings/treat_warnings_as_errors");
|
GLOBAL_CACHED(global_treat_warnings_as_errors, bool, "debug/gdscript/warnings/treat_warnings_as_errors");
|
||||||
|
|
||||||
|
bool warning_is_error = global_treat_warnings_as_errors;
|
||||||
for (List<GDScriptWarning>::Element *E = warnings.front(); E;) {
|
for (List<GDScriptWarning>::Element *E = warnings.front(); E;) {
|
||||||
GDScriptWarning &w = E->get();
|
GDScriptWarning &w = E->get();
|
||||||
int skip_index = -1;
|
int skip_index = -1;
|
||||||
|
@ -215,6 +215,9 @@ String _get_screen_sizes_tag(const Ref<EditorExportPreset> &p_preset) {
|
|||||||
String _get_activity_tag(const Ref<EditorExportPreset> &p_preset) {
|
String _get_activity_tag(const Ref<EditorExportPreset> &p_preset) {
|
||||||
String orientation = _get_android_orientation_label(
|
String orientation = _get_android_orientation_label(
|
||||||
OS::get_singleton()->get_screen_orientation_from_string(GLOBAL_GET("display/window/handheld/orientation")));
|
OS::get_singleton()->get_screen_orientation_from_string(GLOBAL_GET("display/window/handheld/orientation")));
|
||||||
|
|
||||||
|
GLOBAL_CACHED(display_window_resizable, bool, "display/window/size/resizable");
|
||||||
|
|
||||||
String manifest_activity_text = vformat(
|
String manifest_activity_text = vformat(
|
||||||
" <activity android:name=\"com.pandemonium.game.PandemoniumApp\" "
|
" <activity android:name=\"com.pandemonium.game.PandemoniumApp\" "
|
||||||
"tools:replace=\"android:screenOrientation,android:excludeFromRecents,android:resizeableActivity\" "
|
"tools:replace=\"android:screenOrientation,android:excludeFromRecents,android:resizeableActivity\" "
|
||||||
@ -223,7 +226,7 @@ String _get_activity_tag(const Ref<EditorExportPreset> &p_preset) {
|
|||||||
"android:resizeableActivity=\"%s\">\n",
|
"android:resizeableActivity=\"%s\">\n",
|
||||||
bool_to_string(p_preset->get("package/exclude_from_recents")),
|
bool_to_string(p_preset->get("package/exclude_from_recents")),
|
||||||
orientation,
|
orientation,
|
||||||
bool_to_string(GLOBAL_GET_CACHED(bool, "display/window/size/resizable")));
|
bool_to_string(display_window_resizable));
|
||||||
manifest_activity_text += " <meta-data tools:node=\"remove\" android:name=\"com.oculus.vr.focusaware\" />\n";
|
manifest_activity_text += " <meta-data tools:node=\"remove\" android:name=\"com.oculus.vr.focusaware\" />\n";
|
||||||
manifest_activity_text += " </activity>\n";
|
manifest_activity_text += " </activity>\n";
|
||||||
return manifest_activity_text;
|
return manifest_activity_text;
|
||||||
|
@ -202,12 +202,14 @@ void MeshInstance::_resolve_skeleton_path() {
|
|||||||
|
|
||||||
bool MeshInstance::_is_global_software_skinning_enabled() {
|
bool MeshInstance::_is_global_software_skinning_enabled() {
|
||||||
// Check if forced in project settings.
|
// Check if forced in project settings.
|
||||||
if (GLOBAL_GET_CACHED(bool, "rendering/quality/skinning/force_software_skinning")) {
|
GLOBAL_CACHED(force_software_skinning, bool, "rendering/quality/skinning/force_software_skinning");
|
||||||
|
if (force_software_skinning) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if enabled in project settings.
|
// Check if enabled in project settings.
|
||||||
if (!GLOBAL_GET_CACHED(bool, "rendering/quality/skinning/software_skinning_fallback")) {
|
GLOBAL_CACHED(software_skinning_fallback, bool, "rendering/quality/skinning/software_skinning_fallback");
|
||||||
|
if (!software_skinning_fallback) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -655,7 +655,8 @@ bool SceneTree::iteration(float p_time) {
|
|||||||
call_group_flags(GROUP_CALL_REALTIME, "_pg_process", "trigger_physics_process");
|
call_group_flags(GROUP_CALL_REALTIME, "_pg_process", "trigger_physics_process");
|
||||||
|
|
||||||
_notify_group_pause("physics_process_internal", Node::NOTIFICATION_INTERNAL_PHYSICS_PROCESS);
|
_notify_group_pause("physics_process_internal", Node::NOTIFICATION_INTERNAL_PHYSICS_PROCESS);
|
||||||
if (GLOBAL_GET_CACHED(bool, "physics/common/enable_pause_aware_picking")) {
|
GLOBAL_CACHED(global_enable_pause_aware_picking, bool, "physics/common/enable_pause_aware_picking");
|
||||||
|
if (global_enable_pause_aware_picking) {
|
||||||
call_group_flags(GROUP_CALL_REALTIME, "_viewports", "_process_picking", true);
|
call_group_flags(GROUP_CALL_REALTIME, "_viewports", "_process_picking", true);
|
||||||
}
|
}
|
||||||
_notify_group_pause("physics_process", Node::NOTIFICATION_PHYSICS_PROCESS);
|
_notify_group_pause("physics_process", Node::NOTIFICATION_PHYSICS_PROCESS);
|
||||||
|
@ -387,7 +387,9 @@ void Viewport::_notification(int p_what) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GLOBAL_GET_CACHED(bool, "physics/common/enable_pause_aware_picking")) {
|
GLOBAL_CACHED(physics_enable_pause_aware_picking, bool, "physics/common/enable_pause_aware_picking")
|
||||||
|
|
||||||
|
if (!physics_enable_pause_aware_picking) {
|
||||||
_process_picking(false);
|
_process_picking(false);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
@ -2914,11 +2916,15 @@ void Viewport::set_disable_input(bool p_disable) {
|
|||||||
if (p_disable == disable_input) {
|
if (p_disable == disable_input) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (p_disable && GLOBAL_GET_CACHED(bool, "gui/common/drop_mouse_on_gui_input_disabled")) {
|
|
||||||
|
GLOBAL_CACHED(global_drop_mouse_on_gui_input_disabled, bool, "gui/common/drop_mouse_on_gui_input_disabled")
|
||||||
|
|
||||||
|
if (p_disable && global_drop_mouse_on_gui_input_disabled) {
|
||||||
_drop_mouse_focus();
|
_drop_mouse_focus();
|
||||||
_drop_mouse_over();
|
_drop_mouse_over();
|
||||||
_gui_cancel_tooltip();
|
_gui_cancel_tooltip();
|
||||||
}
|
}
|
||||||
|
|
||||||
disable_input = p_disable;
|
disable_input = p_disable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2194,7 +2194,9 @@ SpatialMaterial::SpatialMaterial(bool p_orm) :
|
|||||||
flags[i] = false;
|
flags[i] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
force_vertex_shading = GLOBAL_GET_CACHED(bool, "rendering/quality/shading/force_vertex_shading");
|
GLOBAL_CACHED(rendering_force_vertex_shading, bool, "rendering/quality/shading/force_vertex_shading");
|
||||||
|
|
||||||
|
force_vertex_shading = rendering_force_vertex_shading;
|
||||||
|
|
||||||
diffuse_mode = DIFFUSE_BURLEY;
|
diffuse_mode = DIFFUSE_BURLEY;
|
||||||
specular_mode = SPECULAR_SCHLICK_GGX;
|
specular_mode = SPECULAR_SCHLICK_GGX;
|
||||||
|
@ -185,7 +185,9 @@ void AudioStreamPlaybackMicrophone::start(float p_from_pos) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GLOBAL_GET_CACHED(bool, "audio/enable_audio_input")) {
|
GLOBAL_CACHED(audio_enable_audio_input, bool, "audio/enable_audio_input");
|
||||||
|
|
||||||
|
if (!audio_enable_audio_input) {
|
||||||
WARN_PRINT("Need to enable Project settings > Audio > Enable Audio Input option to use capturing.");
|
WARN_PRINT("Need to enable Project settings > Audio > Enable Audio Input option to use capturing.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,9 @@ void PortalOcclusionCuller::prepare_generic(PortalRenderer &p_portal_renderer, c
|
|||||||
// Bodge to keep settings up to date, until the project settings PR is merged
|
// Bodge to keep settings up to date, until the project settings PR is merged
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
if (Engine::get_singleton()->is_editor_hint() && ((Engine::get_singleton()->get_frames_drawn() % 16) == 0)) {
|
if (Engine::get_singleton()->is_editor_hint() && ((Engine::get_singleton()->get_frames_drawn() % 16) == 0)) {
|
||||||
_max_polys = GLOBAL_GET_CACHED(int32_t, "rendering/misc/occlusion_culling/max_active_polygons");
|
GLOBAL_CACHED(occlusion_culling_max_polygons, int32_t, "rendering/misc/occlusion_culling/max_active_polygons");
|
||||||
|
|
||||||
|
_max_polys = occlusion_culling_max_polygons;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
_num_spheres = 0;
|
_num_spheres = 0;
|
||||||
|
@ -870,7 +870,8 @@ uint32_t RenderingServer::mesh_surface_get_format_stride(uint32_t p_format, int
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RenderingServer::mesh_surface_make_offsets_from_format(uint32_t p_format, int p_vertex_len, int p_index_len, uint32_t *r_offsets, uint32_t *r_strides) const {
|
void RenderingServer::mesh_surface_make_offsets_from_format(uint32_t p_format, int p_vertex_len, int p_index_len, uint32_t *r_offsets, uint32_t *r_strides) const {
|
||||||
bool use_split_stream = GLOBAL_GET_CACHED(bool, "rendering/misc/mesh_storage/split_stream") && !(p_format & RS::ARRAY_FLAG_USE_DYNAMIC_UPDATE);
|
GLOBAL_CACHED(storage_split_stream, bool, "rendering/misc/mesh_storage/split_stream");
|
||||||
|
bool use_split_stream = storage_split_stream && !(p_format & RS::ARRAY_FLAG_USE_DYNAMIC_UPDATE);
|
||||||
|
|
||||||
int attributes_base_offset = 0;
|
int attributes_base_offset = 0;
|
||||||
int attributes_stride = 0;
|
int attributes_stride = 0;
|
||||||
@ -1248,7 +1249,8 @@ bool RenderingServer::_mesh_find_format(RS::PrimitiveType p_primitive, const Arr
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t RenderingServer::mesh_find_format_from_arrays(PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes, uint32_t p_compress_format) {
|
uint32_t RenderingServer::mesh_find_format_from_arrays(PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes, uint32_t p_compress_format) {
|
||||||
bool use_split_stream = GLOBAL_GET_CACHED(bool, "rendering/misc/mesh_storage/split_stream") && !(p_compress_format & RS::ARRAY_FLAG_USE_DYNAMIC_UPDATE);
|
GLOBAL_CACHED(storage_split_stream, bool, "rendering/misc/mesh_storage/split_stream");
|
||||||
|
bool use_split_stream = storage_split_stream && !(p_compress_format & RS::ARRAY_FLAG_USE_DYNAMIC_UPDATE);
|
||||||
|
|
||||||
uint32_t offsets[RS::ARRAY_MAX];
|
uint32_t offsets[RS::ARRAY_MAX];
|
||||||
|
|
||||||
@ -1268,7 +1270,8 @@ uint32_t RenderingServer::mesh_find_format_from_arrays(PrimitiveType p_primitive
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RenderingServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes, uint32_t p_compress_format) {
|
void RenderingServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_primitive, const Array &p_arrays, const Array &p_blend_shapes, uint32_t p_compress_format) {
|
||||||
bool use_split_stream = GLOBAL_GET_CACHED(bool, "rendering/misc/mesh_storage/split_stream") && !(p_compress_format & RS::ARRAY_FLAG_USE_DYNAMIC_UPDATE);
|
GLOBAL_CACHED(storage_split_stream, bool, "rendering/misc/mesh_storage/split_stream");
|
||||||
|
bool use_split_stream = storage_split_stream && !(p_compress_format & RS::ARRAY_FLAG_USE_DYNAMIC_UPDATE);
|
||||||
|
|
||||||
uint32_t offsets[RS::ARRAY_MAX];
|
uint32_t offsets[RS::ARRAY_MAX];
|
||||||
|
|
||||||
@ -1338,7 +1341,8 @@ void RenderingServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_p
|
|||||||
}
|
}
|
||||||
|
|
||||||
Array RenderingServer::_get_array_from_surface(uint32_t p_format, PoolVector<uint8_t> p_vertex_data, int p_vertex_len, PoolVector<uint8_t> p_index_data, int p_index_len) const {
|
Array RenderingServer::_get_array_from_surface(uint32_t p_format, PoolVector<uint8_t> p_vertex_data, int p_vertex_len, PoolVector<uint8_t> p_index_data, int p_index_len) const {
|
||||||
bool use_split_stream = GLOBAL_GET_CACHED(bool, "rendering/misc/mesh_storage/split_stream") && !(p_format & RS::ARRAY_FLAG_USE_DYNAMIC_UPDATE);
|
GLOBAL_CACHED(storage_split_stream, bool, "rendering/misc/mesh_storage/split_stream");
|
||||||
|
bool use_split_stream = storage_split_stream && !(p_format & RS::ARRAY_FLAG_USE_DYNAMIC_UPDATE);
|
||||||
|
|
||||||
uint32_t offsets[ARRAY_MAX];
|
uint32_t offsets[ARRAY_MAX];
|
||||||
uint32_t strides[RS::ARRAY_MAX];
|
uint32_t strides[RS::ARRAY_MAX];
|
||||||
|
Loading…
Reference in New Issue
Block a user