I'm not a Constitutional expert, but as far as I am aware there's nothing strict saying states can secede, but nothing strict saying they can't, either. Thus were such a case to be pursued "legality" is just whatever SCOTUS pull out of their nine arseholes as they see fit at the time. However, the point is more that what the Constitution, law and SCOTUS says is in reality a complete irrelevance.
If a state secedes unilaterally, what stops them? Ultimately, use of force. Therefore, in this situation, it's not a matter of law, it's who wins the resultant war: if the secessionists, they are now independent beyond the legal reach of their parent, and secession has been de facto legalised. The same effectively applies to a bilateral secession. Constitutional law is rendered completely irrelevant if the Federal gov. agree to let a state go. Sure, SCOTUS can say "Nuh-uh - Constitution says no-one leaves!" but without enforcement by the Federal government, the secessionists are de facto independent and that's the end of that.
So would the Federal government force a state to remain in the Union? The historical record shows countries have sometimes allowed secession, and sometimes not. Basically, the parent state would do a cost benefit analysis of whether it would cost them more to attempt to hold the state or let it go: because sometimes being larger but disunited is worse than being smaller and united. I would suggest that a Texas that was prepared to make the USA's life a misery if it weren't released to independence would stand a good chance of secession.