This has been fixed in Mesa git master: https://cgit.freedesktop.org/mesa/mesa/commit/?id=16ef7ab5c13d2c5638f5a4e1fe7f0303d26b4e96