No person can be convicted of a felony except upon the verdict of a jury duly rendered and recorded, unless the defendant, upon entering a plea, has in open court in person waived his right of trial by jury in writing in accordance with Articles 1.13 and 1.14; provided, however, that it shall be necessary for the state to introduce evidence into the record showing the guilt of the defendant and said evidence shall be accepted by the court as the basis for its judgment and in no event shall a person charged be convicted upon his plea without sufficient evidence to support the same. The evidence may be stipulated if the defendant in such case consents in writing, in open court, to waive the appearance, confrontation, and cross-examination of witnesses, and further consents either to an oral stipulation of the evidence and testimony or to the introduction of testimony by affidavits, written statements of witnesses, and any other documentary evidence in support of the judgment of the court. Such waiver and consent must be approved by the court in writing, and be filed in the file of the papers of the cause.
Tex. Code Crim. Proc. § 1.15