diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/resources/visual_shader.cpp | 4 | ||||
-rw-r--r-- | scene/resources/visual_shader.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 01f62c4929..f7d7c2d1bc 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -1266,6 +1266,10 @@ void VisualShader::_update_shader() const { for (int i = 0; i < default_tex_params.size(); i++) { const_cast<VisualShader *>(this)->set_default_texture_param(default_tex_params[i].name, default_tex_params[i].param); } + if (previous_code != final_code) { + const_cast<VisualShader *>(this)->emit_signal("changed"); + } + previous_code = final_code; } void VisualShader::_queue_update() { diff --git a/scene/resources/visual_shader.h b/scene/resources/visual_shader.h index 215b7c7d46..45beb8e6ca 100644 --- a/scene/resources/visual_shader.h +++ b/scene/resources/visual_shader.h @@ -73,6 +73,7 @@ private: } graph[TYPE_MAX]; Shader::Mode shader_mode; + mutable String previous_code; Array _get_node_connections(Type p_type) const; |