Added patches needed in Mesa.

Tested with Mesa GitHash 52576dcb882202ea1e2c239c5865b1ce74ff9847.