So it turned out that me mixing Mesa versions (I also used a git version of Mesa for myself) confused Mesa. I solved it by deleting ~/.cache/mesa_shader_cache. I doubt that this will be a problem for anyone else, so here's a new rebased patch that updates Mesa to 18.1.1. With your blessing I'll push it to staging.