A judge of a district court before whom there is any proceeding in a criminal case, including any proceeding that has been deferred upon probation of the defendant pursuant to § 16.1-278.8, 16.1-278.9, 18.2-61, 18.2-67.1, 18.2-67.2, 18.2-251, 19.2-298.02, 19.2-303.2, or 19.2-303.6, shall certify to the clerk of the circuit court of his county or city, and a judge or court before whom there is, in a criminal case, any proceeding preliminary to conviction in another court, upon receiving information of the conviction from the clerk of the court wherein it is, shall certify to such clerk, all the expenses incident to such proceedings which are payable out of the state treasury.
Va. Code § 19.2-335