summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/main.cpp12
-rw-r--r--main/tests/test_shader_lang.cpp2
2 files changed, 13 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp
index a95af44215..c625a9cb36 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -1481,6 +1481,15 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
// We could add more, and make the CLI arg require a comma-separated list of profilers.
EngineDebugger::get_singleton()->profiler_enable("scripts", true);
}
+
+ if (!project_manager) {
+ // If not running the project manager, and now that the engine is
+ // able to load resources, load the global shader variables.
+ // If running on editor, dont load the textures because the editor
+ // may want to import them first. Editor will reload those later.
+ rendering_server->global_variables_load_settings(!editor);
+ }
+
_start_success = true;
locale = String();
@@ -2280,6 +2289,9 @@ void Main::cleanup() {
// Sync pending commands that may have been queued from a different thread during ScriptServer finalization
RenderingServer::get_singleton()->sync();
+ //clear global shader variables before scene and other graphics stuff is deinitialized.
+ rendering_server->global_variables_clear();
+
#ifdef TOOLS_ENABLED
EditorNode::unregister_editor_types();
#endif
diff --git a/main/tests/test_shader_lang.cpp b/main/tests/test_shader_lang.cpp
index 1e85f7f1d2..dbe2da86cf 100644
--- a/main/tests/test_shader_lang.cpp
+++ b/main/tests/test_shader_lang.cpp
@@ -342,7 +342,7 @@ MainLoop *test() {
Set<String> types;
types.insert("spatial");
- Error err = sl.compile(code, dt, rm, types);
+ Error err = sl.compile(code, dt, rm, types, NULL);
if (err) {