It might be worth coming up with a better solution to this in the future. See this thread as an example: https://lists.freedesktop.org/archives/mesa-dev/2016-September/127953.html