From 76f6c0849c35ba1a3993b91892a977a5504e6f28 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Sun, 8 Aug 2021 08:04:20 +0300 Subject: Make `compile` shader function to use struct instead long parameter list --- servers/rendering/renderer_rd/shader_compiler_rd.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'servers/rendering/renderer_rd') diff --git a/servers/rendering/renderer_rd/shader_compiler_rd.cpp b/servers/rendering/renderer_rd/shader_compiler_rd.cpp index b02b3d2723..794c999d1d 100644 --- a/servers/rendering/renderer_rd/shader_compiler_rd.cpp +++ b/servers/rendering/renderer_rd/shader_compiler_rd.cpp @@ -1413,7 +1413,13 @@ ShaderLanguage::DataType ShaderCompilerRD::_get_variable_type(const StringName & } Error ShaderCompilerRD::compile(RS::ShaderMode p_mode, const String &p_code, IdentifierActions *p_actions, const String &p_path, GeneratedCode &r_gen_code) { - Error err = parser.compile(p_code, ShaderTypes::get_singleton()->get_functions(p_mode), ShaderTypes::get_singleton()->get_modes(p_mode), ShaderLanguage::VaryingFunctionNames(), ShaderTypes::get_singleton()->get_types(), _get_variable_type); + SL::ShaderCompileInfo info; + 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_variable_type_func = _get_variable_type; + + Error err = parser.compile(p_code, info); if (err != OK) { Vector shader = p_code.split("\n"); -- cgit v1.2.3