diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2021-12-08 15:15:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-08 15:15:07 +0300 |
commit | 04fac59f3fc035ec75a7d9b46621dd75ec9d8483 (patch) | |
tree | b2ffa6cb52a944a922f78ddebdce6a233ec6eccd /servers/rendering/shader_language.h | |
parent | 6ab7657464da75a75edac731f4d863d4afc11cd1 (diff) | |
parent | 76f6c0849c35ba1a3993b91892a977a5504e6f28 (diff) |
Merge pull request #51381 from Chaosus/shader_compile_enchancement
Diffstat (limited to 'servers/rendering/shader_language.h')
-rw-r--r-- | servers/rendering/shader_language.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/servers/rendering/shader_language.h b/servers/rendering/shader_language.h index 3de89a89a5..ed218975cd 100644 --- a/servers/rendering/shader_language.h +++ b/servers/rendering/shader_language.h @@ -1024,8 +1024,17 @@ public: void clear(); static String get_shader_type(const String &p_code); - Error compile(const String &p_code, const Map<StringName, FunctionInfo> &p_functions, const Vector<StringName> &p_render_modes, const VaryingFunctionNames &p_varying_function_names, const Set<String> &p_shader_types, GlobalVariableGetTypeFunc p_global_variable_type_func); - Error complete(const String &p_code, const Map<StringName, FunctionInfo> &p_functions, const Vector<StringName> &p_render_modes, const VaryingFunctionNames &p_varying_function_names, const Set<String> &p_shader_types, GlobalVariableGetTypeFunc p_global_variable_type_func, List<ScriptCodeCompletionOption> *r_options, String &r_call_hint); + + struct ShaderCompileInfo { + Map<StringName, FunctionInfo> functions; + Vector<StringName> render_modes; + VaryingFunctionNames varying_function_names = VaryingFunctionNames(); + Set<String> shader_types; + GlobalVariableGetTypeFunc global_variable_type_func = nullptr; + }; + + Error compile(const String &p_code, const ShaderCompileInfo &p_info); + Error complete(const String &p_code, const ShaderCompileInfo &p_info, List<ScriptCodeCompletionOption> *r_options, String &r_call_hint); String get_error_text(); int get_error_line(); |