diff options
author | Fabio Iotti <fabiogiopla@gmail.com> | 2023-03-03 21:36:48 +0100 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-03-13 21:51:36 +0100 |
commit | 01324f025ae4dbc64bbaf42fe5f6fc0ab9745998 (patch) | |
tree | a086b2a44810e7f1ceb54e86524c5f180a69271b /servers/rendering | |
parent | c6f7675b1f541ba72f983861b722864887241eb7 (diff) |
Error on hint_normal_roughness_texture and hint_depth_texture outside of spatial shader
(cherry picked from commit 528e0d095eba65804e3b4174f8138cdc920382a9)
Diffstat (limited to 'servers/rendering')
-rw-r--r-- | servers/rendering/shader_language.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index 958e960ab2..084fb64a53 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -8798,11 +8798,19 @@ Error ShaderLanguage::_parse_shader(const HashMap<StringName, FunctionInfo> &p_f _set_error(RTR("'hint_normal_roughness_texture' is not supported in gl_compatibility shaders.")); return ERR_PARSE_ERROR; } + if (String(shader_type_identifier) != "spatial") { + _set_error(vformat(RTR("'hint_normal_roughness_texture' is not supported in '%s' shaders."), shader_type_identifier)); + return ERR_PARSE_ERROR; + } } break; case TK_HINT_DEPTH_TEXTURE: { new_hint = ShaderNode::Uniform::HINT_DEPTH_TEXTURE; --texture_uniforms; --texture_binding; + if (String(shader_type_identifier) != "spatial") { + _set_error(vformat(RTR("'hint_depth_texture' is not supported in '%s' shaders."), shader_type_identifier)); + return ERR_PARSE_ERROR; + } } break; case TK_FILTER_NEAREST: { new_filter = FILTER_NEAREST; |