summaryrefslogtreecommitdiffstats
path: root/servers
diff options
context:
space:
mode:
authorze2j <46556066+ze2j@users.noreply.github.com>2024-03-21 15:46:41 +0100
committerze2j <46556066+ze2j@users.noreply.github.com>2024-03-21 15:46:41 +0100
commit993cd25ff20dba3cfd5c2f128d3c39cc7aebab4b (patch)
treef6ee84055461bf044d6d30baf6dad565339fdb6a /servers
parentfe01776f05b1787b28b4a270d53037a3c25f4ca2 (diff)
downloadredot-engine-993cd25ff20dba3cfd5c2f128d3c39cc7aebab4b.tar.gz
Fix false positive errors in gdshaderinc files
These language features are wrongly detected as errors (not supported) when used in gdshaderinc files: - instance uniforms - hint_normal_roughness_texture - hint_depth_texture This type of error should only occur when the shader type is not spatial and not a gdshaderinc file.
Diffstat (limited to 'servers')
-rw-r--r--servers/rendering/shader_language.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp
index fef1a205d6..8fbad346a4 100644
--- a/servers/rendering/shader_language.cpp
+++ b/servers/rendering/shader_language.cpp
@@ -8361,7 +8361,7 @@ Error ShaderLanguage::_parse_shader(const HashMap<StringName, FunctionInfo> &p_f
}
}
#endif // DEBUG_ENABLED
- if (String(shader_type_identifier) != "spatial") {
+ if (shader_type_identifier != StringName() && String(shader_type_identifier) != "spatial") {
_set_error(vformat(RTR("Uniform instances are not yet implemented for '%s' shaders."), shader_type_identifier));
return ERR_PARSE_ERROR;
}
@@ -8848,7 +8848,7 @@ Error ShaderLanguage::_parse_shader(const HashMap<StringName, FunctionInfo> &p_f
_set_error(RTR("'hint_normal_roughness_texture' is only available when using the Forward+ backend."));
return ERR_PARSE_ERROR;
}
- if (String(shader_type_identifier) != "spatial") {
+ if (shader_type_identifier != StringName() && 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;
}
@@ -8857,7 +8857,7 @@ Error ShaderLanguage::_parse_shader(const HashMap<StringName, FunctionInfo> &p_f
new_hint = ShaderNode::Uniform::HINT_DEPTH_TEXTURE;
--texture_uniforms;
--texture_binding;
- if (String(shader_type_identifier) != "spatial") {
+ if (shader_type_identifier != StringName() && 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;
}