diff options
-rw-r--r-- | drivers/gles3/storage/material_storage.cpp | 7 | ||||
-rw-r--r-- | servers/rendering/shader_language.cpp | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gles3/storage/material_storage.cpp b/drivers/gles3/storage/material_storage.cpp index 4a44279be9..4fb780b665 100644 --- a/drivers/gles3/storage/material_storage.cpp +++ b/drivers/gles3/storage/material_storage.cpp @@ -1546,6 +1546,8 @@ MaterialStorage::MaterialStorage() { actions.render_mode_defines["unshaded"] = "#define MODE_UNSHADED\n"; actions.render_mode_defines["light_only"] = "#define MODE_LIGHT_ONLY\n"; + actions.global_buffer_array_variable = "global_shader_uniforms"; + shaders.compiler_canvas.initialize(actions); } @@ -1719,6 +1721,7 @@ MaterialStorage::MaterialStorage() { actions.default_repeat = ShaderLanguage::REPEAT_ENABLE; actions.check_multiview_samplers = true; + actions.global_buffer_array_variable = "global_shader_uniforms"; shaders.compiler_scene.initialize(actions); } @@ -1775,6 +1778,8 @@ MaterialStorage::MaterialStorage() { actions.default_filter = ShaderLanguage::FILTER_LINEAR_MIPMAP; actions.default_repeat = ShaderLanguage::REPEAT_ENABLE; + actions.global_buffer_array_variable = "global_shader_uniforms"; + shaders.compiler_particles.initialize(actions); } @@ -1828,6 +1833,8 @@ MaterialStorage::MaterialStorage() { actions.default_filter = ShaderLanguage::FILTER_LINEAR_MIPMAP; actions.default_repeat = ShaderLanguage::REPEAT_ENABLE; + actions.global_buffer_array_variable = "global_shader_uniforms"; + shaders.compiler_sky.initialize(actions); } } diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index 91e9879bae..a8a7075047 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -8243,6 +8243,10 @@ Error ShaderLanguage::_parse_shader(const HashMap<StringName, FunctionInfo> &p_f _set_error(vformat(RTR("Uniform instances are not yet implemented for '%s' shaders."), shader_type_identifier)); return ERR_PARSE_ERROR; } + if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") { + _set_error(RTR("Uniform instances are not supported in gl_compatibility shaders.")); + return ERR_PARSE_ERROR; + } if (uniform_scope == ShaderNode::Uniform::SCOPE_LOCAL) { tk = _get_token(); if (tk.type != TK_UNIFORM) { |