You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shader global uniforms are broken, throwing "Global uniform does not exist" errors when running a project.
Additionally, "This function should never be used outside the editor, it can severely damage performance." errors are thrown along with the shader errors. This is caused by a !Engine::get_singleton()->is_editor_hint() check in RendererStorageRD::global_variable_get_type, which works in the editor, but fails when actually running the project.
This all seems to have been caused by 99064d5, by changing a global_variable_get_type_internal call in ShaderCompiler::_get_variable_type to a global_variable_get_type call. This would be simple to fix by just reverting to the previous function call, but it seems to have been a part of a bigger refactoring, so perhaps there is a better way to do it now?
Steps to reproduce
Add a global shader uniform in project settings.
Create a canvas shader that uses that global uniform.
Use the shader in any canvas item node in the scene tree.
Run the project.
Godot version
v4.0.alpha.custom_build [fc09d78]
System information
Windows 10
Issue description
Shader global uniforms are broken, throwing "Global uniform does not exist" errors when running a project.
Additionally, "This function should never be used outside the editor, it can severely damage performance." errors are thrown along with the shader errors. This is caused by a
!Engine::get_singleton()->is_editor_hint()
check inRendererStorageRD::global_variable_get_type
, which works in the editor, but fails when actually running the project.This all seems to have been caused by 99064d5, by changing a
global_variable_get_type_internal
call inShaderCompiler::_get_variable_type
to aglobal_variable_get_type
call. This would be simple to fix by just reverting to the previous function call, but it seems to have been a part of a bigger refactoring, so perhaps there is a better way to do it now?Steps to reproduce
Add a global shader uniform in project settings.
Create a canvas shader that uses that global uniform.
Use the shader in any canvas item node in the scene tree.
Run the project.
Minimal reproduction project
GlobalUniformsTest.zip
The text was updated successfully, but these errors were encountered: