Fixes https://gitlab.freedesktop.org/mesa/mesa/-/issues/8718 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22141>