Witnesses on behalf of the State or defendant may, at the request of either party, be required to enter into bail in an amount to be fixed by the court to appear and testify in a criminal action; but if it shall appear to the court that any witness is unable to give security upon such bail, he shall be released without security.
Tex. Code Crim. Proc. § 24.24