If a motion to set aside an indictment, information, or complaint for failure to provide a speedy trial is sustained, the court shall discharge the defendant. A discharge under this article is a bar to any further prosecution for the offense discharged and for any other offense arising out of the same transaction, other than an offense of a higher grade that the attorney representing the state and prosecuting the offense that was discharged does not have the primary duty to prosecute.
Tex. Code Crim. Proc. § 28.061