petra: take restricted classes into account
This patch implements some changes needed to take restricted classes into account for example for D450, but it does not claim to be complete. This will have to be fully tested when these restrictions are really used.
Tested by fatherbushido using D450
Differential Revision: https://code.wildfiregames.com/D473