From 8ae2e6681ee5dbb75994fe4b531c3eac1bf49965 Mon Sep 17 00:00:00 2001 From: kobewi Date: Thu, 6 Jul 2023 14:44:24 +0200 Subject: [PATCH] Allow more hint types for uniform arrays --- servers/rendering/shader_language.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index ca41cc8d51f..bbff47f630c 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -8612,7 +8612,12 @@ Error ShaderLanguage::_parse_shader(const HashMap &p_f } if (uniform.array_size > 0) { - if (tk.type != TK_HINT_SOURCE_COLOR) { + static Vector supported_hints = { + TK_HINT_SOURCE_COLOR, TK_REPEAT_DISABLE, TK_REPEAT_ENABLE, + TK_FILTER_LINEAR, TK_FILTER_LINEAR_MIPMAP, TK_FILTER_LINEAR_MIPMAP_ANISOTROPIC, + TK_FILTER_NEAREST, TK_FILTER_NEAREST_MIPMAP, TK_FILTER_NEAREST_MIPMAP_ANISOTROPIC + }; + if (!supported_hints.has(tk.type)) { _set_error(RTR("This hint is not supported for uniform arrays.")); return ERR_PARSE_ERROR; }