浏览代码

Merge pull request #57207 from Chaosus/fix_global_uniforms

Yuri Roubinsky 3 年之前
父节点
当前提交
b82cb79c4e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      servers/rendering/shader_language.cpp

+ 1 - 1
servers/rendering/shader_language.cpp

@@ -7799,7 +7799,7 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
 				}
 
 				if (uniform) {
-					if (uniform_scope == ShaderNode::Uniform::SCOPE_GLOBAL) {
+					if (uniform_scope == ShaderNode::Uniform::SCOPE_GLOBAL && Engine::get_singleton()->is_editor_hint()) { // Type checking for global uniforms is not allowed outside the editor.
 						//validate global uniform
 						DataType gvtype = global_var_get_type_func(name);
 						if (gvtype == TYPE_MAX) {