From 289cc89a3953e117e4ee188a9535af89d2602c8c Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Sun, 10 Jan 2021 10:52:30 +0300 Subject: Prevent crash due to assigning incorrect order of instance uniform --- servers/rendering/shader_language.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 &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; -- cgit v1.2.3