Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow more hint types for uniform arrays #79100

Conversation

KoBeWi
Copy link
Member

@KoBeWi KoBeWi commented Jul 6, 2023

Fixes #78213
All repeat/filter hints are now available.

@KoBeWi KoBeWi added this to the 4.2 milestone Jul 6, 2023
@KoBeWi KoBeWi requested a review from a team as a code owner July 6, 2023 12:45
@akien-mga
Copy link
Member

Try this format:

diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp
index 67028ddf0d..bbff47f630 100644
--- a/servers/rendering/shader_language.cpp
+++ b/servers/rendering/shader_language.cpp
@@ -8612,9 +8612,11 @@ Error ShaderLanguage::_parse_shader(const HashMap<StringName, FunctionInfo> &p_f
 							}
 
 							if (uniform.array_size > 0) {
-								static Vector<int> 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 };
+								static Vector<int> 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;

@akien-mga akien-mga added the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Jul 6, 2023
@KoBeWi KoBeWi force-pushed the [filter,_filter,_filter,_filter,_filter,_filter] branch from 5bb854b to 8ae2e66 Compare July 6, 2023 13:06
@YuriSizov YuriSizov merged commit 65cc4db into godotengine:master Jul 12, 2023
@YuriSizov
Copy link
Contributor

Thanks!

@KoBeWi KoBeWi deleted the [filter,_filter,_filter,_filter,_filter,_filter] branch July 12, 2023 12:28
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.2.

@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot set filter/repeat mode for uniform arrays of Sampler2Ds
4 participants