summaryrefslogtreecommitdiff
path: root/servers/rendering/shader_compiler.cpp
diff options
context:
space:
mode:
authorYuri Rubinsky <chaosus89@gmail.com>2022-10-03 14:01:46 +0300
committerYuri Rubinsky <chaosus89@gmail.com>2022-10-03 15:06:20 +0300
commita2c32590ee3a6a540bbcbc96b775d8b1a314707d (patch)
treef9188bc7c7b74ead45376749d407a2275ec5516f /servers/rendering/shader_compiler.cpp
parentd331b803b8e63b0dab406a12c21805a17ee0a6a8 (diff)
Fix global uniform crash at editor startup
Diffstat (limited to 'servers/rendering/shader_compiler.cpp')
-rw-r--r--servers/rendering/shader_compiler.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/servers/rendering/shader_compiler.cpp b/servers/rendering/shader_compiler.cpp
index ab5b8af794..1d83cc9de7 100644
--- a/servers/rendering/shader_compiler.cpp
+++ b/servers/rendering/shader_compiler.cpp
@@ -32,8 +32,8 @@
#include "core/config/project_settings.h"
#include "core/os/os.h"
+#include "servers/rendering/rendering_server_globals.h"
#include "servers/rendering/shader_types.h"
-#include "servers/rendering_server.h"
#define SL ShaderLanguage
@@ -1348,8 +1348,8 @@ String ShaderCompiler::_dump_node_code(const SL::Node *p_node, int p_level, Gene
return code;
}
-ShaderLanguage::DataType ShaderCompiler::_get_variable_type(const StringName &p_type) {
- RS::GlobalShaderParameterType gvt = RS::get_singleton()->global_shader_parameter_get_type(p_type);
+ShaderLanguage::DataType ShaderCompiler::_get_global_shader_uniform_type(const StringName &p_name) {
+ RS::GlobalShaderParameterType gvt = RSG::material_storage->global_shader_parameter_get_type(p_name);
return (ShaderLanguage::DataType)RS::global_shader_uniform_type_get_shader_datatype(gvt);
}
@@ -1358,7 +1358,7 @@ Error ShaderCompiler::compile(RS::ShaderMode p_mode, const String &p_code, Ident
info.functions = ShaderTypes::get_singleton()->get_functions(p_mode);
info.render_modes = ShaderTypes::get_singleton()->get_modes(p_mode);
info.shader_types = ShaderTypes::get_singleton()->get_types();
- info.global_shader_uniform_type_func = _get_variable_type;
+ info.global_shader_uniform_type_func = _get_global_shader_uniform_type;
Error err = parser.compile(p_code, info);