summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-01-11 14:58:55 +0100
committerGitHub <noreply@github.com>2021-01-11 14:58:55 +0100
commita33dc4274cdc7b46c7586e832baded992038bea8 (patch)
treeccb77cb8cb10e367e29ac1d2fafc272369ad8520
parent4f8a036fc58351cbbf18d72efdade740a17fe979 (diff)
parent289cc89a3953e117e4ee188a9535af89d2602c8c (diff)
Merge pull request #45066 from Chaosus/shader_fix_uniform_crash
Prevent editor crash due to modify the order of non-instance shader uniforms by instance uniforms
-rw-r--r--servers/rendering/shader_language.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp
index 0cb9220bb3..2fa3355d2f 100644
--- a/servers/rendering/shader_language.cpp
+++ b/servers/rendering/shader_language.cpp
@@ -6305,7 +6305,9 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
}
uniform2.texture_order = -1;
- uniform2.order = uniforms++;
+ if (uniform_scope != ShaderNode::Uniform::SCOPE_INSTANCE) {
+ uniform2.order = uniforms++;
+ }
}
uniform2.type = type;
uniform2.scope = uniform_scope;