From a2c32590ee3a6a540bbcbc96b775d8b1a314707d Mon Sep 17 00:00:00 2001 From: Yuri Rubinsky Date: Mon, 3 Oct 2022 14:01:46 +0300 Subject: Fix global uniform crash at editor startup --- servers/rendering/shader_compiler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'servers/rendering/shader_compiler.cpp') 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); -- cgit v1.2.3