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
This commit is contained in:
Rémi Verschelde 2021-01-11 14:58:55 +01:00 committed by GitHub
commit a33dc4274c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -6305,8 +6305,10 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
} }
uniform2.texture_order = -1; uniform2.texture_order = -1;
if (uniform_scope != ShaderNode::Uniform::SCOPE_INSTANCE) {
uniform2.order = uniforms++; uniform2.order = uniforms++;
} }
}
uniform2.type = type; uniform2.type = type;
uniform2.scope = uniform_scope; uniform2.scope = uniform_scope;
uniform2.precision = precision; uniform2.precision = precision;