Fix Command Queue Crash

* No longer allow sending an object (texture) to the server as material parameter
* Keep a parameter cache locally in ShaderMaterial
This commit is contained in:
reduz
2021-07-07 10:57:56 -03:00
parent 8cd1b59ea7
commit d41e3f9aeb
8 changed files with 80 additions and 24 deletions
+6 -1
View File
@@ -293,7 +293,12 @@ void GeometryInstance3D::set_shader_instance_uniform(const StringName &p_uniform
instance_uniforms.erase(p_value);
} else {
instance_uniforms[p_uniform] = p_value;
RS::get_singleton()->instance_geometry_set_shader_parameter(get_instance(), p_uniform, p_value);
if (p_value.get_type() == Variant::OBJECT) {
RID tex_id = p_value;
RS::get_singleton()->instance_geometry_set_shader_parameter(get_instance(), p_uniform, tex_id);
} else {
RS::get_singleton()->instance_geometry_set_shader_parameter(get_instance(), p_uniform, p_value);
}
}
}