fd7203ce80
This gives us a single place to handle the conversion, and fixes a compilation warning by adding an explicit cast. Reviewed-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15525>