The attorney representing the State may, by permission of the court, dismiss a criminal action at any time upon filing a written statement with the papers in the case setting out his reasons for such dismissal, which shall be incorporated in the judgment of dismissal. No case shall be dismissed without the consent of the presiding judge.
Tex. Code Crim. Proc. § 32.02