Writing a custom shader with a uniform array of sampler2D and then sampling one of those samplers from within a function causes the error servers/rendering/shader_language.cpp:5431 - Condition "n->type != Node::NODE_TYPE_VARIABLE" is true. Continuing. to be printed into console whenever the shader is saved.
This could be a mistake in the shader, but I'm reporting this as a bug because the associated line of code in the source has a comment saying "//bug? this should always be a variable".
Steps to reproduce
Create a fresh project.
Create a new shader (Right click in FileSystem, Create New > Resource, choose Shader).
Double click the shader to edit it, paste in the shader code below and hit Ctrl-S (you'll get a nag about having no root node but the external resource being saved, this is not relevant).
Output tab in the bottom panel will contain the error servers/rendering/shader_language.cpp:5431 - Condition "n->type != Node::NODE_TYPE_VARIABLE" is true. Continuing.
If you comment out the second-to-last line and uncomment the line above that (the one that says it does not print the error) then save the shader, the error will not be printed. It seems the error is caused by calling the function.
Tested versions
System information
Godot v4.2.2.stable.mono - Fedora Linux 40 (KDE Plasma) - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 6700 XT (RADV NAVI22) () - 12th Gen Intel(R) Core(TM) i9-12900K (24 Threads)
Issue description
Writing a custom shader with a uniform array of sampler2D and then sampling one of those samplers from within a function causes the error
servers/rendering/shader_language.cpp:5431 - Condition "n->type != Node::NODE_TYPE_VARIABLE" is true. Continuing.
to be printed into console whenever the shader is saved.This could be a mistake in the shader, but I'm reporting this as a bug because the associated line of code in the source has a comment saying "//bug? this should always be a variable".
Steps to reproduce
servers/rendering/shader_language.cpp:5431 - Condition "n->type != Node::NODE_TYPE_VARIABLE" is true. Continuing.
If you comment out the second-to-last line and uncomment the line above that (the one that says it does not print the error) then save the shader, the error will not be printed. It seems the error is caused by calling the function.
Minimal reproduction project (MRP)
N/A