1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Add safe defaults for async shader compilation

This commit is contained in:
Pedro J. Estébanez
2022-06-28 11:21:55 +02:00
parent d74ff8dd93
commit f971c886fa
2 changed files with 26 additions and 9 deletions

View File

@@ -2735,16 +2735,19 @@ VisualServer::VisualServer() {
force_shader_fallbacks = GLOBAL_GET("rendering/gles3/shaders/debug_shader_fallbacks");
}
#endif
GLOBAL_DEF("rendering/gles3/shaders/shader_compilation_mode", 2);
GLOBAL_DEF("rendering/gles3/shaders/shader_compilation_mode", 0);
ProjectSettings::get_singleton()->set_custom_property_info("rendering/gles3/shaders/shader_compilation_mode", PropertyInfo(Variant::INT, "rendering/gles3/shaders/shader_compilation_mode", PROPERTY_HINT_ENUM, "Synchronous,Asynchronous,Asynchronous + Cache"));
GLOBAL_DEF("rendering/gles3/shaders/shader_compilation_mode.mobile", 0);
GLOBAL_DEF("rendering/gles3/shaders/shader_compilation_mode.web", 0);
GLOBAL_DEF("rendering/gles3/shaders/max_simultaneous_compiles", 2);
ProjectSettings::get_singleton()->set_custom_property_info("rendering/gles3/shaders/max_simultaneous_compiles", PropertyInfo(Variant::INT, "rendering/gles3/shaders/max_simultaneous_compiles", PROPERTY_HINT_RANGE, "1,8,1"));
GLOBAL_DEF("rendering/gles3/shaders/max_simultaneous_compiles.mobile", 1);
GLOBAL_DEF("rendering/gles3/shaders/max_simultaneous_compiles.web", 1);
GLOBAL_DEF("rendering/gles3/shaders/log_active_async_compiles_count", false);
GLOBAL_DEF("rendering/gles3/shaders/shader_cache_size_mb", 512);
ProjectSettings::get_singleton()->set_custom_property_info("rendering/gles3/shaders/shader_cache_size_mb", PropertyInfo(Variant::INT, "rendering/gles3/shaders/shader_cache_size_mb", PROPERTY_HINT_RANGE, "128,4096,128"));
GLOBAL_DEF("rendering/gles3/shaders/shader_cache_size_mb.mobile", 128);
GLOBAL_DEF("rendering/gles3/shaders/shader_cache_size_mb.web", 128);
}
VisualServer::~VisualServer() {