I've sent the patch to mesa-dev. It now appears here: https://patchwork.freedesktop.org/patch/113613/