summaryrefslogtreecommitdiff
path: root/scene/resources/material.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/material.cpp')
-rw-r--r--scene/resources/material.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index 55bb4e9073..b4ea60cb8d 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -535,6 +535,8 @@ void ShaderMaterial::_shader_changed() {
void ShaderMaterial::set_shader(const Ref<Shader>& p_shader) {
+ ERR_FAIL_COND(p_shader.is_valid() && p_shader->get_mode()!=Shader::MODE_MATERIAL);
+
if (shader.is_valid())
shader->disconnect(SceneStringNames::get_singleton()->changed,this,SceneStringNames::get_singleton()->_shader_changed);
shader=p_shader;