Merge branch 'perfqueries'. Adds support for PE performance metrics. Used in Super Mario Sunshine's "Scrubbing Sirena Beach" level to determine when enough goop has been cleaned up to finish the level. Also used in TimeSplitters: Future Perfect to determine the appearance of flares around light sources (e.g. sun). OpenGL and D3D11 only. D3D9 support unlikely to be added unless anyone bothers to do the work. Initial work and D3D11 support by me. Kudos go to Billiard for adding the OpenGL support and reviving development of this branch that way :D Slightly (~7%) decreases performance when performance metrics are used (and only then). Fixes issue 1498. Fixes issue 5368.