Merge pull request #68127 from Chaosus/shader_fix
Fix predefined constants to be accessible in the shader includes
This commit is contained in:
commit
0e3928618f
|
@ -1251,7 +1251,7 @@ bool ShaderLanguage::_find_identifier(const BlockNode *p_block, bool p_allow_rea
|
||||||
if (is_shader_inc) {
|
if (is_shader_inc) {
|
||||||
for (int i = 0; i < RenderingServer::SHADER_MAX; i++) {
|
for (int i = 0; i < RenderingServer::SHADER_MAX; i++) {
|
||||||
for (const KeyValue<StringName, FunctionInfo> &E : ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(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) {
|
if (r_data_type) {
|
||||||
*r_data_type = E.value.built_ins[p_identifier].type;
|
*r_data_type = E.value.built_ins[p_identifier].type;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue