summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-02 14:17:13 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-02 14:17:13 +0100
commit0e3928618faea900ff68156d1c6c4e25d9004838 (patch)
treec068ddc9c69200a7367e2cafcf09454fc1a9644e
parent2fd2a04efc3aba56d27a1a71d6d3a999d2ce9f69 (diff)
parent0a85d3b0ccf8c71450c5ba72d6052e8e211dac42 (diff)
Merge pull request #68127 from Chaosus/shader_fix
Fix predefined constants to be accessible in the shader includes
-rw-r--r--servers/rendering/shader_language.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp
index 4d27c400f0..2f5846f520 100644
--- a/servers/rendering/shader_language.cpp
+++ b/servers/rendering/shader_language.cpp
@@ -1251,7 +1251,7 @@ bool ShaderLanguage::_find_identifier(const BlockNode *p_block, bool p_allow_rea
if (is_shader_inc) {
for (int i = 0; i < RenderingServer::SHADER_MAX; i++) {
for (const KeyValue<StringName, FunctionInfo> &E : ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(i))) {
- if ((current_function == E.key || E.key == "global") && E.value.built_ins.has(p_identifier)) {
+ if ((current_function == E.key || E.key == "global" || E.key == "constants") && E.value.built_ins.has(p_identifier)) {
if (r_data_type) {
*r_data_type = E.value.built_ins[p_identifier].type;
}