Improve compatibility with Mesa on Linux