Move the computation of the viewport matrix into a new update_viewport_matrix()